ext/spyglass/contour.cc in spyglass-0.0.3 vs ext/spyglass/contour.cc in spyglass-0.0.4
- old
+ new
@@ -64,11 +64,9 @@
//
// http://opencv-code.com/tutorials/automatic-perspective-correction-for-quadrilateral-objects/
std::vector<cv::Point> contour = to_value_vector(SG_GET_CONTOUR(self));
cv::approxPolyDP(contour, contour, cv::arcLength(cv::Mat(contour), true) * 0.02, true);
if (contour.size() != 4) {
- // TODO: Throw exception here?
- std::cout << "The object is not quadrilateral!" << std::endl;
return Qnil;
}
// Get mass center
cv::Point center(0,0);