1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 23:33:05 +04:00

Merge branch 4.x

This commit is contained in:
Alexander Smorkalov
2026-07-08 11:31:07 +03:00
144 changed files with 4751 additions and 1058 deletions
+1 -1
View File
@@ -10,7 +10,7 @@ using namespace cv;
static void help(char** argv)
{
printf("\nShow off image morphology: erosion, dialation, open and close\n"
printf("\nShow off image morphology: erosion, dilation, opening and closing\n"
"Call:\n %s [image]\n"
"This program also shows use of rect, ellipse, cross and diamond kernels\n\n", argv[0]);
printf( "Hot keys: \n"
+7
View File
@@ -107,6 +107,8 @@ int main(int argc, char *argv[])
pDefaultBLOB.filterByConvexity = false;
pDefaultBLOB.minConvexity = 0.95f;
pDefaultBLOB.maxConvexity = (float)1e37;
// Enable contour collection so we can draw blob outlines (see getBlobContours() below).
pDefaultBLOB.collectContours = true;
// Descriptor array for BLOB
vector<String> typeDesc;
// Param array for BLOB
@@ -189,6 +191,11 @@ int main(int argc, char *argv[])
int i = 0;
for (vector<KeyPoint>::iterator k = keyImg.begin(); k != keyImg.end(); ++k, ++i)
circle(result, k->pt, (int)k->size, palette[i % 65536]);
// Retrieve the per-blob contours collected during detect() and outline each blob.
// Requires SimpleBlobDetector::Params::collectContours to be true.
const vector<vector<Point> >& blobContours = sbd->getBlobContours();
for (size_t c = 0; c < blobContours.size(); ++c)
drawContours(result, blobContours, (int)c, Scalar(0, 255, 0), 1);
}
namedWindow(*itDesc + label, WINDOW_AUTOSIZE);
imshow(*itDesc + label, result);