当前位置:网站首页>Get to know opencv4.x for the first time --- add Gaussian noise to the image
Get to know opencv4.x for the first time --- add Gaussian noise to the image
2022-07-25 09:47:00 【F l e】
// Add Gaussian noise to the image
#include <stdio.h>
#include <iostream>
#include <string>
#include <opencv2\opencv.hpp>
using namespace std;
using namespace cv;
int main()
{
// The distribution probability density of noise in the image satisfies Gaussian distribution
Mat img = imread("person3.jpeg");// Read the three channel image
namedWindow(" Original picture ", WINDOW_NORMAL);
imshow(" Original picture ", img);
// Generate a size with the original image , Gaussian noise image of the same type
Mat noise = Mat::zeros(img.rows, img.cols, img.type());
RNG rng;
rng.fill(noise, RNG::NORMAL, 10, 20);// establish RNG Class is to be able to call fill The function is used to generate random numbers with Gaussian distribution
// Adding the noise image and the original image can produce Gaussian noise effect
img = img + noise;
namedWindow(" Gauss diagram ", WINDOW_NORMAL);
imshow(" Gauss diagram ", img);
waitKey(0);
return 0;
}

边栏推荐
猜你喜欢

如何安装pytorch?—— 一种最简单有效的方法!

Job 7.15 shell script

Prim minimum spanning tree (diagram)

CoreData存储待办事项

初识Opencv4.X----在图像上绘制形状

First acquaintance with opencv4.x --- ROI interception

OC -- Foundation -- array
![[data mining] Chapter 3 basis of data analysis](/img/ec/5d988371ea19919148ab6ef4d0247d.png)
[data mining] Chapter 3 basis of data analysis

How to install pytorch—— A most simple and effective method!

初识Opencv4.X----为图像添加高斯噪声
随机推荐
Android 如何使用adb命令查看应用本地数据库
Student management system (summary)
[code source] add brackets to the daily question
@3-1 CCF 2020-09-1 scale detection point query
@1-1 CCF 2021-04-1 gray histogram
SurfaceView 闪屏(黑一下问题)
关于C和OC
matlab绘图|坐标轴axis的一些常用设置
CoreData存储待办事项
1094 - Google recruitment
@4-1 CCF 2020-06-1 linear classifier
【降维打击】希尔伯特曲线
First knowledge of opencv4.x --- image histogram drawing
服务器cuda toolkit多版本切换
[deep learning] self encoder
[code source] daily question - queue
UI - infinite rotation chart and column controller
【深度学习】自编码器
【Android studio】批量数据导入到android 本地数据库
[deep learning] convolutional neural network