@@ -44,14 +44,14 @@ struct type_caster<cv::Mat>{
4444 int nh = 1 ;
4545 int nw = 1 ;
4646 int nc = 1 ;
47- int ndims = info.ndim ;
47+ int ndims = static_cast < int >( info.ndim ) ;
4848 if (ndims == 2 ){
49- nh = info.shape [0 ];
50- nw = info.shape [1 ];
49+ nh = static_cast < int >( info.shape [0 ]) ;
50+ nw = static_cast < int >( info.shape [1 ]) ;
5151 } else if (ndims == 3 ){
52- nh = info.shape [0 ];
53- nw = info.shape [1 ];
54- nc = info.shape [2 ];
52+ nh = static_cast < int >( info.shape [0 ]) ;
53+ nw = static_cast < int >( info.shape [1 ]) ;
54+ nc = static_cast < int >( info.shape [2 ]) ;
5555 }else {
5656 char msg[64 ];
5757 std::sprintf (msg, " Unsupported dim %d, only support 2d, or 3-d" , ndims);
@@ -133,7 +133,7 @@ struct type_caster<cv::Size_<T>>{
133133 return false ;
134134 }
135135
136- value = cv::Size (pt[0 ].cast <T>(), pt[1 ].cast <T>());
136+ value = cv::Size (static_cast < int >( pt[0 ].cast <T>()), static_cast < int >( pt[1 ].cast <T>() ));
137137 return true ;
138138 }
139139
@@ -409,7 +409,7 @@ PYBIND11_MODULE(pymtracking, m)
409409 base_detector.def (" SetMinObjectSize" , &BaseDetector::SetMinObjectSize);
410410 base_detector.def (" GetDetects" , &BaseDetector::GetDetects);
411411 base_detector.def (" CalcMotionMap" , &BaseDetector::CalcMotionMap);
412- # if 1
412+
413413 py::class_<MotionDetector, PyMotionDetector> mdetector (m, " MotionDetector" );
414414 mdetector.def (py::init<BackgroundSubtract::BGFG_ALGS, cv::Mat&>());
415415 mdetector.def (" Init" , &MotionDetector::Init);
@@ -429,7 +429,6 @@ PYBIND11_MODULE(pymtracking, m)
429429 .value (" LOBSTER" , BackgroundSubtract::BGFG_ALGS::ALG_LOBSTER)
430430 .value (" MOG2" , BackgroundSubtract::BGFG_ALGS::ALG_MOG2)
431431 .export_values ();
432- #endif
433432
434433 py::enum_<tracking::Detectors>(base_detector, " Detectors" )
435434 .value (" VIBE" , tracking::Detectors::Motion_VIBE)
0 commit comments