Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Pictures won't save

I captured an image using a Cohu 7700 series camera and an IMAQ PCI-1428 card. The picture captures fine. But when it gets saved, the picture comes out totally black, instead of what the captured image looked like before saving. Any suggestions? I tried everything "Help" said to try and it still didn't save right.
0 Kudos
Message 1 of 9
(3,801 Views)
It sounds like it is a 16 bit image. You can only use PNG format to save a 16 bit image, and it will only load back into LabVIEW. If you want to use other formats, you will need to convert it to 8 bits before you save it. Typically shifting the bits or dynamic ranging are the most popular methods for converting to 8 bits.

Bruce
Bruce Ammons
Ammons Engineering
Message 2 of 9
(3,801 Views)
How do you convert it back into 8 bits - I tried using the LUT binary function, but it still wouldn't work... How do you shift the bits or dynamic ranging on the software? I also tried opening it back up in Measurement and Automation Explorer but it still didn't work - there's only one configuration to save it as...
0 Kudos
Message 3 of 9
(3,801 Views)
In LabVIEW, you can use IMAQ Cast Image to convert it to an 8-bit image. For a 10-bit image, you would want to use shift=2 to shift everything two bits to the right. This drops the least significant data and retains the 8 highest bits. Another option is to specify a LUT that converts 16 bits to 8 bits however you desire. This seems to be the only way to do the dynamic ranging. The dynamic ranging is automatic for displaying images, and I assumed it was also availble for image conversion.

I don't think you can load images back into MAX. You should be able to specify what format to save it in, though. At the bottom of the Save dialog, it should give you a choice of "Save as type". Of course, for a 16 bit image the only option is probabl
y PNG.

Bruce
Bruce Ammons
Ammons Engineering
0 Kudos
Message 4 of 9
(3,801 Views)
Thanks! Could you give me more specific information on using IMAQ Cast Image - is this in the Labview program (I am not too familiar with it yet)? I tried to find it but couldn't...

How would you specify the LUT? Could you be more specific in what to actually do? I already brought the binary threshold high down to 255 so that the image looks basically only black and white, and it didn't work, although the contrast in my image did go down.

The only option to save under was still .png, even after I had done these things, and the image still pulls up as totally black. The changes didn't make an effect in the saved image.

Thanks so much for your help!
Bethany
0 Kudos
Message 5 of 9
(3,801 Views)
Okay, here are a few clarifications:

The PNG file saved by MAX and LabVIEW is not 100% compatible with other programs. It will load with other programs, but looks very dark. If you look very, very closely you may see some of the details of your image that are very faint.

In MAX, you can't do much other than save a PNG file. You can't do conversions (unless the camera can be set to 8 bit mode, which would solve all your problems).

In LabVIEW, the routine IMAQ Cast Image is available if you have the Vision toolkit. You can find it in Vision help, or look under Vision Utilities -> Image Management on the Vision palette. I would try a bit shift of 2 before trying to create custom LUTs, because it is much simpler.

B
ruce
Bruce Ammons
Ammons Engineering
0 Kudos
Message 6 of 9
(3,801 Views)
Thanks! I actually don't have Vision toolkit, so I will have to purchase that.

Also, I tried to take another picture and an error came up - I haven't changed anything that I know of...

Would you know what this means or what I should do to fix it? " wait timed out - acquisition not complete"

Thanks again!
0 Kudos
Message 7 of 9
(3,801 Views)
It means that for some reason the signal from the camera is not reaching the card. Common reasons are that the cable is loose or the camera is off.

It could also mean that there is an error in the timing settings in your camera file, but if it has been working fine up to now it is most likely the reason above.

Bruce
Bruce Ammons
Ammons Engineering
0 Kudos
Message 8 of 9
(3,801 Views)
Thanks! I did tighten the connection and it worked again! It must have been that!

Thanks for all your help! I just ordered the Vision toolkit, so hopefully once I get that, I can do what you advised to save my images...

Thanks again,
Bethany
0 Kudos
Message 9 of 9
(3,801 Views)