Why does imtophat fail code generation when not using dynamic memory allocation?

7 views (last 30 days)
Using MATLAB Coder in 2015b, the following line:
A = imtophat(R, strel('disk',3));
Where R is a grayscale image in a 1200 x 1200 matrix
Leads to a failure that MATLAB Coder is unable to effectively describe (the error at that line is simply, "Function call failed").
Within MATLAB code, in morphop it complains "varargin and varargout are not supported here."
Further in "NeighborhoodProcessor", it complains "Logical indexing requires support of variable-sized arrays, which is currently disabled."
According to the MATLAB documentation I have satisfied the Coder requirements for imtophat, that the image is 3D or less and the structuring element is a compile time constant.
Turning on dynamic memory allocation allows code generation to proceed, but for obvious reasons I'd like to avoid that if possible.
So why is Coder having difficulty here?
  1 Comment
Anish Mitra
Anish Mitra on 23 Feb 2016
Hi,
I am able to reproduce the error with a simple example. You could consider contacting MathWorks Technical Support in your region with a simple reproduction model.

Sign in to comment.

Answers (0)

Categories

Find more on MATLAB Coder in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!