Professional Documents
Culture Documents
20150214060137
20150214060137
HALCON
HALCON
Blob
()
HALCON:
HALCON:
HALCON
SDK
HALCON:
2009-4-27
HALCON:
open_framegrabber, info_framegrabber
HALCON:
'File'
open_framegrabber ('DahengCAM', , 1, 1, 0, 0, 0, 0, 'default, -1,
'gray', -1, 'false', 'default', 'default', -1, -1,
FGHandle)
grab_image(_async)()
set / get_framegrabber_param
while (true)
grab_image (Image, FGHandle)
* Apply image processing
endwhile
close_framegrabber, close_all_framegrabbers
read_image
close_framegrabber(FGHandle)
HALCON:
HALCON:
Easy source
selection
n $(HALCONROOT)/images/board
n (File)
Automatic code
generation
n
n
n
n
Interactive parameter
settings
Connection
configuration
HALCON:
HALCON:
HALCON
2009-4-27
HALCON:
HALCON:
n
n
(gray-value-based)
shape-based
(component-based)
Level 4
conrelation-based
(descriptor-based)
(deformable)
(point-based)
Level 3
Level 2
Level 1
HALCON:
Level
4
2009-4-27
HALCON:
* Generate ROI
* read image from file or frame grabber
inspect_shape_model(Image,ModelImage,ModelRegion,1, Contrast
Contrast)
inspect_shape_model(Image,ModelImages,ModelRegions,5,40)
dev_display(Image)
dev_display(ModelRegions)
dev_display(Image)
dev_display(ModelRegion)
Contrast
Contrast
Contrast
HALCON:()
HALCON:
HALCON:
AngleStart
AngleExtent
rad()
180
120
90 180
90
x,
AngleStart = -x
AngleExtent = 2x
2009-4-27
HALCON:
ScaleMin = 0.3; ScaleMax = 2
n
n
Bright outside
Dark inside
Template
Accepted objects
Template
Accepted objects
:ignore_local_polarity
(bounding boxes)
2009-4-27
(gray-value-based)
Overlap
shape-based
conrelationbased
(componentbased)
1.73G
640*482
(descriptorbased)
2009-4-27
(deformable)
(point-based)
HALCON:Blob
HALCON:Blob
Blob()
Blob
HALCON:Blob
HALCON:
Blob
(
)
threshold
thresholdHALCON
threshold
R = {( x, y) R | g min g ( x, y) g max }
2009-4-27
HALCON:Blob
HALCON:Blob
0.02
0.02
0.015
0.015
0.01
0.01
0.005
0.005
0
0
Histogramm
50
Histogramm
0.02
0.02
0.015
0.015
0.01
0.01
0.005
0.005
100
150
=4
200
250
50
100
150
=8
200
250
0
0
50
100
150
200
250
50
100
150
HALCON:Blob
200
250
HALCON:Blob
S
R = {( x, y ) R | g ( x, y) s ( x, y ) t}
bzw.
R = {( x, y) R | g ( x, y ) s ( x, y ) t }
170
Grauwertprofil
gray profil e
smoothed gray profile
Gegl tetes Grauwertprofil
160
150
140
130
120
110
100
90
m
e
a
n_
i
m
a
g
e
HALCON:Blob
80
70
0
10
15
20
25
HALCON:Blob
30
35
40
ma
sk
mean_image (Image, ImageMean, 21, 21)
dyn_threshold (Image, ImageMean,
Region, 15, 'dark')
boundary, skeleton
2009-4-27
n
n
n Halcon8
HALCON: Blob
8-Neighborhood
4-Neighborhood
Local threshold
Global threshold
n HALCON
n
n
n
n : 44
n
Input image
Segmentation
n
n top-hat, bottom-hat, hit-or-miss, boundary
n
n Fitting, pruning, thickening, thinning, skeleton
Union
Operator
R S = {x | x R x S }
Usage
R S = {x | x R x S }
n intersection: Intersect each region of the first parameter with the union of
all regions of the second parameter
Usage
n Generate regions by combining primitive shape
n Use as a result those points where two methods return pixels
Intersection
Definition
Operator
RS
RS
2009-4-27
Difference
Definition
Operator
R \ S = {x | x R x S }
n difference: Subtract from all regions of the first parameter the union of all
regions of the second parameter
Usage
n Generate regions by combining primitive shape
n Use as a result those points where one method but not the other one returns
pixels
Translation
Definition
Operator
Rt = {x | x t R} = {y | y = x + t x R}
Usage
n Adapt the position of a model region
n Extract one border side (with difference)
Note
n Results depends on the system flag 'clip_region'
R\S
Transposition
R( 2,1)
Dilation
(
R = { x | x R}
((
R=R
Reversible:
( (
RSRS
Increasing:
(
Entity-invariant:
Z (R) = Z (R)
Definition:
(0,0)
(0,0)
(
R
(
S
dilation(R,S)
Erosion
(0,0)
Input image
Segmented region
(threshold)
Connected components
(undesirable decomposition)
R
Segmented region
after applying dilation
(circle, diameter 5)
Connected components
(correct decompositon)
erosion(R,S)
Intersection between
connected components
and segmented region
10
2009-4-27
Closing
(0,0)
dilation(R,S)
closing(R,S)
Example: Closing
Opening
(0,0)
erosion(R,S)
opening(R,S)
Example: Opening
()
n
n , OCR
n
n
11
2009-4-27
HALCON:Blob
Input image
smallest_circle:
r
(rm , cm )
Convexity():
Contlength():
Compactness():
k=
Orientation of all regions, e.g., for rotation correction
rectangularity
n
n roundness, circularity, compactness
l2
4a
Feature Inspection
n HALCON
difference
12
2009-4-27
n
n
n
HALCON
Sobel, Roberts, Robinson, Frei
filters.
hysteresis thresholding nonmaximum suppression
(a) (b) .
()
n
n
n
Standard:
sobel_amp, sobel_dir, edges_image
Advanced:
derivate_gauss, edges_color
n
Standard:
threshold, skeleton, inspect_shape_model
Advanced:
hysteresis_threshold, nonmax_suppression_dir
n
a)
b) c)
Standard:
background_seg, close_edges, close_edges_length, opening_circle,
split_skeleton_lines, hough_lines_dir, hough_lines, gen_contours_skeleton_xld
13
2009-4-27
n Sub-Pixel ?
Sub-Pixel
Sub-Pixel
a)ROI
c)
b)
HALCON1/50
a)x-ray
n
n ROI
n
edges_sub_pixedges_color_sub_pix
lines_gausslines_color
n
get_contour_attrib_xld
get_contour_global_attrib_xld
query_contour_attribs_xld
query_contour_global_attribs_xld
n XLD Contours
n
b)
Halcon
XLD
a)
b)
c)
a)
b)
14
2009-4-27
n XLD
edges_sub_pix, edges_color_sub_pixlines_gauss, lines_facet
XLD; sobel_ampedges_imagebandpass_image
RegionXLDgen_contour_polygon_xld
gen_contour_polygon_rounded_xld
n XLD
segment_contours_xld, split_contours_xld
select_shape_xld
union_collinear_contours_xldunion_straight_contours_xld
union2_closed_contours_xld
n
fit_line_contour_xld gen_contour_polygon_xld
fit_rectangle2_contour_xld gen_rectangle2_contour_xld
fit_circle_contour_xld gen_circle_contour_xld
fit_ellipse_contour_xld gen_ellipse_contour_xld
n
area_center_xld, compactness_xld, convexity_xld, eccentricity_xld, diameter_
xld, orientation_xld
n XLD
XLDXLD
get_contour_xld
gen_region_contour_xld
n
gen_measure_rectangle2,
gen_measure_arc,
translate_measure
1.
measure_pos,
measure_pairs
2.
set_fuzzy_measure,
fuzzy_measure_pos,
fuzzy_measure_pairs,
fuzzy_measure_pairin
g
15
2009-4-27
PCB
/
OCV&OCR
2D/3D
16