Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

High frame rate image acq (400fps) for 5sec, and adding time on the picture.

I am pretty sure the frame rate is correct. Check the frame rate displayed when you acquire in MAX. It should say 250 fps acquired.

To get a more accurate timing, you should read a millisecond timer before and after the actual acquisition. There is probably about 1 sec of setup time before the acquisition starts, so start the millisecond timer after setting it up.

Another way to time it is to set up a continuous acquisition, read the current frame number and the millisecond timer, wait a little while, then read the frame number and timer again.

Bruce
Bruce Ammons
Ammons Engineering
0 Kudos
Message 11 of 17
(1,850 Views)
Hi Bruce,

in fact, I have copied the section of your file that defined the setup for the 250fps (in your case, you called this option '250 FPS' while I just call it '400 FPS', this is just the name of the set of options though). I used the exact parameters as you did and still get 125fps through MAX (when selecting '400 FPS' selection I have defined in the icd file). I have also made a Labview VI that grabs a certain number of buffer in continuous mode and shows them in a window with a slide control. There is a stop watch in front of the camera. When I slide from the first image through the last one, and specifying to acquire 125 frame (buffer size = 125), there is 1 second elapsed. Having the parameters settled for 250fps like in your icd file, I should see roughly 0.5sec elapsed. This means I acquired at 125fps. MAX tells me the same.

Actually I had to copied your parameters into the ES-310T icd file provided by NI as your file was giving an error from MAX saying 'currupted file'. Attached is the icd file I was using. You can see the parameters are exactly the same.

I have installed a "config file generator" from NI and try to use it. It is better than nothing, but knowing what should I adjust to get 400fps would help instead of trying millions of options and understanding parameters to find out I don't really care of those...

This little application (config file generator) seems to be well developped with a help, but there is still some parameters that are leaking and not considered. Like the Interlaced Mode could be Frame or Field but it's not accessible from the application (neither explained), pixel clock detect is not explained and not clearly handled (what it is and how it affect the frame rate), the 'DisableIORdy' parameter is generated but not handled neither explained. The "tap" theory is obscur; in relation with it is the Simultaneous parameter in the Interlaced mode which is not handled. Scaling is not handled but might not be a big deal in general... the Bynary Threshold is not handle and is not clear what it means... Briefly, I still don't know how to adjust all those intriging parameters to have a 400 frame rate per second... It seems that the interlaced 'frame' mode is not handled by NI since it automatically became "field" when you open and save the icd file in MAX without making any changes.. I wonder if that happen when the labview VI "IMAQ init" changes that to 'field' on the fly too..(and maybe changes other parameters not well defined in the icd file to some kind of default values on the fly.. that would be a nightmare though)

Thank you for your help. I am still doing research to set this config file for 400fps. I am sorry your icd file parameters does not gives me 250fps like you have. I have the latest MAX (3.1.1) and IMAQ (3.0.1) updates. Labview version is 7.1 and I am under WinXP SP2. Computer is a P4 1.5GHz with 1.5Gb of RAM.

attached is my icd file created by the "config file generator" and where I have added the '400 FPS' option with your setup to get 250fps. Note that I had to change back "Simultaneous (1, 0)" to "Simultaneous (2, 0)" under the interlaced definition as well as "Tap (2)" instead of "Tap (1)" to meet the exactitude of your icd file. This change gives an error in the "config file generator" when opening the icd file but gives back images in the labview VI with no errors (another mysterious behavior related to the "tap" theory). I have the feeling I am getting close to the answer, but I'm still not quite there...

Best regards,

Mathieu Fregeau

By the way, this icd file generator can be downloaded from the NI ftp web site:
ftp://ftp.ni.com/support/imaq/pc/ni-imaq/cfgenerator/1.0/Setup.EXE
0 Kudos
Message 12 of 17
(1,845 Views)
I think you left out a very important part in your version.

Action (Interface, Digital) {
AcquisitionWindow (0, 1, 320, 240)
MaxImageSize (320, 246)
}

You didn't include the AcquisitionWindow command, which tells IMAQ what size of image to expect. I noticed you set it earlier in the file, but I think it needs to be set here.

If you don't set things in the right order, the camera will default to the standard settings, which is probably why you aren't getting higher frame rates.

My icd file was written for IMAQ 2.5.1 or so, and there have been a number of changes since then. You might want to try loading an older version of IMAQ and see if my file works.

Bruce
Bruce Ammons
Ammons Engineering
0 Kudos
Message 13 of 17
(1,842 Views)
One more thing. You should copy the entire Attributes section from my file to yours, and remove all of the old Attributes section. I scanned through your file and noticed that you are turning the ROI and block select mode back off later in the file. This will drop the frame rate down to 125!!! These sections have to be removed for my sections to work. After you get the basic operation working, you can add sections back in one at a time if you need them.

Bruce
Bruce Ammons
Ammons Engineering
0 Kudos
Message 14 of 17
(1,839 Views)
Hi Bruce,

Now we touch the real thing, besides the fact that I sent you the wrong file. Priorly to my previous comment, I was testing to reach 400fps with specifying the acquisition window in the definition of the '400 FPS' mode (those lines you talked about in the icd file at the location where I define the '400 FPS'). It was not working either. But I think I have find a way, and you pointed that out, which is very not trivial. This is a configuration file, and by definition, not a linear code; but actually it seems to work like a linear code.

Actually, and I can't explain why the icd file has been developed this way (NI Engineer welcome!), I have to define the acquisition parameters through the "current" and "default" parameters for each one (i.e. block read out, acquisition window, region of interest ON, and even the exposure time) and NOT through the definition of the '400 FPS' configurable mode option. If I define all the parameters and the right window size OUTSIDE the definition of the '400 FPS' group, as it use to be when defining the command and the default values, that works pretty well. The bad side is that I can't choose another configuration (125 fps per example) on the fly without stoping the application that use the camera, going into the icd file and make the hard change on the 'current' values of each parameters, save the icd file, and restart the application.

The "configurable option" of multiple FPS mode does not seem to work unless maybe defining them before defining the '400 FPS' mode, but that completely twisted my mind and is uterly counter-intuitive! I don't know why some people still program a way they are the only one to understand..

But I got my camera to work at 315fps adjusting block read out stop at 81 and a window of 300 x 120. I am looking to reach 400fps now.

The question is, what is the mathematics under the combination of window size, block read out and the frame rate? this way I will set up the parameters for the biggest window at closest to 400fps as possible.

I thank you a thousand time Bruce, without you, I would still be working like an ant to figure that out...

Best regards,

Mathieu Fregeau
0 Kudos
Message 15 of 17
(1,839 Views)
Ok guys, after some overtime work, I've finally make it grabbing 400 fps, and even 475fps.

The camera file is attached. It is for a Redlake ES-310T CCD camera with a NI board PCI-1422.

I feel some explanations would be appreciated for the novice and probably many others. Well.. the icd file logic is not trivial at a glance since you define each command as an "accessible" command for MAX and labview by giving a name to each command or mode. Per exemple the exposure level, you call it "Exposure Time" but it is actually senging the command EXE with the value in msec. And you define like this all the commands you want to have access in MAX and labview (usually the icd contains all the commands possible for the particular camera). From now it's ok, but the trick is to not redefine the parameters of the acquisition in the icd file after it has been defined (might seems logic, but not instinctive). The thing is that somewhere, there is a sub-group of commands together under the mode "Continuous" which define many pre-adjusted parameters, and that is where you define your custom high frame-rate. In my case, I called it '400 FPS' and I define the "region of interest" to be ON and the "Block readout" to be ON for that mode (the value of block stop is very critical and related to the region captured). BUT many commands are defined as stand-alone command further in the icd file...(like the region of interest, and block readout) and a "default" and "current" value were associated in those definitions. And because it was defined after the mode '400 FPS' it was having a kind of priority (while I still don't understand why the selected mode don't have the priority since AFTER initializing the camera in MAX or labview, which means it has read the icd file, you can select and re-select a mode which has it's own definition of region of interest and exposure and block readout, etc.)

Anyway, after many trials and error, the camera grabs 400fps. The configuration generator software was helpful to understand many parameters. And that forum truly helped.

I hope the icd file theory is less obscur for those who will have to work with it.

In this icd file, 3 additional frame rate mode are implemented, in addition to the basic ones: 250fps 400fps and 475fps. Thanks to Bruce and the NI engineers.

Best regards,

Mathieu Fregeau
0 Kudos
Message 16 of 17
(1,821 Views)
I just found out from Mathieu, he has been able to achieve 400fps by adjusting the frame size to 320x100. I really appreciate all of Bruce's help and it would be very helpful if Mathieu could post the modified camera file in this post. Thanks a lot everyone.

Nipun M
Applications Engineer
National Instruments
Message 17 of 17
(1,819 Views)