Clear Filters
Clear Filters

Some small trouble with systems objects in Embedded MATLAB functions

2 views (last 30 days)
I'm sorry I've been asking alot of questions on the forums it just helps me get more done faster then spending hours sorting through documentation. So I have the following code in an Embedded Matlab functions. In which it takes an images the number of objects in that image and then isolates the individual objects into new seperate images the variables it imports are boxes which are the dimensions of the bbox for each object. Count; the number of objects in the image and baseimage or the core image containing the objects. It outputs a array of images called just plained old images. I'm having some trouble with systems object vision.ShapeInserter and this is the following error I get when running it:
*Reported by vision.ShapeInserter: This System object (or its current configuration) does not support variable input sizes.
Function 'MATLAB Function2' (#41.573.593), line 27, column 17: "step(h, image, Cord)" Launch diagnostic report.*
and
*Code Directory : "C:\Users\Linus\Documents\MATLAB\slprj\_sfprj\Draft1\_self\sfun\src"
Machine (#17): "Draft1" Target : "sfun"*
The line of code it is reffering to is noted below:
function images = fcn(boxes,c,baseimage)
%#codegen
persistent h;
if isempty(h)
h = vision.ShapeInserter('Fill',true,'Opacity',1.0);
end;
count = c(:,1);
image = baseimage(:,:,1);
dim = size(baseimage);
x = dim(1,1);
* y = dim(1,2);
images = zeros(x,y,count);
Pts = zeros(4,(count - 1));
Cord = zeros(4,1);
for g = 1:count
l = 1;
image = baseimage(:,:,1);
for f = 1:count
if(g == f)
continue;
end
Pts(:,l) = (boxes(:,f));
l = l + 1;
end
for s = 1:(count - 1)
Cord = rot90(Pts(:,s));
image = step(h, image, Cord);(This I think its problem with Cord)
end
images(:,:,g) = image;
end
This error only occurs in Simulink and not with Matlab one thing to note is that this simulation is being run in struct with time as it data import export parameters any assistance would be greatly appreciated.
  1 Comment
Kaustubha Govind
Kaustubha Govind on 28 Jul 2011
See if you can set a breakpoint and examine if one of the inputs is changing size between time-steps?

Sign in to comment.

Answers (0)

Categories

Find more on Image Processing and Computer Vision in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!