Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Save Image on IMAQ Image Display corrupting data?

When I right-click and save image on the IMAQ Image Display indicator, something happens to the gray-scale values. My output looks the same from run to run, but sometimes this happens between runs in the saved *.png file:





In the second picture, the background lightened up for some reason when saved, even though on my output display, the background was exactly as before.

any thoughts?


Thanks,
Candice
0 Kudos
Message 1 of 7
(3,513 Views)
Hi Candice,

Could you post the code you are using and describe the steps you take to recreate this issue? I would like to recreate the issue here.

Thanks!
--Michelle

National Instruments
0 Kudos
Message 2 of 7
(3,495 Views)
Thank you for your interest, but I really cannot post the code or tell you what I am doing here.

I can say that this is a hypothetical 16bit image that I have created, using the "Given Range 0:4095" setting on the IMAQ Display Indicator. The counts on the images (as the white ball gets smaller or larger) should remain almost the same, and the pixel count on the indicator tells me that it did stay mostly the same between images. I only encountered this problem when saving the image. I am hoping it is an issue concerning the Save Image function of this display indicator, because if it is a bug in my application, no one can be of any help to me.
0 Kudos
Message 3 of 7
(3,493 Views)
Candice,

I'm assuming a few things about your code but I want to verify this with you-

1. Since you are specifying a range from 0:4095 I assume your image is 12-bit, is this true?
2. Also, when you use IMAQ Create are you specifying Greyscale I16 as type?

Now I am not sure what you are expecting to see in these two images. From what I read is the only thing you are expecting to change is the size of the dot?
After you save the image and open it again are seeing the expected image or the washed out version you view when you are saving the image?

Regards
--Michelle

National Instruments
0 Kudos
Message 4 of 7
(3,468 Views)
1)Yes
2)Yes

Only the size of the dot should be changed.

I'm not sure what your last question is asking, but the washed out image appears only in the saved file. The display in the vi does not change.

A fellow scientest advised me to pause my program while saving the image? Any thoughts on that?

I think the solution to this problem should be to just ditch the "Right-Click, Save Image," and just programmatically save the image into a file.

Thanks,
Candice
0 Kudos
Message 5 of 7
(3,452 Views)
Candice,

My last question was: What are you expecting to see when you open the saved image in comparison to the one you see on the front panel? Is the top image what you expect and the bottom what you are actually seeing?

Either way I think this may be a reason for what you are seeing...take a look at this KnowledgeBase:
Why Does My Image Look Brighter After Saving it to a File? It basically says if you are opening an image with more than 8 bits of data in an 8-bit display/buffer then the image will become lighter as a result of how LabVIEW interprets a higher resolution file in a lower resolution display.

If you are opening the saved image in a program other than LabVIEW then I cannot tell how the program will interpret the values outside of the 8-bit range. So give it a try in LabVIEW and you should be able to display the saved image as you have originally mapped it using the same range as before.
--Michelle

National Instruments
Message 6 of 7
(3,429 Views)
When opening the saved image, I expected to see a background like that of the first image. Instead, I got the washed out background of the second image.

I see what you are saying; thanks for the link. I will keep that in mind.
0 Kudos
Message 7 of 7
(3,421 Views)