フィルターのクリア

How can adjust luminosity with HSV?

2 ビュー (過去 30 日間)
Biza Ferreira
Biza Ferreira 2015 年 6 月 16 日
コメント済み: Biza Ferreira 2015 年 6 月 16 日
Hello friends, I have a set of 20 color images and I want to implement some operations.but before working on these images, I must homogenize the luminance (HSV) someone can suggest me a way to do this. I have done the following code, anda I want get the array of all image luminance average, but my problem is since the image is obtained by a for loop when a try change the image in rgb2hsv give me this error
if true
% code
Error using rgb2hsv (line 59)
MAP must be a Mx3 array.
Error in teste (line 15)
hsv = rgb2hsv(a)
end
the code :
if true
% code
clear all, close all, clc;
imgDir = dir(fullfile('','/database/*.jpg'));
outDir = '/resultados/';
imgDimensao = length(imgDir);
data =zeros(1,imgDimensao)
for x = 1:length(imgDir)
handles.images{x}=imread(fullfile('','/database/',imgDir(x).name));
a = imgDir(x).name;
hsv = rgb2hsv(a)
a = mean2(a);
data(x) = a ;
end
data
mean2(data
end

採用された回答

Image Analyst
Image Analyst 2015 年 6 月 16 日
THe badly-named "a" must be an RGB image, not a filename string. And don't use hsv as an image name since it's a built-in function.
rgbImage =imread(fullfile('','/database/',imgDir(x).name));
hsvImage = rgb2hsv(rgbImage);
meanValues(x) = mean2(hsvImage (:,:, 3));
After the loop, you can get the overall mean by doing this:
meanV = mean(meanValues);
  1 件のコメント
Biza Ferreira
Biza Ferreira 2015 年 6 月 16 日
thanks for your time and consideration

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeImage Processing Toolbox についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by