How to find a "contour" of 3d object?
I have a set of images that a taken from single point of view but with different focal length, kinda like computer tomography slices. So by stacking them up I can form 3d image of object.
I need to find a "contour" of 3d objects. For now i see only brute force way: stack images in 3d cvMatND, do X, Y and Z slices and use cvFindContours().
Is there more intelligent way to do this?
Try to give more details for us to better understand what you really want. Would the contour of your largest slice solve the problem? My reasoning is, taking your example of tomography slices, the slice which captures the largest area of the object will give an approximation of the object's contour. Well it depends on the complexity of the shape...
Thanks for reply, Rui. Images i'm working with are shots of plankton spices in water. Here is video example of going trough set of shot: http://db.tt/jG2pQDSv It's not a fair slices, but i'm fine with blurry traces. This is not perfectly representing example, objects can be bigger and more complex, not just a small blurry dots. What i need is to determine positions and sizes of spices. Not just dimensions, but shape of objects, that's why i think i need to do scans through all 3 dimensions. Ideal solution would be some sort of "3d contours", as 2d contours are visually 2d image with set of indexed enclosed curves, so "3d contour" would be a binarized 3d matrix with set of indexed enclosed clouds of pixels. I'm completely new to computer vision so my terminology may be messy an confusing.
From my limited experience your problem seems quite hard, even considering the 2d case. Why? Most of your shapes (the plankton spices) are quite small and faded (unless your data has a much larger resolution than that video). It is possible to use the Dilate operation, which will increase your shapes and makes it easier to count them. But it is not appropriate to take measures because it enlarges the shape.
Also, many of the shapes intersect which makes it difficult to tell them apart.
The good news is that your background seems to have no noise, meaning, its only a black background and all of your foreground are your target shapes.
Do not get disappointed by my comment, I am not a big expert, you should continue to research =)
For me the "contour" of a 3D shape is a surface. Is this what you want to get?
I agree with Mathieu and I'm giving this an upvote as interesting. How would you even expect the contour to be stored in memory? As a set of surface normals at each voxel? Or are you happy with just a 3D bitmap, setting edges to 1? Depending on how detailed you want it, it is much more difficult than the discrete 2D case where a chain code or similar can do the job.