Rotate image Version 2 (Python)

Action group: Vision


Description

The action rotates the image. 

Orientation is changed in two ways: the first is rotation, the second is vertical and horizontal mirroring. Accordingly, for each method parameters are set, for the first method degrees are set, for the second method the type of mirroring vertically or horizontally is specified, if both parameters are set - the robot does not work

Action icon


Parameters 

Input parameters

Image - image orientation of which you want to change. In the field set the path to the target image.

Flip - type of reflection of the specified image. It is possible to choose from the following values: Vertical; Horizontal. 

Vertical/horizontal reflection:

Rotate - the degree of rotation for the specified image.

Rotation in degrees (-50):

Settings

PropertyDescriptionTypeFilling exampleMandatory field
Parameters
ImageThe image, orientation of which needs to be changed. The action first reflects the image, then changes the rotation angle. Available formats: jpg, jpeg, jpe, png, bmp, ppm.Robin.FilePath
Yes
FlipThe type of reflection of the specified image.Robin.String
No
RotateThe degree of rotation for the specified image. The value must be between -360 and 360. A positive value will rotate the image clockwise and a negative value will rotate the image counterclockwise. If «0» is specified, the image will not change.Robin.Numeric
No

Special conditions of use

The action rotates the specified image. 

  1. The action can rotate the image by the set number of degrees: from -360 to 360. A positive value will rotate the image clockwise, and a negative value will rotate the image counterclockwise. If "0" is set, the image will not change.
  2. If a number outside the range is set, and an uneven number is set, the robot will generate an error. Error description: "Incorrect filling of parameters."
  3. The action can reflect the image vertically or horizontally.
  4. If no change option is selected, the action does not change anything.
  5. The user should set the path to the file (image). Acceptable file extensions: jpg, jpeg, bmp, png, ppm, jpe.
  6. If the user set an incorrect file extension, the robot will generate an error.  Error description: "An invalid file extension is specified."

Examples 

Original images:

Vertical/horizontal reflections:

Rotation in degrees (-50):

Example of use

Task

Flip the image horizontally. 

Solution

Use the "Rotate Image" action. 

Implementation

  1. Move the "Rotate Image" action (Vision group) to the workspace. 
  2. Set the "Rotate Image" action parameters.


  3. Click the "Start" button in the top panel. 

Result

The program robot completed successfully. The flipped is displayed horizontally. 

  • Нет меток