|
|
|
|
|
<Image variable>.Straighten (Function) In french: <Variable Image>.Redresse Transforms an image by applying perspective correction. srcImg is Image = "Rubiks_cubes.jpg"
dstImg is Image = srcImg
dstImg.FillColor = LightOrange
srcPoly is Polygon
Add(srcPoly.Point, [POT_SRC_TL, POT_SRC_TL])
Add(srcPoly.Point, [srcImg.Width - POT_SRC_TL, POT_SRC_TL])
Add(srcPoly.Point, [srcImg.Width - POT_SRC_TL, srcImg.Height - POT_SRC_TL])
Add(srcPoly.Point, [POT_SRC_TL, srcImg.Height - POT_SRC_TL])
dstPoly is Polygon
Add(dstPoly.Point, [POT_SRC_TL, POT_SRC_TL])
Add(dstPoly.Point, [srcImg.Width - POT_SRC_TL, POT_SRC_TL + POT_Droite])
Add(dstPoly.Point, [srcImg.Width - POT_Bas - POT_SRC_TL, srcImg.Height - POT_Droite - POT_SRC_TL])
Add(dstPoly.Point, [POT_SRC_TL + POT_Bas, srcImg.Height - POT_SRC_TL])
srcImg = srcImg.Découpe(POT_SRC_TL, POT_SRC_TL, srcImg.Width - POT_SRC_TL, srcImg.Height - POT_SRC_TL)
IF dstImg.Redresse(srcPoly, dstPoly) = False THEN
Error()
END
Syntax
Straightening an image in a destination polygon Hide the details
<Result> = <Image variable>.Straighten(<Source polygon> , <Destination polygon>)
<Result>: Boolean - True if the transformation has been applied,
- False otherwise.
<Image variable>: Image variable Name of the Image variable to be used. <Source polygon>: Polygon variable Name of the Polygon variable used to define the area to be transformed. This polygon must be a quadrilateral. <Destination polygon>: Polygon variable Name of the Polygon variable used to define the area that contains the transformed image. The coordinates of this quadrilateral are used to define the transformation. The source quadrilateral is transformed into the destination quadrilateral.
Straightening an image in a destination rectangle Hide the details
<Result> = <Image variable>.Straighten(<Source polygon> [, <Destination rectangle>])
<Result>: Boolean - True if the transformation has been applied,
- False otherwise.
<Image variable>: Image variable Name of the Image variable to be used. <Source polygon>: Polygon variable Name of the Polygon variable used to define the area to be transformed. This polygon must be a quadrilateral. <Destination rectangle>: Optional Rectangle variable Name of the Rectangle variable used to define the area that contains the transformed image. The coordinates of this rectangle are used to define the transformation. The image contained in the source quadrilateral will be transformed to fit the destination rectangle. If this parameter is not specified, a rectangle is automatically generated. Remarks - Any part of the image outside the <Source polygon> is lost in the transformation. The resulting image will not contain these elements.
- The resulting image will be contained in a rectangle around the <Destination polygon>. The result is placed at coordinates (0,0).
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|