Skip to content

Conversation

l-bat
Copy link

@l-bat l-bat commented Oct 26, 2017

No description provided.

@valentina-kustikova
Copy link
Contributor

@SolarSystem23, мне надо запустить ваш код и на что-то посмотреть/помочь исправить?

@l-bat
Copy link
Author

l-bat commented Oct 27, 2017

Посмотреть корректность кода

cv::merge(channels, dst_roi);
dst_roi.copyTo(src_copy_roi);
return src_copy;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Реализацию методов необходимо вынести из заголовочного файла в файл реализации.


std::fill(channels.begin(), channels.end(), dst_gray_roi);
cv::Mat dst_roi;
cv::merge(channels, dst_roi);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Мне кажется, что можно было просто написать merge(dst_gray_roi, dst_gray_roi, dst_gray_roi, dst_roi), операция слияния перегружена.


const char* kAbout =
"This is an empty application that can be treated as a template for your "
"own doing-something-cool applications.";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Содержательная строка, описывающая функционал, осталась от шаблона.

#include <opencv/cv.hpp>
#include <image_processing.hpp>

#include "opencv2/core.hpp"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Общие правила по стилю кодирования предполагают, что сначала подключаются системные библиотеки, потом библиотеки третьих разработчиков, потом собственные библиотеки.

#include <iostream>
#include <string>
#include <opencv/cv.hpp>
#include <opencv2/core.hpp>
#include <image_processing.hpp>

Отличие угловых скобок и кавычек при подключении следующее: кавычки используются, если файл лежит в текущей директории, угловые скобки, когда заголовочные файлы лежат по подключаемым путям.

// Do something cool.
cv::namedWindow("input");
cv::setMouseCallback("input", onMouse);
cv::Mat input = cv::imread("/home/luba/Downloads/Lenna.jpg");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Название файла должно быть передано через аргументы командной строки приложения.

break;
}
ImageProcessorImpl processor;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Что-то форматирование поплыло.

@valentina-kustikova
Copy link
Contributor

@SolarSystem23, у меня ваш код не собирается. Надо добиться того, чтобы код компилировался и выполнял базовые сценарии.


CascadeDetector detector;
//("../test/test_data/detection/cascades/intel_logo_cascade.xml");
detector.Init("/home/luba/github/itseez-ss-2016-practice/test/test_data/detection/cascades/unn_old_logo_cascade.xml");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Надо передать модель через параметры командной строки.

detector.Init( filePathDetector);
}*/

CvCapture* capture = cvCreateCameraCapture(CV_CAP_ANY);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тип CvCapture - это старый тип, сейчас есть VideoCapture, у которого перегружены операции потокового ввода/вывода. Можно посмотреть пример использования в документации.

CvCapture* capture = cvCreateCameraCapture(CV_CAP_ANY);
assert( capture );
IplImage* frame=0;
cvNamedWindow("capture", CV_WINDOW_AUTOSIZE);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Аналогично это старая версия, новая версия namedWindow


CvCapture* capture = cvCreateCameraCapture(CV_CAP_ANY);
assert( capture );
IplImage* frame=0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Для представления изображения используется тип Mat

@@ -0,0 +1,96 @@
#include <iostream>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Почему этот файл оказался в ветке с лабораторной работой по обработке?!

@valentina-kustikova
Copy link
Contributor

@SolarSystem23, надо разбить версии по веткам (сейчас все лабы в одном месте).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants