Accepting float disparity maps.

pull/739/head
Leonardo Brás 9 years ago
parent 138bd0c971
commit 0ea0278222
  1. 10
      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();

Loading…
Cancel
Save