Commit 2f3ddab1734db7dad237c828322f78f2180d4e26

Authored by Josh Klontz
Committed by GitHub
1 parent 3217f745

Update cropfromlandmarks.cpp

Fixed #499
openbr/plugins/imgproc/cropfromlandmarks.cpp
@@ -54,8 +54,8 @@ class CropFromLandmarksTransform : public UntrainableTransform @@ -54,8 +54,8 @@ class CropFromLandmarksTransform : public UntrainableTransform
54 QRectF rect(minX - padW, minY - padH, (maxX - minX + 1) + padW * 2, (maxY - minY + 1) + padH * 2); 54 QRectF rect(minX - padW, minY - padH, (maxX - minX + 1) + padW * 2, (maxY - minY + 1) + padH * 2);
55 if (rect.x() < 0) rect.setX(0); 55 if (rect.x() < 0) rect.setX(0);
56 if (rect.y() < 0) rect.setY(0); 56 if (rect.y() < 0) rect.setY(0);
57 - if (rect.x() + rect.width() > src.m().cols) rect.setWidth(src.m().cols - rect.x());  
58 - if (rect.y() + rect.width() > src.m().rows) rect.setHeight(src.m().rows - rect.y()); 57 + if (rect.x() + rect.width() > src.m().cols) rect.setWidth (src.m().cols - rect.x());
  58 + if (rect.y() + rect.height() > src.m().rows) rect.setHeight(src.m().rows - rect.y());
59 59
60 if (shiftPoints) { 60 if (shiftPoints) {
61 QList<QPointF> points = src.file.points(); 61 QList<QPointF> points = src.file.points();