logo

Crowdly

Browser

Add to Chrome

#include<opencv2/opencv.hpp> using namespace cv; int main() {     Mat im...

✅ 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()

{

    Mat image = imread("image.jpg");

    imshow('Original image', image);

    Mat image_gray;

    ...

    Mat image_thresh;

    threshold(image_gray, image_thresh, 150, 255, THRESH_BINARY);

    vector<vector<Point>> contours;

    vector<Vec4i> hierarchy;

    findContours(image_thresh, contours, hierarchy, RETR_TREE,

                         CHAIN_APPROX_NONE);

    Mat image_contours_objects = image.clone();

    drawContours(image_contours_objects, contours, -1, Scalar(0, 255, 0), 2);

    imwrite("contours_objects_image.jpg", image_contours_objects);

    imshow("The outlines of the objects in the image are found", image_copy);

    waitKey(0);

    destroyAllWindows();

    return 0;

}

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

0%
0%
0%
100%
0%
0%
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