06-11-2013 01:46 PM - edited 06-11-2013 01:49 PM
I am trying to display and record into an avi file images from a Hamamatsu ORCA Flash 4.0 camera. I modified a sample program provided by Hamamatsu, which uses the IMAQ ArrayToImage VI to convert the pixel data. The resulted image can be displayed okay, but the same image directed to a file results in an empty AVI. There is no error in the chain of avi operations (ie. avi open, write frame, and avi close). The code is attached. I greatly appreciate your insights. Thanks.
06-12-2013 06:24 PM
Hello aoslo,
Thanks for including your VI, unfortunately I do not have the driver VI's or camera and can't test this acquisition but I'll do what I can. I am a little confused at what is occurring, could you clarify a couple of things for me. Is the .avi actually empty or is it displaying a blank video for a period of time? Also, have you checked the data type that is coming out of the acquisition, are you sure that it is a U16 or could it be another datatype?
I think it would be useful to create an indicator and take a look at the array data, and calculate the max and min value of the array as well.
Cheers,
Joel
06-13-2013 01:50 PM
@Joel-P wrote:
Hello aoslo,
Thanks for including your VI, unfortunately I do not have the driver VI's or camera and can't test this acquisition but I'll do what I can. I am a little confused at what is occurring, could you clarify a couple of things for me. Is the .avi actually empty or is it displaying a blank video for a period of time? Also, have you checked the data type that is coming out of the acquisition, are you sure that it is a U16 or could it be another datatype?
I think it would be useful to create an indicator and take a look at the array data, and calculate the max and min value of the array as well.
Cheers,
Joel
Hi Joel
The Hamamatsu VIs can be downloaded from: http://www.dcamapi.com/downloads.php#labview
I don't know what to do with the camera.
As for your two questions,
1. The avi file size is 0 byte.
2. According to the manufacturer, the data type is U16. I'm waiting for a confirmation from a Hamamatsu engineer, and will let you know if I hear something different.
What I'm looking for is a program that allows me to display images real time, and write frames to an avi at the commmand of an operator. We don't want to lose frames after the operator issues the 'grab' command, but can tolerate slowing down or even brief interruptions in the display of the images. If you happen to have a sample program that does similar things, I'd greatly appreciate it if you could share the code. Thanks much.
06-14-2013 06:12 PM
Hello aoslo,
Thanks for the link to the Hamamatsu VI's. Have you examined the array data that is coming out of the acquisition?
In response to the architecture that you are looking for with a programmatic choice of whether or not to log the data to file this could be accomplished with a couple of methods. The simplest method would be to have a simple case structure around the logging VI's where you can decide whether or not you would like to log using a boolean control. We could also look into implementing a state machine architecture which would likely be much more flexible. There are some example state machine designs in LabVIEW 2012 and several of the earlier versions.
Cheers,
Joel
06-18-2013 10:56 AM
@Joel-P wrote:
Hello aoslo,
Thanks for the link to the Hamamatsu VI's. Have you examined the array data that is coming out of the acquisition?
In response to the architecture that you are looking for with a programmatic choice of whether or not to log the data to file this could be accomplished with a couple of methods. The simplest method would be to have a simple case structure around the logging VI's where you can decide whether or not you would like to log using a boolean control. We could also look into implementing a state machine architecture which would likely be much more flexible. There are some example state machine designs in LabVIEW 2012 and several of the earlier versions.
Cheers,
Joel
Hello Joel,
I got this error message when I tried to convert images in Hamamatsu's proprietary format to avi.
IMAQ Vision: (Hex 0xBFF604C2) The image cannot be converted to a type compatible with the codec used.
You either provided a 16-bit monochrome image or 64-bit color image and the bit depth is not set, or the codec only supports grayscale images and a color image was used.
I've seen discussions about this issue. I wonder if NI has worked out a solution to the problem.
Thanks.
06-19-2013 05:58 PM
Hello aoslo,
Do you have any additional documentation regarding the image format that is coming from the Hamamatsu VI's? You mentioned that this is a proprietary format, do they include any conversion VI's that would allow you to turn this into a standard image type or into an avi frame?
Regards,
Joel
06-20-2013 02:37 PM
@Joel-P wrote:
Hello aoslo,
Do you have any additional documentation regarding the image format that is coming from the Hamamatsu VI's? You mentioned that this is a proprietary format, do they include any conversion VI's that would allow you to turn this into a standard image type or into an avi frame?
Regards,
Joel
Hello Joel,
I don't have particular information about their image format. I tried to attach an image file acquired from one of their VIs, but I kept getting rejected because (I think) the file is too big (8MB per frame). Hamamatsu provided an example VI to convert their images to the .tiff format (attached). I modified the example, attempting to convert to avi. That's when I encountered the error message I mentioned in my last post.
Their images are unsigned 16-bit, so a straight convertion to avi seems out of the question. I wonder if you have any suggestions of how to get around the 8-bit limitation of the avi format.
06-21-2013 06:51 PM
Hello aoslo,
In regards to converting the 16 bit image, you can use the following community generated example code and this should allow you to save the image to the .avi frame.
Save 16-bit image to AVI
https://decibel.ni.com/content/docs/DOC-4672
Here are a couple other methods that we can use to convert the 16 bit image to 8 bit, although these will be lossy, and then save that image to the avi.
Convert Image to 8-bits
http://zone.ni.com/devzone/cda/epd/p/id/755
Cheers,
Joel