04-10-2007 08:45 PM
04-11-2007 05:02 PM
04-11-2007 07:47 PM
04-12-2007 03:05 PM
Don,
I apologize for the mistake. I still may be misunderstanding you. From what I can tell, you want to be able to set your image type programmatically? You can't change it after the IMAQ create because the IMAQ create actually creates a block of memory that the image will fit in. But, if you look at the example program (Help >> Find Examples...) called HL Grab.vi I think this may help. Notice that there is a property node that reads the image type from the incoming camera initialization, and sets the IMAQ Create.vi's image type to that. If you change the camera in this program, or if your camera image type changes, it will change with it. Is that at all what you were looking for? If I misunderstood please let me know, thank you!
-Allison S.
Applications Engineering
04-12-2007 04:21 PM
Yes, I need to be able to do it programmatically. However, I am using IMAQ readfile to read in an already-stored TIF image from disk. I'm not acquiring from a camera. Let's say for now it could be 8- or 16-bit, but I do not know beforehand. So within a programmatic context, I need some utility to look at the file and see what the bit depth is, then I can programmatically set the image type on the IMAQ Create based on the discovered bit depth.
If you look at the graphic file functions, say for example 'read BMP file'. If you look, there is an output cluster of image information including the bit depth and colors. This allows you to choose the correct way to 'unflatten the pixmap' (unflatten pixmap.vi) which has outputs for 1, 4, 8, and 24-bit pixmap). This is the equivalent of what I need in IMAQ Vision. Unfortunately, straight LabVIEW does not have the facilities to read in .TIF files (unless you know something I don't). If it did, then I would not need this particular IMAQ capability.
Sincerely,
Don
04-13-2007 04:13 PM
04-16-2007 07:04 AM
Hi Allison:
See message#3 in this thread. The IMAQGetImageInfo fx will not help - because the image space must be set up before you can call this. Therefore, if you do not specify image type, and the image is read in as 8-bit by default, the IMAQGetImageInfo fx will return a value of 8-bit for image type, even if the actual image you are trying to open is other than 8-bit.
There needs to be a way to find the image type prior to creating the image space. In other words, there needs to be either a utility within IMAQ Vision or a 3rd party tool that can be used within LabVIEW to get the image information so as to be able to programmatically determine image information.
Sincerely,
Don
04-17-2007 03:27 PM
Hi Don,
I tried running this VI and it was able to recognize the two different images. See if this works for you. I was able to recognize your image from your third post as a 16 bit image.
If this doesn’t work let me know what version of Vision you are using.
Have a great day,
Gavin
04-18-2007 10:13 AM
Right in front of us the whole time! I should have seen this. Instead, I was fixated on GetImageInfo instead of GetFileInfo. Thanks a lot for pointing this out!
Sincerely,
Don