%this is my code, and error report
[filename,pathname] = uigetfile({'*.jpg;*.bmp'},'Select an Image');I = imread([pathname filename]);imshow(I);[bw, rgb]=hsvth(I);figure, imshow(bw);figure, imshow(rgb);img1 = imcrop(rgb);img2 = imcrop(rgb);%imshow(img1);
%imshow(img2);
%I=imread('autumn.tif');
%Histogram
R=img1(:,:,1);G=img1(:,:,2);B=img1(:,:,3);figure, subplot(3,1,1)imhist(R)subplot(3,1,2)imhist(G)subplot(3,1,3)imhist(B)%R Value
red_min=min(min(R(:,:,1)))red_max=max(max(R(:,:,1)))%G Value
green_min=min(min(G(:,:,2)))green_max=max(max(G(:,:,2)))%B Value
blue_min=min(min(B(:,:,3)))blue_max=max(max(B(:,:,3)))
Best Answer