Skip to content

Commit 2c051d5

Browse files
committed
Merge pull request #3154 from doprea:4.x
2 parents bb3048d + 5c5dedc commit 2c051d5

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)