Added support of CV_16S depth in morphology operations
This commit is contained in:
parent
9d871abd32
commit
04ac6db04a
@ -983,13 +983,14 @@ cv::Ptr<cv::FilterEngine> cv::createMorphologyFilter( int op, int type, InputArr
|
|||||||
borderValue == morphologyDefaultBorderValue() )
|
borderValue == morphologyDefaultBorderValue() )
|
||||||
{
|
{
|
||||||
int depth = CV_MAT_DEPTH(type);
|
int depth = CV_MAT_DEPTH(type);
|
||||||
CV_Assert( depth == CV_8U || depth == CV_16U || depth == CV_32F );
|
CV_Assert( depth == CV_8U || depth == CV_16U || depth == CV_16S || depth == CV_32F );
|
||||||
if( op == MORPH_ERODE )
|
if( op == MORPH_ERODE )
|
||||||
borderValue = Scalar::all( depth == CV_8U ? (double)UCHAR_MAX :
|
borderValue = Scalar::all( depth == CV_8U ? (double)UCHAR_MAX :
|
||||||
depth == CV_16U ? (double)USHRT_MAX : (double)FLT_MAX );
|
depth == CV_16U ? (double)USHRT_MAX :
|
||||||
|
depth == CV_16S ? (double)SHRT_MAX : (double)FLT_MAX );
|
||||||
else
|
else
|
||||||
borderValue = Scalar::all( depth == CV_8U || depth == CV_16U ?
|
borderValue = Scalar::all( depth == CV_8U || depth == CV_16U ? 0. :
|
||||||
0. : (double)-FLT_MAX );
|
depth == CV_16S ? (double)SHRT_MIN : (double)-FLT_MAX );
|
||||||
}
|
}
|
||||||
|
|
||||||
return Ptr<FilterEngine>(new FilterEngine(filter2D, rowFilter, columnFilter,
|
return Ptr<FilterEngine>(new FilterEngine(filter2D, rowFilter, columnFilter,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user