Borrar filtros
Borrar filtros

How to upload groundTruth?

1 visualización (últimos 30 días)
Thijs Langius
Thijs Langius el 24 de Ag. de 2022
Respondida: Saffan el 7 de Sept. de 2023
I have a question regarding my image recognition project.
I downloaded labeled images. I now have a filemap containg .jpg (images) and .txt files (coordinates of the box).
Example 123_456.jpg, and 123_456.txt.
Txt files contain for ex.:
0 0.578964870010237 0.553121683650408 0.130052151238592 0.24380704041721.
Furthermore I have a structure containing the following info:
Name, Folder, Date, Bytses, Isdir and datenum
How can I merge all coordinates and all names into one struct/matrix?
I want to make a groundTruth with the following function:
gTruth = groundTruth(dataSource,labelDefs,labelData);

Respuestas (1)

Saffan
Saffan el 7 de Sept. de 2023
Hi Thijs,
You can use “readmatrix method to extract the coordinates from the text files and “fileparts” method to extract the name of the images and store them in a structure. Here is an example code snippet:
for i = 1:numberOfFiles
% Read the .txt file and extract the coordinates
coordinates = readmatrix(txtFilePath(i));
% Extract the image name from the file path
[~, imageName, ~] = fileparts(imageFilePath(i));
% Append the name and coordinates to the mergedData struct
mergedData(end+1).Name = imageName;
mergedData(end).Coordinates = coordinates;
end
Please refer this for more information:

Categorías

Más información sobre Convert Image Type en Help Center y File Exchange.

Productos


Versión

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by