1 Star 0 Fork 0

lewlovehow / Learning-OpenCV-3_examples

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
example_02-05.cpp 1.25 KB
一键复制 编辑 原始数据 按行查看 历史
Gary Bradski 提交于 2017-06-30 18:24 . adding headers and output
// Example 2-5. Loading and then smoothing an image before it is displayed on the screen
#include <opencv2/opencv.hpp>
void help(char** argv ) {
std::cout << "\n"
<< "2-05: load and smooth an image before displaying \n"
<< argv[0] <<" <path/video>\n"
<< "For example:\n"
<< argv[0] << " ../tree.avi\n"
<< std::endl;
}
int main( int argc, char** argv ) {
if (argc != 2) {
help(argv);
return 0;
}
// Load an image specified on the command line.
//
cv::Mat image = cv::imread(argv[1],-1);
// Create some windows to show the input
// and output images in.
//
cv::namedWindow( "Example 2-5-in", cv::WINDOW_AUTOSIZE );
cv::namedWindow( "Example 2-5-out", cv::WINDOW_AUTOSIZE );
// Create a window to show our input image
//
cv::imshow( "Example 2-5-in", image );
// Create an image to hold the smoothed output
//
cv::Mat out;
// Do the smoothing
// ( Note: Could use GaussianBlur(), blur(), medianBlur() or
// bilateralFilter(). )
//
cv::GaussianBlur( image, out, cv::Size(5,5), 3, 3);
cv::GaussianBlur( out, out, cv::Size(5,5), 3, 3);
// Show the smoothed image in the output window
//
cv::imshow( "Example 2-5-out", out );
// Wait for the user to hit a key, windows will self destruct
//
cv::waitKey( 0 );
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/lewlovehow/Learning-OpenCV-3_examples.git
git@gitee.com:lewlovehow/Learning-OpenCV-3_examples.git
lewlovehow
Learning-OpenCV-3_examples
Learning-OpenCV-3_examples
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891