adding noise to images
조회 수: 1 (최근 30일)
이전 댓글 표시
hi
i need to add x% noise ONLY to black areas of my image (image is grayscale) so x% of the black areas be replaced with white (changing 0 to 255)
댓글 수: 0
답변 (1개)
David Hill
2021년 4월 15일
편집: David Hill
2021년 4월 15일
black=find(image==0);
white=randperm(length(black),floor(x/100*length(black)));
image(white)=uint8(255);
댓글 수: 2
David Hill
2021년 4월 15일
편집: David Hill
2021년 4월 15일
You could put in a range. My guess is that you think it is black but is not (==0).
black=find(image<10);%change range until you are satisfied.
참고 항목
카테고리
Help Center 및 File Exchange에서 Convert Image Type에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!