Ask Your Question

Revision history [back]

which should be convex, right? NO Convex : If you choose two points inside shape then All points of line segment defined by end points belong to shape.

your shape : image description

this segment proove that shape is not convex

image description

Discrete geometry : should convex right ? I'm agree but reality it is not convex

which should be convex, right? NO NO

Convex : If you choose two points inside shape then All points of line segment defined by end points belong to shape.

your shape : image description

this segment proove that shape is not convex

image description

Discrete geometry : should convex right ? I'm agree but reality it is not convex

which should be convex, right? NO

Convex : If you choose two points inside shape then All points of line segment defined by end points belong to shape.

your shape : image description

this segment proove that shape is not convex

image description

Discrete geometry : should convex right ? I'm agree but reality it is not convex

this one is convex :

Point p1(10,10),p4(10,100), p3(100,100), p2(100,10) ;
vector<Point> ctr;

ctr.push_back(p1);
ctr.push_back(p4);
ctr.push_back(p3);
ctr.push_back(p2);
ctrImg.push_back(ctr);

if (isContourConvex(ctr))
    cout << "Contour is convex\n";
else
    cout << "Contour is not convex\n";

which should be convex, right? NO

Convex : If you choose two points inside shape then All points of line segment defined by end points belong to shape.

your shape : image description

this segment proove that shape is not convex

image description

Discrete geometry : should convex right ? I'm agree but reality it is not convex

this one is convex :

Point p1(10,10),p4(10,100), p3(100,100), p2(100,10) ;
vector<Point> ctr;

ctr.push_back(p1);
ctr.push_back(p4);
ctr.push_back(p3);
ctr.push_back(p2);
ctrImg.push_back(ctr);

if (isContourConvex(ctr))
    cout << "Contour is convex\n";
else
    cout << "Contour is not convex\n";