|
@@ -2358,17 +2358,11 @@ namespace OTSIMGPROC
|
|
|
int r;
|
|
|
Point inscribeCirclecenter;
|
|
|
FindInnerCircleInContour(outContour, inscribeCirclecenter, r);
|
|
|
- //--------------------------------------------------------calculate the xraypos failed, expect improving later!
|
|
|
- //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));
|
|
|
- //}
|
|
|
+ //--------------------------------------------------------calculate the xraypos !
|
|
|
+
|
|
|
+ CRect rec = a_pOTSPart->GetParticleRect();
|
|
|
+
|
|
|
+ a_pOTSPart->SetXRayPos(CPoint(inscribeCirclecenter.x - nExpand_Size + rec.left - 1, inscribeCirclecenter.y - nExpand_Size + rec.top - 1));
|
|
|
//--------------------------------------------------------
|
|
|
|
|
|
//circle(cvContourImg, inscribeCirclecenter, r, Scalar(200));
|
|
@@ -2390,7 +2384,7 @@ namespace OTSIMGPROC
|
|
|
int ny = mu.m01 / mu.m00;
|
|
|
//circle(cvcopyImg, Point(nx, ny), 1, (255), 1);
|
|
|
Point ptCenter = Point((int)nx, (int)ny);
|
|
|
- if (pointPolygonTest(outContour, ptCenter, false) != 1)// the center point doesn't contain in the contour, we think it as curve shape.
|
|
|
+ if (pointPolygonTest(listEdge, ptCenter, false) != 1)// the center point doesn't contain in the contour, we think it as curve shape.
|
|
|
{
|
|
|
isStripShape = true;
|
|
|
}
|