From 0ea0278222ea285bd08b81a78eca576c80bec593 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonardo=20Br=C3=83=C2=A1s?= Date: Mon, 25 Jul 2016 16:02:32 -0300 Subject: [PATCH] Accepting float disparity maps. --- modules/ximgproc/src/disparity_filters.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/ximgproc/src/disparity_filters.cpp b/modules/ximgproc/src/disparity_filters.cpp index f0b056126..82c74a8ae 100644 --- a/modules/ximgproc/src/disparity_filters.cpp +++ b/modules/ximgproc/src/disparity_filters.cpp @@ -516,8 +516,8 @@ int readGT(String src_path,OutputArray dst) double computeMSE(InputArray GT, InputArray src, Rect ROI) { - CV_Assert( !GT.empty() && (GT.depth() == CV_16S) && (GT.channels() == 1) ); - CV_Assert( !src.empty() && (src.depth() == CV_16S) && (src.channels() == 1) ); + CV_Assert( !GT.empty() && (GT.depth() == CV_16S || GT.depth() == CV_32F) && (GT.channels() == 1) ); + CV_Assert( !src.empty() && (src.depth() == CV_16S || GT.depth() == CV_32F) && (src.channels() == 1) ); CV_Assert( src.rows() == GT.rows() && src.cols() == GT.cols() ); double res = 0; Mat GT_ROI (GT.getMat(), ROI); @@ -538,8 +538,8 @@ double computeMSE(InputArray GT, InputArray src, Rect ROI) double computeBadPixelPercent(InputArray GT, InputArray src, Rect ROI, int thresh) { - CV_Assert( !GT.empty() && (GT.depth() == CV_16S) && (GT.channels() == 1) ); - CV_Assert( !src.empty() && (src.depth() == CV_16S) && (src.channels() == 1) ); + CV_Assert( !GT.empty() && (GT.depth() == CV_16S || GT.depth() == CV_32F) && (GT.channels() == 1) ); + CV_Assert( !src.empty() && (src.depth() == CV_16S || GT.depth() == CV_32F) && (src.channels() == 1) ); CV_Assert( src.rows() == GT.rows() && src.cols() == GT.cols() ); int bad_pixel_num = 0; Mat GT_ROI (GT.getMat(), ROI); @@ -560,7 +560,7 @@ double computeBadPixelPercent(InputArray GT, InputArray src, Rect ROI, int thres void getDisparityVis(InputArray src,OutputArray dst,double scale) { - CV_Assert( !src.empty() && (src.depth() == CV_16S) && (src.channels() == 1) ); + CV_Assert( !src.empty() && (src.depth() == CV_16S || GT.depth() == CV_32F) && (src.channels() == 1) ); Mat srcMat = src.getMat(); dst.create(srcMat.rows,srcMat.cols,CV_8UC1); Mat& dstMat = dst.getMatRef();