why is impoly so slow?

Can someone explain to me why it takes approximately 2.5 seconds for impoly to create a simple object using my 2.8GHz quad core Xeon with 32GB?
See code below:
clear all;
clear classes;
close all;
clc;
I=imread('pout.tif');
figure,imshow(I);
a_iXY=[47,184;39,158;37,58;145,52;163,144;];
hGCA=gca;
tic
hImpoly=impoly(hGCA,a_iXY);
toc

回答 (1 件)

Dan
Dan 2015 年 8 月 10 日

0 投票

I did some digging and found that impoly eventually calls /Applications/MATLAB_R2015a.app/toolbox/images/imuitools/private/polygonSymbol.m which (amazingly) spend almost a full second reading in "point.png" using imread! I think these are just the vertices of the polygon. It seems like this is very wasteful....

カテゴリ

ヘルプ センター および File ExchangeConvert Image Type についてさらに検索

質問済み:

Dan
2015 年 8 月 6 日

回答済み:

Dan
2015 年 8 月 10 日

Community Treasure Hunt

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

Start Hunting!

Translated by