LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

gray scale image

Attachment is a vi (Labview version 8.2.1) to draw gray scale image. When it runs, its speed is getting slower. Drawing of the later plot is much slower than that of the former one. I think this vi maybe redraw the former plots before drawing the next one and waste too much time. I tried several methods to resolve it, but I failed. Could anybody help me with it? Thanks!

帖子被Labview86在 01-21-2009 11:49 AM
时编辑过了
0 Kudos
Message 1 of 6
(3,573 Views)

First of all, you are NOT drawing a grayscale image, but you are drawing 40000 1x1 full color greyed-out rectangles, one at a time (!!). That is something entirely different!

 

There is no reason to update the image in the innermost loop. A better way to do things would be to build a 2D aray inside the loop and then draw it once as image. Here's a quick draft. See if it makes sense (takes a few ms). It would be even faster as a true 8bit greyscale image, of course.

Message 2 of 6
(3,559 Views)

Thanks!

 

Actually, I tried your solution before to compare the speed, and I got to know what happened to the first vi. But for my case, I can not resolve the problem like that, because I have to see every plots immediately when got it. I think stopping the former plots redrawn before the next plot drawn may be the right solution, but I do not know how to realize it. Could you please give more advice? Thanks!

0 Kudos
Message 3 of 6
(3,557 Views)

Labview86 wrote:

But for my case, I can not resolve the problem like that, because I have to see every plots immediately when got it.


OK, you have some serious misconceptions here. You should not update the plot faster than you can actually look at it. You monitor refresh rate, and thus the screen update, is the limiting speed at which you can display things.

 

If you receive more data in that timeframe, you should update at a resonable interval. It makes absolutely no sense to force an update after each point, because that slows things down much more as you noticed.

 

If you want to see intermediary updates, build the image in a shift register and update e.g. after every row. See attached. As you can see, it is still significantly slower that drawing the entire thing at once. You need to find the right balance!

Message Edited by altenbach on 01-21-2009 12:26 PM
Message 4 of 6
(3,533 Views)
Also don't forget that you could display your data as an intensity graph instead.
0 Kudos
Message 5 of 6
(3,524 Views)

Good solution! Thanks!

 

I tried to update image line by line before, but your vi is much better than what I did. See attachment (this one was edited by Labview version 8.6). Maybe I can get some comment from you about the style. It seems that my vi is faster than yours, which confused me. Theoretically, yours should be much faster than mine because you update all the former lines and the next line at once, while I update line by line before drawing the next line.

0 Kudos
Message 6 of 6
(3,521 Views)