cr.vision.geom_transform package¶
Submodules¶
cr.vision.geom_transform.projective2d_actions module¶
-
cr.vision.geom_transform.projective2d_actions.
rotate
(img, theta)[source]¶ Rotates an image from its center. Adjust the size of the output image so that rotated image is fully contained inside it.
Steps - Estimate the size of the bounding box for the rotated image. - Locate the center of the target image - Rotate the image about its center - Move its center to the target image center
cr.vision.geom_transform.projective2d_matrices module¶
A set of classes to represent projective transformations
-
class
cr.vision.geom_transform.projective2d_matrices.
Identity
[source]¶ Bases:
object
An identity transform definition
-
class
cr.vision.geom_transform.projective2d_matrices.
Transform
(previous)[source]¶ Bases:
object
A projective transformation matrix definition
-
class
cr.vision.geom_transform.projective2d_matrices.
Translation
(previous, t_x, t_y)[source]¶ Bases:
cr.vision.geom_transform.projective2d_matrices.Transform
cr.vision.geom_transform.scaling module¶
-
cr.vision.geom_transform.scaling.
resize
(image, target_width=None, target_height=None, interpolation=4)[source]¶ Resize image to target width or height or both
If only target_width is specified, then target_height is automatically calculated. If only target_height is specified, then target_width is automatically calculated. In these two cases, aspect ratio is preserved.
Otherwise, image is resized as per specified target width and height.
Module contents¶
Package for functions and classes related to geometric transformations of images