X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fplugins%2Fmoveobj%2Fmoveobj.C;h=77a80a3bbd59f8cbeb6ae77de38f115e75a0f6b9;hb=d6fcc223fa4c7d549c66f0fb84a5f81476d59251;hp=b40e5f6bb0832ec47c00cc9eeb5b5ba96929c7ed;hpb=8d1431081df60da0719db2c77e4c56830521c7e8;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/plugins/moveobj/moveobj.C b/cinelerra-5.1/plugins/moveobj/moveobj.C index b40e5f6b..77a80a3b 100644 --- a/cinelerra-5.1/plugins/moveobj/moveobj.C +++ b/cinelerra-5.1/plugins/moveobj/moveobj.C @@ -153,12 +153,12 @@ void MoveObj::update_gui() } void MoveObj::to_mat(Mat &mat, int mcols, int mrows, - VFrame *inp, int ix,int iy, BC_CModel mcolor_model) + VFrame *inp, int ix,int iy, int mcolor_model) { int mcomp = BC_CModels::components(mcolor_model); int mbpp = BC_CModels::calculate_pixelsize(mcolor_model); int psz = mbpp / mcomp; - int mdepth = psz < 2 ? CV_8U : CV_16U; + int mdepth = psz < 2 ? CV_8U : psz < 4 ? CV_16U : CV_32F; if( mat.dims != 2 || mat.depth() != mdepth || mat.channels() != mcomp || mat.cols != mcols || mat.rows != mrows ) { mat.release(); @@ -249,13 +249,13 @@ int MoveObj::process_buffer(VFrame *frame, int64_t start_position, double frame_ to_mat(next_mat, w,h, iframe, 0,0, BC_GREY8); int corner_count = MAX_COUNT; - int search_radius = config.block_size; + int block_size = config.block_size; int min_distance = config.search_radius; goodFeaturesToTrack(next_mat, *next_corners, corner_count, 0.01, // quality_level - min_distance, noArray(), search_radius, - 0, // use_harris + min_distance, noArray(), block_size, + false, // use_harris 0.04); // k ptV pt1, pt2; @@ -334,7 +334,7 @@ int MoveObj::process_buffer(VFrame *frame, int64_t start_position, double frame_ // interpolate with identity matrix accum_matrix = w0*identity + w1*accum_matrix; - AffineMatrix matrix; + AffineMatrix &matrix = affine->matrix; for( int i=0,k=0; i<3; ++i ) for( int j=0; j<3; ++j ) matrix.values[i][j] = amat[k++]; @@ -342,7 +342,6 @@ int MoveObj::process_buffer(VFrame *frame, int64_t start_position, double frame_ //printf("MoveObj::process_buffer %d %jd matrix=\n", __LINE__, start_position); //matrix.dump(); - affine->set_matrix(&matrix); // iframe is always temp, if we get here output->clear_frame(); affine->process(output, iframe, 0, AffineEngine::TRANSFORM,