Sorry if this seems a trivial question but I am new to MATLAB and getting no help from elsewhere. All suggestions will be gratefully received and tried.
Replace pixels in a matrix without using histeq
1 回表示 (過去 30 日間)
古いコメントを表示
I have a greyscale image that is 291 x 240. I have been tasked with performing histogram equalization but WITHOUT using histeq. We have been told to use a nested for loop to access each pixel individually (yes, I KNOW that this is not ideal) and replace each value by a lookup table value, T. T is an array of 256 values in the range 0 - 255.
Here is the loop , but apparently the code in the loop does not produce the correct answer. Can anyone please suggest how else I apply T to the pixel I want to transform.
for i = 1:1:r %go through rows
for j = 1:1:c %columns
img_heq(i, j) = intlut(img (i,j), uint8(T));
end
end
採用された回答
Jan
2019 年 7 月 17 日
for i = 1:1:r %go through rows
for j = 1:1:c %columns
img_heq(i, j) = T(img(i,j) + 1);
end
end
3 件のコメント
KALYAN ACHARJYA
2019 年 7 月 17 日
編集済み: KALYAN ACHARJYA
2019 年 7 月 17 日
@Jan Ohh look up table T is already given, which use to map the image, right..
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!