To predict when vehical has stopped based on the visual input using opencv c++ [closed]

asked 2018-03-23 04:09:49 -0600

Shruti gravatar image

updated 2018-03-23 07:43:30 -0600

LBerger gravatar image

Hi, I'm working on a project the objective is to predict when the vehicle has stopped based on the visual input. i have to write an algorithm in c++ which prints "STOP" at the top right corner of the image when the vehicle comes to stop. i don't know how to start. can anyone help me out with an approach or any method? Is there any code available for the same

edit retag flag offensive reopen merge delete

Closed for the following reason not a real question by LBerger
close date 2018-03-23 04:16:29.042978

Comments

1

A vehicle is stopped when N car positions are equal : detect the car and measure postion. Start to write some code and come back with a real opencv problem

LBerger gravatar imageLBerger ( 2018-03-23 04:16:00 -0600 )edit

If context is autonomous driving and embedded camera in the car, one possible solution is to look at optical flow.

Eduardo gravatar imageEduardo ( 2018-03-23 07:13:55 -0600 )edit

i have completed optical flow. any suggestion, what to do futhure to get frames and to print stop on the frame when a car stops

// By y += 5, x += 5 you can specify the grid 
            for (int y = 0; y < Roi.rows; y += 20) {          //50 is the distance between two grid points
                for (int x = 0; x < Roi.cols; x += 20)
                {
                    // get the flow from y, x position * 10 for better visibility
                    const Point2f flowatxy = flow.at<Point2f>(y, x) * 10;
                    // draw line at flow direction
                    line(Roi, Point(x, y), Point(cvRound(x + flowatxy.x), cvRound(y + flowatxy.y)), Scalar(255, 0, 0));
                    // draw initial point
                    circle(Roi, Point(x, y), 1, Scalar(0, 0, 0), -1);


                }

            }

            // draw the results
            namedWindow("image", WINDOW_AUTOSIZE);
            imshow("image", original);.

}

Shruti gravatar imageShruti ( 2018-03-23 22:08:58 -0600 )edit

When the displacement flow is almost null, you can print a text with cv::putText()?

Eduardo gravatar imageEduardo ( 2018-03-26 11:18:57 -0600 )edit