1 | initial version |
You should use connectedComponentsWithStat You will have rect, area and center in stats
eliminate what does it means?
2 | No.2 Revision |
You should use connectedComponentsWithStat You will have rect, area and center in stats
int nLabels = connectedComponents(bw, labelImage, stat,centroid,8);
vector<Rect> rComp;
for (int i=0;i<nLabels;i++)
{
rComp.push_back(Rect(Point(stat.at<int>(i,CC_STAT_LEFT ),oint(stat.at<int>(i,CC_STAT_TOP)),Size(stat.at<int>(i,CC_STAT_WIDTH ),oint(stat.at<int>(i,CC_STAT_HEIGHT)));
}
// you can draw all rect
eliminate what does it means?
3 | No.3 Revision |
You should use connectedComponentsWithStat You will have rect, area and center in stats
int nLabels = connectedComponents(bw, labelImage, stat,centroid,8);
vector<Rect> rComp;
for (int i=0;i<nLabels;i++)
{
rComp.push_back(Rect(Point(stat.at<int>(i,CC_STAT_LEFT ),oint(stat.at<int>(i,CC_STAT_TOP)),Size(stat.at<int>(i,CC_STAT_WIDTH ),oint(stat.at<int>(i,CC_STAT_HEIGHT)));
),stat.at<int>(i,CC_STAT_TOP)),Size(stat.at<int>(i,CC_STAT_WIDTH ),stat.at<int>(i,CC_STAT_HEIGHT)));
}
// you can draw all rect
eliminate what does it means?
4 | No.4 Revision |
You should use connectedComponentsWithStat You will have rect, area and center in stats
int nLabels = connectedComponents(bw, labelImage, stat,centroid,8);
vector<Rect> rComp;
Mat stat,centroid;
for (int i=0;i<nLabels;i++)
{
rComp.push_back(Rect(Point(stat.at<int>(i,CC_STAT_LEFT ),stat.at<int>(i,CC_STAT_TOP)),Size(stat.at<int>(i,CC_STAT_WIDTH ),stat.at<int>(i,CC_STAT_HEIGHT)));
}
// you can draw all rect
eliminate what does it means?
5 | No.5 Revision |
You should use connectedComponentsWithStat You will have rect, area and center in stats
Mat stat,centroid;
int nLabels = connectedComponents(bw, labelImage, stat,centroid,8);
vector<Rect> rComp;
Mat stat,centroid;
for (int i=0;i<nLabels;i++)
{
rComp.push_back(Rect(Point(stat.at<int>(i,CC_STAT_LEFT ),stat.at<int>(i,CC_STAT_TOP)),Size(stat.at<int>(i,CC_STAT_WIDTH ),stat.at<int>(i,CC_STAT_HEIGHT)));
}
// you can draw all rect
eliminate what does it means?
6 | No.6 Revision |
You should use connectedComponentsWithStat You will have rect, area and center in stats
Mat stat,centroid;
int nLabels = connectedComponents(bw, labelImage, stat,centroid,8);
vector<Rect> rComp;
for (int i=0;i<nLabels;i++)
{
rComp.push_back(Rect(Point(stat.at<int>(i,CC_STAT_LEFT ),stat.at<int>(i,CC_STAT_TOP)),Size(stat.at<int>(i,CC_STAT_WIDTH ),stat.at<int>(i,CC_STAT_HEIGHT)));
cout<<stat.at<int>(i,CC_STAT_AREA)
}
// you can draw all rect
rect
eliminate what does it means?
7 | No.7 Revision |
You should use connectedComponentsWithStat You will have rect, area and center in stats
Mat stat,centroid;
int nLabels = connectedComponents(bw, labelImage, stat,centroid,8);
vector<Rect> rComp;
for (int i=0;i<nLabels;i++)
{
rComp.push_back(Rect(Point(stat.at<int>(i,CC_STAT_LEFT Rect r(Rect(Point(stat.at<int>(i,CC_STAT_LEFT ),stat.at<int>(i,CC_STAT_TOP)),Size(stat.at<int>(i,CC_STAT_WIDTH ),stat.at<int>(i,CC_STAT_HEIGHT)));
cout<<stat.at<int>(i,CC_STAT_AREA)
),stat.at<int>(i,CC_STAT_HEIGHT)))
}
rComp.push_back(r);
rectangle(bw,r,Scalar::all(255),1);
cout<<stat.at<int>(i,CC_STAT_AREA);
}
// you can draw all rect
eliminate what does it means?