GaussianBlur(帧,帧,大小(10,10), 1.0);错误:“大小”未在此范围内声明
一段时间后返回C ++,无法通过此错误解决问题。请帮忙。
#include "opencv2/highgui/highgui.hpp"
#include <opencv2/imgproc.hpp>
#include <opencv2/core/types.hpp>
#include <iostream>
int main() {
constexpr int device_id = 0;
cv::VideoCapture input_stream(device_id);
if (!input_stream.isOpened()) {
std::cerr << "Could not open camera" << std::endl;
return EXIT_FAILURE;
}
const std::string window_title = "CT";
cv::namedWindow(window_title, cv::WINDOW_GUI_NORMAL);
cv::Mat frame;
while (true) {
input_stream >> frame;
if (frame.empty()) {
std::cerr << "The camera returned an empty frame, please check the camera" << std::endl;
break;
}
GaussianBlur(frame, frame, Size(10,10), 1.0);
//blur(frame, blurredFrame, Size(3,3));
//cv::imshow(window_title, frame);
cv::imshow(window_title , frame);
constexpr int delay_ms = 15;
if (cv::waitKey(delay_ms) >= 0) { break; }
}
return EXIT_SUCCESS;
}
错误:在此范围内未宣布“大小”,
GaussianBlur(frame, frame, Size(10,10), 1.0);
预计将获得高斯布鲁结果
P.S.似乎解决方案是使用CV ::大小
getting back to C++ after a while and cannot resolve an issue with this error. Please kindly help.
#include "opencv2/highgui/highgui.hpp"
#include <opencv2/imgproc.hpp>
#include <opencv2/core/types.hpp>
#include <iostream>
int main() {
constexpr int device_id = 0;
cv::VideoCapture input_stream(device_id);
if (!input_stream.isOpened()) {
std::cerr << "Could not open camera" << std::endl;
return EXIT_FAILURE;
}
const std::string window_title = "CT";
cv::namedWindow(window_title, cv::WINDOW_GUI_NORMAL);
cv::Mat frame;
while (true) {
input_stream >> frame;
if (frame.empty()) {
std::cerr << "The camera returned an empty frame, please check the camera" << std::endl;
break;
}
GaussianBlur(frame, frame, Size(10,10), 1.0);
//blur(frame, blurredFrame, Size(3,3));
//cv::imshow(window_title, frame);
cv::imshow(window_title , frame);
constexpr int delay_ms = 15;
if (cv::waitKey(delay_ms) >= 0) { break; }
}
return EXIT_SUCCESS;
}
error: ‘Size’ was not declared in this scope
GaussianBlur(frame, frame, Size(10,10), 1.0);
expected to get GaussianBlur results
P.S. seems like solution is to use cv::Size
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
PS似乎解决方案只是使用CV ::大小
P.S. seems like solution is just to use cv::Size