Loop in a array
1 次查看(过去 30 天)
显示 更早的评论
Hi,
I have a question. I have an image with three bands. How can I apply a loop for do an operation to all the pixels?
image1=imread('image_1.tif'); %I've load the image. Has a length of 4x4x3
band1a= image_1(:,:,1);
band2a= image_1( :,:,2);
band3b= image_1(:,:,3);
for i = 1:numel(band1b)
(...) this is the part of the operation
output= ?
Thanks a lot in advance,
5 个评论
回答(1 个)
Image Analyst
2012-11-26
What is image_1? All you have shown up until that point is image1, which is a different variable.
3 个评论
Image Analyst
2012-11-27
Regarding "I know it could be something confusing but what I want is to get this last three values (spout1_c, spout2_c and spout3_c) for every pixel, in every band." How about this:
image1(:, :, 1) = spout1_a;
image1(:, :, 2) = spout1_b;
image1(:, :, 3) = spout1_c;
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!