- Store a set of images in a folder and save the header file in the same folder.
- Store all the information that you want in header file inside a MATLAB struct and write that struct to a json file.
- Whenever you want to share the set of images, share the entire folder.
How do I create a header file that is associated with a set of images captured from a camera?
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Scott Kaiser
el 20 de En. de 2023
Comentada: Scott Kaiser
el 23 de En. de 2023
I have been asked to acquire and store a set of images for processing in matlab. I need to have an associated header file that contains general information about this set of images (number of images, rows, columuns, time, etc). What is the best way to accomplish this and how do I keep these images "attached" to this header file? Im new to image processing and could use a little guidance on how to do this. If further clarification is needed please let me know!
Kind Regards
0 comentarios
Respuesta aceptada
Aditya
el 23 de En. de 2023
Editada: Aditya
el 23 de En. de 2023
Hi Scott,
I understand that you want to understand how to organize the image data that you are acquiring. At the end it all depends on your personal preference. Here is a general practice that I have seen being followed in computer vision community:
Organizing data
The set of images will be stored in a folder. The folder will contain the header file. This is the simplest way to keep the images "attached to the header file". Here is the folder structure. Whenever you share the dataset, you will share the entire folder. All programming languages, including MATLAB have excellent support for file/folder operations.
root
|-- image set-1
|-- image-1.png
|-- image-2.png
|-- ...
|-- header file
|-- image set-2
|-- image-1.png
|-- image-2.png
|-- ...
|-- header file
|-- ....
|-- ....
|-- image set-n
|-- image-1.png
|-- image-2.png
|-- ...
|-- header file
Header File
This is also based on your preference. My preferred way of doing this is to use json files because of following reasons:
json files are easy to read in programming languages. You can directly load contents of a json file to a struct using jsondecode. A simple example showing same :
function result = read_json(fname)
fid = fopen(fname);
raw = fread(fid,inf);
str = char(raw');
fclose(fid);
result = jsondecode(str);
end
Similarly, you can easily write a MATLAB struct to a json file using jsonencode as shown in documentation examples.
json files are easy to share. They are human readable and can be understood by simply opening them. All programming languages have excellent support for reading and writing to a json file.
To summarize
Más respuestas (0)
Ver también
Categorías
Más información sobre JSON Format en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!