jabcode
 All Classes Files Functions Variables Enumerations Macros
transform.c File Reference

Matrix transform. More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "jabcode.h"
#include "detector.h"

Functions

jab_perspective_transformsquare2Quad (jab_float x0, jab_float y0, jab_float x1, jab_float y1, jab_float x2, jab_float y2, jab_float x3, jab_float y3)
 Calculate transformation matrix of square to quadrilateral. More...
 
jab_perspective_transformquad2Square (jab_float x0, jab_float y0, jab_float x1, jab_float y1, jab_float x2, jab_float y2, jab_float x3, jab_float y3)
 Calculate transformation matrix of quadrilateral to square. More...
 
jab_perspective_transformmultiply (jab_perspective_transform *m1, jab_perspective_transform *m2)
 Calculate matrix multiplication. 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...
 
jab_perspective_transformgetPerspectiveTransform (jab_point p0, jab_point p1, jab_point p2, jab_point p3, jab_vector2d side_size)
 Get perspetive transformation matrix. More...
 
void warpPoints (jab_perspective_transform *pt, jab_point *points, jab_int32 length)
 Warp points from source image to destination image in place. More...
 

Detailed Description

Matrix transform.

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_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

Calculate matrix multiplication.

Parameters
m1the multiplicand
m2the multiplier
Returns
m1 x m2
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_perspective_transform* quad2Square ( jab_float  x0,
jab_float  y0,
jab_float  x1,
jab_float  y1,
jab_float  x2,
jab_float  y2,
jab_float  x3,
jab_float  y3 
)

Calculate transformation matrix of quadrilateral to square.

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
Returns
the transformation matrix
jab_perspective_transform* square2Quad ( jab_float  x0,
jab_float  y0,
jab_float  x1,
jab_float  y1,
jab_float  x2,
jab_float  y2,
jab_float  x3,
jab_float  y3 
)

Calculate transformation matrix of square to quadrilateral.

Parameters
x0the x coordinate of the 1st destination point
y0the y coordinate of the 1st destination point
x1the x coordinate of the 2nd destination point
y1the y coordinate of the 2nd destination point
x2the x coordinate of the 3rd destination point
y2the y coordinate of the 3rd destination point
x3the x coordinate of the 4th destination point
y3the y coordinate of the 4th destination point
Returns
the transformation 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