diff --git a/tests/Interface/core/ImageContainerTest.cpp b/tests/Interface/core/ImageContainerTest.cpp index 442f79ca6c..89be5c3307 100644 --- a/tests/Interface/core/ImageContainerTest.cpp +++ b/tests/Interface/core/ImageContainerTest.cpp @@ -24,6 +24,30 @@ #include #include +template +bool testcvdp(cv::Mat testImgcv,Img testImg,bool norm = false) +{ + int cvn = testImgcv.dims; + if(cvn!=N) return false; + for(int i=0;i(i,j)) return false; + k++; + } + } + } + return true; +} int main() { // The original test image is a gray scale image, and the pixel values are as // follows: @@ -132,8 +156,16 @@ int main() { const Img testBracketOperator2(grayimage_bmp); // CHECK: 240.0 fprintf(stderr, "%f\n", testBracketOperator2[15]); - - + //===--------------------------------------------------------------------===// + // Test Opencv Image without norm + //===--------------------------------------------------------------------===// + cv::Mat testImgcv=cv::imread( + "../../../../tests/Interface/core/TestGrayImage.bmp", + cv::IMREAD_GRAYSCALE); + Img testImg(testImgcv); + bool test=testcvdp(testImgcv,testImg); + //CHECK: 1 + fprintf(stderr,"%d \n",test); //===--------------------------------------------------------------------===// // Test jpeg format image. //===--------------------------------------------------------------------===// @@ -334,4 +366,4 @@ int main() { fprintf(stderr, "%f\n", testBracketOperator6[15]); return 0; -} \ No newline at end of file +}