LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Draw crosshairs "live" on peak in image?

Is there anything that does something close to this? I'm doing this very
painful "draw line" sequence (Picture Controls) after loading a bitmap
into a Picture Control, grabbing the unflattened U16 array data, and
using "array max & min" (which is OK for now since our peak is clean. I
know this is not the best way to track a 2D peak...).

It just seems that this would have been tried before; who wants to
reinvent the wheel! Thanks in advance!

Also, the display of this image is in the standar "while" polling loop,
where other things are happening/updating. Unfortunately, when I load
the image and feed it both to a 3D graph and to the peak-finder, the
image data zeros itself in the next poll loop since no new image
was
loaded from disk (press a button to do this), so my graph & crosshairs
flash on briefly then are zero'ed out. Shift registers??

Thanks!
-Helen

--

"I love deadlines. I like the whooshing sound as they fly by." - Douglas
Adams
0 Kudos
Message 1 of 3
(1,706 Views)
"Helen E. Kourous" wrote in message
news:39F03F4E.97D12CD5@erim-int.com...
> Is there anything that does something close to this? I'm doing this very
> painful "draw line" sequence (Picture Controls) after loading a bitmap
> into a Picture Control, grabbing the unflattened U16 array data, and
> using "array max & min" (which is OK for now since our peak is clean. I
> know this is not the best way to track a 2D peak...).

Haven't seen that in particular done before. Should just be a matter of
finding the peak in a VI, passing coordinates and drawing some vertical
lines at offset +- something * scaling factor to make it look right. I
mention scaling factor since as you zoom in and out of your data the
crosshair should probably grow/shrink.

> Also, the display of this image is in the standar "while" polling loop,
> where other things are happening/updating. Unfortunately, when I load
> the image and feed it both to a 3D graph and to the peak-finder, the
> image data zeros itself in the next poll loop since no new image was
> loaded from disk (press a button to do this), so my graph & crosshairs
> flash on briefly then are zero'ed out. Shift registers??

3D graph in my experience was painfully slow for a user interface. Your
mileage may vary, this was on my K6-400 160mb. I ended up using a picture
indicator and doing my own display function which worked better. Consider
the same since updating in a loop seemed to suck out a lot of cpu time.

And yes, the behavior you describe is exactly what I got most of the time
when I forgot shift registers for some reason. Either on the array content
or the picture indicator or something. I remember the 3d graph wanted some
kind of ActiveX communication so I can't tell ya exactly which lines to
throw registers on offhand.

As I'm sure you're noticing graphics and strings are both kind of a pain. If
you want REAL fun try the draw circle vi. It is simply the most
non-intuitive thing I've ever seen. This weekend's task is to rewrite draw
circle as center+angle+stepangle as opposed to the insane four corners that
LV does.

-joey
0 Kudos
Message 2 of 3
(1,706 Views)
> Is there anything that does something close to this? I'm doing this very
> painful "draw line" sequence (Picture Controls) after loading a bitmap
> into a Picture Control, grabbing the unflattened U16 array data, and
> using "array max & min" (which is OK for now since our peak is clean. I
> know this is not the best way to track a 2D peak...).
>
> It just seems that this would have been tried before; who wants to
> reinvent the wheel! Thanks in advance!
>
> Also, the display of this image is in the standar "while" polling loop,
> where other things are happening/updating. Unfortunately, when I load
> the image and feed it both to a 3D graph and to the peak-finder, the
> image data zeros itself in the next poll loop since no new image was
> loaded from disk (pre
ss a button to do this), so my graph & crosshairs
> flash on briefly then are zero'ed out. Shift registers??
>

I can't help much with finding the peak of the image. I suspect there
are many techniques, and each of them has tradeoffs in accuracy, speed,
and applicability. Once you know the location, though, drawing the
cursor should be easy. If you don't want the picture control to redraw,
then don't send data to it, or send the same data again.. In otherwords,
you can use shift registers to send the same data over and over, or you
can use a case statement, wired to the Load Button, that governs whether
or not the data is sent to the picture control. If the picture control's
terminal is located in the TRUE frame, and only gets new data when the
Boolean button is TRUE, then nothing gets written in the FALSE, and that
is in fact a good place to do a Wait ms of something like 50 or 100.

Greg McKaskle
0 Kudos
Message 3 of 3
(1,706 Views)