MATLAB Answers

How to convert a .csv file into a MATLAB groundtruth format for different classes of vehicles in a dataset?

83 views (last 30 days)
Muhammad Sanwal
Muhammad Sanwal on 23 Jan 2021
Commented: dpb on 24 Jan 2021
This question was flagged by dpb
Hi. Below is the attached csv file for different classes of vehicles corresponding to their respective images.
When I open this csv file in MATLAB, after running the following code, I get the following view of the table :
T=readtable('C:\Users\Muhammad Sanwal\Desktop\COMSATS\The 9th Semester (FA20)\FYP pt 1\MIO-TCD-Localization\gt_train.csv');
% ^^^^^^^^^------ your csv filename
p=T{:,1};
q=T{:,2};
save('C:\Users\Muhammad Sanwal\Desktop\COMSATS\The 9th Semester (FA20)\FYP pt 1\MIO-TCD-Localization\gt_train.mat','p','q')
% ^^^^^^^^^----- your resulting .mat filename
Figure 1:Table in .csv format:
Figure 2: Table in .mat format
However, I want the table to be in the following format:
Figure 3: Desired format (with bounding boxes to be shown in square brackets)
Since my vehicle dataset contains more than 100000 images, is there a code that can convert the csv file that i have attached into a table of the desired format? Because doing it manually using image labeler takes a lot of time.
For more details, my friend has posted a similar query in the following link:
Kindly help me solve this problem
  5 Comments

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!