MATLAB: Hi, i have an image that contain noise which i have extracted from another image, i want to write the noisy pixel values into a separate .txt file, can anyone help me out with it please

image noiseimage processingImage Processing Toolbox

Best Answer

What does that mean??? Do you want a CSV file with x, y, gray level? Or row, column, gray level? How are you defining which ones are the noise pixels? Since you've already extracted this image from another image can we assume that every pixel in here is considered noise? So if it's not zero, it's noise?
Did you try find() and csvwrite()?
[rows, columns, grayLevels] = find(grayImage);
data = [rows(:), columns(:), grayLevels(:)]; % Stitch together into a matrix, each pixel on one row.
csvwrite(filename, data);