10-14-2013 05:57 AM
Dear all,
I'm currently working on a research project where we should analyze de motions of a floating structure by using stereoscopic vision. Untill now, we know how to detect on each frame the points what we need (2 or 3) but we have a problem, the shape detector (circles) detects all the points but not allways assign the same object identifier along the video record. I mean that for the same object, in some frames is assigned to Object1 and in other frames as object2. This is a problem for us, because we need the pixel coordinates of each point in order to postprocess this info for the ·3D analysis. If the matrix resulting is mixing the coordinates of both points, it will be very hard and tedious to check it manually.
Initially I thought about using different color for each point and apply colour filters, but at the end our lab cameras are monochrome... and while the structure is moving in 6 dof, the best shape for the reference points is the sphere to ensure a circle projection for any location.
Exists any "easy" solution?
Thank you very much!
Alexis
10-14-2013 04:08 PM
In your first frame, establish a window for each object. This window should be the size of the object blob, plus a variable which you can control. Let's call it tollerance. It should reflect the maximum number of pixels an object could move away from it's current position, without leaving the window area.
After the first image, you only need to consider the area inside the window to "look" for your object in its new position. To make it more robust, you can add a step that looks for new objects AFTER all the existing ones have been processed. Use masking to block out the areas you do not want to see during evaluation. You can also close out windows if an object disappears for more than X frames.
10-15-2013 09:07 AM
There is another way to do this. For each new point that you loacte scan through the old array of points and find the closest one. Reassign the index of your new point based on the index of the closest point. Bit more maths but a lot less image processing. MoviJOHN's method will work but you will have to repeat the operation for each ROI. It depends how many points you are trying to track.
Mike
10-15-2013 09:19 AM
Thank you very much,
I will use the coordinates obtained and reassssign as Object 1 or 2 by a simple matlab code, since on each frame the displacement is small, computing the distance between points for consecutive frames I can decide who is who. 😉
Thank you again!
10-15-2013 09:40 AM
You can use the IMAQ Point Distances VI to do this as it gives you distances between points and then find the minimum index from the array. No need to go out to Matlab for this, the VI's are right there.
Mike
10-15-2013 09:45 AM
I didn't know that, I will check the vi and use it, of course, THANK YOU Mike!