Clear Filters
Clear Filters

C-Code for bwlabel

1 view (last 30 days)
Philipp Lenz
Philipp Lenz on 23 Jul 2019
Commented: Yogesh Khurana on 30 Jul 2019
Hello,
i have a Problem with the C-Code Generation for the bwlabel function.
My input is a binary 200x200 matrix. The Error:
Computed maximum size of output1 of function 'intermediateLabelRuns' is not bounded. Static memory allocation requieres all sizes to be bounded. The computet size is [:? x1]. Function 'bwlabel.m' "startRow".
I get the same Error for "endRow" "startCol" and "labelForEachRun"
For this problem i tried to set an coder.varsize in the copied bwlabel function with an upper bound for the specific variables. In this case i get another Error:
The function 'indexInt' is not supported for standalone code generation. See the documentation for coder.extrinsic to learn how you can use this function in simulation. "coder.internal.indexInt(startRow(k)"
The documentation says that the function is supported for c-code Generation. Do you now how i can handle this ?
Best regards
Philipp Lenz
  1 Comment
Yogesh Khurana
Yogesh Khurana on 30 Jul 2019
I tried reproducing the error using the following code:
img = coder.typeof(logical(0), [inf, inf], [0, 0]);
cfg = coder.config;
codegen -config cfg -args {img} bwlabel -o bwlabelObj
z = bwlabelObj(rand(100) > 0.5);
It seems to be working.
You can also refer to the documentation of coder.typeof for more information on bounded or unbounded inputs:

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!