Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Detect cars in video

Hello,

I´m new with OpenCV and I want detect cars in a webcam or a video file. This is my current solution:

while (Camera.read(RawImage))
{
    Camera >> RawImage;
    BackgroundMask(RawImage, Mask);
    cv::threshold(Mask, BinaryMask, 100, 255, cv::THRESH_BINARY);
    Mat NewImage(RawImage.rows, RawImage.cols, CV_8UC3, Scalar(0, 255, 0));
    RawImage.copyTo(NewImage, BinaryMask);

    imshow("Rawimage", RawImage);
    imshow("New Image", NewImage);
    waitKey(30);
}

I get a green Image with the filtered cars in it. Now I want to draw a box around this cars. How can I do it in an easy way?

Thank you for help :)