Can imnoise return the indices of locations where noise was added?
1 回表示 (過去 30 日間)
古いコメントを表示
HI everyone,
is there any method in Matlab which can provide the locations of corrupted pixels which are corrupted after manual insertion of noise using imnoise or anyother method?
0 件のコメント
採用された回答
Image Analyst
2013 年 9 月 22 日
With imnoise, no, because it adds noise to every pixel, so the answer is "every pixel". With some other method, if some pixels remain untouched, you can find the changed pixels as a binary image, which is almost always the most convenient form like this:
binaryImage = originalImage ~= noisyImage;
If, for some reason, you want that in a list of coordinates, you can do that with find, like Azzi showed you
if ndims(binaryImage) == 2
[rows, columns] = find(binaryImage
else
[rows, columns, colorChannels] = find(binaryImage);
end
Though this is usually less convenient. For example if you were doing a modified median filter or something, you'd use the binaryImage only, not the coordinates. What are you going to do when you say you need "the locations" so I can tell you what form of "locations" will work best for you?
0 件のコメント
その他の回答 (1 件)
Azzi Abdelmalek
2013 年 9 月 22 日
編集済み: Azzi Abdelmalek
2013 年 9 月 22 日
If Im1 is the original image and Im2 the disturbed one, you can find the indices by
[ii,jj]=find(Im1~=Im2)
%OR
[ii,jj,kk]=find(Im1~=Im2)
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Image Processing Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!