fixed bug in cv::Scharr and cv::Laplacian (ddepth < 0)

This commit is contained in:
Vladislav Vinogradov 2011-05-10 06:28:48 +00:00
parent bf29b16d1d
commit 79b500eb0d

View File

@ -507,6 +507,8 @@ void cv::Scharr( const InputArray& _src, OutputArray _dst, int ddepth, int dx, i
double scale, double delta, int borderType ) double scale, double delta, int borderType )
{ {
Mat src = _src.getMat(); Mat src = _src.getMat();
if (ddepth < 0)
ddepth = src.depth();
_dst.create( src.size(), CV_MAKETYPE(ddepth, src.channels()) ); _dst.create( src.size(), CV_MAKETYPE(ddepth, src.channels()) );
Mat dst = _dst.getMat(); Mat dst = _dst.getMat();
@ -538,6 +540,8 @@ void cv::Laplacian( const InputArray& _src, OutputArray _dst, int ddepth, int ks
double scale, double delta, int borderType ) double scale, double delta, int borderType )
{ {
Mat src = _src.getMat(); Mat src = _src.getMat();
if (ddepth < 0)
ddepth = src.depth();
_dst.create( src.size(), CV_MAKETYPE(ddepth, src.channels()) ); _dst.create( src.size(), CV_MAKETYPE(ddepth, src.channels()) );
Mat dst = _dst.getMat(); Mat dst = _dst.getMat();