Closed GoogleCodeExporter closed 8 years ago
Search the README.txt file for "array"
Original comment by samuel.a...@gmail.com
on 6 Jul 2011 at 1:18
Thanks. That solved this problem but this time I`m getting the following error:
Assertion failed (dst.data != src.data && src.cols > 0 && src.rows > 0) in
unknown function, file
c:\Users\vp\work\ocv\opencv\modules\imgproc\src\imgwarp.cpp, line 2954
My Code:
CvMat mmat = cvCreateMat(3,3,CV_32FC1);
CvPoint2D32f c1 = new CvPoint2D32f(4);
CvPoint2D32f c2 = new CvPoint2D32f(4);
//corner points of the parking place
c1.position(0).set(43, 18);
c1.position(1).set(280, 40);
c1.position(2).set(19, 223);
c1.position(3).set(304, 200);
c2.position(0).set(0, 0);
c2.position(1).set(320, 0);
c2.position(2).set(0, 240);
c2.position(3).set(320, 240);
mmat = cvGetPerspectiveTransform(c1, c2, mmat);
cvWarpPerspective(Y, Y, mmat);
Original comment by fur...@isikdogan.com
on 6 Jul 2011 at 1:42
You are overwriting the reference to your mmat, so it gets deallocated. You
need to keep a reference to it.
Original comment by samuel.a...@gmail.com
on 6 Jul 2011 at 1:50
Ah no, this is not the problem. The error message clearly indicates "dst.data
!= src.data", so you cannot do what you want to do. This is a perfectly normal
error of OpenCV and has nothing to do with JavaCV. Please write /correct/
code...
Original comment by samuel.a...@gmail.com
on 6 Jul 2011 at 1:51
[deleted comment]
Thanks. It`s working now. Here`s the final code:
CvMat mmat = cvCreateMat(3,3,CV_32FC1);
CvPoint2D32f c1 = new CvPoint2D32f(4);
CvPoint2D32f c2 = new CvPoint2D32f(4);
//corner points of the parking place
c1.position(0).set(0, 0);
c1.position(1).set(320, 0);
c1.position(2).set(0, 240);
c1.position(3).set(320, 240);
c2.position(0).set(0, 0);
c2.position(1).set(Y.width(), 0);
c2.position(2).set(0, Y.height());
c2.position(3).set(Y.width(), Y.height());
cvGetPerspectiveTransform(c1, c2, mmat);
cvWarpPerspective(Y, AlignedY, mmat);
Original comment by fur...@isikdogan.com
on 6 Jul 2011 at 2:00
Original issue reported on code.google.com by
fur...@isikdogan.com
on 6 Jul 2011 at 1:16