From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, 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: 

fast image rotation and contrast adaptation

First: I'm new in vision processing. Smiley Wink
 
I'm using LabView 8.0 with the IMAQ Vision development module. The aim is to control the angle and the contrast of a precalculated image (a greyscale wedge) in a fast loop with a framerate of 60 or 100Hz. Currently I use the time-consuming IMAQ rotate and IMAQ BCG functions. All these function works very fine but a litle bit to slow for my application. I have measure: IMAQ rotate with 40ms and IMAQ BCG with 15ms for an image with 1024 x 768 pixels (8-bit greyscale) on a new PC. I know that an arbitrary rotation is a processor intensive task.
 
Please correct me, but i assume that with IMAQ rotate the image rotation will be carried out in the PC RAM. Afterwards the recalculated image will be written in the grafic memory. In a final step the image will be displayed on the monitor by mean of the grafic processor.
 
I can imagine there exist a solution or some ideas in the LabView community to use the high end 3D very fast grafic card processor for the rotation and contrast tasks. I hope the approach will accelerate the time of calculation.
 
Thanks for your help.
 
Best regards
 
Ivo Buske
 
0 Kudos
Message 1 of 8
(3,899 Views)

"ibstein74" <x@no.email> wrote in message news:1142460732409-338548@exchange.ni.com...
First: I'm new in vision processing. Smiley Wink
&nbsp;
I'm using LabView 8.0 with the IMAQ Vision development module. The aim is to control the angle and the contrast of a precalculated image (a greyscale wedge) in a fast loop with a framerate of 60 or 100Hz. Currently I use the time-consuming IMAQ rotate and IMAQ BCG functions. All these function works very fine but a litle bit to slow for my application. I have measure: IMAQ rotate with 40ms and IMAQ BCG with&nbsp;15ms for an image with&nbsp;1024 x 768 pixels (8-bit greyscale) on a new PC. I know that an arbitrary rotation is a processor intensive task.
&nbsp;
Please correct me, but i assume that with IMAQ rotate the image rotation will be carried out in the PC RAM. Afterwards the recalculated image will be written in the grafic memory. In a final step&nbsp;the image will be displayed on the monitor by mean of the grafic processor.
&nbsp;
I can imagine there exist&nbsp;a solution or some ideas in the LabView community to use the high end 3D very fast grafic card processor for the rotation and contrast tasks. I hope the approach will&nbsp;accelerate the time of calculation.
&nbsp;
Thanks for your help.
&nbsp;
Best regards
&nbsp;
Ivo Buske
&nbsp;



Hi,


Transfering the image to the GPU and back might take more time then doing it on the CPU.


You might also need to convert the IMAQ image to a hardware API readable format. Worse case, you need to use imagetoarray, and that will take a lot of time too. (Perhaps there is a way to manipulate (add an offset) the IMAQ pointer so you can pass the pointer to the hardware API. You'll need to understand the IMAQ image format, and I'm not sure it's documented.)


You could try to make your routine that rotates a byte, and does the BCG in one. Memory access is expensive, and you'll save on read and one write... The IMAQ code should be very efficient, so it will be hard to top it. And you'll still need to know the internal IMAQ image format.


Can you explain more about your application? Why do you need to rotate? Do you really need to rotate the entire image? If you could determine a ROI first, you'll gain a lot of speed.


Sorry, no solution...


Wiebe.








0 Kudos
Message 2 of 8
(3,858 Views)
Hi Wiebe,

I have a fixed image, created before with array functions, that contain a pure linear greyscale gradient (left side: white / right side: black). I used this image to control a "spatial light modulator". This device is connected to the second DVI graphic card output. The main task of the "spatial light modulator" is to shift the local phase of the reflective light. It works as an spatial resolved "adaptive mirror".  The local phase shift correspondes directly to the applied grey level of the image. To change the direction in both dimensions of the reflective light I need to rotate this image (= rotate the phase wedge) Thereby the contrast can adjust the absolute angle of reflection.

After I had calculated my greyscale gradient image and applied it to the second DVI output, I want only control the contrast and rotation. I think the graphic card function are very fast. But I have to control the graphic card directly per DLL or C-function node. It must be possible because I can tune the contrast and adjust the rotation manually with the nvidea driver in the windows system manager. I'm  waiting for a couple of weeks of an answer from nvidea but it seems that contrast and rotation of an 2D-image is not a real problem for these 3-D guys. 😞

I hope of an answer or new ideas.

Ivo Buske


0 Kudos
Message 3 of 8
(3,852 Views)
Hi,


If I understand correctly, you just want a gradient screen to rotate, and to be able to adjust it's contrast.


This can be done a lot easier without an image. If you use OpenGL, you can just draw two triangles with there color set correctly. (You'd be able to make nice rainbow pictures as a bonus.)


An C/C++ application, or dll, could be made in a few hours by someone experienced with opengl and c++. You could even create an opengl window, and control it with LabVIEW. In other opengl applications there are some practical problems, but some might not matter to your application. Biggest problem is getting feedback (mouse clicks, close, move, resize window etc.) from the OpenGL window to LabVIEW.


Opening a opengl window, rotating a few polygons, adjusting color, closing window certainly doable.


Regards,


Wiebe.





"ibstein74" <x@no.email> wrote in message news:1147695009235-365063@exchange.ni.com...
Hi Wiebe, I have a fixed image, created before with array functions, that contain a pure linear greyscale gradient (left side: white / right side: black). I used this image to control a "spatial light modulator". This device is connected to the second DVI graphic card output. The main task of the "spatial light modulator" is to shift the local phase of the reflective light. It works as an spatial resolved "adaptive mirror".&nbsp; The local phase shift correspondes directly to the applied grey level of the image. To change the direction in both dimensions of the reflective light I need to rotate this image (= rotate the phase wedge) Thereby the contrast can adjust the absolute angle of reflection.After I had calculated my greyscale gradient image and applied it to the second DVI output, I want only control the contrast and rotation. I think the graphic card function are very fast. But I have to control the graphic card directly per DLL or C-function node. It must be possible because I can tune the contrast and adjust the rotation manually with the nvidea driver in the windows system manager. I'm&nbsp; waiting for a couple of weeks of an answer from nvidea but it seems that contrast and rotation of an 2D-image is not a real problem for these 3-D guys. :-(I hope of an answer or new ideas.Ivo Buske
0 Kudos
Message 4 of 8
(3,846 Views)
And of course, the rambling about IMAQ image pointers isn't relevant. (Skip all IMAQ.)


You might as well send the image once (each time it changes), and rotate it with opengl.


"Wiebe@CARYA" <wiNOebe.walsSPtra@carAMya.nl> wrote in message news:44687eaa@PYROS.natinst.com...
Hi,


If I understand correctly, you just want a gradient screen to rotate, and to be able to adjust it's contrast.


This can be done a lot easier without an image. If you use OpenGL, you can just draw two triangles with there color set correctly. (You'd be able to make nice rainbow pictures as a bonus.)


An C/C++ application, or dll, could be made in a few hours by someone experienced with opengl and c++. You could even create an opengl window, and control it with LabVIEW. In other opengl applications there are some practical problems, but some might not matter to your application. Biggest problem is getting feedback (mouse clicks, close, move, resize window etc.) from the OpenGL window to LabVIEW.


Opening a opengl window, rotating a few polygons, adjusting color, closing window certainly doable.


Regards,


Wiebe.





"ibstein74" <x@no.email> wrote in message news:1147695009235-365063@exchange.ni.com...
Hi Wiebe, I have a fixed image, created before with array functions, that contain a pure linear greyscale gradient (left side: white / right side: black). I used this image to control a "spatial light modulator". This device is connected to the second DVI graphic card output. The main task of the "spatial light modulator" is to shift the local phase of the reflective light. It works as an spatial resolved "adaptive mirror".&nbsp; The local phase shift correspondes directly to the applied grey level of the image. To change the direction in both dimensions of the reflective light I need to rotate this image (= rotate the phase wedge) Thereby the contrast can adjust the absolute angle of reflection.After I had calculated my greyscale gradient image and applied it to the second DVI output, I want only control the contrast and rotation. I think the graphic card function are very fast. But I have to control the graphic card directly per DLL or C-function node. It must be possible because I can tune the contrast and adjust the rotation manually with the nvidea driver in the windows system manager. I'm&nbsp; waiting for a couple of weeks of an answer from nvidea but it seems that contrast and rotation of an 2D-image is not a real problem for these 3-D guys. :-(I hope of an answer or new ideas.Ivo Buske
0 Kudos
Message 5 of 8
(3,846 Views)
Hi!
By the way, could you describe, how do you use SLM as 2nd monitor in Labview? I mean you have to send a picture to it separately. I suppose you use holoeye phase only slm? I have nearly same task - to display a motion "picture" on this SLM.
Thank you.
GL
0 Kudos
Message 6 of 8
(3,680 Views)
Hi Grischa,

That's easy. You can use the second DVI monitor output. In Labview do you have to use the pixel range of the second monitor.  Be sure, that you use the expanded function of you grafic card - not clone the screen!

I have different SLM types from different companies in my lab. Holoeye is one of them. I use LC-R 2500 and LC-R 720 from Holoeye.

May I ask you, what is the applicaton do you deal with? Do you come from Germany?

Best greetings

Ivo
0 Kudos
Message 7 of 8
(3,663 Views)
Glad to see your reply. It's better to discuss it by email. Please, write me: glazar@yandex.ru
Yes, currently I'm in Germany, but originally from Moscow. Since you have exprience with different phase SLMs it would be great to dicuss it with you. Especially I'm interested in phase noises and repeatability of individual pixels. Holoeye doesn't provide such information (they really dont know it), but it is very important for me. So I'm trying to measure it by myself, controlling slm and usb-camera with Labview.
In one word my final application is imaging.
Mit freundlichen Gruesse,
Grischa.
0 Kudos
Message 8 of 8
(3,661 Views)