Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

IMAQ multiple images saves to files

I'm developing a confocal microscope with multi-axis control where I
use servos and motion controller cards for the works. I managed to
generate vivid images of semiconductor images in 2D plane (x,y) from a
Laser Diode source reflectance and optical feedback, but would like to
make slices along z-axis so that I would have completely define a
stacked image i.e. I= f(x,y,z) (hences, a 3D reconstruction from 2D
planes) in this manner I need to displace a z-motor from a range (+),
zero, to (-)in each displacement I would have then generated a 2D
image save and kept into a file. I have a problem with IMAQ VIs on how
to do this exactly when I need to repeat the steps and file saving to
a disk? Any suggestions or ideas are welcome.
0 Kudos
Message 1 of 4
(3,209 Views)
Here's a quick easy way if you are using NI Motion and NI Vision:

Figure out your camera frame rate, and figure out how much you want to
move between images. Figure out a motion rate for your z motor that
will give you this (motion rate = delta z per frame * frame rate).

Set up your motion, but don't start it. Set up a sequence with the
number of frames you want in vision, plus a few extra before and
after. Start your motion and your vision. It will take images at the
desired interval, giving you a stack of images. Drop the first few
and the last few that are totally out of focus and save the remaining
images. A nice way to save a sequence of images is to use the JPEG to
string conversion routine (search for it in the developer zone) to
convert each image to a
string, then save the array of strings to a
single file. Compressing images at 75% usually looks pretty good, and
using 100% is practically lossless.

Bruce
0 Kudos
Message 2 of 4
(3,209 Views)
Hello Bruce, this seems pretty much ok only if I have a camera in
place.But this design does not and will not use one because it is
essentially an optical imager by itself (call it a laser diode
reflectance microscope). So, the images are generated from optical
reflections converted to voltage by a Laser Diode (and its
controller). What I do is spot a surface get some light intensity on
it move the stage to another spot until I covered an area (m x n)
pixels.So, my problem really boils down to how IMAQ Vision do a
multiple save of this 2D arrays with increments on z-axis (servo
motor). Attached is an screenshot and a sample image from my set-up.
Download All
0 Kudos
Message 3 of 4
(3,209 Views)
Okay, just skip to the last step. Convert each image to a JPEG string
and store it in an array. When you are done, store the string array
to the disk. If you need to store other information with each image,
just make it a cluster with the image string part of the cluster, and
save the array of clusters at the end.

If you have a 2D array, convert it to an IMAQ image using
ArrayToImage, then do the JPEG string conversion.

Bruce
0 Kudos
Message 4 of 4
(3,209 Views)