LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Offline Image analysis using images from directory

Hi,
 
I am working on an application where I capture a sequence of images (about 180 of them at 1 image per second) to a .avi file using IMAQ for IEEE 1394.  Once the acquisition is complete, I extract individual frames (into a directory) from the .avi file.  I now need to do an image difference between each successive pair of images.  The way I plan to go about with this is by converting each image to an array (using  IMAQ Image to Array) and do the processing on the obtained arrays. 
 
However, I am not sure how I can read and input the image (from the directory) to the "IMAQ Image to Array.vi" (this VI needs an image as an input).  I looked at VIs such as "Read BMP file.vi", but am not sure as to what would work.
 
Any help would be highly appreciated.
 
Thanks.
 
Ram
0 Kudos
Message 1 of 14
(3,636 Views)
Ram,
 
You can easily do an image difference by using Image Processing -> Operators -> IMAQ Subtract.  I do have the optional Vision Builder software installed on my system.  You want to use IMAQ Read File to load the image from disk into IMAQ format.
 
Matt
Matthew Fitzsimons

Certified LabVIEW Architect
LabVIEW 6.1 ... 2013, LVOOP, GOOP, TestStand, DAQ, and Vison
0 Kudos
Message 2 of 14
(3,621 Views)
Hi Matt,

Unfortunately, I don't have NI-Vision software.  I am working with the NI-IMAQ for IEEE 1394 cameras.  Is there any other way I can read an image and change it into an array? 

Ram
0 Kudos
Message 3 of 14
(3,617 Views)

I do not know what features come in the base package but do you have IMAQ Image To Array?  It is located in the Pixel Manipulation pallet.

If you have vision what you are trying to do is a less than 5 minute VI to write and implement start to finish.  You may want to consider purchasing this software.

Matt

Matthew Fitzsimons

Certified LabVIEW Architect
LabVIEW 6.1 ... 2013, LVOOP, GOOP, TestStand, DAQ, and Vison
0 Kudos
Message 4 of 14
(3,615 Views)
Matt,

The "IMAQ for IEEE 1394 cameras" driver software comes with the "IMAQ IMAGE to Array.vi", which is exactly what I intend to use to convert the images to arrays.  The problem I have now is converting the .bmp file (in the local hard drive) to an IMAQ image, which is required as an input to the "IMAQ IMAGE to Array.vi"

Do you know of any other means (other than using Vision) such as using the graphic formats palettes to read an image and convert it to an array?

Thanks.

Ram
0 Kudos
Message 5 of 14
(3,613 Views)
Use IMAQ Array to Image after doing the array subtaction to get you end result.  Use IMAQ Write BMP File located in the files pallette to save the image back to disk.

Message Edited by mfitzsimons on 11-07-2005 11:13 AM

Matthew Fitzsimons

Certified LabVIEW Architect
LabVIEW 6.1 ... 2013, LVOOP, GOOP, TestStand, DAQ, and Vison
0 Kudos
Message 6 of 14
(3,610 Views)
Hello Ram,
You could try using the non-IMAQ picture functions that are part of LabVIEW. You can read in your .bmp file using Read BMP file and then convert the image data output into a 2D array by using the Flatten Pixmap function. You will have to do some parsing out of the 2D array to get the respective RGB values to subtract. Either way, this is a very simple task in the Vision Development Module.
 
Regards,
 
Jack J.
Product Support Engineer
National Instruments
0 Kudos
Message 7 of 14
(3,593 Views)
0 Kudos
Message 8 of 14
(3,578 Views)
Hi Jack,

I tried working on your suggestion.  I extracted the "image array" from the cluster ("image data") output of the "Read BMP File.vi",  tried wiring it to the "8-bit pixmap" input of the "Flatten Pixmap.vi", and realized that both of them are of different types.  Another issue I am having trouble dealing with is the output format of the image in the cluster "image data" of the "Read BMP File.vi".  My  image is a 1024*768 array whereas the output above-mentioned is of a different size.  I must remind you here that I have a black & white camera, although the images are in RGB format when I extract them from the avi file (containing the sequence of images captured from the process) and store them as  .bmp files.

At this point of time, I don't seem to have a clue as to how to go about with this application.  Also, I have a VI (see attached VI: Picture to RGB array) that can convert the BMP file into an RGB array.  However, I am running short of ideas when it comes to converting an RGB array into a grayscale array.  I have also attached a sample image of interest.  I would appreciate your help in this regard.

Thanks

Ram
0 Kudos
Message 9 of 14
(3,576 Views)
Hi Jack,

I am not able to upload my sample image (in the form of a BMP file) as an attachent.  Here is the image in JPEG format

Ram
0 Kudos
Message 10 of 14
(3,576 Views)