Skip to content
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

Couldn't get the edges of Depth Image when using MVTec Halcon #10652

Closed
mustaqimasri opened this issue Jul 5, 2022 · 13 comments
Closed

Couldn't get the edges of Depth Image when using MVTec Halcon #10652

mustaqimasri opened this issue Jul 5, 2022 · 13 comments

Comments

@mustaqimasri
Copy link

  • Before opening a new issue, we wanted to provide you with some useful suggestions (Click "Preview" above for a better view):

  • All users are welcomed to report bugs, ask questions, suggest or request enhancements and generally feel free to open new issue, even if they haven't followed any of the suggestions above :)


Required Info
Camera Model { D455 }
Operating System & Version {Win (10)
Kernel Version (Linux Only) (n.a.)
Platform PC
Language {Halcon}
Segment {Others}

Issue Description

Hi there, we have a Realsense Depth Camera D455 that we plan to use for checking the dimension of the box. We set the camera at the height of 2meter and plan to capture the depth image of the box, and from the depth image we are going to do some image processing later. Currently, we are using MVTec Halcon(Realsense interface) for our development and here is our result. The red circle is the box that we target to capture.

DimensionChecking_RGB_and_Depth Image_edit

These are the parameter that we use in our implementation:
set_framegrabber_param(AcqHandle, 'SourceSelector', 'Depth')
set_framegrabber_param(AcqHandle, 'ComponentSelector', 'Intensity')
set_framegrabber_param(AcqHandle, 'ComponentEnable', 100)
set_framegrabber_param(AcqHandle, 'DepthResolution', '848x480')
set_framegrabber_param(AcqHandle_3D, 'LaserPower', 360.0)

My question is, how can we improve the result for the box? Is there a way we can get the edge of the box or the exact square shape of it? Any parameter in MVTec Halcon, configuration on the camera or suggestions can be made, please suggest.

Thank you in advance for your help.

@MartyG-RealSense
Copy link
Collaborator

Hi @amar-mustaqim The color shades of the cardboard box and the floor are similar, so the box does not stand out strongly on the depth image.

Are you able to set a RealSense Visual Preset camera configuration from within the MVTec Halcon? If so then setting the Medium Density preset may help to sharpen the edges of a 'blobby' cardboard box on the depth image whilst also providing accuracy, as demonstrated in a discussion about overhead depth-sensing of cardboard boxes at #7021

@mustaqimasri
Copy link
Author

Hi @MartyG-RealSense , I have tried to test with different color background which are white and dark blue color, and I tried the Medium Density preset setting as suggested. However the result still same as before, no edges appeared for the box at the distance of 2meter from the camera.

Result of dark blue color background:
DimensionChecking_blue_groundtruth

Result of white color background:
DimensionChecking_white_groundtruth

Result with Medium Density preset:
dimensionchecking_mediumdensity_blue_groundtruth

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Jul 6, 2022

Are you able to use auto-exposure instead of a fixed manual exposure value of 33000? If you can use auto-exposure then please try setting ExposureAuto to On, as the current Off status of that setting in the above image suggests that auto-exposure is disabled.

@mustaqimasri
Copy link
Author

The ExposureAuto is already set to On by default in MVTec Halcon during the image acquisition, so even though I'm using auto-exposure the edge of the image still not captured. That's why I try changing the manual exposure value, which automatically will disable the ExposureAuto but, the result still same.

@MartyG-RealSense
Copy link
Collaborator

The depth images look very dark even though the RGB images show that there is good illumination. Could you try setting EmitterAlwaysOn to On (it is Off in the image of the settings) to make sure that the camera's dot pattern projection is active.

@MartyG-RealSense
Copy link
Collaborator

Hi @amar-mustaqim Do you require further assistance with this case, please? Thanks!

@mustaqimasri
Copy link
Author

Hi @MartyG-RealSense , yes I'm still need your help for this case but not immediately, maybe at the end of this month I'll come back for this case. As for now, we just lower down our camera setup until it able to get the edge of the box because we are focusing on the algorithm to measure the box dimension first.

@MartyG-RealSense
Copy link
Collaborator

Okay, that's no problem at all to come back to the case at the end of the month. Thanks very much for the update!

@MartyG-RealSense
Copy link
Collaborator

Hi @amar-mustaqim Do you have an update about this case that you can provide, please? Thanks!

@mustaqimasri
Copy link
Author

Hi @MartyG-RealSense I can say that this issue already solve and I will close it. Thank you so much for your assist. Cheers!

@MartyG-RealSense
Copy link
Collaborator

That's great news that you achieved a solution, @amar-mustaqim - thanks very much for the update :)

@vpenev77
Copy link

vpenev77 commented Jun 4, 2024

Hi, I'm trying to grab a 2d rgb image using realsense and halcon but it doesn't work. Can you help me

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Jun 4, 2024

Hi @vpenev77 If you are using MVTec Halcon then there is documentation for its RealSense interface at the link below.

https://www.mvtec.com/products/interfaces/documentation/view/18111-3d-camera-1811-progress-mvtecdoc-realsense

The documentation advises that the parameter color_space can be set to the value rgb instead of its default setting of 'default'.

Which RealSense camera model are you using, please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants