I'm trying to add random noise to an RGB image without using any built in noise functions.

AddRandomNoise: adds random noise to an image.
function [ outImg ] = addRandomNoise( inImg)
The input image inImg has pixel values between 0 and 255 in all three channels R,G and B. This function adds random noise to each pixel and writes out the new image to outImg. The random noise added should be different for every pixel and it should be in the range [-255, 255].

1 Comment

I understand you want to add noise to an image. Can you clarify what type of noise or how the noise should be added? For example, if you look at the following link to the documentation on 'imnoise' it will list a few different options.

Sign in to comment.

Answers (1)

Do you mean you can't use imnoise()? Or, even worse, you can't even use rand(), randi(), and randn()? Why don't you want to use them? They make it so easy.
If you're really wanting to write your own random number generator, then you can find algorithms here in Wikipedia: https://en.wikipedia.org/wiki/Random_number_generation
Also see this:

Asked:

on 15 Oct 2015

Answered:

on 26 Oct 2015

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!