sams icons, changed with-findobj to with-opencv, added plugins flowobj, gaborobj
[goodguy/history.git] / cinelerra-5.1 / plugins / moveobj / moveobj.C
index b40e5f6bb0832ec47c00cc9eeb5b5ba96929c7ed..4f5fd0fd36dcf0b6fad250308a466606cd251e6c 100644 (file)
@@ -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,12 +249,12 @@ 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,
+               min_distance, noArray(), block_size,
                0,           // use_harris
                0.04);       // k