From 11:00 PM CDT Friday, Nov 8 - 2:30 PM CDT Saturday, Nov 9, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

straight the image

Solved!
Go to solution

Hello every one,

 

Can any one help to in finding a way of how to straight the any image. If there is an image whose orientaion is completely out of phase comapred to reference image then how to straight the image. IMAQ rotate and IMAQ symmetry can do it but they work manually ( you have to change the angles yoursself) but I want the labview to recognise the image and straight it for me. Is this possible.?  I have attached my basic VI which only consists how to straight the image and an image which can explain everything itself. Thanks for help 

 

Best wishes,

Lazer

Download All
0 Kudos
Message 1 of 9
(3,458 Views)

Hello everyone,

 

My post is nearly 4 day old now, I am wondering when I will get the response.

 

Lazer

0 Kudos
Message 2 of 9
(3,394 Views)

A little exaggeration.  Try 2 days old.

0 Kudos
Message 3 of 9
(3,391 Views)

Hello Raven,

 

Thanks for reply and correction. 

 

Lazer

0 Kudos
Message 4 of 9
(3,384 Views)
Solution
Accepted by topic author lazer

Hello lazer,

 

From looking over your previous forum posts, specifically this one here:

 

http://forums.ni.com/t5/Machine-Vision/Pattern-Recognition-for-solar-cells-for-different-sizes/m-p/2...

 

The last program you posted ( "detect the shape 2.vi" ) looks like you have an angle coming out from your cluster of IMAQ Detect Shapes vi. What you would want to do to straighten up an image is to take a reference to your shape, which you are doing in that program, see its angle of offset from either the vertical or horizontal, which you also have coming out from an unbundle by name function, and then apply that angle to rotate your image in the opposite direction to get it "straight". I would suggest taking that angle and feeding it in to your IMAQ rotate function that you have in "straight the image.vi" and seeing the results of it there.

Best regards,

Mark W
Applications Engineer
National Instruments UK & Ireland
Message 5 of 9
(3,357 Views)

Hello Mark, 

 

Thanks for reply and guding me through the procedure. It is working. Thank you very much, however I have another question to ask. As you can see in my post "Detect the shape 2", What I am trying to do is: I am intending to detect the rectangle and then calculate the area of this rectangle. Any way which can perform this task as well. I have attached, another VI which I tried to detect the image but this one only showing me the cells only, but I am trying to detect the whole rectangle. I program which can detect any rectangle and calculate the area of the rectangle. 

 

Many Thanks 

Lazer

0 Kudos
Message 6 of 9
(3,329 Views)

Hello lazer,

 

We will try to make sure that we keep these issues separate in different threads so that if any one searches for your initial query they will find the solution in this thread, feel free to mark this thread as solved and carry the enquiry with regards to the area of the rectangle in the new thread that you have created:

 

http://forums.ni.com/t5/Machine-Vision/Detect-the-rectangular/m-p/2370836

Best regards,

Mark W
Applications Engineer
National Instruments UK & Ireland
0 Kudos
Message 7 of 9
(3,293 Views)

Hello Mark,

 

Thanks for replying. Regards to accept the solution, at the moment there is no option for accepting the solution as it appears on the browsing page, I will accept it because I understood your point.  Can you suggest a way, how can I detect my rectangle. You can post suggestion on my other thread.

 

Many Thanks

Lazer 

0 Kudos
Message 8 of 9
(3,283 Views)

When images are displayed in an incorrect orientation, you may rotate selected images counterclockwise or with a customized rotation angle. Rotating images individually or rotating a group of images can also be easily achieved! Here is a simple VB.NET solution for rotating image.

0 Kudos
Message 9 of 9
(3,204 Views)