Skip to content

Commit 5c5dedc

Browse files
author
Dan Oprea
committed
https://github.com/opencv/opencv_contrib/issues/3152
1 parent bb3048d commit 5c5dedc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules/xphoto/src/inpainting_fsr.impl.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ icvGetTodoBlocks(Mat& sampled_img, Mat& sampling_mask, std::vector< std::tuple<
318318
Mat error_mask_2d = sampling_mask(Range(yblock_counter*block_size - top_border, std::min(img_height, (yblock_counter*block_size + block_size + bottom_border))), Range(xblock_counter*block_size - left_border, std::min(img_width, (xblock_counter*block_size + block_size + right_border))));
319319

320320
// determine normalized and weighted standard deviation
321-
if (block_size > block_size_min)
321+
if (block_size > block_size_min && xblock_counter < sigma_n_array.cols && yblock_counter < sigma_n_array.rows)
322322
{
323323
double sigma_n = icvStandardDeviation(distorted_block_2d, error_mask_2d);
324324
sigma_n_array.at<double>( yblock_counter, xblock_counter) = sigma_n;

0 commit comments

Comments
 (0)