introlab / find-object

Find-Object project
http://introlab.github.io/find-object/
BSD 3-Clause "New" or "Revised" License
448 stars 189 forks source link

x and y axis point not correctly #63

Open hygxy opened 6 years ago

hygxy commented 6 years ago

Hi I've observed a strange phenomenon as shown below:

this is the scene in real world
real

and this is what is being displayed in rivz when i run this programm rviz

Acoording to :https://homes.cs.washington.edu/~edzhang/tutorials/kinect2/kinect3.html, the z axis is pointing correctly, but x and y not

Can you please also help me with this situation , why is that ?@matlabbe , thanks in advance

matlabbe commented 6 years ago

find_object uses ROS convention, see REP 103:

In relation to a body the standard is:

x forward y left z up

Also:

In the case of cameras, there is often a second frame defined with a "_optical" suffix. This uses a slightly different convention:

z forward x right y down

hygxy commented 6 years ago

@matlabbe Hi, thanks for the explanation, could you please also show me the general idea and corresponding codes for removing outliers from the detected keypoints and drawing a rectangle upon the left inliers?

matlabbe commented 6 years ago

See cv::findHomography(). See also this example (see here to draw rectangles with Qt) based on this example.

hygxy commented 6 years ago

@matlabbe I've checked the link from OpenCV now, the problem of my code is that the drawn rectangle changes every loop even if the scene is static(sometimes also dramatically, especially when I move the scene to a distance much far away from the camera than that in which the model is taken), and therefore the pose calculation also changes. So could you please also tell me how do you make it stabilized?

matlabbe commented 6 years ago

Are you comparing Find-Object built with the same version of OpenCV you are using? There could be some differences on how RANSAC is done.

In our code, the rectangle is drawn after each processed frame. The rectangle is shaking a little. When the object looks smaller than the reference image, there could be less features matched between the scene and the object. When there is a low number of features, the transform computed by cv::findHomography() would change more between images (even if the scene is static), more noisy. You may verify how many inliers you get after calling cv::findHomography(). In Find-Object, by default a minimum of 6 inliers are required to accept the transformation (see Homography panel in Parameters view).