Vote count:
0
My objective is to get a birds eye view of the image and using this, detect lane markings and vehicles and calculate distance from detected objects. Warp perspective is giving me a lot of issues.
Now I am using as input to opencv a video captured from a camera placed in a moving car. I only have the video. So will this birds eye view be of any help to me? is it even possible to get it?? I do not have camera parameters or any other details. Calculating distance is also imperative. I am using VC++ 2010
Please shed some light on this. i want to do something very similar to images shown in this link. thats the first step. generate a top-dow view of a road using warpPerspective() opencv the code m using:and its not working:
int main(void)
{
Mat input,dst;
Point2f inputQuad[4];
// Output Quadilateral or World plane coordinates
Point2f outputQuad[4];
// Lambda Matrix
Mat lambda( 2, 4, CV_32FC1 );
//Input and Output Image;
//Load the image
input = imread( “C:/176955961.jpg”, 1 );
imshow(“original”, input);//300×168
// Set the lambda matrix the same type and size as input
// Set the lambda matrix the same type and size as input
lambda = Mat::zeros( input.rows, input.cols, input.type() );
// The 4 points that select quadilateral on the input , from top-left in clockwise order
// These four pts are the sides of the rect box used as input
inputQuad[0] = Point2f( 200,50 );
inputQuad[1] = Point2f( 300,50);
inputQuad[2] = Point2f( 0,350 );
inputQuad[3] = Point2f( input.cols,350);
// The 4 points where the mapping is to be done , from top-left in clockwise order
outputQuad[0] = Point2f( 0,0 );
outputQuad[1] = Point2f( input.cols,0);
outputQuad[2] = Point2f( 100,input.rows);
outputQuad[3] = Point2f( input.cols-100,input.rows);
// Get the Perspective Transform Matrix i.e. lambda
lambda = getPerspectiveTransform( inputQuad, outputQuad );
// Apply the Perspective Transform just found to the src image
warpPerspective(input,dst,lambda,dst.size() );
imshow(“cpp”,dst);
return 0;
}
asked 33 secs ago
Birds eye view giving problems- co ordinate geometry-distance calculation
Aucun commentaire:
Enregistrer un commentaire