-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using a different image size for linemod detection for KinectV2 #28
Comments
Hi, I've done it once but it is not completely adapted for different images scales, check it in ecto_image_pipeline |
Regarding "For some image sizes the assertion then passes and the code runs. Unfortunately no objects are found..." there can be another problem. You could try to train with the same image size that you will use for recognition (it worked for me), for example set in the training config file ; |
I got some positive results yesterday. I will come back on this later. But thanks for the help ! :) |
Did you try to change the threshold? |
Setting images size in training config definitely helps, especially if training and test images are very different in size (that was twice in my case) |
@nlyubova Don't worry more. It works great :) I didn't have to add the |
wow! good job! so what id you change? |
In
And as you advised I have added in
These params are for QHD images only. |
Good Job. |
Thanks Jimmy and Nlyubova! Thanks to you I get great linemod detection of the can with kinect2_bridge on ROS Kinetic on Ubuntu 16.04. Mike |
Hi, I have tried the modifications to the linemod and training files but am still having trouble detecting the coke can, majority of the time I just see "publishing to topic:/recognized_object_array". Very rarely I could catch a glimpse of the mesh, when it mistaken a random object for coke. If I use Kinect1 however, it detects fine. Just not sure what I am doing wrong with Kinectv2? |
Hi @JimmyDaSilva, |
Hi @JimmyDaSilva |
Sorry @MoranChen , I haven't been using ROS since 2016. Very sorry but I don't have much time to use on this project. To go back to the problem, I agree with @giacomodabisias, this should be improved up inside OpenCV. |
Hello @JimmyDaSilva, I also try to detect a coke/mug by using the Kinect V2. For this I cloned the most recent master branch of this repository. I changed the code lines in Special feature of my setup is that the Kinect V2 is not connected to the Ubuntu computer. Instead the camera is connected to a Windows machine. This windows machine publishes the depth image and rgb image to seperate ROS topics (by using a implementation of ROS#). This works fine. I also publish the camera info as Now my key issue is: Do you use a depth image (512 x 424 pixels) and a rgb image (960 x 540 pixels)? Or is the resolution of the rgb image 1920 x 1080 pixels? When I use a depth image (512 x 424 pixels), a rgb image (960 x 540 pixels) and the changed files from above, I get an assertion fault. This fault says, there is an error within a OpenCV file. Do I have to change another files apart from Thanks a lot for your help in advance! |
@waltejon Sorry but I think that's all I changed. |
Linemod in opencv is using a linearMemoryPyramid with levels {5,8} by default:
https://github.com/Itseez/opencv_contrib/blob/master/modules/rgbd/src/linemod.cpp#L1834:L1840
5 and 8 work fine for 640x480 images, but fails with every image sizes provided by the KinectV2 (512x424, 960x540, 1920x1080).
The problem has been discussed there:
opencv/opencv#4593
So I am trying to not use
getDefaultLINEMOD
but create my own detector using these lines inlinemod_detect.cpp
:instead of
detector_ = getDefaultLINEMOD()
For some image sizes the assertion then passes and the code runs. Unfortunately no objects are found...
@vrabaud I guess you know a bit more about the image processing behind. Do think this is something that actually work? Which values for T would you pick? How many pyramid levels do you think are necessary ?
Thanks for the help !
Jimmy
The text was updated successfully, but these errors were encountered: