Creating a probability map for an image

조회 수: 4 (최근 30일)
OphirP
OphirP 2018년 6월 25일
I have an image ("img") and two arrays - x axis as the pixel intensity and y axis as the probability of a pixel with this intensity to have some property (x and y form a PDF). I want to create a matrix ("map") with the size of img where on each position there's the probability of the pixel in that position on img to have the property, means: map(p) = y(img(p)). I've attempted to use a container map but the performance is very bad and it takes approx. 3 seconds per image to execute (bellow - unique image values is x, Fpdf is y). Is there any better way to achieve this?
MF = containers.Map(unique(img,'sorted'),Fpdf);
FGprobMap = zeros(size(img));
for i=(1:size(img,1))
for j=(1:size(img,2))
pixB = MF(img(i,j));
FGprobMap(i,j) = pixG;
end
end

답변 (0개)

카테고리

Help CenterFile Exchange에서 Images에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by