Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Keep pixel coordinates while using IMAQ Rotate?

Hello.

I would like to know if it is possible to keep the pixel coordinate information of the original image while using IMAQ Rotate.
If I assume correctly, IMAQ Rotate creates a "new" picture with "new" pixel coordinates. Thus, when looking at pixel coordinates of the rotated picture, you always get the "new" pixel coordinates. But I would like to get the pixel coordinates of the original image.

Is this possible?

Thanks for your help!

Greetings,
Dennis.
0 Kudos
Message 1 of 9
(4,527 Views)
Hello,

I'm not sure I understood what you mean... here is a snippet, hope this can help you.

If you mean you want the same pixel after the rotation, I think you have to calculate the coordinates "after rotation" yourself using the angle.



We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 2 of 9
(4,518 Views)
Hi,

@TiTou wrote:
Hello,

I'm not sure I understood what you mean... here is a snippet, hope this can help you.
[...]


thanks for the code, but unfortunately this is not what I had in mind.



@TiTou wrote:
[...]

If you mean you want the same pixel after the rotation, I think you have to calculate the coordinates "after rotation" yourself using the angle.


Yes, this is exactly what I ment. I rotate the picture, then use pattern matching to find some specific pixels in the image. From these pixels I need the pixel coordinates. But I only get the coordinates of the rotated image, not from original one.
I tried using the "Set simple calibration" to specify the rotation angle and then use "Convert Pixel to Real World", but this didn't work somehow, although it should, right?

Greetings,
Dennis
0 Kudos
Message 3 of 9
(4,510 Views)
Hi Dennis

I've made a rough example demonstrating the reverse rotation of the coordinates. Hope it helps.

Vladimir

View my profile on LinkedIn
0 Kudos
Message 4 of 9
(4,503 Views)
Hi Vladimir,

I'm interested in seeing your VI, could you repost it in LV 8.20 please Smiley Surprised ?



We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 5 of 9
(4,493 Views)
Thanks a lot !

We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 7 of 9
(4,483 Views)
Thanks Vladimir,

it works.
But I still wonder, why my first approach won't work:


@dpetsch wrote:
I tried using the "Set simple calibration" to specify the rotation angle and then use "Convert Pixel to Real World", but this didn't work somehow, although it should, right?


Can you tell me, why this doesn't work?

Cheers,
    Dennis.
0 Kudos
Message 8 of 9
(4,450 Views)
Hi Dennis

Sorry I've never used that. Maybe you could post some more details about what exactly you are feeding into the VI, so that someone from NI can help you better.

Vladimir

View my profile on LinkedIn
0 Kudos
Message 9 of 9
(4,445 Views)