Local histogram equalization in matlab

8 ビュー (過去 30 日間)
Hossein Mohamadi
Hossein Mohamadi 2020 年 11 月 4 日
回答済み: Subhadeep Koley 2020 年 11 月 4 日
Hi.how can i histeq in a rectangular region in an image without any cheang in other pixels. I need code . thanks

回答 (1 件)

Subhadeep Koley
Subhadeep Koley 2020 年 11 月 4 日
The below code might help.
% Read the image
img = imread('cameraman.tif');
% Extract your Region-Of-Interest (ROI)
ROI = img(50:200, 50:200); % Change these values according to your need
% Perform histogram equalization on the ROI
histEqROI = histeq(ROI);
% Replace original ROI histogram equalizated ROI
resImg = img;
resImg(50:200, 50:200) = histEqROI;
% Display results
figure
subplot(1, 2, 1)
imshow(img)
title('Original image')
subplot(1, 2, 2)
imshow(resImg)
title('ROI histogram equalizated image')

カテゴリ

Help Center および File ExchangeImage Filtering and Enhancement についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by