Creating a probability map for an image

5 ビュー (過去 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 Center および File ExchangeImages についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by