johnson-pkt / javacv

Automatically exported from code.google.com/p/javacv
GNU General Public License v2.0
0 stars 0 forks source link

cvGetAffineTransform problem or I misunderstood? #155

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
Just to test the transform, I used the following code:

CvPoint2D32f src = new CvPoint2D32f(3);
CvPoint2D32f dst = new CvPoint2D32f(3);
CvMat affm = cvCreateMat(2, 3, CV_32F);
dst.position(0).x(0) .y(0);
dst.position(1).x(120) .y(0);
dst.position(2).x(0) .y(80);
src.position(0).x(356) .y(210);
src.position(1).x(476) .y(210);
src.position(2).x(356) .y(290);
affm = cvGetAffineTransform(src, dst, affm);

What is the expected output? What do you see instead?
The expected output for "affm" should be [1.0, 0.0, -356; 0.0, 1.0, -210]
I tested it also using openCV c++ version, it's correct.
But in javaCV "affm" turns out to be [ -1.031E-42, 0.0, 3.67345E-40; 0.2247191, 
0.0, 6.52391E-40 ]

What version of the product are you using? On what operating system?
I'm using opencv231, your Jan.8th released code with eclipse IDE and JDK 6.0

Please provide any additional information below.

Original issue reported on code.google.com by pangyu0...@gmail.com on 13 Feb 2012 at 5:22

GoogleCodeExporter commented 8 years ago
What you wish to call is probably
    cvGetAffineTransform(src.position(0), dst.position(0), affm);
as shown in the README.txt file.

Please ask your questions on the mailing list if possible, thank you.

Original comment by samuel.a...@gmail.com on 13 Feb 2012 at 5:55

GoogleCodeExporter commented 8 years ago
Thank you very much. After you pointed out, I saw how cvFillConvexPoly() is 
used. I'll be more careful next time. And I'll try to use group maillist next 
time. 

Original comment by pangyu0...@gmail.com on 13 Feb 2012 at 6:05