Importing pixel array in Excel and creating an image
7 次查看(过去 30 天)
显示 更早的评论
Hello everyone,
A MATLAB beginner here. I would like to ask a quick question. I believe this is simple for a lot of you folks. I have an image in the form of pixel array in Excel sheet. I wish to create an image from this and also be able to set a certain threshold so that the numerical values of any pixels that do not meet the threshold become zero.
I really really appreciate everyone's help in advance!
采纳的回答
Image Analyst
2018-11-9
Try this:
data = importdata('AuL_1.csv', ',', 5);
grayImage = data.data;
subplot(2, 2, 1);
imshow(imadjust(grayImage), []);
subplot(2, 2, 2);
histogram(grayImage);
grid on;
threshold = 4;
mask = grayImage < threshold;
% Erase mask pixels.
grayImage(mask) = 0;
subplot(2, 2, 3);
imshow(imadjust(grayImage), []);

4 个评论
Image Analyst
2018-11-9
编辑:Image Analyst
2018-11-9
Yes, just use ind2rgb() to create an RGB image. Or you can keep it grayscale and just use colormap() to change the way it's displayed.
更多回答(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!