I'm actually trying to detect multiple moving objects using a stereovision system in order to calculate the depth using the triangulate Matlab function.
In order to achieve that, I followed these steps:
- Calibrate the sterevision system and export the Stereo Parameters to Matlab Workspace;
- Live feed acquisition of the frames with the two cameras;
- Using GMM ( Gaussian Mixture of Models) algorithm to extract the foreground objects from the background objects;
- Using some morphological operations such as opening to filter the noise;
- Detecting Blobs and calculating the centroids and the Bboxes in the two images (left and right);
- Using the triangulate function to calculate the depth of the detected objects;
Now, here are the problems that I faced:
- In order to use the "triangulate" function, we need the same number of centroids in the right and the left images, and even if I set the maximum number of Blobs to 1 in each image, there is almost all the time no correspondance between the two centroids, so the triangulation is not correct;
- I tried to use the SURF algorithm in order to find the stereo scorrespondances, but it doesn't give the correspondance of a given centroid, it just give the correspondances of features that the SURF algorithlm detect;
- I also tried to rectify the stereo images in order to get the corresponding centroid of the left image on the same line in the right image, but ... how to find this corresponding centroid in the second image;
- Then I tried to detect the moving objects only on the left image, and use the right image just to find the depth, but I still don't have good results ;
So my question is,
How should I proceed to get the corresponding cendroid point in the right and left images, in order to determine the depth using Triangulate Matlab Function ?