Thanks, that is actually what I've been trying but
Imgproc.getPerspectiveTransform doesn't seem to like it...
This is my code:
//First I declare all the variables and initialize an int[] for my src
and dst points
List<Point> src_points;
List<Point> dst_points;
Mat H;
Mat dst_mat;
Mat src_mat;
int[] s_points={120,0,240,0,0,120,360,120};
int[] d_points={0,0,360,0,0,120,360,120};
//Then I initialize all Mat and ArrayList...
H= new Mat();
dst_mat=new Mat();
src_mat=new Mat();
src_points = new ArrayList<Point>(4);
dst_points = new ArrayList<Point>(4);
//I'm adding all the points to the ArrayLists
for(int q = 0; q<8;q=q+2)
{
src_points.add(new Point(s_points[q],
s_points[q+1]));
dst_points.add(new Point(d_points[q],
d_points[q+1]));
}
//I convert the List of points to Mat as this:
dst_mat = Converters.vector_Point_to_Mat(dst_points);
src_mat = Converters.vector_Point_to_Mat(src_points);
//At this point I've got a 4*1*CV_32SC2. It looks good but the code
crashes when calling Imgproc.getPerspectiveTransform... I don't know
how exactly src_mat and dst_mat should be! I've also tried transposing
the mats... Don't know what I am missing
H= Imgproc.getPerspectiveTransform(src_mat, dst_mat);
Thanks,
Esther