Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Please fill out the contact form below and we will reply as soon as possible.

  • Contact Us
  • Home
  • Products
  • Quality control & Inspection
  • Inspection systems

How to manually rotate an image FH/FHV7

Written by Arlo D'Cruz

Updated at April 8th, 2024

Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Please fill out the contact form below and we will reply as soon as possible.

  • Products
    Automation Systems Control Components Motion & Drives Quality control & Inspection Robotics Safety Sensing Services Software Switching Components
  • Amplify e-Store
    e-Store public
  • Public CSC
+ More

Introduction

Occasionally it is necessary to apply a rotation to an image without using the built in shape search or other position finding functions. Usually this is so the image is in the correct orientation for the operator. It is possible to accomplish this using the Position Compensation Unit.

Background

Let's say:

  • w is the width of the image.
  • h is the height of the image.
  • θ is the angle of rotation in radians.

The image is rotated about the top left corner, so we can calculate the x and y offsets as:

Horizontal offset (xoffset):

xoffset = - (w  cos(θ) - h * sin(θ) - w)/2

Vertical offset (yoffset):

yoffset = - (w  sin(θ) + h * cos(θ) - h)/2

Examples

The below examples show how you might calculate a one-off static offset (manual calculation), or create an automated offset using the calculation unit.

Manual calculation example

 

Automated calculation

 
 

For this example we will use a rotation of 180 degrees. We used an excel spreadsheet to calculate the offsets. Note that the dimensions of the image are 640x480.

X offset expression:

=-1*(B1*COS(RADIANS(B3))-B2*SIN(RADIANS(B3))-B1)/2

Y offset expression:

=-1*(B1*SIN(RADIANS(B3))+B2*COS(RADIANS(B3))-B2)/2

Set the position compensation unit to calculation mode. Use Bi-linear mode if 90 is not a factor of your rotation. Enter the offsets and rotation angle in the “Position” section.

The image will now be flipped 180 degrees. 

 

For this example we will use a rotation of 22 degrees. We used the calculation unit to calculate the offsets. Note that the dimensions of the image are 640x480.

Flow:

Calculation unit:

X Offset Expression:

-(640*COS(U1.D00)-480*SIN(U1.D00)-640)/2

Y Offset Expression:

-(640*SIN(U1.D00)+480*COS(U1.D00)-480)/2

Position Compensation:

Result:

 

 

 

 

 

 

 

 

image manipulation rotate manually fh fhv rotate orientation

Was this article helpful?

Yes
No
Give feedback about this article

Related Articles

  • How to log FH and FHV7 Images on a Network Folder
  • Step by Step Guide: Microscan ID40 Barcode Reading to an NJ/NX PLC via Ethernet/IP
  • FH/FHV7 to CJ2 via Ethernet/IP
  • How many FHV units can I connect to from the Remote Operation tool?

Definition by Author

0
0
Expand