-
Notifications
You must be signed in to change notification settings - Fork 31
op warpPerspective
firepick1 (pixel) edited this page Oct 31, 2014
·
7 revisions
Applies a perspective transformation to an image.
Reference: Geometric Image Transformations: warpPerspective()
The perspective matrix can be:
- Specified in the perspective stage itself
- Computed and obtained from a preceding camera calibration stage (see op-matchGrid).
- Provided externally as FireSight pipeline arguments
{"op":"warpPerspective","borderMode":"BORDER_CONSTANT","borderValue":[0,0,0]}
-
borderMode pixel extrapolation method (
BORDER_CONSTANT
orBORDER_REPLICATE
). - borderValue value used in case of a constant border; by default, it equals [0,0,0].
- model Name of stage whose model has a JSON "calibrate" object having cameraMatrix and distCoeffs.
NOTE: Currently, this stage is written with the flags
parameter hard-coded to INTER_LINEAR
.
{}
Example: A different perspective pipeline
firesight -i img/cal-grid.png -p json/matchGrid-perspective.json -Dtemplate=img/cross32.png
In this example, we used op-matchGrid to give us a perspective matrix that makes a dramatic difference.
... "perspective":[ 1.0405136564383939, 0.026744906574870872, -2.943810346145538, 0.024529984309304427, 1.097007339310166, -14.050588819421538, -1.7780681696463529e-5,0.00027266213560320576,1.0 ], ...
Distorted image
Undistorted image