Fixes issue #174

This commit is contained in:
Matt Hill
2015-08-10 23:20:37 -04:00
parent 39525717d8
commit b145da1e85

View File

@@ -97,6 +97,10 @@ namespace alpr
response.results.img_width = img.cols; response.results.img_width = img.cols;
response.results.img_height = img.rows; response.results.img_height = img.rows;
// Fix regions of interest in case they extend beyond the bounds of the image
for (unsigned int i = 0; i < regionsOfInterest.size(); i++)
regionsOfInterest[i] = expandRect(regionsOfInterest[i], 0, 0, img.cols, img.rows);
for (unsigned int i = 0; i < regionsOfInterest.size(); i++) for (unsigned int i = 0; i < regionsOfInterest.size(); i++)
{ {
response.results.regionsOfInterest.push_back(AlprRegionOfInterest(regionsOfInterest[i].x, regionsOfInterest[i].y, response.results.regionsOfInterest.push_back(AlprRegionOfInterest(regionsOfInterest[i].x, regionsOfInterest[i].y,