Commit 0ea02782 authored by Leonardo Brás's avatar Leonardo Brás

Accepting float disparity maps.

parent 138bd0c9
...@@ -516,8 +516,8 @@ int readGT(String src_path,OutputArray dst) ...@@ -516,8 +516,8 @@ int readGT(String src_path,OutputArray dst)
double computeMSE(InputArray GT, InputArray src, Rect ROI) double computeMSE(InputArray GT, InputArray src, Rect ROI)
{ {
CV_Assert( !GT.empty() && (GT.depth() == CV_16S) && (GT.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) && (src.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() ); CV_Assert( src.rows() == GT.rows() && src.cols() == GT.cols() );
double res = 0; double res = 0;
Mat GT_ROI (GT.getMat(), ROI); Mat GT_ROI (GT.getMat(), ROI);
...@@ -538,8 +538,8 @@ double computeMSE(InputArray GT, InputArray src, Rect ROI) ...@@ -538,8 +538,8 @@ double computeMSE(InputArray GT, InputArray src, Rect ROI)
double computeBadPixelPercent(InputArray GT, InputArray src, Rect ROI, int thresh) double computeBadPixelPercent(InputArray GT, InputArray src, Rect ROI, int thresh)
{ {
CV_Assert( !GT.empty() && (GT.depth() == CV_16S) && (GT.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) && (src.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() ); CV_Assert( src.rows() == GT.rows() && src.cols() == GT.cols() );
int bad_pixel_num = 0; int bad_pixel_num = 0;
Mat GT_ROI (GT.getMat(), ROI); Mat GT_ROI (GT.getMat(), ROI);
...@@ -560,7 +560,7 @@ double computeBadPixelPercent(InputArray GT, InputArray src, Rect ROI, int thres ...@@ -560,7 +560,7 @@ double computeBadPixelPercent(InputArray GT, InputArray src, Rect ROI, int thres
void getDisparityVis(InputArray src,OutputArray dst,double scale) 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(); Mat srcMat = src.getMat();
dst.create(srcMat.rows,srcMat.cols,CV_8UC1); dst.create(srcMat.rows,srcMat.cols,CV_8UC1);
Mat& dstMat = dst.getMatRef(); Mat& dstMat = dst.getMatRef();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment