How do I make this C# code more efficient, in terms of FPS and time complexity? Image&lt;Bgr, Byte&gt; frame = _capture.QueryFrame();
Image&lt;Gray, Byte&gt; grayFrame = frame.Convert&lt;Gray, Byte&gt;();
grayFrame._EqualizeHist();
MCvAvgComp[][] facesDetected = grayFrame.DetectHaarCascade(_faces, 1.1, 1, 
    Emgu.CV.CvEnum.HAAR_DETECTION_TYPE.FIND_BIGGEST_OBJECT, new Size(20, 20));

if (facesDetected[0].Length == 1)
{
    MCvAvgComp face = facesDetected[0][0];

    #region Search ROI based on Face Metric Estimation -

    Int32 yCoordStartSearchEyes = face.rect.Top + (face.rect.Height * 3 / 11);
    Point startingPointSearchEyes = new Point(face.rect.X, yCoordStartSearchEyes);
    Size searchEyesAreaSize = new Size(face.rect.Width, (face.rect.Height * 3 / 11));
    Rectangle possibleROI_eyes = new Rectangle(startingPointSearchEyes, searchEyesAreaSize);

    #endregion

    int widthNav = (frame.Width / 10 * 2);
    int heightNav = (frame.Height / 10 * 2);
    Rectangle nav = new Rectangle(new Point(frame.Width / 2 - widthNav / 2, frame.Height / 2 - heightNav / 2), 
        new Size(widthNav, heightNav));
    frame.Draw(nav, new Bgr(Color.Lavender), 3);
    Point cursor = new Point(face.rect.X + searchEyesAreaSize.Width / 2, 
        yCoordStartSearchEyes + searchEyesAreaSize.Height / 2);

    grayFrame.ROI = possibleROI_eyes;
    MCvAvgComp[][] eyesDetected = grayFrame.DetectHaarCascade(_eyes, 1.15, 3, 
        Emgu.CV.CvEnum.HAAR_DETECTION_TYPE.DO_CANNY_PRUNING, new Size(20, 20));
    grayFrame.ROI = Rectangle.Empty;

    if (eyesDetected[0].Length != 0)
    {
        frame.Draw(face.rect, new Bgr(Color.Yellow), 1);

        foreach (MCvAvgComp eye in eyesDetected[0])
        {
            Rectangle eyeRect = eye.rect;
            eyeRect.Offset(possibleROI_eyes.X, possibleROI_eyes.Y);
            grayFrame.ROI = eyeRect;
            frame.Draw(eyeRect, new Bgr(Color.DarkSeaGreen), 2);

            frame.Draw(possibleROI_eyes, new Bgr(Color.DeepPink), 2);

            if (nav.Left &lt; cursor.X &amp;&amp; cursor.X &lt; (nav.Left + nav.Width) 
                &amp;&amp; nav.Top &lt; cursor.Y &amp;&amp; cursor.Y &lt; nav.Top + nav.Height)
            {
                LineSegment2D CursorDraw = new LineSegment2D(cursor, new Point(cursor.X, cursor.Y + 1));
                frame.Draw(CursorDraw, new Bgr(Color.White), 3);

                int xCoord = (frame.Width * (cursor.X - nav.Left)) / nav.Width;
                int yCoord = (frame.Height * (cursor.Y - nav.Top)) / nav.Height;

                Cursor.Position = new Point(xCoord, yCoord);
            }
        }
    }
    imageBoxFrame.Image = frame;
}
I think your code is already quite good. My guess is that the calls to DetectHaarCascade are the majority of the time. Can you run a profiler on it? The Equatec profiler is free. As for the lower loop you could preallocate your colors (although I assume they're structs). Also, I don't see where possibleROI_eyes changes, so do you really need to draw that every time through the loop? Or is it drawing at the cursor position?