|
@@ -132,7 +132,7 @@ namespace OTSIMGPROC
|
|
|
{
|
|
|
int center_x = centroids.at<double>(i, 0);
|
|
|
int center_y = centroids.at<double>(i, 1);
|
|
|
- //矩形边框
|
|
|
+ //锟斤拷锟轿边匡拷
|
|
|
int x = stats.at<int>(i, CC_STAT_LEFT);
|
|
|
int y = stats.at<int>(i, CC_STAT_TOP);
|
|
|
int w = stats.at<int>(i, CC_STAT_WIDTH);
|
|
@@ -320,7 +320,7 @@ namespace OTSIMGPROC
|
|
|
{
|
|
|
int center_x = centroids.at<double>(i, 0);
|
|
|
int center_y = centroids.at<double>(i, 1);
|
|
|
- //矩形边框
|
|
|
+ //锟斤拷锟轿边匡拷
|
|
|
int x = stats.at<int>(i, CC_STAT_LEFT);
|
|
|
int y = stats.at<int>(i, CC_STAT_TOP);
|
|
|
int w = stats.at<int>(i, CC_STAT_WIDTH);
|
|
@@ -567,7 +567,7 @@ namespace OTSIMGPROC
|
|
|
Mat imageGray3;
|
|
|
|
|
|
|
|
|
- cv::cvtColor(matImg, imageGray3, cv::COLOR_GRAY2RGB);//灰度转换 opencv4
|
|
|
+ cv::cvtColor(matImg, imageGray3, cv::COLOR_GRAY2RGB);//锟揭讹拷转锟斤拷 opencv4
|
|
|
cv::watershed(imageGray3, marks);
|
|
|
|
|
|
|
|
@@ -1322,7 +1322,7 @@ namespace OTSIMGPROC
|
|
|
{
|
|
|
int center_x = centroids.at<double>(i, 0);
|
|
|
int center_y = centroids.at<double>(i, 1);
|
|
|
- //矩形边框
|
|
|
+ //锟斤拷锟轿边匡拷
|
|
|
int x = stats.at<int>(i, CC_STAT_LEFT);
|
|
|
int y = stats.at<int>(i, CC_STAT_TOP);
|
|
|
int w = stats.at<int>(i, CC_STAT_WIDTH);
|
|
@@ -1386,7 +1386,7 @@ namespace OTSIMGPROC
|
|
|
void COTSImageProcess::findPeakAndValley(const vector<int>& v, vector<int>& peakPositions, vector<int>& valleyPositions)
|
|
|
{
|
|
|
vector<int> diff_v(v.size() - 1, 0);
|
|
|
- // 计算V的一阶差分和符号函数trend
|
|
|
+ // 锟斤拷锟斤拷V锟斤拷一锟阶诧拷趾头锟斤拷藕锟斤拷锟絫rend
|
|
|
for (vector<int>::size_type i = 0; i != diff_v.size(); i++)
|
|
|
{
|
|
|
if (v[i + 1] - v[i] > 0)
|
|
@@ -1396,7 +1396,7 @@ namespace OTSIMGPROC
|
|
|
else
|
|
|
diff_v[i] = 0;
|
|
|
}
|
|
|
- // 对Trend作了一个遍历
|
|
|
+ // 锟斤拷Trend锟斤拷锟斤拷一锟斤拷锟斤拷锟斤拷
|
|
|
for (int i = diff_v.size() - 1; i >= 0; i--)
|
|
|
{
|
|
|
if (diff_v[i] == 0 && i == diff_v.size() - 1)
|
|
@@ -1856,10 +1856,10 @@ namespace OTSIMGPROC
|
|
|
|
|
|
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.
|
|
|
- double minRectArea = D_MIN * D_MinRecLen*a_PixelSize*a_PixelSize;//最小外接矩形面积
|
|
|
- double fillRatio = a_pOTSPart->GetActualArea() / minRectArea;//实际面积与最小外接矩形面积比,that's the fill rate.
|
|
|
+ double minRectArea = D_MIN * D_MinRecLen*a_PixelSize*a_PixelSize;//锟斤拷小锟斤拷泳锟斤拷锟斤拷锟斤拷
|
|
|
+ double fillRatio = a_pOTSPart->GetActualArea() / minRectArea;//实锟斤拷锟斤拷锟斤拷锟斤拷锟叫★拷锟接撅拷锟斤拷锟斤拷锟斤拷锟�,that's the fill rate.
|
|
|
double lengthWidthRatio;
|
|
|
- lengthWidthRatio = (double)D_MinRecLen / D_MIN;//长宽比
|
|
|
+ lengthWidthRatio = (double)D_MinRecLen / D_MIN;//锟斤拷锟斤拷锟�
|
|
|
|
|
|
|
|
|
//decide if this shape is a strip shape :if the lenthWidthRatio>2 then it is. if the lengthWidthRatio<2 and the areaRatio<0.5 then it is.
|
|
@@ -2348,7 +2348,7 @@ namespace OTSIMGPROC
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
- BOOL COTSImageProcess::CalcuBrightPhaseDarkPhaseGrayByOtsu(CBSEImgPtr a_pImgIn, int& gray1, int& gray2)
|
|
|
+ BOOL COTSImageProcess::CalcuBrightPhaseDarkPhaseGrayByOtsu(CBSEImgPtr a_pImgIn, int& bright, int& dark)
|
|
|
{
|
|
|
Mat srcImgMat = GetMatDataFromBseImg(a_pImgIn);
|
|
|
Mat brightPhaseMat, darkPhaseMat;
|
|
@@ -2359,8 +2359,8 @@ namespace OTSIMGPROC
|
|
|
cv::Scalar mean2, std2;
|
|
|
cv::meanStdDev(brightPhaseMat, mean1, std1);
|
|
|
cv::meanStdDev(darkPhaseMat, mean2, std2);
|
|
|
- gray1 = (int)mean2[0];
|
|
|
- gray2 = (int)mean1[0];
|
|
|
+ bright = (int)mean1[0];
|
|
|
+ dark = (int)mean2[0];
|
|
|
return TRUE;
|
|
|
}
|
|
|
|