Some small trouble with systems objects in Embedded MATLAB functions

1 次查看(过去 30 天)
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.

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Computer Vision with Simulink 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by