computer-visionhalconhdevelop

Image to process has wrong gray value type (HALCON error code: 9001)


i am trying to make a calibration program for machine vision with Halcon. What i am doing is i use the image acquisition assistant to connect to my external camera and then i insert the generated code for the acquisition of a picture. Then i am using find_calib_object and i get the following error : Image to process has wrong gray value type (HALCON error code: 9001) This is the picture i've taken: enter image description here

My question is how to fix this error and how to make the picture rgb

This is my code: write_string(WindowHandle, 'Generating a position and sending it to the robot...') * Using procedure to generate the position and send the robot

PositionGeneration (Socket, WindowHandle, TupleWithPositions)

* Image Acquisition 01: Code generated by Image Acquisition 01
open_framegrabber ('GenICamTL', 0, 0, 0, 0, 0, 0, 'default', -1, 'default', -1, 'false', 'default', 'Zivid_DEV_21513D73', 0, -1, AcqHandle)
grab_image_start (AcqHandle, -1)
grab_image_async (Image, AcqHandle, -1)
* Image Acquisition 01: Do something
close_framegrabber (AcqHandle)


dev_display (Image)

* Saving the picture

I've tried to change the parameters of the camera but nothing has helped.


Solution

    1. Why do you have a cursor on the image if this is taken by the camera?
    2. Your *.png file has 3 channels which are identical.

    If you have an RGB camera, you need to set the open_framegrabber parameters "colorspace" and "bitsperchannel" to correct values.