2

I am using a frame grabber inspecta-5 with 1GB memory, also a high speed camera "EoSens Extended Mode, 640X480 1869fps, 10X8 taps". I am new to coding for grabbers and also to controlling the camera. the Inspecta-5 grabber, gives me different options, like changing the requested number of frames from the camrea to grabber and also from grabber to main memory. also I can use camrea links to send signal to camera and have different exposure times. but Im not really sure what should I use to obtain 1000 frame per second rate, and how can I test it? according to the software manual if I set the following options in the camera profile : ReqFrame=1000 GReqFrame=1000 it means transfer 1000 frames from the camera to grabber and also transfer 1000 frame from grabber to Main memory, respectively. but does it mean that I have 1000fps?

what would be the option for setting the fps to 1000 ? and also how can I test it that I really grabbed 1000 frames in One Second????

here is a link to the grabber software manual : mikrotron.de/index.php?de_downloadfiles you can find the software manual under the "Inspecta Level1 API for WinNT/2000/XP" section. the file name is "i5-level1-sw_manual_e.pdf" , just in case if anybody needs it.

THANK YOU

user261002
  • 2,182
  • 10
  • 46
  • 73
  • What have you tried so far? Can you provide a link to the framegrabber and camera APIs? – japreiss Mar 16 '12 at 15:55
  • here is the link to the grabber software manual : http://www.mikrotron.de/index.php?de_downloadfiles you can find the software manual under the "Inspecta Level1 API for WinNT/2000/XP" section. the file name is "i5-level1-sw_manual_e.pdf" – user261002 Mar 16 '12 at 16:01
  • il sure the level1 API give me all the options, but because im new to this kind of programmings im not sure how can I approach the problems and also how can I check(test) if im getting 1000fps? – user261002 Mar 16 '12 at 16:05
  • You need to try something or tell us your ideas - even if you think they might be wrong. Otherwise you are just asking us to do lots of work for you. – japreiss Mar 16 '12 at 16:55
  • ok I see you are right. I m going to change the question right now. Thank you – user261002 Mar 16 '12 at 17:31

1 Answers1

1

At 1,000fps you don't have much time to snap a frame or even save a frame. Use the following example and plug in your estimated FPS, capture and save latencies. At 1,000fps, you can have a total of about .8ms latency (and why not .99999? I don't know - something to do with unattainable theoretical max or my old PC).

public static void main(String args[]) throws Exception {

    int fps = 1000;
    float simulationCaptureNowMS = .40f;
    float simulationSaveNowNowMS = .40f;

    final long simulationCaptureNowNS = (long)(simulationCaptureNowMS * 1000000.0f);
    final long simulationSaveNowNowNS = (long)(simulationSaveNowNowMS * 1000000.0f);
    final long windowNS = (1000*1000000)/fps;
    final long movieDurationSEC = 2;
    long dropDeadTimeMS = System.currentTimeMillis() + (1000* movieDurationSEC);
        while(System.currentTimeMillis() < dropDeadTimeMS){
            long startNS = System.nanoTime(); 
            actionSimulator(simulationCaptureNowNS);
            actionSimulator(simulationSaveNowNowNS);
            long endNS = System.nanoTime();
            long sleepNS = windowNS-(endNS-startNS);
            if (sleepNS<0) {
                System.out.println("Data loss. Try again.");
                System.exit(0);
            }
            actionSimulator(sleepNS);
        }
        System.out.println("No data loss at "+fps+"fps with interframe latency of "+(simulationCaptureNowMS+simulationSaveNowNowMS)+"ms");
}            

private static void actionSimulator(long ns) throws Exception {
    long d = System.nanoTime()+ns;
    while(System.nanoTime()<d) Thread.yield();
}
Java42
  • 7,628
  • 1
  • 32
  • 50
  • The frame grabber memory itself could hold up to 3495 frames, assuming it's a grayscale camera. I don't think any PC would be able to sustain over 300GB per second. I'm not even sure they can do it in a burst. – Mark Ransom Mar 16 '12 at 21:27
  • BTW, the reason for the actionSimulator() method is so you can throw in some variance ( a little randomness or min/max ranges etc ). – Java42 Mar 16 '12 at 21:27
  • @MarkRansom Not much time, 3.5 seconds @ 1Kfps - Must be trying to take a movie of an explosion. – Java42 Mar 16 '12 at 21:31
  • Sorry, I'm off by a few orders of magnitude - that's 300MB per second, not 300GB. Still agressive, but not totally impossible. – Mark Ransom Mar 16 '12 at 21:38
  • Usually you only use that kind of frame rate for something that's over pretty quickly - think water droplet, stuff like that. At least 3.5 seconds is long enough to cover a little PC latency in the trigger. – Mark Ransom Mar 16 '12 at 21:42
  • hi Chuck and Mark, thank you so much for your contribution to the answer, now I understand more. I have a dump question, I really don't know how can I set the fps for my camera? shall I add it to the camera profile, the only options that I have for the camera profile are : Reqframe and GReqFrame. lets say if I put Reqframe=-31 it means transfer 30 frames from the grabber to main memory, but does it means we have fps=30 ????? please give me an idea, I am really stuck right now. THANK YOU – user261002 Mar 18 '12 at 19:34
  • just to give you an idea of what we are trying to do, we want to measure if human tissue has been fused with radio frequency during the surgery or not, therefore we need a very fast camera and also laser illumination. :D – user261002 Mar 18 '12 at 20:08
  • @user261002, sorry but that kind of question is really going to depend on someone with experience with your exact camera. That's not me, and probably not Chuck either. For this class of camera you really should be able to get some manufacturer or distributor support. – Mark Ransom Mar 20 '12 at 03:19
  • Thank you so much, I find the camera tools which gives me all the options of setting the Shutter time and the fps settings. Thanks for your answer and your help – user261002 Mar 21 '12 at 09:57
  • hi Chuck,thank you for your code, im trying to convert your JAVA code into C++. is the actionSimulator is an action for a time event, of is it implemented by you? do you know if I can use Time.h header file for my purpose? please let me know. Thank you – user261002 Apr 02 '12 at 14:42
  • I don't know. Maybe the article at http://stackoverflow.com/questions/275004/c-timer-function-to-provide-time-in-nano-seconds will help. – Java42 Apr 02 '12 at 15:15