mirror of
https://github.com/opencv/opencv.git
synced 2026-07-29 07:13:02 +04:00
fix to prevent QR code decoding from throwing on degenerate source points
This commit is contained in:
committed by
Muhammed Pallikkal
parent
edfa999b93
commit
5d54e90fa4
@@ -2958,7 +2958,12 @@ std::string ImplContour::decode(InputArray in, InputArray points, OutputArray st
|
||||
vector<Point2f> src_points;
|
||||
points.copyTo(src_points);
|
||||
CV_Assert(src_points.size() == 4);
|
||||
CV_CheckGT(contourArea(src_points), 0.0, "Invalid QR code source points");
|
||||
if (contourArea(src_points) <= 0.0)
|
||||
{
|
||||
if (straight_qrcode.needed())
|
||||
straight_qrcode.release();
|
||||
return std::string();
|
||||
}
|
||||
|
||||
QRDecode qrdec(useAlignmentMarkers);
|
||||
qrdec.init(inarr, src_points);
|
||||
|
||||
Reference in New Issue
Block a user