How do i use imnoise localvar?
4 次查看(过去 30 天)
显示 更早的评论
I attached an image of what we are working on right now. We have to extract the 'white ones' on them but our problem is that some part of the image are getting in the way since they have the 'same color' as the ones we want to extract. So I was thinking of inserting a noise then removing it to solve the problem. I was thinking of using 'imnoise localvar' since it somewhat relates to image intensities.
Here is my sample code
I = imread('im0059.ppm');
imshow(I)
J = imnoise(I,'localvar', image_intensity,var) ;
figure, imshow(J)
K = filter2(fspecial('average',3),J)/255;
figure, imshow(K)
L = medfilt2(J,[3 3]);
figure, imshow(L)
I don't know what to put on image_intensity and var. Help please. Also if you have any suggestions on what im doing. Please do tell. Thanks a lot!
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/145276/image.jpeg)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/145277/image.jpeg)
3 个评论
kuldeep desai
2018-7-16
编辑:kuldeep desai
2018-7-16
I = imread('im0059.ppm'); subplot(2,2,1),imshow(I),title('Original Image') I=rgb2gray(I); subplot(2,2,2), imshow(I),title('Gray Image') J = imnoise(I,'localvar',0.04*rand(size(I))) ; subplot(2,2,3), imshow(J),title('Noisy Image') K = filter2(fspecial('average',3),J)/255; L = medfilt2(J,[3 3]); subplot(2,2,4), imshow(L),title('Noise Removal')
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/192175/image.png)
Image Analyst
2018-7-16
Kuldeep, can you put this down in the Answers section along with the other answers instead of up here in the comments section where we usually ask the user to clarify the question? You can also get credit (reputation points) for it down there.
回答(1 个)
Image Analyst
2014-9-4
Why don't you just do trial and error until you get an image that you're happy with?
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!