Create bagofFeatures for code generation
1 次查看(过去 30 天)
显示 更早的评论
I'm trying to create a bagOfFeatures for use in a script that will be compiled to C code. The help page for bagOfFeatures states:
For code generation, the bagOfFeatures function does not support the ImageDatastore object as input. Instead, specify the input as a structure with fields Images and Labels. The Images field must contain a cell array of grayscale or RGB color images. The Labels field must contain image labels stored as categorical arrays.
As a result, I cannot use the constructers of the form
bag = bagOfFeatures(imds)
However, if I try to create a structure imds with fields Images and Labels as suggested, I recieve the following error when I run
bofData = bagOfFeatures(imds);
Error using bagOfFeatures/parseInputs
The value of 'imds' is invalid. Expected imds to be one of these types:
imageSet, matlab.io.datastore.ImageDatastore
Instead its type was struct.
This seems to indicate I cannot pass a structure as suggested - how can I create a bagOfFeatures using the specified input? I don't see a Name/Value pair related to this.
Thanks in advance!
2 个评论
Sahithi Kanumarlapudi
2023-9-8
Hi Michael,
Could you attach the script that you have used to create the struct and the script you used to do codegen. It would help us in understanding the issue better.
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!