Skip to content

Commit e7b9cfa

Browse files
committed
imgproc:fix winSize in createHanningWindow()
1 parent ef2b730 commit e7b9cfa

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

modules/imgproc/include/opencv2/imgproc.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2723,7 +2723,7 @@ An example is shown below:
27232723
createHanningWindow(hann, Size(100, 100), CV_32F);
27242724
@endcode
27252725
@param dst Destination array to place Hann coefficients in
2726-
@param winSize The window size specifications
2726+
@param winSize The window size specifications (both width and height must be > 1)
27272727
@param type Created array type
27282728
*/
27292729
CV_EXPORTS_W void createHanningWindow(OutputArray dst, Size winSize, int type);

modules/imgproc/src/phasecorr.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,7 @@ void cv::createHanningWindow(OutputArray _dst, cv::Size winSize, int type)
579579
CV_INSTRUMENT_REGION()
580580

581581
CV_Assert( type == CV_32FC1 || type == CV_64FC1 );
582+
CV_Assert( winSize.width > 1 && winSize.height > 1 );
582583

583584
_dst.create(winSize, type);
584585
Mat dst = _dst.getMat();

0 commit comments

Comments
 (0)