Skip to content
This repository has been archived by the owner on Dec 3, 2021. It is now read-only.

Commit

Permalink
modified CvMat.find_fundamental_mat to use CV_MAT_DEPTH
Browse files Browse the repository at this point in the history
  • Loading branch information
ser1zw committed Apr 19, 2011
1 parent fc5a680 commit e5e8728
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions ext/opencv/cvmat.cpp
Expand Up @@ -5012,7 +5012,7 @@ rb_optical_flow_bm(int argc, VALUE *argv, VALUE self)
VALUE
rb_find_fundamental_mat_7point(VALUE klass, VALUE points1, VALUE points2)
{
VALUE fundamental_matrix = cCvMat::new_object(9, 3, CVMAT(points1)->type);
VALUE fundamental_matrix = cCvMat::new_object(9, 3, CV_MAT_DEPTH(CVMAT(points1)->type));
int num = cvFindFundamentalMat(CVMAT(points1), CVMAT(points2), CVMAT(fundamental_matrix),
CV_FM_7POINT, 0, 0, NULL);
return (num == 0) ? Qnil : fundamental_matrix;
Expand All @@ -5030,7 +5030,7 @@ rb_find_fundamental_mat_7point(VALUE klass, VALUE points1, VALUE points2)
VALUE
rb_find_fundamental_mat_8point(VALUE klass, VALUE points1, VALUE points2)
{
VALUE fundamental_matrix = cCvMat::new_object(3, 3, CVMAT(points1)->type);
VALUE fundamental_matrix = cCvMat::new_object(3, 3, CV_MAT_DEPTH(CVMAT(points1)->type));
int num = cvFindFundamentalMat(CVMAT(points1), CVMAT(points2), CVMAT(fundamental_matrix),
CV_FM_8POINT, 0, 0, NULL);
return (num == 0) ? Qnil : fundamental_matrix;
Expand Down Expand Up @@ -5061,7 +5061,7 @@ rb_find_fundamental_mat_ransac(int argc, VALUE *argv, VALUE klass)
int num = 0;
rb_scan_args(argc, argv, "21", &points1, &points2, &option);
option = FIND_FUNDAMENTAL_MAT_OPTION(option);
fundamental_matrix = cCvMat::new_object(3, 3, CVMAT(points1)->type);
fundamental_matrix = cCvMat::new_object(3, 3, CV_MAT_DEPTH(CVMAT(points1)->type));
if(FFM_WITH_STATUS(option)){
CvMat *points1_ptr = CVMAT(points1);
int status_len = (points1_ptr->rows > points1_ptr->cols) ? points1_ptr->rows : points1_ptr->cols;
Expand Down Expand Up @@ -5098,7 +5098,7 @@ rb_find_fundamental_mat_lmeds(int argc, VALUE *argv, VALUE klass)
int num = 0;
rb_scan_args(argc, argv, "21", &points1, &points2, &option);
option = FIND_FUNDAMENTAL_MAT_OPTION(option);
fundamental_matrix = cCvMat::new_object(3, 3, CVMAT(points1)->type);
fundamental_matrix = cCvMat::new_object(3, 3, CV_MAT_DEPTH(CVMAT(points1)->type));
if(FFM_WITH_STATUS(option)){
CvMat *points1_ptr = CVMAT(points1);
int status_len = (points1_ptr->rows > points1_ptr->cols) ? points1_ptr->rows : points1_ptr->cols;
Expand Down Expand Up @@ -5146,9 +5146,9 @@ rb_find_fundamental_mat(int argc, VALUE *argv, VALUE klass)
option = FIND_FUNDAMENTAL_MAT_OPTION(option);
int fm_method = FIX2INT(method);
if (fm_method == CV_FM_7POINT)
fundamental_matrix = cCvMat::new_object(9, 3, CVMAT(points1)->type);
fundamental_matrix = cCvMat::new_object(9, 3, CV_MAT_DEPTH(CVMAT(points1)->type));
else
fundamental_matrix = cCvMat::new_object(3, 3, CVMAT(points1)->type);
fundamental_matrix = cCvMat::new_object(3, 3, CV_MAT_DEPTH(CVMAT(points1)->type));
if (FFM_WITH_STATUS(option)) {
CvMat *points1_ptr = CVMAT(points1);
int status_len = (points1_ptr->rows > points1_ptr->cols) ? points1_ptr->rows : points1_ptr->cols;
Expand Down

0 comments on commit e5e8728

Please sign in to comment.