Hi, I need some explanation for the following code we wrote in class today:
function [imageMapped] = L1_image_map(image,T)
imageMapped = zeros(size(image));
for channel = 1:size(image,3)
for ii= 1:size(image,1)
for jj=1:size(image,2)
imageMapped(ii,jj, channel)=T(image(ii,jj,channel) +1,channel);
end
imageMapped = im2uint8(imageMapped);
end
end
end
Where T is the transformation function T=255*CDF. Thanks!

 채택된 답변

Image Analyst
Image Analyst 2017년 12월 6일
편집: Image Analyst 2017년 12월 6일

0 개 추천

Why should there be T=255*CDF? You'd use the CDF to create T if you were doing a histogram equalization, but this function doesn't do that (unless you passed in a T of that).
This code is basically a look up table operation, the kind of thing done by the function intlut(). It changes the gray level of the image based on what the value is in the index of T. For example if T(5) is 100, then a gray level of 4 would get mapped/changed to a gray level of 100.
  1. T(1) is the new gray level for pixels with a value of 0.
  2. T(2) is the new gray level for pixels with a value of 1.
  3. T(3) is the new gray level for pixels with a value of 2.
  4. etc.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Histograms에 대해 자세히 알아보기

질문:

2017년 12월 6일

편집:

2017년 12월 6일

Community Treasure Hunt

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

Start Hunting!

Translated by