When we read color image information we will get data in rows x cols x 3(RGB color)

I want to extract the min value from separate color

Originally I could do

R = I(:,:,1);
G = I(:,:,2);
B = I(:,:,3);

to extract separate data color and normally find min by

Rmin = min(R(:));

and so on...

but Is there any proper solution to use min?

I tried

min(I(:,:,1:3));

but it didn't right (dimension answer was 1xcolx3 : It should be 1x3)

有帮助吗?

解决方案

My guess is you have to use the nested min. For example use the following command

min(min(I, [], 1), [], 2)

This should give the result you want.

其他提示

Try this:

min(min(min(I,3)))

or for a cleaner output:

squeeze(min(min(min(I,3))))

There is probably a nicer way, without nesting the min function.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top