LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Real time image analysis

I am looking at a transient optical event (a flash of light) with both a CCD
color camera
mounted to a microscope and an Ocean Optics USB2000 spectrometer. Both
instruments
furnish useful data, but the image provided by the camera is actually more
"telling" as to what
is going on. The information unfortunately is qualitative not quantitative.

A clunky solution might be to watch the portion of the monitor screen
showing the flash
with a photocell, and feed the pulse into an analog input of a DAQ board and
numerically
integrate the pulse. That way I would have both the actual event visible in
one window
displayed in the monitor and pulse height, duration and integrated value
displayed in a LabView
window.

Can I use the video signal coming from the camera and the LabView Image
analysis package
and do away with all the analog crap? All the information needed is
contained in the camera's
blue channel. I would have all the information noted above in a single
LabView window.

Bill Lubarsky


Message 1 of 5
(4,102 Views)
Hi Bill,

It looks like you are trying to pull out the blue pixel values for your color image.  How are you getting the camera images to the computer?  If you are accessing a group of saved images, then you can use the VIs in the Graphics & Sound palette to extract the Blue values.  Just use Read JPEG File VI (or whatever format it is), Unflatten Pixmap VI (which coverts the image data into a 2D array of RGB values in your case), and Color to RGB VI (to extract the Blue data).  Then you can use Flatten Pixmap VI to reform a new grayscale image only made of blue values.

If you are using one of our framegrabber cards and have installed the free NI-IMAQ driver, then it comes with the IMAQ ColorImagetoArray VI with which you could extract the Blue data from.  If you have the Vision Development Module, then you have even more powerful tools in your hands.  The IMAQ ExtractColorPlanes VI can take in an image, parse out the R, G, and B values, and automatically convert it into a new image with only the blue color plane (or red or green).

Note: the [pink] image data type used by LabVIEW's Graphics and Sound palette is different from the [purple] image data type used by NI-IMAQ and NI Vision.  One way of converting between the two is save to file using image data type A and then open it up again using the VIs for image data type B.

Let me know if you have additional questions!

Cheers,
Irene Chow
National Instruments
Applications Engineer
0 Kudos
Message 2 of 5
(4,091 Views)

"Irene C" <x@no.email> wrote in message
news:1150807210846-380847@exchange.ni.com...
> Hi Bill,
>
> It looks like you are trying to pull out the blue pixel values for your
> color image.&nbsp; How are you getting the camera images to the
> computer?&nbsp; If you are accessing a group of saved images, then you
> can use the VIs in the Graphics &amp; Sound palette to extract the Blue
> values.&nbsp; Just use Read JPEG File VI (or whatever format it is),
> Unflatten Pixmap VI (which coverts the image data into a 2D array of
> RGB values in your case), and Color to RGB VI (to extract the Blue
> data).&nbsp; Then you can use Flatten Pixmap VI to reform a new
> grayscale image only made of blue values.
>
> If you are using one of our framegrabber cards and have installed the
> free NI-IMAQ driver, then it comes with the IMAQ ColorImagetoArray VI
> with which you could extract the Blue data from.&nbsp; If you have the
> Vision Development Module, then you have even more powerful tools in
> your hands.&nbsp; The IMAQ ExtractColorPlanes VI can take in an image,
> parse out the R, G, and B values, and automatically convert it into a
> new image with only the blue color plane (or red or green).
>
> Note: the [pink] image data type used by LabVIEW's Graphics and
> Sound palette is different from the [purple] image data type used by
> NI-IMAQ and NI Vision.&nbsp; One way of converting between the two is
> save to file using image data type A and then open it up again using
> the VIs for image data type B.
>
> Let me know if you have additional questions!
>
> Cheers,
> Irene Chow
> National Instruments
> Applications Engineer

Irene.

The image is coming from a CCD camera with a USB2 interface.
I downloaded the free drivers from the NI website as well as the
30 day trial Vision Development module. It took me a few hours to get
an image on the monitor, but the image showed severe horizontal banding
as the lamp started and achieved steady-state operation.

What I would have to do is extract is a global value for the pixels
in the blue image plane. Either a median or some sort of weighted average
to account for the number of pixels as well as the luminance value for each
one.
This would have to be done in near-real-time so the operator would know the
lamp was in spec.

Bill Lubarsky
Lamp Scientist
LCD Lighting, Inc\Light Sources Inc


0 Kudos
Message 3 of 5
(4,088 Views)
 

Bill,

You have a very interesting application.  Grabbing data from a USB webcam in real-time will be extremely difficult, as there is no deterministic bus or OS behind the polling.  The banding you are seeing is also a result of a high refresh rate on your screen combined with a slower capture speed of the camera.  After talking with our R&D team, they suggested that you may want to explore splicing into the direct monitor feed.  That will allow you to avoid banding and you could use a high speed capture board (NI PCI-1430 or NI PCI-1428) to grab images faster.  The Vision Development Module gives you several functions that you can use to look at a region of interest (ROI) and return the standard deviation and average intensity values.  For instance, IMAQ Quantify returns a report with a variety of statistical information for a defined ROI.

Thanks,

Scott Savage
National Instruments
Applications Engineering
www.ni.com/support

0 Kudos
Message 4 of 5
(4,077 Views)
Thanks.

I was talking to one of your people Tuesday and he said about the same
thing. I was just hoping someone would pull a magic vi out of his hat that
wouldn't
cost us anything more than the software.

Now, what I capture for analysis doesn't have to be the screen image.
What I mean is could you use a case structure: one case would show the
image on the monitor, the other would simply process the blue pixel data
coming down the USB cable. I do not absolutely have to see what is going on.
at all times. I just want to use the camera as the detector for what amounts
to a flash radiometer.

WEL

"Savageaggie" <x@no.email> wrote in message
news:1150909810919-381675@exchange.ni.com...
> Bill,
> You have a very interesting application.&nbsp; Grabbing data from a USB
> webcam in real-time will be extremely difficult, as there is no
> deterministic bus or OS behind the polling.&nbsp; The banding you are
> seeing is also a result of&nbsp;a high refresh rate on your screen
> combined with a slower capture speed of the camera.&nbsp; After talking
> with our R&amp;D team, they suggested that you may want to explore
> splicing into the direct monitor feed.&nbsp; That will allow you to avoid
> banding&nbsp;and you could use a high speed capture board (<a
> href="http://sine.ni.com/nips/cds/view/p/lang/en/nid/202340"
> target="_blank">NI PCI-1430</a>&nbsp;or <a
> href="http://sine.ni.com/nips/cds/view/p/lang/en/nid/12068"
> target="_blank">NI PCI-1428</a>) to grab images faster.&nbsp; The Vision
> Development Module gives you several functions that you can use to look at
> a region of interest (ROI)&nbsp;and return the standard deviation and
> average intensity values.&nbsp; For instance, IMAQ Quantify returns a
> report with a variety of statistical information for a defined ROI.
> Thanks,
> Scott SavageNational InstrumentsApplications Engineeringwww.ni.com/support




0 Kudos
Message 5 of 5
(4,069 Views)