Create bagofFeatures for code generation

1 vue (au cours des 30 derniers jours)
Michael Sorocky
Michael Sorocky le 20 Juin 2023
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 commentaires
Anush
Anush le 20 Juin 2023
You can try checking out the code with:
edit bagOfFeatures.m
Sahithi Kanumarlapudi
Sahithi Kanumarlapudi le 8 Sep 2023
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.

Connectez-vous pour commenter.

Réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by