Borrar filtros
Borrar filtros

combine the string and number

1 visualización (últimos 30 días)
weam
weam el 2 de Feb. de 2023
Comentada: weam el 6 de Feb. de 2023
hello, I have the coordinates of objects in the image and the path of the image and I want to combine all these in the cell array
trainingData = combine(bldsTrainT,bldsTrainW); % this function to combine
when adding the path of the image, display the error
how can instead this function with others to accept the path

Respuesta aceptada

Walter Roberson
Walter Roberson el 2 de Feb. de 2023
Are you referring to combine for augmented image data store?
If so then each element you combine, such as bldsTrainT, must be a data store, not a path itself. You would imageDatastore to wrap the path into an image data store and combine.
  8 comentarios
Walter Roberson
Walter Roberson el 5 de Feb. de 2023
insertShape only permits a cell array for "line", "polygon", or "filled-polygon". If you want to plot more than one rectangle you need to use a numeric array
RGB = insertShape(I,'Rectangle', [bbox1; bbox2] );
weam
weam el 6 de Feb. de 2023
Thank you so much

Iniciar sesión para comentar.

Más respuestas (1)

Aylin
Aylin el 2 de Feb. de 2023
Editada: Aylin el 2 de Feb. de 2023
Hi, I wanted to second Walter's answer which will work best if you want to read the filenames as image data.
However if you do really want the raw filenames in the CombinedDatastore, you can use ArrayDatastore to wrap the filenames before calling combine:
filenames = {'file1.png' 'file2.png'}';
filenameDs = arrayDatastore(filenames, OutputType="same");
trainingData = combine(bldsTrainT,bldsTrainW, filenameDs);
% Or use "transform" to get more control over the combination method
trainingData = transform(bldsTrainT, bldsTrainW, filenameDs, ...
@(trainT, trainW, filename) {trainT trainW filename});
Is this what you're looking for?

Productos


Versión

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by