Tutorial - VC-Z HALCON Image Acquisition Interface  1.0

How to get images

How to get images

At first we need to get images from the camera in order to build the image processing task.

1. First SSH connection

In this tutorial, we assume that the VC-Z camera has this IP address:

192.168.3.15

Conect to the SSH server of the device as 'root':

SshConnection.png

The password is 'root'.

2. Launch the Image server

And then launch the embedded Image Server with this command:

vcimgnetsrv &

And finally launch the simple image acquisition sample on the camera :

/root/imageCaptTransferTest

3. Display image on the host

On the host PC where we can PING the camera, launch the 'atxClient' and enter the IP of the camera, the size of the sensor in DX and DY and finaly you can snap an image by a clic on 'Get Image'. You have to save some of them by a clic on 'Save Image':

atxClient_SaveImage.png

Take some images of your box and put them in the same folder in order to facilitate the next steps.

4. Create the HDev Program

Open the HDevelop IDE on the HOST PC and the Image Acquisition Assistant:

HDevelop_ImgAcqAssistantMenu.png

With the 'File' interface:

HDevelopImgAcqAssistantFileInterface.png

And select the folder where you saved the previous images:

HDevelop_ImgAcqAssistant_ImagesFolder.png

Now you can connect to this virtual camera and snap over the image series. Go on the 'Code generation' tab and click on 'Insert code'. The following code will be generated:

// Image Acquisition 01: Code generated by Image Acquisition 01
open_framegrabber ('File', 1, 1, 0, 0, 0, 0, 'default', -1, 'default', -1, 'false', 'D:/src/HIA_vcnanoz/trunc/hAcqVcNanoZ/livrable/doc/tutorial_1/', 'default', 1, -1, AcqHandle)
grab_image_start (AcqHandle, -1)
while (true)
grab_image_async (Image, AcqHandle, -1)
// Image Acquisition 01: Do something
endwhile
close_framegrabber (AcqHandle)

Finally we save the HDevelop program in the images folder, and we can use a relative path in the open_framegrabber() in order to run the program even after moving the folder:

// Image Acquisition 01: Code generated by Image Acquisition 01
open_framegrabber ('File', 1, 1, 0, 0, 0, 0, 'default', -1, 'default', -1, 'false', './', 'default', 1, -1, AcqHandle)

You can get the source code here and the test image.


Next section: How to build image processing