Follow on Facebook

header ads

How to find average H, S, V from HSV image?



In this post, i will show you how to find average of H, S, V from HSV image. for more understanding see below code.

clear;
 close all;
 clc;

 img = imread('C:\Users\US\Desktop\CompVision\images\lenna.jpg');
 %imresize(img,[200 200]);
 img = rgb2hsv(img);
 figure('units','normalized','outerposition',[0 0 1 1]),
 subplot(221), imshow(img), title('Lenna Image');

 [r, c, ch] = size(img);
 img_H =img(:,:,1);
 subplot(222), imshow(img_H), title('Channel H');
 img_S =img(:,:,2);
 subplot(223), imshow(img_S), title('Channel S');

 img_V =img(:,:,3);
 subplot(224), imshow(img_V), title('Channel V');









Post a Comment

0 Comments