|
@@ -37,11 +37,6 @@ namespace OTSDataType
|
|
|
|
|
|
protected CImageHandler m_ImagePro;
|
|
|
|
|
|
- //bool leftBorderParticlesBias = true;//true means that when there is overlap to process image the particles on the leftBorder will be included.
|
|
|
- //bool rightBorderParticlesBias = true;
|
|
|
- //bool upBorderParticlesBias = true;
|
|
|
- //bool downBorderParticlesBias = true;
|
|
|
-
|
|
|
protected List<COTSParticleClr> m_listAllParticles = new List<COTSParticleClr>();//hold up all the particles abstracted from bse image;
|
|
|
|
|
|
protected List<COTSParticleClr> m_listAnalysisParticles = new List<COTSParticleClr>();// according to xraylimit constraint,pick out the first big particles.
|
|
@@ -76,14 +71,6 @@ namespace OTSDataType
|
|
|
m_otsRect = value;
|
|
|
}
|
|
|
|
|
|
- //public bool GetLeftBorderParticlesBiasDefine() { return leftBorderParticlesBias; }
|
|
|
- //public void SetLeftBorderParticlesBiasDefine(bool ifSelect) { leftBorderParticlesBias = ifSelect; }
|
|
|
- //public bool GetRightBorderParticlesBiasDefine() { return rightBorderParticlesBias; }
|
|
|
- //public void SetRightBorderParticlesBiasDefine(bool ifSelect) { rightBorderParticlesBias = ifSelect; }
|
|
|
- //public bool GetUpBorderParticlesBiasDefine() { return upBorderParticlesBias; }
|
|
|
- //public void SetUpBorderParticlesBiasDefine(bool ifSelect) { upBorderParticlesBias = ifSelect; }
|
|
|
- //public bool GetDownBorderParticlesBiasDefine() { return downBorderParticlesBias; }
|
|
|
- //public void SetDownBorderParticlesBiasDefine(bool ifSelect) { downBorderParticlesBias = ifSelect; }
|
|
|
public int GetMeasureSequence()
|
|
|
{
|
|
|
return measureSequence;
|
|
@@ -237,13 +224,15 @@ namespace OTSDataType
|
|
|
foreach (var p1 in rightsideparts)
|
|
|
{
|
|
|
int p1left = 0, p1right = 0, p1top = 0, p1bottom = 0;
|
|
|
- p.GetOTSRect(ref p1left, ref p1top, ref p1right, ref p1bottom);
|
|
|
+ p1.GetOTSRect(ref p1left, ref p1top, ref p1right, ref p1bottom);
|
|
|
COTSRect p1rec = new COTSRect(p1left, p1top, p1right, p1bottom);
|
|
|
PointF p1Center = p1rec.GetCenterPoint();
|
|
|
if (Math.Abs(pcenter.X - p1Center.X) < 2 * overlap && Math.Abs(pcenter.Y - p1Center.Y) < 2 * overlap)
|
|
|
{
|
|
|
- if (p.CalculateSimilarity(p1) > 0.95)
|
|
|
+ var sim = p.CalculateSimilarity(p1);
|
|
|
+ if ( sim> 0.95)
|
|
|
{
|
|
|
+ log.Warn("remove left side duplicate particle,similarity:" + sim.ToString("F3"));
|
|
|
findsimilar = true;
|
|
|
break;
|
|
|
}
|
|
@@ -278,13 +267,15 @@ namespace OTSDataType
|
|
|
foreach (var p1 in othersideparts)
|
|
|
{
|
|
|
int p1left = 0, p1right = 0, p1top = 0, p1bottom = 0;
|
|
|
- p.GetOTSRect(ref p1left, ref p1top, ref p1right, ref p1bottom);
|
|
|
+ p1.GetOTSRect(ref p1left, ref p1top, ref p1right, ref p1bottom);
|
|
|
COTSRect p1rec = new COTSRect(p1left, p1top, p1right, p1bottom);
|
|
|
PointF p1Center = p1rec.GetCenterPoint();
|
|
|
if (Math.Abs(pcenter.X - p1Center.X) < 2 * overlap && Math.Abs(pcenter.Y - p1Center.Y) < 2 * overlap)
|
|
|
{
|
|
|
- if (p.CalculateSimilarity(p1) > 0.95)
|
|
|
+ var sim = p.CalculateSimilarity(p1);
|
|
|
+ if (sim > 0.95)
|
|
|
{
|
|
|
+ log.Warn("remove upside duplicate particle,similarity:" + sim.ToString("F3"));
|
|
|
findsimilar = true;
|
|
|
break;
|
|
|
}
|
|
@@ -319,13 +310,15 @@ namespace OTSDataType
|
|
|
foreach (var p1 in othersideparts)
|
|
|
{
|
|
|
int p1left = 0, p1right = 0, p1top = 0, p1bottom = 0;
|
|
|
- p.GetOTSRect(ref p1left, ref p1top, ref p1right, ref p1bottom);
|
|
|
+ p1.GetOTSRect(ref p1left, ref p1top, ref p1right, ref p1bottom);
|
|
|
COTSRect p1rec = new COTSRect(p1left, p1top, p1right, p1bottom);
|
|
|
PointF p1Center = p1rec.GetCenterPoint();
|
|
|
if (Math.Abs(pcenter.X - p1Center.X) < 2 * overlap && Math.Abs(pcenter.Y - p1Center.Y) < 2 * overlap)
|
|
|
{
|
|
|
- if (p.CalculateSimilarity(p1) > 0.95)
|
|
|
+ var sim = p.CalculateSimilarity(p1);
|
|
|
+ if (sim > 0.95)
|
|
|
{
|
|
|
+ log.Warn("remove right side duplicate particle,similarity:" + sim.ToString("F3"));
|
|
|
findsimilar = true;
|
|
|
break;
|
|
|
}
|
|
@@ -356,17 +349,19 @@ namespace OTSDataType
|
|
|
COTSRect prec = new COTSRect(pleft, ptop, pright, pbottom);
|
|
|
PointF pcenter = prec.GetCenterPoint();
|
|
|
bool findsimilar = false;
|
|
|
- var othersideparts = rightField.GetSideParticlesByOverlap(SORTING_DIRECTION.UP, overlap);
|
|
|
+ var othersideparts = downField.GetSideParticlesByOverlap(SORTING_DIRECTION.UP, overlap);
|
|
|
foreach (var p1 in othersideparts)
|
|
|
{
|
|
|
int p1left = 0, p1right = 0, p1top = 0, p1bottom = 0;
|
|
|
- p.GetOTSRect(ref p1left, ref p1top, ref p1right, ref p1bottom);
|
|
|
+ p1.GetOTSRect(ref p1left, ref p1top, ref p1right, ref p1bottom);
|
|
|
COTSRect p1rec = new COTSRect(p1left, p1top, p1right, p1bottom);
|
|
|
PointF p1Center = p1rec.GetCenterPoint();
|
|
|
if (Math.Abs(pcenter.X - p1Center.X) < 2 * overlap && Math.Abs(pcenter.Y - p1Center.Y) < 2 * overlap)
|
|
|
{
|
|
|
- if (p.CalculateSimilarity(p1) > 0.95)
|
|
|
+ var sim = p.CalculateSimilarity(p1);
|
|
|
+ if (sim > 0.95)
|
|
|
{
|
|
|
+ log.Warn("remove down side duplicate particle,similarity:" + sim.ToString("F3"));
|
|
|
findsimilar = true;
|
|
|
break;
|
|
|
}
|
|
@@ -479,7 +474,7 @@ namespace OTSDataType
|
|
|
int fldright = (int)fldrec.GetBottomRight().X;
|
|
|
int fldtop = (int)fldrec.GetTopLeft().Y;
|
|
|
int fldbottom = (int)fldrec.GetBottomRight().Y;
|
|
|
- if ((top - fldtop > 2 * overlap) && (fldbottom-bottom>2*overlap) && (left-fldleft>2*overlap) && (fldright-right>2*overlap))
|
|
|
+ if ((Math.Abs(top - fldtop) > 2 * overlap) && (Math.Abs(fldbottom-bottom)>2*overlap) && (Math.Abs(left-fldleft)>2*overlap) && (Math.Abs(fldright-right)>2*overlap))
|
|
|
{
|
|
|
sideparts.Add(p);
|
|
|
}
|