|
@@ -1334,9 +1334,9 @@ namespace OTSIMGPROC
|
|
int h = stats.at<int>(i, CC_STAT_HEIGHT);
|
|
int h = stats.at<int>(i, CC_STAT_HEIGHT);
|
|
int area = stats.at<int>(i, CC_STAT_AREA);
|
|
int area = stats.at<int>(i, CC_STAT_AREA);
|
|
|
|
|
|
- double dArea = area * a_pixelSize * a_pixelSize;
|
|
|
|
|
|
+ double actualArea = area * a_pixelSize * a_pixelSize;
|
|
|
|
|
|
- if (dArea >= partAreaMin && dArea < partAreaMax)
|
|
|
|
|
|
+ if (actualArea >= partAreaMin && actualArea < partAreaMax)
|
|
{
|
|
{
|
|
|
|
|
|
|
|
|
|
@@ -1364,8 +1364,18 @@ namespace OTSIMGPROC
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
-
|
|
|
|
- GetParticles(rectMax.x, rectMax.y, rectMax.width, rectMax.height, imageROI.data, listParticleOut);
|
|
|
|
|
|
+ COTSParticleList roiParts;
|
|
|
|
+ if (GetParticles(rectMax.x, rectMax.y, rectMax.width, rectMax.height, imageROI.data, roiParts))
|
|
|
|
+ {
|
|
|
|
+ COTSParticlePtr roiPart = roiParts[0];//normally ,we will find only one part in the roi.
|
|
|
|
+ roiPart->SetXRayPos(CPoint(center_x, center_y));
|
|
|
|
+ CRect r = CRect(x, y, x + w, y + h);
|
|
|
|
+ roiPart->SetParticleRect(r);
|
|
|
|
+ roiPart->SetArea(actualArea);
|
|
|
|
+ roiPart->SetPixelArea(area);
|
|
|
|
+ listParticleOut.push_back(roiPart);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1521,10 +1531,17 @@ namespace OTSIMGPROC
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- GetParticles(rectMax.x, rectMax.y, rectMax.width, rectMax.height, imageROI.data, listParticleOut);//We will find more than one particle in one ROI. and We cann't decide which are the valid and not valid.So we will do another filter again later.
|
|
|
|
|
|
+ COTSParticleList roiParts;
|
|
|
|
+ if (GetParticles(rectMax.x, rectMax.y, rectMax.width, rectMax.height, imageROI.data, roiParts))
|
|
|
|
+ {
|
|
|
|
+ COTSParticlePtr roiPart = roiParts[0];//normally ,we will find only one part in the roi.
|
|
|
|
+ roiPart->SetXRayPos(CPoint(center_x, center_y));
|
|
|
|
+ CRect r = CRect(x, y, x + w, y + h);
|
|
|
|
+ roiPart->SetParticleRect(r);
|
|
|
|
+ roiPart->SetArea(actualArea);
|
|
|
|
+ roiPart->SetPixelArea(area);
|
|
|
|
+ listParticleOut.push_back(roiPart);
|
|
|
|
+ }
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1561,8 +1578,6 @@ namespace OTSIMGPROC
|
|
|
|
|
|
for (unsigned int i = 0; i < nLengthS; i++)
|
|
for (unsigned int i = 0; i < nLengthS; i++)
|
|
{
|
|
{
|
|
-
|
|
|
|
-
|
|
|
|
long nValueTemp = (long)*(pSrcImg + nHeightS * nWidthImg + nStartS + i);
|
|
long nValueTemp = (long)*(pSrcImg + nHeightS * nWidthImg + nStartS + i);
|
|
nPixelAll += nValueTemp;
|
|
nPixelAll += nValueTemp;
|
|
}
|
|
}
|
|
@@ -1570,12 +1585,9 @@ namespace OTSIMGPROC
|
|
BYTE nAveGray = (BYTE)(nPixelAll / nPixelNum);
|
|
BYTE nAveGray = (BYTE)(nPixelAll / nPixelNum);
|
|
pParticle->SetAveGray(nAveGray);
|
|
pParticle->SetAveGray(nAveGray);
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
+
|
|
m_pFieldData->SetParticleList(listParticleOut);
|
|
m_pFieldData->SetParticleList(listParticleOut);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -2074,12 +2086,12 @@ namespace OTSIMGPROC
|
|
{
|
|
{
|
|
COTSParticlePtr pParticle = COTSParticlePtr(new COTSParticle());
|
|
COTSParticlePtr pParticle = COTSParticlePtr(new COTSParticle());
|
|
pParticle->SetFeature(pFeature);
|
|
pParticle->SetFeature(pFeature);
|
|
- if (!pParticle->CalCoverRect())
|
|
|
|
|
|
+ /*if (!pParticle->CalCoverRect())
|
|
{
|
|
{
|
|
return FALSE;
|
|
return FALSE;
|
|
- }
|
|
|
|
|
|
+ }*/
|
|
|
|
|
|
- COTSSegmentsList listSegment = pFeature->GetSegmentsList();
|
|
|
|
|
|
+ /*COTSSegmentsList listSegment = pFeature->GetSegmentsList();
|
|
|
|
|
|
long nPixelNum = 0;
|
|
long nPixelNum = 0;
|
|
|
|
|
|
@@ -2092,7 +2104,7 @@ namespace OTSIMGPROC
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- pParticle->SetArea(nPixelNum);
|
|
|
|
|
|
+ pParticle->SetArea(nPixelNum);*/
|
|
a_listParticle.push_back(pParticle);
|
|
a_listParticle.push_back(pParticle);
|
|
}
|
|
}
|
|
|
|
|