[pixkit image] attack: Image attack simulation - yunfuliu/pixkit GitHub Wiki

addWhiteNoise

Add white noise to each raw pixel.

C++: bool addWhiteNoise(const cv::Mat &src,cv::Mat &dst,const double maxMag)

Parameters:

  • src - The source image.
  • dst - The destination image.
  • maxMag - The largest magnitude (unit: pixel value) of the noise to each pixel.

Example:

addWhiteNoise(src,dst,30);