Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Odd Image Behavior

Hello all,
I come to you very puzzled and in need of some assistance...Smiley Sad

I am acquiring images using Format 7, Mode 0, 1280x1024 Video Mode.  I am using different mags of 1.3x, 2.5x, 3.0x, and 4.0x, as the magnification increases so should the total image count for the prism that I am inspecting.

To cover the 1.3x mag, images are collected in 4x5 fashion creating an overall image with dimensions of 5120x5125.  The 2.5x mag in a 8x9 fashion creates an image with dimensions of 10240x9216.

Where the trouble starts is at the 3.0x and 4.0x mags.  The 3.0x mag collects images 11 across and 12 down, and results in an image with dimensions of 12800 x 12288.  However, when taking into account the individual image sizes of 1280x1024, the images collected should be 10 across and 12 down.  As for the 4.0x mag, images are collected 9 across and 13 down, resulting in an overall image with dimensions of 15360 x 14336.  However, taking into account individual dimension sizes of 1280x1024 the combined image should be 12 across and 14 down.

Only a few problems could bring about this issue.  I suspect either the camera mode, or my VI for image combination (which will be attached).

Has anyone ever encountered something of this fashion, if so...please let me know what you've done.  If not, please take a look at my VI and tell me if there's a problem within that could cause errors in my image combination.

Thank you in advance for your time
0 Kudos
Message 1 of 12
(4,785 Views)

Steve,

The piece of code you attached looks fine.  It looks like the problem is somewhere else.

I would probe the code as it goes through the motions.  Does it collect the right number of images?  Does it start the combination process with the right number of images?

Bruce

Bruce Ammons
Ammons Engineering
Message 2 of 12
(4,784 Views)
Hey Bruce,

The number of images collected is predetermined by a number I put in.

The prism sits atop a MICOS position linear stage and elevation stage, so step widths must be determined to move the prism so images can be captured smoothly.

These step widths are determined through MAX where I move the prism a certain distance until edges align properly.

The combination process cannot move forward unless the proper amount of images is present.  The combination process works perfectly fine...the combined image comes up as I intend it to, showing the full prism.  However, it should require less images to do so.

Unfortunately I cannot attach any of the combined prism images because they all exceed the maximum file size for the forums Smiley Sad
0 Kudos
Message 3 of 12
(4,781 Views)
Hi Steve,

I can confirm Bruce's input that there doesn't seem to be anything incorrect in the code.  I noticed that this code is only combining the images in a single dimension though.  Could you post the code that combines both dimensions so that we can confirm that this is working properly as well?

If we determine that the image combination code is not the problem, then the next logical step will be to make sure that the images you're combining are in the format that you are expecting.


Rishee B.
Applications Engineer
National Instruments
Message 4 of 12
(4,742 Views)
Thank you for your response Rishee.

You are correct, that VI performed the image combination horizontally.

The attached VI is what I use to perform image combination in vertical fashion.

I'll wait for a response before I dive into image formats.

Thanks!
0 Kudos
Message 5 of 12
(4,728 Views)
Hi Steve,

This vertical code seems fine as well.  I would go ahead and look into the formats of your source images.


Rishee B.
Applications Engineer
National Instruments
0 Kudos
Message 6 of 12
(4,711 Views)
Hey Rishee, thanks for clarifying that my VIs for image stiching are fully functional...

I took a peak at the settings through MAX and I was set at video mode 28, Format 7 Mode 0 1280 x 1024.  I reset back to the camera's original settings and those settings are at video mode 27, 1280 x 960 Y (Mono 8) 7.5 fps.

Not quite sure how that could effect much cause my problems exist in the X axis rather than the Y axis; this mode changes the Y axis on increments of 84 pixels.

Perhaps I should mention what camera I am using as well.  My camera is an Imaging Solutions Group LW-1.3-S-1394 M. http://www.isgchips.com/Templates/t_lw-1.3-r-1394.htm
0 Kudos
Message 7 of 12
(4,703 Views)
Hi Steve,

In your final application code, are you running a single VI to acquire your images and stitch them together, or are you using one VI to acquire the images and save them to disk, and then another VI similar to the ones you have posted which loads them and combines them?

If it's the first case, you may consider splitting these two functions so that you can look at the intermediate images to be sure that they are all 1280 x 1024 as you expect.

As for the hardware configuration, as you said, it wouldn't make sense for this to be happening in both dimensions if you had the resolution set to 1280 x 960, so I don't think this is the problem.


Rishee B.
Applications Engineer
National Instruments
0 Kudos
Message 8 of 12
(4,677 Views)
Hello again Rishee,

I acquire the entire array of images before I do any image combination.  They are all saved to a seperate folder and once the final image is taken, the VI moves along to the VIs that I've posted for combination.

You saw the VIs for image combination so I'll show you the VI I use for image acquisition and perhaps you'll notice something odd in there...sad to say I hope you can find something Smiley Sad

Attached is the method for capturing images and subVI for video mode.  Normally set inside a loop with increments for my motors movement but that isn't an effect of the image capture.

Thank you in advance once again Rishee for your continued help and efforts.  I truly appreciate it.


Download All
0 Kudos
Message 9 of 12
(4,657 Views)
Steve,
 
If you have a folder of temporary images, you can do a couple of things:
 
1. Check the resolution of the images, and make sure they are 1280x1024 or whatever you expect.
 
2. Make sure the number of images is correct, and they are named as expected
 
If either of these is wrong, it is your acquisition routine.  If everything in the folder is correct, it is your merging routine.
 
Bruce
Bruce Ammons
Ammons Engineering
Message 10 of 12
(4,632 Views)