|
@@ -2329,6 +2329,7 @@ namespace OTSIMGPROC
|
|
|
curve2.push_back(pt);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
double d_perp1 = 0, d_perp2 = 0;
|
|
|
for (unsigned int i = 0; i < curve1.size(); i++)
|
|
|
{
|
|
@@ -2351,6 +2352,17 @@ namespace OTSIMGPROC
|
|
|
int r;
|
|
|
Point inscribeCirclecenter;
|
|
|
FindInnerCircleInContour(outContour, inscribeCirclecenter, r);
|
|
|
+ CPoint xrayPos = a_pOTSPart->GetXRayPos();
|
|
|
+ double localPos = pointPolygonTest(outContour, Point2f(xrayPos.x, xrayPos.y), false);
|
|
|
+ if (localPos == 1 || localPos == 0)//像素点在多边形内和边缘
|
|
|
+ {
|
|
|
+
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ a_pOTSPart->SetXRayPos(CPoint(inscribeCirclecenter.x, inscribeCirclecenter.y));
|
|
|
+ }
|
|
|
+
|
|
|
//circle(cvContourImg, inscribeCirclecenter, r, Scalar(200));
|
|
|
a_pOTSPart->SetDInscr(r * 2 * a_PixelSize);
|
|
|
//---------------calculate the image other caracater: length/width realArea/minRectangeArea etc. we can use these propertes to do forward process.
|