Skip to content

Commit

Permalink
Fixed exception when ROI for generated sample is evaluated out of ima…
Browse files Browse the repository at this point in the history
…ge borders
  • Loading branch information
terfendail committed Jan 9, 2018
1 parent c71dc78 commit 29faf16
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/createsamples/utility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -685,8 +685,8 @@ void icvPlaceDistortedSample( Mat background,
Mat img( background.size(), CV_8UC1 );
Mat maskimg( background.size(), CV_8UC1 );

resize( data->img(roi), img, img.size(), 0, 0, INTER_LINEAR_EXACT);
resize( data->maskimg(roi), maskimg, maskimg.size(), 0, 0, INTER_LINEAR_EXACT);
resize( data->img(roi & Rect(Point(0,0), data->img.size())), img, img.size(), 0, 0, INTER_LINEAR_EXACT);
resize( data->maskimg(roi & Rect(Point(0, 0), data->maskimg.size())), maskimg, maskimg.size(), 0, 0, INTER_LINEAR_EXACT);

forecolordev = theRNG().uniform( -maxintensitydev, maxintensitydev );

Expand Down

0 comments on commit 29faf16

Please sign in to comment.