Can we apply histogram equalization on the HSV image?
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I have an HSV image.. and i want to apply histogram equalization on this image.. is it possible?
0 Kommentare
Antworten (2)
Walter Roberson
am 27 Okt. 2015
Yes, you can apply histogram equalization to any numeric array.
0 Kommentare
Image Analyst
am 19 Sep. 2021
Yes, though the results might look pretty strange unless you applied it to only the V channel, like this:
clc; % Clear the command window.
close all; % Close all figures (except those of imtool.)
clear; % Erase all existing variables. Or clearvars if you want.
workspace; % Make sure the workspace panel is showing.
format long g;
format compact;
fontSize = 15;
fprintf('Beginning to run %s.m ...\n', mfilename);
rgbImage = imread('peppers.png');
subplot(2, 1, 1);
imshow(rgbImage);
impixelinfo; % Show RGB as you mouse over image.
title('Original RGB Image', 'FontSize', fontSize);
% Convert to HSV color space.
hsvImage = rgb2hsv(rgbImage);
% Do histogram equalization on only the V channel.
newV = histeq(hsvImage(:, :, 3));
hsvImage(:, :, 3) = newV;
% Convert back to RGB color space.
newRGBImage = hsv2rgb(hsvImage);
subplot(2, 1, 2);
imshow(newRGBImage);
impixelinfo; % Show RGB as you mouse over image.
title('New RGB Image', 'FontSize', fontSize);
g = gcf;
g.WindowState = 'maximized';
fprintf('Done running %s.m.\n', mfilename);
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/743264/image.png)
0 Kommentare
Siehe auch
Kategorien
Mehr zu Histograms finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!