Skip to main content

Acquisition Speed

Answered

Comments

4 comments

  • Official comment
    TDY_Manuel
    Community team
    Expert (Gold)

    Could you please run QueryPerformanceCounter in a loop to check the granularity on your system? 

  • TDY_Manuel
    Community team
    Expert (Gold)

    HI Chris, 

    Could you please post the part of the code where you measure the time?

    Best regards,
    Manuel 

    0
  • Chris Houle
    if (loopCnt < z_numTriggers)
    {
        waitCnt[loopCnt] = WaitForTriggerReadyAcqStatus(pCam);
        result = result | GrabNextImageByTrigger(nodeMap);
        QueryPerformanceCounter((LARGE_INTEGER*)&ctr2);
        timestamp[loopCnt] = ((double)(ctr2 - ctr1) / (double)freq);
    }
    //------------------------------------------------------------------------------------------
    #define PERF_COUNTER_START() \
        __int64 ctr1 = 0, ctr2 = 0, freq = 0; \
        QueryPerformanceCounter((LARGE_INTEGER *)&ctr1); \
        QueryPerformanceFrequency((LARGE_INTEGER *)&freq);
    //------------------------------------------------------------------------------------------
    int WaitForTriggerReadyAcqStatus(CameraPtr pCam) {
        int counter = 0;
        PERF_COUNTER_START();
        while (!pCam->AcquisitionStatus()) {
            //cout << "Waiting" << endl;
            Sleep(1);
            counter++;
        }
        QueryPerformanceCounter((LARGE_INTEGER*)&ctr2);
        return (int)(((double)(ctr2 - ctr1) / (double)freq)*1000);
    }
    //------------------------------------------------------------------------------------------
    int GrabNextImageByTrigger(INodeMap& nodeMap)
    {
        int result = 0;
        try {
        // Execute software trigger
        CCommandPtr ptrSoftwareTriggerCommand = nodeMap.GetNode("TriggerSoftware");
        if (!IsAvailable(ptrSoftwareTriggerCommand) || !IsWritable(ptrSoftwareTriggerCommand)) {
            cout << "Unable to execute trigger. Aborting..." << endl;
            return -1;
        }
        ptrSoftwareTriggerCommand->Execute();
        }
        catch (Spinnaker::Exception& e) {
            cout << "Error: " << e.what() << endl;
            result = -1;
        }
        return result;
    }
    0
  • Chris Houle

    You are correct that it is a side effect of something on my system.

    0

Please sign in to leave a comment.

Powered by Zendesk