why not improve the parseInputs function which uses strmatch ?

I wrote a matlab code that uses the bwtraceboundary function. In my code this function needs to be called a really large number of times. When I use the profiler to check timing of my code, I find that bwtraceboundary uses the parseInputs function which in turn calls for
if strmatch(string, validStrings{i})
And this line constitutes a significant part of the CPU time.
While STRMATCH is slow and not recommended by MATLAB, I am wondering if MATLAB can modify the parseInputs function in terms of the string compare. Thanks!

回答 (1 件)

Image Analyst
Image Analyst 2013 年 7 月 12 日

0 投票

Why are you using bwtraceboundary() instead of bwboundaries? I never use bwtraceboundary().

1 件のコメント

Zhibing
Zhibing 2013 年 7 月 12 日
Hi, in my case I need to specify the initial staring pixel and the starting direction as well as the connection number. This leaves me the choice of bwtraceboundary(). Thanks.

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeCharacters and Strings についてさらに検索

質問済み:

2013 年 7 月 12 日

Community Treasure Hunt

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

Start Hunting!

Translated by