Cannot generate code for indexing expression where the index has unknown size and underlying cell array is not homogeneous.
1 回表示 (過去 30 日間)
古いコメントを表示
Hi,
I am trying to generate code for clusterDetections algorithms. But i'm getting errors for unknown size.
Please someone guide mw how to solve this. i'm attaching the screenshots of the error for reference
3 件のコメント
Walter Roberson
2020 年 7 月 20 日
It appears that updateTracks does expect a cell array of detections, so you will have to switch back to that.
I also see that for code generation, "All the detections used with a multi-object tracker must have properties with the same sizes and types".
I am far from sure, but it looks to me as if the detections you were creating might be different sizes -- you are generating your meas2D based upon the content of the image, and maybe the number of pixels covered need to be the same for each of the objects ??
This is speculation, something you could try; I have never used that toolbox.
回答 (1 件)
Prasanth
2020 年 11 月 24 日
Hi Vimal,
I understand that the function 'updateTracker' is not accepting arguments of type struct array during code generation.
Since C/C++ are statically typed languages, the fields, their types and sizes of the structure variables/arguments should be known at compile time for code generation to succeed.
In your case, the fields of the structure you are passing into the function is unknown at compile time, since it is dependent on the output of the 'clusterDetections' function that is known at run time.
If the fields of the structure is known and do not change, try predefining the variable 'detectionClusters' as an struct array and pass it as an argument into the function 'updateTracker'.
The following documentation page gives more insights on implementing the same.
Hope this helps.
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!