jabcode
 All Classes Files Functions Variables Enumerations Macros
detector.h File Reference

Detector header. More...

Go to the source code of this file.

Classes

struct  jab_finder_pattern
 Finder pattern. More...
 
struct  jab_alignment_pattern
 Alignment pattern. More...
 
struct  jab_perspective_transform
 Perspective transform. More...
 

Macros

#define TEST_MODE   1
 
#define MAX_MODULES   145
 
#define MAX_SYMBOL_ROWS   3
 
#define MAX_SYMBOL_COLUMNS   3
 
#define MAX_FINDER_PATTERNS   200
 
#define PI   3.14159265
 
#define CROSS_AREA_WIDTH   14
 
#define DIST(x1, y1, x2, y2)   (jab_float)(sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2)))
 

Enumerations

enum  jab_detect_mode { QUICK_DETECT = 0, NORMAL_DETECT, INTENSIVE_DETECT }
 

Functions

jab_bitmapbinarizer (jab_bitmap *bitmap, jab_int32 channel)
 Binarize a color channel of a bitmap using local binarization algorithm. More...
 
jab_bitmapbinarizerHist (jab_bitmap *bitmap, jab_int32 channel)
 Binarize a color channel of a bitmap using histogram binarization algorithm. More...
 
jab_bitmapbinarizerHard (jab_bitmap *bitmap, jab_int32 channel, jab_int32 threshold)
 Binarize a color channel of a bitmap using a given threshold. More...
 
jab_perspective_transformgetPerspectiveTransform (jab_point p0, jab_point p1, jab_point p2, jab_point p3, jab_vector2d side_size)
 Get perspetive transformation matrix. More...
 
jab_perspective_transformperspectiveTransform (jab_float x0, jab_float y0, jab_float x1, jab_float y1, jab_float x2, jab_float y2, jab_float x3, jab_float y3, jab_float x0p, jab_float y0p, jab_float x1p, jab_float y1p, jab_float x2p, jab_float y2p, jab_float x3p, jab_float y3p)
 Calculate transformation matrix of quadrilateral to quadrilateral. More...
 
void warpPoints (jab_perspective_transform *pt, jab_point *points, jab_int32 length)
 Warp points from source image to destination image in place. More...
 
jab_bitmapsampleSymbol (jab_bitmap *bitmap, jab_perspective_transform *pt, jab_vector2d side_size)
 Sample a symbol. More...
 
jab_bitmapsampleSymbolwithNc (jab_bitmap *bitmap, jab_perspective_transform *pt, jab_vector2d side_size, jab_int32 symbol_type, jab_bitmap *ch[])
 Sample a symbol. More...
 
jab_bitmapsampleCrossArea (jab_bitmap *bitmap, jab_perspective_transform *pt)
 Sample a cross area between the host and slave symbols. More...
 

Variables

jab_bitmaptest_mode_bitmap
 

Detailed Description

Detector header.

libjabcode - JABCode Encoding/Decoding Library

Copyright 2016 by Fraunhofer SIT. All rights reserved. See LICENSE file for full terms of use and distribution.

Contact: Huajian Liu liu@s.nosp@m.it.f.nosp@m.raunh.nosp@m.ofer.nosp@m..de Waldemar Berchtold walde.nosp@m.mar..nosp@m.berch.nosp@m.told.nosp@m.@sit..nosp@m.frau.nosp@m.nhofe.nosp@m.r.de

Function Documentation

jab_bitmap* binarizer ( jab_bitmap bitmap,
jab_int32  channel 
)

Binarize a color channel of a bitmap using local binarization algorithm.

Parameters
bitmapthe input bitmap
channelthe color channel
Returns
binarized bitmap | NULL if failed
jab_bitmap* binarizerHard ( jab_bitmap bitmap,
jab_int32  channel,
jab_int32  threshold 
)

Binarize a color channel of a bitmap using a given threshold.

Parameters
bitmapthe input bitmap
channelthe color channel
thresholdthe threshold
Returns
binarized bitmap | NULL if failed
jab_bitmap* binarizerHist ( jab_bitmap bitmap,
jab_int32  channel 
)

Binarize a color channel of a bitmap using histogram binarization algorithm.

Parameters
bitmapthe input bitmap
channelthe color channel
Returns
binarized bitmap | NULL if failed
jab_perspective_transform* getPerspectiveTransform ( jab_point  p0,
jab_point  p1,
jab_point  p2,
jab_point  p3,
jab_vector2d  side_size 
)

Get perspetive transformation matrix.

Parameters
p0the coordinate of the 1st finder/alignment pattern
p1the coordinate of the 2nd finder/alignment pattern
p2the coordinate of the 3rd finder/alignment pattern
p3the coordinate of the 4th finder/alignment pattern
side_sizethe side size of the symbol
Returns
the transformation matrix
jab_perspective_transform* perspectiveTransform ( jab_float  x0,
jab_float  y0,
jab_float  x1,
jab_float  y1,
jab_float  x2,
jab_float  y2,
jab_float  x3,
jab_float  y3,
jab_float  x0p,
jab_float  y0p,
jab_float  x1p,
jab_float  y1p,
jab_float  x2p,
jab_float  y2p,
jab_float  x3p,
jab_float  y3p 
)

Calculate transformation matrix of quadrilateral to quadrilateral.

Parameters
x0the x coordinate of the 1st source point
y0the y coordinate of the 1st source point
x1the x coordinate of the 2nd source point
y1the y coordinate of the 2nd source point
x2the x coordinate of the 3rd source point
y2the y coordinate of the 3rd source point
x3the x coordinate of the 4th source point
y3the y coordinate of the 4th source point
x0pthe x coordinate of the 1st destination point
y0pthe y coordinate of the 1st destination point
x1pthe x coordinate of the 2nd destination point
y1pthe y coordinate of the 2nd destination point
x2pthe x coordinate of the 3rd destination point
y2pthe y coordinate of the 3rd destination point
x3pthe x coordinate of the 4th destination point
y3pthe y coordinate of the 4th destination point
Returns
the transformation matrix
jab_bitmap* sampleCrossArea ( jab_bitmap bitmap,
jab_perspective_transform pt 
)

Sample a cross area between the host and slave symbols.

Parameters
bitmapthe image bitmap
ptthe transformation matrix
Returns
the sampled area matrix
jab_bitmap* sampleSymbol ( jab_bitmap bitmap,
jab_perspective_transform pt,
jab_vector2d  side_size 
)

Sample a symbol.

Parameters
bitmapthe image bitmap
ptthe transformation matrix
side_sizethe symbol size in module
Returns
the sampled symbol matrix
jab_bitmap* sampleSymbolwithNc ( jab_bitmap bitmap,
jab_perspective_transform pt,
jab_vector2d  side_size,
jab_int32  symbol_type,
jab_bitmap ch[] 
)

Sample a symbol.

Parameters
bitmapthe image bitmap
ptthe transformation matrix
side_sizethe symbol size in module
symbol_typethe symbol type (0,2,3,4,5: metadata for Nc will be sampled as black/white)
chthe binarized color channels of the bitmap
Returns
the sampled symbol matrix
void warpPoints ( jab_perspective_transform pt,
jab_point points,
jab_int32  length 
)

Warp points from source image to destination image in place.

Parameters
ptthe transformation matrix
pointsthe source points
lengththe number of source points