Search code examples
c#opencvemgucv

What is the equivalent of “getTickFrequency” from OpenCV in C# EmguCV?


I am converting this code from C++ to C#

double freq = getTickFrequency() / 1000;

I can't find the equivalent of getTickFrequency in EmguCV in C#.


Solution

  • Just like my previous question, I didn't find an explicit function for getTickFrequency in EmguCV. The only solution I found is to rewrite the function using the open source of OpenCV OpenCV Core

    [DllImport("Kernel32.dll")]
    private static extern bool QueryPerformanceFrequency(out long lpFrequency);
    double GetTickFrequency()
    {
        QueryPerformanceFrequency(out long freq);
        return (double)freq;
    }
    

    I thing EmguCV should be revised to add these missing parts with good documentation.