merged new master branch
changed tests for tvl1 optflow correction of a bug preventing compilation with cuda (fmin changed to fminf)
This commit is contained in:
		@@ -378,7 +378,6 @@ PERF_TEST_P(ImagePair, OpticalFlowDual_TVL1,
 | 
			
		||||
        alg->set("medianFiltering", 1);
 | 
			
		||||
        alg->set("innerIterations", 1);
 | 
			
		||||
        alg->set("outerIterations", 300);
 | 
			
		||||
 | 
			
		||||
        TEST_CYCLE() alg->calc(frame0, frame1, flow);
 | 
			
		||||
 | 
			
		||||
        CPU_SANITY_CHECK(flow);
 | 
			
		||||
 
 | 
			
		||||
@@ -61,7 +61,7 @@ namespace cv { namespace cuda { namespace device
 | 
			
		||||
        template <int channels> static float __device__ pixeldiff(const uchar* left, const uchar* right, float max_data_term);
 | 
			
		||||
        template<> __device__ __forceinline__ static float pixeldiff<1>(const uchar* left, const uchar* right, float max_data_term)
 | 
			
		||||
        {
 | 
			
		||||
            return fmin( ::abs((int)*left - *right), max_data_term);
 | 
			
		||||
            return fminf( ::abs((int)*left - *right), max_data_term);
 | 
			
		||||
        }
 | 
			
		||||
        template<> __device__ __forceinline__ static float pixeldiff<3>(const uchar* left, const uchar* right, float max_data_term)
 | 
			
		||||
        {
 | 
			
		||||
@@ -69,7 +69,7 @@ namespace cv { namespace cuda { namespace device
 | 
			
		||||
            float tg = 0.587f * ::abs((int)left[1] - right[1]);
 | 
			
		||||
            float tr = 0.299f * ::abs((int)left[2] - right[2]);
 | 
			
		||||
 | 
			
		||||
            return fmin(tr + tg + tb, max_data_term);
 | 
			
		||||
            return fminf(tr + tg + tb, max_data_term);
 | 
			
		||||
        }
 | 
			
		||||
        template<> __device__ __forceinline__ static float pixeldiff<4>(const uchar* left, const uchar* right, float max_data_term)
 | 
			
		||||
        {
 | 
			
		||||
@@ -80,7 +80,7 @@ namespace cv { namespace cuda { namespace device
 | 
			
		||||
            float tg = 0.587f * ::abs((int)l.y - r.y);
 | 
			
		||||
            float tr = 0.299f * ::abs((int)l.z - r.z);
 | 
			
		||||
 | 
			
		||||
            return fmin(tr + tg + tb, max_data_term);
 | 
			
		||||
            return fminf(tr + tg + tb, max_data_term);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        template <typename T>
 | 
			
		||||
 
 | 
			
		||||
@@ -166,7 +166,13 @@ TEST(Video_calcOpticalFlowDual_TVL1, Regression)
 | 
			
		||||
    ASSERT_EQ(gold.rows, flow.rows);
 | 
			
		||||
    ASSERT_EQ(gold.cols, flow.cols);
 | 
			
		||||
 | 
			
		||||
    const double err = calcRMSE(gold, flow);
 | 
			
		||||
    double err = calcRMSE(gold, flow);
 | 
			
		||||
    EXPECT_LE(err, MAX_RMSE);
 | 
			
		||||
    tvl1->set("gamma", 1.f);
 | 
			
		||||
    tvl1->calc(frame1, frame2, flow);
 | 
			
		||||
    ASSERT_EQ(gold.rows, flow.rows);
 | 
			
		||||
    ASSERT_EQ(gold.cols, flow.cols);
 | 
			
		||||
    err = calcRMSE(gold, flow);
 | 
			
		||||
    EXPECT_LE(err, MAX_RMSE);
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user