Info

This question is closed. Reopen it to edit or answer.

Noise to Image Object

1 view (last 30 days)
Kelsey
Kelsey on 26 Feb 2020
Closed: MATLAB Answer Bot on 20 Aug 2021
Hello! I am a little rusty on my matlab and would love any and all feedback. I am creating a new image using smaller images (think collage style). I am happy with the output image. However, I would like to add gaussian noise to the output image. I am having issues because the imnoise function does not work with an image object datatype. I'm sure there is an easy solution but I can't seem to find exactly what I am looking for. Thanks in advance.
image(B_1);
hold on
image(pos, pos2 , Hit_1);
image(pos5, pos6, Hit_2);
image(pos3, pos4, Noise1);
rectangle('Position', [pos pos2 s s], 'EdgeColor','r')
rectangle('Position', [pos3 pos4 s2 s2], 'EdgeColor','r')

Answers (1)

Prabhan Purwar
Prabhan Purwar on 2 Mar 2020
Hello,
Following code may help
C = imread('ngc6543a.jpg');
ni=imnoise(C,'gaussian');
imshow(ni)
imshow(C)
Kindly make use of imwrite() to convert file into jpg format as shown
A = rand(50);
imwrite(A,'myGray.png')
Following links may help

This question is closed.

Community Treasure Hunt

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

Start Hunting!