You are on page 1of 63

HALCON

HALCON UNIXNT/2000/xp Library


C
C++
HALCON Windows NT/2000/XP COM Visual
Basic
HALCON

HALCON HDevelop
HALCON

HALCON 6.0 parallel


HALCON CPU
HALCON

1.1
HALCON opreator library

HALCON operator library HALCON ( HDevelop


HALCON C++) library
Kalman

HALCON

fast_match best_match

HALCON

()
HALCON region
region region

HALCON ROI
region

HALCON pattern
pattern HALCON pattern

HALCON (shape-based)
pattern
6.1 HMatchIt

HALCON tuple
tuples HALCON
tuples tuples
tuple tuple HALCON
tuple
HALCON
HALCON

HALCON CC++ COM


CC++ COM HALCON
HALCON HDevelop
HALCON
HDevelop? HDevelop

HDevelop
CC++ COM

HALCON 40
http://www.mvtec.com/halcon/
open_framegrabber grab_image

HALCON
HALCON HALCON
HALCON Frame Grabber
Integration Programmer's Manual

1.2 HALCON
HALCON
Operating System

Processor

Compiler

Windows NT 4.0 /2000 /XP

compatible to Intel Pentium

MS Visual Studio 3

Linux 2.2/2.4

compatible to Intel Pentium

gcc 2.95

Solaris 7

SPARC

CC 5.2

IRIX 6.5

MIPS

CC

Tru64 UNIX 5.1

Alpha

cxx

HALCON

Linux libc6(glibc-2.1.x) Linux RedHat SuSe

HALCON Philips TriMedia DSP NT/2000/XP


HALCON/C User's Manual

1.3 Parallel HALCON


HALCON NT/2000/XP
LinuxSolarisHALCON thread-safe

Parallel HALCON thread-safe reentrant


NT/2000/XPLinuxSolaris
Parallel HALCON
HALCON HDevelop C++C
(
data parallelism)

HALCON

parallel HALCON CPU


HALCON
HALCON cluster

Parallel HALCON COM reentrant COM


Microsoft Visual Basic

1.4

HDevelop User's Manual


HALCON HDevelop
HALCON/C++ User's Manual
C++ HALCON library
HALCON/C User's Manual
C HALCON library
HALCON/COM User's Manual
COM HALCON library Visual Basic
Extension Package Programmer's Manual
HALCON
Frame Grabber Integration Programmer's Manual
HALCON
HALCON/HDevelop,HALCON/C++,HALCON/C,HALCON/COM
HALCON
Application Guide
Application Note

MVTec PDF HTML


http://www.mvtec.com/halcon

HALCON
1.demo HDEvelop
HALCON

2. HALCON HDevelop
CC++COM Extension package Interface

3. HALCON runtime version


HDevelop

runtime demo

1. Nodelocked license
2. floating license
license server HALCON
license server server server
Windows NT server Linux Solaris
Windows NT/2000/XP HALCON HALCON server

temporary license

2.1
CD HALCON
http://www.mvtec.com/halcon/download release_note.html
HALCON

UNIX Windows
6

%HALCONROOT%\examples\extension_package\halconuser
2.4
UNIX
$HALCONROOT/examples/extension_package/halconuser

HALCON 6.0 6.1


Windows registry 2.2
ActiveVisionTools 1.0 1.3 HALCON6.1
HALCON 6.0.x
6.0.1 6.0.2 2.1.3

2.1.1

Windows NT/2000/XP

CD nt-x86
Setup.exe Administrator
HALCON

HALCON 2.1.5
ActiveVisionTools
HALCON
( 2.1.5 )

(CompactCustomTypical)Full HALCON version


(Runtime)runtime version
(Demo)demo hdevelop_demo.exe
CD
dongle2.3.5
HALCON
floating license server license manager daemon floating
licensefloating license license server
2.3.4
7

2.1.2 UNIX
mount CD
cdrom root
CD mount /etc/fstab mount
/dev/cdrom /cdrom
CD shell script "install-unix" HALCON
HALCONROOT ( 2.4.2 ) HALCON

CD
32
HALCON
( 2.4.2 )
2.1.3
HALCON 6.0 6.0.1 6.0.2
MVTec's http://www.mvtec.com/halcon/download
HALCON 6.0.2
6.0.2 HALCON dongle ( GLOBEtrotter)
HALCON "license not found"
2.3.5.1
2.1.4 HALCON
%HALCONROOT%

FLEXlm license
bin HALCON HDevelop DLL frame grabber libraries
doc\pdf PDF

application_guide CC++delphi fg_integration(


)extension_packagehdevelop MFCVB

examples

images
include C/C++ header
lib HALCON libraries( Windows
.libUNIX .so)
license

2.1.5 HALCON
HALCON Windows NT/2000/XP
%PATH%%HALCONROOT%%HALCONIMAGES%
%HALCONEXTENSIONS% 2.4.1
HALCON COM DLL halconx.dll re-register
DOS shell bin\i586-nt4 ( HALCON) unregister

regsvr32 /u halconx.dll
HALCON

halconx.dll register

regsvr32 halconx.dll
UNIX HALCON $HALCONROOT
$HALCONIMAGES$PATH$LD_LIBRARY_PATH
2.1.6 ActivVisionTools
ActiveVisionTools1.0 2.0 HALCON6.0 ( 6.0.1)
HALCON 6.1 ActivVisionTools HALCON 6.1
ActivVisionTools ActivVisionTools2.0
HALCON 6.1 OCX ActivVTools.ocx
DOS shell ActivVisionTools
bin\i586-nt4 ocx unregist
regsvr32 /u ActivVTools.ocx

ocx CD misc\i586-nt4\avt20.

regsvr32 ActivVTools.ocx

ActivVisionTools2.0 1.0 1.3 HALCON6.1 (


ocx) HALCON6.1 ActivVisionTools
1.3 ActivVisionTools
HALCON6.0.x 2.1.5
register COM library halconx.dll

2.2
2.2.1 Windows NT/2000/XP
Windows ( HALCON )
1.
2. HALCON 5.1
HALCON

>>MVTec HALCON>Uninstall

3. 5.2

6.5.2
registry
HDevelop
HKEY_CURRENT_USER>Software>MVTev>Halcon

dongle 2.3.5

10

6.0.2
dongle
6.0.2 HALCON
2.3.5.1
2.2.2 UNIX
HALCON
rm -rf $HALCONROOT
.hevelop HOME ( 2.4.2 )
HDevelop

Parallel HALCON 6.0 beta operator check_par_hw_potential


.halcon_par_info HOME

2.3
HALCON FLEXlm license manager

HALCON ()
runtime license( 2.3.2)
license file 2.3.2 floating license
2.3.4
2.3.4
NT/2000/XP
Pentium III CPU ID Windows NT/2000/XP dongle
dongle
nodelocked floating license 2.3.5
2.3.1.1 HDevelop
demo HDevelop Help>About
CPU IDdongle

11

6.5.3

2.3.1.2

lmhostid

lmhostid FLEXlm Windows DOS UNIX


$HALCONROOT/FLEXlm (
i586-Linux2.2)
lmhostid -ether
Windows
> lmhostid -ether
lmhostid - Copyright (C) 1989-2000 Globetrotter Software, Inc.
The FLEXlm host ID of this machine is "00e02958e36a"
ID"00e02958e36a" hostname
lmhostid ffffffff 6.5.3.1
CPU ID lmhostid cpu64
> lmhostid -cpu64
lmhostid - Copyright (C) 1989-2000 Globetrotter Software, Inc.
The FLEXlm host ID of this machine is "0003-C1DE-01C3-E79F"
lmhostid "" BIOS CPU ID

12

dongle ID( Windows NT/2000/XP)

lmhostid -flexid

> lmhostid -flexid


lmhostid - Copyright (C) 1989-2000 Globetrotter Software, Inc.
The FLEXlm host ID of this machine is "FLEXID=7-36c79bd7"

dongle
2.3.2 Runtime license HALCON
HALCON "Basic operators""Image/Region/XLD
management" HALCON "Background Estimation""1D Bar
Code Reader" runtime

HDevelop File>Moduals
"Save" .mod

CC++COM get_moduals

13

2.3.3 license file


HALCON license file%HALCONROOT%\license
license.dat floatong license,
HALCON license verver
nodelocked license file
############################
# MVTec (ID: 0080c77161e2) #
############################
FEATURE MVTec_Halcon mvtecd 6.1 permanent 0 FC17B37961F326F957A8 \
VENDOR_STRING=65535 HOSTID=0080c77161e2 ck=23
FEATURE MVTec_HDevelop mvtecd 6.1 permanent 0 CC279389F3566E1D6363 \
VENDOR_STRING=65535 HOSTID=0080c77161e2 ck=32

nodelocked license

"FEATURE" HALCON license


6.1 license 6.0 6.1
license 6.1.x
#################################
# MVTec (ID: FLEXID=7-b285ff7f) #
#################################
FEATURE MVTec_Halcon mvtecd 6.1 permanent 0 3C574319AF86C4A5DE4A \
VENDOR_STRING=65535 HOSTID=FLEXID=7-b285ff7f ck=35
FEATURE MVTec_HDevelop mvtecd 6.1 permanent 0 7C772379E2D066930D10 \
VENDOR_STRING=65535 HOSTID=FLEXID=7-b285ff7f ck=245

nodelocked development license dongle

#################################
# MVTec (ID: FLEXID=7-b285ff7f) #
#################################
FEATURE MVTec_Halcon mvtecd 6.1 permanent 0 3C574319AF86C4A5DE4A \
VENDOR_STRING=65535 HOSTID=FLEXID=7-b285ff7f ck=35

nodelocked runtime license dongle

14

2.3.4 floating license


license verver
license manager daemon HALCON license
file copy HALCON copy license verver (
2.3.4.3)
floating license"SERVER" FLEXlm license server
halconserver port number(27000)
############################
# MVTec (ID: 0080c77161e2) #
############################
SERVER halconserver 0080c77161e2 27000
DAEMON mvtecd C:\Progra~1\MVTec\Halcon\FLEXlm\i586-nt4\mvtecd
FEATURE MVTec_Halcon mvtecd 6.1 permanent 2 4C72DB2EC0F315624FAE \
VENDOR_STRING=16383 ck=97

floating runtime license ()


hostname dongle-bound license
dongle license

port port
port number
HALCON license file "SERVER"
host name port number license server license
server port name license manager daemon

license server daemon mvtecd

%HALCONROOT%\FLEXlm\%ARCHITECTURE%\mvtecd
( ARCHITECTURE 2.4 )
license file
HALCON HALCON c:\program
Files\MVTec\Halcon c:\progra~1\MVTec\Halcon
license manager daemon

2.3.4.1 Windows NT/2000/XP license manager daemon


Windows
DOS ()
15

"%HALCONROOT%\FLEXlm\i586-nt4\installs" -n "HALCON Licenses"


-c "%HALCONROOT%\license\license.dat"
-l "%HALCONROOT%\license\license.log"
-e "%HALCONROOT%\FLEXlm\i586-nt4\lmgrd.exe"

%HALCONROOT% Windows
HALCON service ""
liscense manager daemon
"%HALCONROOT%\FLEXlm\i58-nt4\installs" -r -n "HALCON Licenses"

2.3.4.2 UNIX license manager daemon


UNIX lmgrd /etc/init.d/boot.local
/sbin/init.d/boot.local
( lmgrd )
/etc/lmgrd -c $HALCONROOT/license/license.dat > $HALCONROOT/license/license.log
2>&1 &
lmgrd root

2.3.4.3 license manager daemon


floating license daemon
Windiows
"""HALCON License"
UNIX lmgrd process 2.3.4.2

2.3.5 dongle
dongle windows 6.0.2 USB dongle
dongle ID "FLEXID=6-""FLEXID=7-" USB dongle ID
"FLEXID=9-"
16

2.3.5.1 dongle
2.1.1 HALCON
sentinel
HALCON DOS
%HALCONROOT%\FLEXlm\i568-nt4\flexid6-7\win_nt setupx86.exe
Functions>install
Administrator

parallel port
HALCON ()
dongle HALCON
CD FLEXlm\i586-nt4\flexid6-7\win_nt

6.0.2
2.1.3 2.2.1

setupx86.exe%HALCONROOT%\FLEXlm\i586-nt4\dongle
HALCON 6.0.2
2.2.1 HALCON 6.0.2
2.1.3 setupx86.exe
%HALCONROOT%\FLEXlm\i568-nt4\flexid6-7\win_nt
HALCON setupx86.exe
CD FLEXlm\i586-nt4\dongle CD
HALCON

2.3.5.2 USB dongle


2.1.1 HALCON
Hardlock HASP
HALCON
DOS %HALCONROOT%\FLEXlm\i586-nt4\flexid9
hinstall.exe
17

hinstall
hinstall
hinstall -info

hinstall -install
hinstall -remove

Administrator
HALCON dongle hinstall.exe
HALCON CD
FLEXlm\i586-nt4\flexid9

2.4

HALCON extension package


Parallel HALCON (initialize)
5.1.1

2.4.1 Windows NT/2000/XP


Setup.exe %HALCONROOT%
""
%PATH%""
Administrator
HALCONROOT
HALCON
C:\Program Files\MVTec\HalconHALCON

%HALCONROOT%\help
HALCON
%HALCONROOT%\doc\html\reference\hdevelop

18

%HALCONROOT%\lut
look-up table
%HALCONROOT%\ocr
trained fonts
%HALCONROOT%\license
license KEY license.dat
%HALCONROOT%\images
HALCONIMAGES HALCON
HALCONIMAGES

ARCHITECTURE
HALCON Windows %ARCHITECTURE%
i586-nt4
HALCON hdevelop.exehalcon.dll
%HALCONROOT%\bin\i586-nt4 link library halcon.lib
%HALCONROOT%\lib\i586-nt4
HALCONEXTENSIONS
( extension packages)
package linked library
help HTML extension package 2.5
HALCONSPY
HALCON HALCONSPY HALCON
HALCON Spy set_spy ("mode"
"on")
%HALCONSPY% linked HALCON
6.4
PATH
%HALCONROOT%\bin\i586-nt4 %HALCONROOT%\FLEXlm\i586-nt4
PATH
19

2.4.2 UNIX
UNIX shells setenv <variable><value>
export <variable>=<value>

HALCON library HDevelop


login script shell resource script .cshrc .profile
HALCONROOT
HALCON
/usr/local/halcon /usr/halconHALCON
$HALCONROOT\help
HALCON
$HALCONROOT\doc\html\reference\hdevelop

$HALCONROOT\lut
look-up table
$HALCONROOT\ocr
trained fonts
$HALCONROOT\license
license KEY license.dat
$HALCONROOT\images
HALCONIMAGES HALCON
HALCONIMAGES
UNIX

ARCHITECTURE
i586-linux2.2
sparc-sun-solaris7ARCHITECTURE hdevelop
$HALCONROOT/bin/$ARCHITECTURE$HALCONROOT/bin/$ARCHITECTURE
20

PATH shell script Shared library


$HALCONROOT/lib/$ARCHITECTURE
ARCHITECTURE
ARCHITECTURE

Operating System (Platform)

i586-linux2.2

Linux 2.2/2.4 on Intel Pentium (or compatible)

sparc-sun-solaris7

Solaris 7 on Sparc Workstations

mips-sgi-irix6.5

IRIX 6.5 on SGI Workstations (Mips processors)

alpha-compaq-osf5.1

Tru64 UNIX 5.1

on Alpha processors

PATH
HDevelop HALCON
$HALCONROOT/bin/$ARCHITECTURE PATH
LD_LIBRARY_PATH
HALCON library $HALCONROOT/lib/$ARCHITECTURE
LD_LIBRARY_PATH
HDevelop
HALCONEXTENSIONS
( package) package
linked library help HTML
extension package 2.5 Extension package
Programmer's Manual
HALCONSPY
HALCON HALCONSPY HALCON
HALCON Spy set_spy ("mode"
"on")$HALCONSPY linked
HALCON 6.4
DISPLAY
X
HOME
Parallel HALCON 6.0 beta check_par_hw_potential
$HOME.halcon_par_info
21

2.5 HALCON Extension Package


HALCON Extension Package Interface HALCON
extension packages package HDevelop
Help>HALCON News(WWW) MVTec

2.5.1 Extension package


package %HALCONROT%
%HALCONROOT%\packages\halconuser HALCONEXTENSONS

package library Dll

package
(HALCONIMAGES)

2.5.2 HDevelop Extension Package


HDevelop package
HALCONEXTENSIONS packages HALCON

Linux HDevelop package library lib/i586-linux2.2


LD_LIBRARY_PATH

2.5.3 Extension Package


package library( Windows DllUNIX shared
library)link
2.5.3.1 Windows NT/2000/XP Extension Package
C C++ packagec.lib packagecpp.lib obj
library halconc.lib halconcpp.lib link
link Dll PATH
%HALCONROOT%\packages\halconuser\bin\i586-nt4
Dll Windows

22

2.5.3.2 Linux Extension Package


C C++ libpackage.so libpackagec.so libpackagecpp.so
link library libhalcon.so libhalconc.solibhalconcpp.so
link
LIBRARY LD_LIBRARY_PATH
lib/i586-Linux2.2

2.5.3.3 Solaris Extension Package


C C++ libpackage.so libpackagec.so libpackagecpp.so
link library libhalcon.so libhalconc.solibhalconcpp.so
link
LIBRARY LD_LIBRARY_PATH
lib/sparc-sun-solaris7

2.5.3.4 IRIX Extension Package


C C++ libpackage.so libpackagec.so link
library libhalcon.so libhalconc.solibhalconcpp.so link
LIBRARY LD_LIBRARY_PATH
lib/mips-sgi-irix6.5

2.5.3.5 Tru64 UNIX(DIGITAL UNIX) Extension Package


C C++ libpackage.so libpackagec.so link
library libhalcon.so libhalconc.solibhalconcpp.so link
LIBRARY LD_LIBRARY_PATH
lib/alpha-compaq-osf5.1

23

HDevelop

HDevelop
bonding balls HALCON
package
%HALCONROOT%\examples\hdevelop\Manuals\GettingStarted\example.dev

HALCON operator HDevelop


operator

ROI

pattern
control struct

HDevelop

bonding balls
24

3.1

HDevelop GUI

Windows "">>MVTec HALCON>HDevelop UNIX


shell hdevelopProgram
HDevelop User's Manual
3.1.1
( loadingsaving)

HDevelop
25

File
Edit
Excute
Visualization
operators
Suggestions
Windows
Help

HDevelop HDevelop
HDevelop
HDevelop

HDevelop HALCON

()

HDevelop
New
Open
Save

program windows
HDevelop
HDevelop

Cut
Copy
paste

Run
Step
Stop

HDevelop
HDevelop

Avtivate
Deactivate
Reset

set parameters

visualization

Pixel info
pixel info
Zooming

gray histogram info


Region info ROI

26

3.1.2 program
HDevelop program
HDevelop
program counter( PC)(breaking point)

3.1.3

combo box

3.1.4

ROI

3.1.5

Visualization graphic

3.2 HDevelop
HDevelop program HDevelop

Shift
()
Operator
() Enter
OK
Apply

PC(Program counter)
HDevelop Step Run
27

Stop

CC++COM
File>Save as

3.3
HALCON object
( Operators>Image>FrameGrabber)
( File>Image File>Read Image)
( Operators>Image>Creation)

read_image

read_image Operators>File>Images
window "Operator" Enter
image object "Die"
28

"Die3"
read_image(Die"Die3")
OK program window
"Die" image object

HALCONIMAGES
%HALCONROOT%\images

3.4

Visualization>Size Window>Original
window ID HDevelop Width
Height ""
dev_open_window(00-1-1blackWindowID)
OK
"Active"
"Die"

Visualiation>Set Parameters>Paint 3D-plot Update 3D


image HDevelop Users Manual

dev_set_paint('3D-plot')
Visualization>Set Parameter zoom
"Interactive"
"Reset"

29

3.5

ROI

ROI

ROI

ROI
ROI
Operators>Graphics>Drawing draw_rectangle1
HDevelop
zoom Row1Column1Row2
Column2 ROI HALCON object
Operator>Regions>Creation gen_rectangle1 Row1
Column2 "ROI"

draw_rectangle1 (WindowID, Row1, Column1, Row2, Column2)


gen_rectangle1 (ROI, Row1, Column1, Row2, Column2)

HALCON object region( 4.2.3 )

30

region region
Visualization dev_*.
Visualization>Color Visualization>Line>Width
Visualization>Draw

ROI
HALCON ROI Operators>Graphics>Drawing
Draw_region
draw_region(ROIwindowID)
draw_rectangle1(
) Edit>Deactivate gen_rectangle1

ROI
ROI
3.8

31

ROI reduce_domain(Operators>Image>Domain)
Die ROI region
reduce_domain(DieROIImageReduced)
mean_image(ImageReducedImageMean1111)_
ImageReduced ROI Clear
ImageReduced
reduced
Operators>Filter>Smoothing mean_image"Die"
Clear mean_image
ImageReduced
ROI PC(program counter) draw_rectangle
draw_region () RUN
BP(break point) Ctrl

3.6
HALCON HALCON
?
HALCON

"thresh""threshold "

32


combo box
HALCON HTML Help>HTML
Operator

HTML
Suggestion>Keywords
3d-projectionArcs

read_image operator knowledge base

HTML
Help
Suggestion>Altinatives

mean_image filter gauss_image


smooth_image
Sugestions>See also
read_image write_image
suggestion>Predecessor

junctions_skeleton skeleton skeleton region skeleton

Suggestion>Successor

successor threshold
33

3.7

combo box
HDevelop
Operator>segmentation threshold
combo box "Die" lower upper threshold
Brighregion
visualization mode
"Draw""Fill"( Color
)"Die""Brightregion"

"BrightRegion"

Apply
OK program
Clear

34

3.8 ROI
"Die" threshold 128
255 raw segmentation ROI bonding
balls shapr_trans"Brightregion""rectangle2"
"Brightregion" region "ROI"
3.5 reduce_domain ROI

threshold(Die,Brightregion,128,255)
shape_trans(Brightregion,ROI,'rectangle2')
reduce_domain(Die,ROI,DieROI)
DieROI

3.9

"Die" bonding balls


threshold

region "RawSegmentation"

""

35

fill_up_shape( Operator>Regions>Transformation)

threshold(DieROI,RawSegmentation,0,50)
fill_up_shape(Rawsegmentation,Wires,'area',1,100)
Wires RawSegmentation

open_circle

bonding balls bonding balls


bonding balls opening_circle

opening_circle(Wires,BallRegion,15.5)
Wires BallRegion

connection
connection(BallRegionBalls)

BallRegion
36

Balls Visualization>Colored
HALCON

tuple

select_shape
Operators>Regions>Features "circularity"
select_shape(BallsFinalBalls'circularity''and'0.851.0)
Die FinalBalls FinalBalls

dev_open_window(00-1-1blackWindowID)
read_image(Die,'die3')
threshold(Die,Brightregion,128,255)
shape_trans(Brightregion,ROI,'rectangle2')
reduce_domain(Die,ROI,DieROI)
threshold(DieROI,RawSegmentation,0,50)
fill_up_shape(Rawsegmentation,Wires,'area',1,100)
opening_circle(Wires,BallRegion,15.5)
connection(BallRegionBalls)
select_shape(BallsFinalBalls'circularity''and'0.851.0)

3.10

bonding balls
count_obj( Operators>Object>Information )
count_obj(FinalBalls,NumBalls)
3.5 draw_rectangle1 NumBallsHALCON
(Operators>Regions>Features)
smallest_circle region
smallest_circle(FinalBallsRowColumnRadius)
37

FinalBalls RowColumnRadius

Radius assign( Operator>Control


)
assign(meanRadiussum(Radius)/|Radius|)
'||' tuple

meanRadius := sum(Radius)/|Rdaius|
area_center(
Operators>Regions>Features ) assign
minArea
area_center(FinalBallsAreaRowCenterColcenter)
minArea

:= min(Area)

tuple
disp_circle(WindoIDRowColumnRadius)

3.11 pattern

bonding ball

threshold ROI
pattern matching

1. template
2. template

38

template

bonding ball template


dev_close_window()

dev_open_window(0300-1-1'black'WindowID)
window ID

read_image(Die4'C:\\Program Files\\MVTec\\HALCON\\images\\die4.tif')
draw_rectangle1(WindowIDRow1Column1Row2Column2) template

gen_rectangle1(ROIRow1Column1Row2Column2)
reduce_domain(Die4ROIImageReduced)
ROI ImageReduced
ImageReduced bonding ball template
Operators>Filter>Match create_template
create_template(ImageReduced54'sort''original'templateID)
matching template assign
TemplRow := (Row1+Row2)/2
TemplCol
:= (Col1+Col2)/2
matching
matching
39

fast_match Operators>Filter>Match
fast_match(Die4MatchestemplateID20)
matches MaxError

fast_match fast_match_mg level


level
fast_match_mg(Die4Matches1TemplateID203)
connection tuple

connection(Matches1BallROI)
region count_obj

count_obj(BallROINumBall)
best_match connection
BallROI region tuple
region Operators>Image>Domain
add_channels
add_channels(BallROIDie4BallImage)
best_match(BallImageTemplateID20'true'RowcolumnError)
RowColumnError
()
Operators>Graphics>Output
disp_rectangle1
disp_rectangle1(WindowIDRow+Row1-TemplRowColumn+Column1-TemplCol
Row+Row2-TemplRowColumn+Column2-TemplCol)
40


template clear_template template

3.12
HALCON

best_match
MaxError
Row Column Error
Error

RealNumBalls := 0
iend value NumBalls

for i := 1 to NumBalls by 1
if (Error[i-1]<255)
disp_rectangle1(WindowIDRow[i-1]+Row1-TemplRow
Column[i-1]+Column1-TemplCol
Row[i-1]+Row2-TemplRowColumn[i-1]+Column2-TemplCol)
RealNumBalls := RealNumBalls + 1
end if
endfor
(
)

41

HALCON
4.1

HALCON data management operator knowledge base


data management tuple
knowledge base

knowledge base HALCON (CC++COM)


HDevelop

HALCON Image Processing Library


Package HALCON

Frame Grabber Interface library

Language-Independent Operator Interface


Language
Interface
C C++COM HALCON
42

4.2 iconic control


HALCON iconic control iconic
region control
bar chart
HALCON tuple
4.2.1 tuple
HALCON
tupleHALCON tuple
filter median_image tuple
median_image tuple HALCON
tuple region
tuple region tuple area_center
tuple region
4.2.2image
image tuple
domain
(RGB)

domain region
domain domain
domain
domain
ROI HALCON
autobahn.dev
%HALCONROOT%\examples\hdevelop\Applications\Sequences

43

image object

region

44

4.2.3 region
region region

region
region region

region runlength encording chord encording


() region

region
region
closing_circle (HDevelop fin2.dev
%HALCONROOT%\examples\hdevelop\Applications\FA)
HALCON
region

region
45

4.2.4
etended ine escription
region region

XLD ()
XLD

edge_sub_pixlines_gauss
Extension Package Programmer's Manual

4.3

HALCON

HALCON DLL (dynamically loadable libraries


unix shared library) library parallel HALCON
DLL parHFG ( 5.3.2 )
HALCON Frame Grabber Interface

open_framegrabber
port
info_framegrabber

set_framegrabber_param

get_framegrabber_param

grab_image grab_image_async
()
grab_image_start

close_framegrabber close_all_framegrabbers

46

set_feamegrabber_lut get_framegrabber_lut
lookup table
HALCON open_framegrabber
grab_image
HALCON MVTec
HALCON
http://www.mvtec.com/halcon/framegrabber DLL

4.3.1
HALCON grab_image

PAL
ms (trigger)

grab_image_start

grab_image_async
grab_image_async
grab_image_async
grab_image_start
()()

4.3.2 (External triggers)

HALCON frame_grabber

external trigger

47

HALCON frame grabber interface


set_framegrabber_param
H_ERR_FGTIMEOUT

asynchronously resetable

asynchronously resetable

4.3.3

Volatile

grab_image grab_image_async
HALCON
history
NTSC ms
HALCON volatile grabbing mode
HALCON

frame grabber interface

4.3.4

HALCON

HALCON HALCON
Frame Grabber Intergration Programmer's Manual
frame grabber API HALCON
buffer HALCON gen_image1_extern

48

4.4

HALCON

32768*32768

100000
100000

1000
tuple
1000000
30000
10000
-32768 +32768
1024

49

Parallel HALCON

parllel HALCON

HALCON parallel HALCON libraries


'parallel' HDevelop parallel HDevelop
parallel HALCON HDevelop
HDevelop HALCON library
hdevelop Parallel HALCON library
parhdevelop
parallel HALOCN
HALCON link library
Windows/NT/2000/XP parhalconc.dll parhalconcpp.dll UNIX
library libhalcon.so libparhalconc.so
libparhalconcpp.so HALCON/C HALCON/C++ User's Manual

5.1 Automatic parallelization


Parallel HALCON

5.1.1 Parallel HALCON


Parallel HALCON
parallel HALCON
check_par_hw_potential HALCON

hcheck_parallel.exe
%HALCONROOT%bin%ARCHITECTURE%
Parallel HALCON check_par_hw_potenial

()
Windows NT/2000/XP Registry UNIX
50

.halcon_par_info $HALCONROOT
check_par_hw_potenial
Windows2000 administrator group privilege 'Power User'
UNIX HALCON .halcon_par_info
check_par_hw_potenial
hcheck_parallel
5.1.2
Parallel HALCON

tuple level
tuple tuple
tuple
tuple
channel level

domain level
domain
HALCON Reference Manual "Parallelization
Information" tuplechanneldomain

5.2 Parallel HALCON


Parallel HALCON thread-safe reentrant
reentrant
reentrancy
example_multithread1.c

51

5.2.1 reentrancy
Reenrancy
reenrant
data

local
Windows NT/2000/XP
local ()
IO Windows

open_window
draw_circle

local

single write muliple read

pattern matching template adapt_template


template

IO write_imageread_imagefwrite_stringfread_string
HALCON update_bg_esti
give_bg_esti HALCON
data
mutual exclusive

combine_road_xldconcat_ocr_trainf
completely exclusive
OCR/OCV
OCR classificaion reser_obj_db
reset_obj_db
52

5.2.2 Style Guide


Initialization
HALCON
reset_obj_db
I/O
WindowsNT/2000/XP IO open_window disp_image
Reference Manual locally reentrant 5.2.1

Multithreading Automatic Parallelzation

5.3

5.3.1 Reentrancy
set_system HALCON
set_system('parallelize_operators''false')
reentrancy
set_system('reentrant''false')
'true'
reentrancy automatic parallelization

debugging
Parallel HALCONHALCON

53

5.3.2 Parallel HALCON


HALCON Parallel HALCON
'reentrant'
'completely exclusively' open_framegrabberinfo_framegrabber
close_framegrabberclose_all_framegrabber
'local' Windows NT/2000/XP
Windows NT/2000/XP DLL HALCON
HFG Parallel HALCON parHFG
HALCON DLL
UNIX HALCON shared library

5.3.3 Extension Package Parallel HALCON


Extension Package Parallel HALCON par
library Windows NT/2000/XP halconuser packageParallel
HALCON parhalconuser.dll library UNIX
libparhalconuser.so

5.3.4 Parallel HALCON HALCON Spy


HALCON Spy Parallel HALCON

54


6.1 HALCON
HDevelop Help>HALCON News (WWW)
MVTec extension package HALCON

6.2 Windows NT/2000/XP


Windows NT/2000/XP
''''

6.3

HDevelop

HDevelop
System suggestions
operator knowledge base
predecessors successors
altinatives reference

Online help on operators


HALCON HDevelop
cross reference
HTML
Debugging help

debugging
HALCONSPY 2.4.2
Result Visualization
HDevelop

55

6.4 HALCON Spy


HALCON Spy
debug
HALCON set_spy HALCON Spy
set_apy('mode''on')
Link HLACON Spy
%HALCONSPY% 2.4
set_spy
set_spy('operator''on')
set_spy('input_control''on')

Windows NT/2000/XP %HALCONSPY%


operator=on;input_control=on
set_spy UNIX ':'

6.5
HDevelop Parallel HALCON

6.5.1
Registration of halconx.dll failed
HALCON/COM library halconx.dll self-register
Microsoft atl.dll register ( library
%SystemRoot%\system32 C:\WINNT\sysem32) library

DOS CD misc\i586-nt4
56

>E:
>cd misc\i586-nt4
>reg-halconx atl.dll
>reg-halconx
license manager daemon
floating license FlEXlm license daemon
DOS ()
"%HALCONROOT%\FLEXlm\i586-nt4\installs" -n "HALCON License"
-c "%HALCONROOT%\license\license.dat"
-l "%HALCONROOT%\license\license.log"
-e "%HALCONROOT%\FLEXlm\i586-nt4\lmgrd.exe"

>>

"HALCON License"

service
daemon
"%HALCONROOT%\FLEXlm\i586-nt4\installs" -r -n "HALCON License"
6.5.2
Unregistration of halconx.dll
register HALCON/COM halconx.dll
HALCON halconx.dll unregister
DOS CD misc\i586-nt4
>E:
>cd misc\i586-nt4
>reg-halconx /u
license manager daemon
2.2.1 float license HALCON 5.0 5.1
FlEXlm license daemon uninstall
DOS
"%HALCONROOT%\FLEXlm\i586-nt4\installs" -r -n "HALCON License"
DOS HALCON

57

c:\Pregram Files\MVTec\Halcon
()
c:\Progra~1\MVTec\Halcon\FLEXlm\i586-nt4\installs -r -n "HALCON License"
()
"c:\Program Files\MVTec\Halcon\FLEXlm\i586-nt4\installs"-r -n "HALCON License"

cd "%HALCONROOT%\FLEXlm\i586-nt4"

installs -r -n "HALCON License"

Internal Error

"Inter Error,unable to load or call external DLL.Please contact your distributor for more
information"

%HALCONROOT%

1.%HALCONROOT% HALCON
>>>> DOS
echo %HALCONROOT%
HALCON
2.
%HALCONROOT% Unins.isu
%HALCONROOT%\FLEXlm\i586-nt4\

HalconUninst.dll

Uninst.isu
58

HalconUninst.dll HALCON HALCON


CD FLEXlm\i586-nt4\
3. Windows Uninstaller
regedit
HKEY_LOCAL_MACHINE->SOFTWARE->Microsoft->Windows->
CurrentVersion->Uninstall->Halcon<Version-Number>
<Version-Number> Halcon ()
'UninstallString'()
c:\WINNT\IsUninst.exe -f"c:\Program Files\MVTec\Halcon\Uninst.isu"
-c"c:\Program Files\MVTec\Halcon\FLEXlm\i586-nt4\HalconUninst.dll"
c:\Program Files\MVTec\Halcon\
%HALCONROOT% Program Files
' " '

4. regedit uninstall

uninstallation failed

1. floating license license manager service


"%HALCONROOT%\FLEXlm\i586-nt4\installs" -r -n "HALCON License"
2. regedit
HKEY_LOCAL_MACHINE->SOFTWARE->Microsoft->Windows->
CurrentVersion->Uninstall->Halcon<Version-Number>

HKEY_LOCAL_MACHINE->SOFTWARE->MVTec
3.
%SystemRoot%\Profiles\All Users\start Menu\Programs\Halcon
%SystemRoot% c:\winnt

59

4. Halcon

%HALCONROOT%

6.5.3 license
license license file
dongle ( 2.3.1 ) license file ( 2.3.3
)

floating license 2.3.4 port license manager


daemon
dongle HALCON 6.0.2 "license not found"
2.3.5.1 dongle driver
6.5.3.1
HDevelop host ID
dongle Pentium III host ID
2.3.1.2
licensing
Windows 2000 XP Media sense(DHCP)
DHCP
http://support.microsoft.com/support/kb/articles/q239/9/24.asp.
lmhostid -ether "ffffffff""0"
Windows2000/XP
client for Microsoft network ""
""
2.3.1.1 2.3.1.2
NT NetBEUI TCP/IP
ID
Windows2000/XP
NetBEUI IPX/SPX

60

lmhostid -cpu64 ""


lmhostid
>lmhostid -cpu64
lmhostid - Copyright (C)1989-2000 Globetrotter Software,Inc
The FLEXlm host ID of this machine is ""
lmhostid:FLEXlm function not available in this version <-45,520>
CPU ID 2.3.1.2 BIOS
BIOS
lmhostid -flexid dongle ID
lmhostid dongle ID 2.3.5
USB parallel port
6.5.4 HDevelop
HDevelop

No license found

%HALCONROOT%\license\license.dat
license
floating license
lost connection to license server
license server server

No license for this operator


license
license
Wrong architecture
HALCON ARCHITECTURE
ARCHITECTURE HALCON
hdevelop:Command not found
61

PATH$HALCONROOT/bin/$ARCHITECTURE
lib*:can't open file
UNIX LD_LIBRARY_PATH( 2.4.2 )
No help file for package<package > in directory <>

%HALCONROOT%\help\ help
HALCONROOT
HDevelop
Help file for package<package-name>is corrupt
package system HALCONROOT %HALCONROOT%\help\

package help
Can't open display
DISPLAY X-server

6.5.5 Pararllel HALCON


Parallel HALCON
HALCON
5.1.1 Parallel HALCON
get_system processor_num
HALCON Parallel HALCON

Visual Studio Parallel HALCON


Microsoft Visual Studio
HALCON Visual Studio

HALCON Parallel HALCON


tuple tuple

62

tuple '(-array)'

6.5.6
UNIX
HALCON
Linux SuSe 7.0
backing-store

xdpyinfo | grep backing-store

options: backing-store YES,save-unders YES


Xservers /usr/lib/X11/xdm()
root "+bs"( backing-store )
:0 local /usr/X11R6/bin/X :0 vt7 +bs
X Server () xdpyinfo

63

You might also like