Rectified left image without projector in HALCON

General Information

  • Product: B57-5MCOC-4
  • Serial Number: 245922
  • Ensenso SDK Version: 4.2.1821
  • Operating System: Windows - HALCON 24.11

Problem / Question

Hello,

I would like to retrieve an image from the left camera in a rectified version without the projector present. I am trying to locate a QR code and use its coordinates to perform average measurements in the X, Y and Z images.

My problem is that I can only retrieve one left image with the projector. I have tried disabling the projector and enabling the front light without success. I have no problem recovering all other types of images.

I use HALCON V24.11.

Hi Benoit,

How do you create the rectified left image? I guess you‘re using „grab_data“ and request the image by passing it to „grab_data_items“?

I recommend to use the explicit commands from the NxLib.

So you would

1.execute the “Capture“ command (before, set the projector to ‚false‘ in the NxTree camera capture parameters)

2.execute „RectifyImages“

3. execute „grab_data“ with the left-rectified image requested by „grab_data_items“

Make sure that „auto_grab_data“ in the RootHandle and CameraHandle are both disabled.

In the topic „how to get a colored pointcloud from the Ensenso C57 camera in MvTec Halcon“, I provided a Hdevelop script, that you can use as a starting point. It contains lots more than you need for this case, but you can see the workflow, syntax and setting the handles in „open_framegrabber“

Best regards

Ute

Edit: Typos

Hi,

Thank you for these elements.

I adapt the program for my application but I still get the rectified image with the projector despite disabling it.

I see in the colored point map program that if Provided Flexview is enable the projectorpattern is removed by comparing flexview images, what does this mean ?

I join my program and json sensor file.

Ensenso_Test.zip (6.8 KB)

I found three positions in the code, that are not working as you might want them to

  1. open_framegrabber (‘Ensenso-NxLib’, 0, 0, 0, 0, 0, 0, ‘default’, 0, ‘Raw’, -1, ‘false’, ‘Item’, ‘/’, 0, 0, RootHandle)
    → The “-1” has to be replaced by explicitly setting ‘auto_grab_data’ to “1” or “0”
  2. from codeline 56 to 61 you’re referring to the ‘RootHandle’ instead of the ‘CameraHandle’, so disabeling the projector didn’t work.
  3. codeline 57 (set_framegrabber_param (RootHandle, ‘auto_grab_data’, ‘false’) seems not to work. I’ve checked with “Inspect as handle” and the value for the parameter “generic” did not change.

Note, that ‘auto_grab_data= 1’ will automatically turn the projector ON. (Refer to “Note” here)

I’ve put the relevant codelines and some additional informations about the Ensenso-Halcon-interface in the uploaded file.

Ensenso_Test_IDS.zip (43.6 KB)

Edit:

Yes, the projector pattern can be removed, if there is a sequence of FlexView images available. Simplified it creates a new image, by using for each pixel coordinate the brightest pixel within the sequence. (Darker pixels are kind of shaddowed by the projector pattern)