Excerpt | ||||
---|---|---|---|---|
|
Introduction
For more information about the software Halcon from MVTec we refere to threir office websideHALCON by MVtec, we refer to the product owner´s online presence: https://www.mvtec.com/products/halcon/
Info |
---|
Halcon HALCON can be preinstalled pre-installed on the camera under the location via |
Halcon Examples on iam camera
You need to openHALCON installation on iam
In order to aquire live frames, the halcon-runtime and halcon-GenICamTL interface has to be installed on the camera.
Halcon environment variables must be set in order for HALCON to work.
Edit halcon.sh (<directory you installed HALCON in, e.g., /opt/halcon>
) accordingly to your installation and copy it to /etc/profile.d
halcon.sh:
Code Block |
---|
HALCONARCH=aarch64-linux; export HALCONARCH
HALCONROOT=<directory you installed HALCON in, e.g., /opt/halcon>; export HALCONROOT
HALCONEXAMPLES=${HALCONROOT}/examples; export HALCONEXAMPLES
HALCONIMAGES=${HALCONROOT}/examples/images; export HALCONIMAGES
PATH=${HALCONROOT}/bin/${HALCONARCH}:${PATH}
export PATH
if [ ${LD_LIBRARY_PATH} ] ; then
LD_LIBRARY_PATH=${HALCONROOT}/lib/${HALCONARCH}:${LD_LIBRARY_PATH}
export LD_LIBRARY_PATH
else
LD_LIBRARY_PATH=${HALCONROOT}/lib/${HALCONARCH}; export LD_LIBRARY_PATH
fi
export XILINX_XRT=/usr
GENICAM_GENTL64_PATH=/opt/synview/cti64 |
Use HALCON on iam
Info |
---|
Be sure that the iAMGigEServer is stopped, before you execute halcon-framegrabber-apps. |
HALCON Examples on iam
Open an SSH Shell connection to the camera. For some example you also need to have In some cases X-Server support is required.
|
There are some examples preinstalled pre-installed to the iam camera. They can be found under the locationhere:
|
On top of the filesystem the file system see for README.md can be found.
There is detalied detailed information about the provided samples.
structureStructure of the test_
halconHALCON folder:
The folder contains the file system below. On can see that the The three examples do have a similar file structure.
|
Description of samples:
test_halcon_aniso_test:
This sample is derived from find_aniso_shape_model.hdev (MVTec Software GmbH).
This sample is designed for testing the performance of the FindAnisoShapeModel() function.
With 50 loops a mean value of the consumed time of FindAnisoShapeModel() is evaluated.
OPTIONS:
NO_WINDOWS ; if defined no windows are shownno windows are shown
Info |
---|
For executing this sample make sure that smd*.png files are inside <directory you installed HALCON>/examples/images/smd |
test_halcon_live_view:
This sample is derived from error_handling_timeout.cpp (MVTec Software GmbH).
This sample is designed for testing the live view of the iam platform.
OPTIONS:
SAVE_IMAGE ; if defined, a image is saved at the end of program
SET_EXPOSURE_TIME ; if defined, a exposure time is set
test_halcon_sw_trigger:
This sample is derived from error_handling_timeout.cpp (MVTec Software GmbH).
This sample is designed to show the software trigger functionality.
This sample aquires 100 software triggered frames.
No live view is implemented.
OPTIONS:
NONE
Execution of one of the provided
HalconHALCON examples
The binarys binaries of the brebuild prebuild examples can be found in the ../bin
directory of each example project. The test_halcon_live_view
can be executed by applying the commands below. The other two others examples can be executet executed in the same way.
|
Tip |
---|
The |
Info |
---|
The two other examples |
Compiling the provided
HalconHALCON examples
It is possible to compile the examples on a Linux Host system (e.g. by using the provided virtual machine image) or native on the camera (over OpenSSH) both using makefiles.
Info |
---|
For native |
compiling on the camera, make sure that halcon include files are inside <directory you installed HALCON>/include |
Tip |
---|
For cross - compiling, you have to source profile_halcon: You can test Test successful sourcing with: You should seeSee then for: |
The next section described describes the process of building the software trigger project as an example.
Build e.g. the software trigger example
Info |
---|
The steps discribed described below are both similar in the same on native and the cross compile enviromentenvironment. |
navigate Navigate into the makfile makefile directory
|
Remove the prebuild binary by execute executing the command make make clean
and build it from source by make
.
Info |
---|
For more details: The exact behavior behaviour of both commands are is defined in the |
|
The compiled binary can be found in the ../bin
directory and can be executed as follow
|
Info |
---|
The other examples |
Building your own
HalconHALCON examples:
Prepare Makefiles
Possibly the easiest way is to copy the complete folder of one of the examples and rename it to your project name.:
Code Block |
---|
cd /home/root/040530_test_halcon/cpp/ mkdir your_project_name cp -vr test_halcon_sw_trigger/* your_project_name |
Now you can edit and rename the given source file from the director your_project_name/source/
or simply replace it by your own cpp file.
Info |
---|
On will get a well-arranged file structure if you use the |
Code Block |
---|
cd /home/root/040530_test_halcon/cpp/your_project_name/makefiles/ make clean |
|
Tip |
---|
Since you are analysing an For analysis of a monochrome image sensor it is important to use a monochrome pixel fomat. Therfore Therefore the given examples do all show how to configrure configure the pixel format in source code. Like the listening from With reference to |
Code Block |
---|
try { acqdevice.SetFramegrabberParam("PixelFormat", "Mono8"); } catch (HException &except) { cout << "---> PixelFormat failed!\n"; cout << "---> Cause: " << except.ErrorMessage() << "(HALCON error " << except.ErrorCode() << ")\n"; cout << "---> CloseFramegrabber!\n"; acqdevice.CloseFramegrabber(); return except.ErrorCode(); } |
You also need to edit Edit the makefile as discribed shown below at in line 38 by with regard to the name naming of your cpp source file.
|
Using make command
navigate Navigate into the makfile makefile directory and exexute execute the make
command.
|
Info |
---|
You may need to remove your binaries which were builed built before by execute when executing the command |
The binary can be found now in the ../bin
directory and can be executed by the commands below.
|
Attachments
Attachments | ||||
---|---|---|---|---|
|
🔍 References
🔗 related content
👥 contact NET
Insert excerpt | ||||||
---|---|---|---|---|---|---|
|