3D-Image Processing find() several values performance

조회 수: 1 (최근 30일)
Matthias Walle
Matthias Walle 2019년 9월 30일
답변: Kritika Bansal 2019년 11월 8일
Basically I am trying to optimize this minimal example:
I am aware of histc() or histcounts(), however I require a linear index.
in contrast to this example the count of indices{} varies.
% Original size is 600x600x600
s=100;
% A is a binned greyscale image
A=repmat(magic(s),[1 1 s]);
% b is basically the bins
b=unique(A);
indices=cell(length(b),1);
tic
parfor i=1:length(b)
indices{i}=find(A==b(i));
end
toc
Performance is really poor on 16 cores. What am I missing?
Also tried replacing find with the mex function from fileexchange
Happy for all suggestings, I have a full license.
Cheers,
matt

답변 (1개)

Kritika Bansal
Kritika Bansal 2019년 11월 8일
Hi,
You can try creating a parallel.pool.Constant and see if that helps you. You can find more information on the link below:

카테고리

Help CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by