|
@@ -1,4 +1,4 @@
|
|
|
-#pragma once
|
|
|
+#pragma once
|
|
|
#include "stdafx.h"
|
|
|
#include <opencv2/core/core.hpp>
|
|
|
#include <opencv2/highgui/highgui.hpp>
|
|
@@ -1667,7 +1667,7 @@ namespace OTSIMGPROC
|
|
|
BOOL COTSImageProcess::CalcuParticleImagePropertes(COTSParticlePtr a_pOTSPart, double a_PixelSize)
|
|
|
{
|
|
|
//--------- convert this particle data to image data,construct an image only with this particle.------
|
|
|
- const int nExpand_Size = 3;
|
|
|
+ const int nExpand_Size = 4;
|
|
|
const int nWhiteColor = 0;
|
|
|
const int nThickness = 1;
|
|
|
// lineType Type of the line
|
|
@@ -1697,9 +1697,9 @@ namespace OTSIMGPROC
|
|
|
COTSSegmentsList listSegment = a_pOTSPart->GetFeature()->GetSegmentsList();
|
|
|
for (auto pSegment : listSegment)
|
|
|
{
|
|
|
- int nStart = pSegment->GetStart() - rect.left + nExpand_Size;
|
|
|
- int nEnd = pSegment->GetStart() + pSegment->GetLength() - rect.left - 1 + nExpand_Size;
|
|
|
- int nHeight = pSegment->GetHeight() - rect.top + nExpand_Size;
|
|
|
+ int nStart = pSegment->GetStart() - rect.left+ nExpand_Size/2;
|
|
|
+ int nEnd = nStart + pSegment->GetLength() ;
|
|
|
+ int nHeight = pSegment->GetHeight() - rect.top+ nExpand_Size/2;
|
|
|
line(particleImage, Point(nStart, nHeight), Point(nEnd, nHeight), Scalar(nBlackColor), nThickness, nLineType);
|
|
|
}
|
|
|
//--------abstract the contour of the particle.
|