代码拉取完成,页面将自动刷新
// 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 );
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。