Show subarray of color image

Given a color image I need to show just a subpart of the image, in matlab this would be something like showing a subarray from array image.

I=imread('lena_std.tif');
imshow(I(1:200,1:200);

With a grayscale image the above code shows correctly the subpart of the image wanted, however with a color image it shows a grayscale image. I know there is a 3° dimension which in a color has a value of 3 (RGB), but I just don't know how to consider that dimension in order to show the subpart in color.

Can you help me please?

Answers


You can add to the code : to address all elements in third dimension:

I=imread('lena_std.tif');
imshow(I(1:200,1:200,:);

Need Your Help

Can I read the link-key table?

java android c bluetooth

I want to save my Bluetooth link-keys table.

Python reportlab not generating pdf properly

python reportlab

I am trying to generate a pdf which will print the font size along with a sentence. But after the pdf is getting generated, it is overlapping.