Image processing loop after loop
Show older comments
first post ever, and im kinda desperate ...
So there is my code, and i know i can do it by a simple function. But its not the point of the task i have ;(
And my question is how to show an image here correctly. cause disp(array) works perfectly, it shows whole array in matlab window with values from 1 to 255, lovely. But when i want to show it as an image (with imshow after mat2gray) its either black for Imagemy2(n,k)=0; or white for anything else i want to put there. Thank you for your help :)
ImageBasic = imread('rentgen.jpg');
Imagemy = imresize(ImageBasic,[40 40]);
array = zeros(40,40);
Imagemy2= mat2gray(array);
K = 40;
N = 40;
for k=1:K
for n=1:N
Imagemy2(k,n)=Imagemy(k,n);
end
end
disp(Imagemy2);
figure(2);
subplot(121)
imshow(Imagemy);
subplot(122)
imshow(Imagemy2);
Accepted Answer
More Answers (0)
Categories
Find more on Image Arithmetic in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!