How can i get the minimum and maximum values of h,s and v of HSV image?
Show older comments
im working on a colour scale to determine the standard of my data(rgb images) and i have successfully converted my rgb image to hsv image. now to complete my colour scale, i need to find the range of each component of hsv by finding the minimum and maximum values for h, s and v of the converted image and display it in text form..but how do i do that?
i manage to find the min for RGB values but stuck on finding min and max of HSV values. below is some of my coding:
data=fopen('minvaluesRGB.txt','w+');
I_HSV = rgb2hsv(I_RGB);
slice_reshape=reshape(I_HSV,[],3);
[unique_RGB,m,n]=unique(slice_reshape,'rows');
minRGB2=sort(unique_RGB(:,:,1));
minRGB22=minRGB2(2,:);
[R]=minRGB22(:,1);
[G]=minRGB22(:,2);
[B]=minRGB22(:,3);
fprintf(data,'%f',[R]);
fprintf(data,'\n');
fprintf(data,'%f',[G]);
fprintf(data,'\n');
fprintf(data,'%f',[B]);
fprintf(data,'\n');
thanks.
Accepted Answer
More Answers (0)
Categories
Find more on Convert Image Type in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!