logo

Crowdly

Browser

Add to Chrome

#include "opencv2/opencv.hpp" using namespace cv; int main(int argc, cha...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

#include "opencv2/opencv.hpp"

using namespace cv;

int main(int argc, char** argv)

{

    Mat image = imread("blob.jpg", IMREAD_GRAYSCALE);

    imshow("Original", image);

    SimpleBlobDetector::Params params;

    params.minThreshold = 0;

    params.maxThreshold = 255;

    params.filterByColor = true;

    params.blobColor = 0;

    params.filterByArea = true;

    params.minArea = 1000;

    params.filterByCircularity = true;

    params.minCircularity = 0.5;

    params.filterByConvexity = true;

    params.minConvexity = 0.67;

    params.filterByInertia = true;

    ...

    vector <KeyPoint> keypoints;

    SimpleBlobDetector detector(params);

    detector.detect(image, keypoints);

    Mat image_with_keypoints;

    drawKeypoints(image, keypoints, image_with_keypoints, Scalar(0, 0, 255),

                             DrawMatchesFlags::DRAW_RICH_KEYPOINTS);

    imshow("Keypoints", image_with_keypoints);

    waitKey(0);

    destroyAllWindows();

    return 0;

}

Для наведеного вище коду вкажіть рядок, який треба вставити на місці ..., щоб комп’ютерна програма мовою Python за допомогою бібліотеки OpenCV реалізовувала до файлу з іменем “blob.jpg” з поточної папки виявлення крапель на зображенні, що представлено вище на рисунку:

More questions like this

Want instant access to all verified answers on exam.nuwm.edu.ua?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome