Image Extraction
Use the code extractSelectedFrame.py to select frames from the videos that collected by the camera.
The images are processed in 4 steps:
Step 1.) Download the code extractSelectedFrame.py.
Step 2.) Extract video frames based on the information in the input index text file (see documentations on the index file).
Home/repos/parse_video_and_sensor_data/src/extractSelectedFrames.py
In Terminal,
type cd followed by the name of the directory (In our case ~/repos/parse_video_and_sensor_data/src$).
Then type python extractSelectedFrames.py (space) (index file name).txt (space) /media/…/(the project folder where all videos are)(space) ~/data texture_classification/(route and name of the output folder)
Note: It’s very important to put a slash in the end following the input folder directory, otherwise it won’t work.
Image Labeling
This step is to get around 100 labeled images, in order to train the program. The input should be the videos and an index text file (see documentations on the index file).The output would be a folder of all selected images with the GPS information written into the image metadata.
Data Training
Data training is a process to 'teach' the algorithm a general rule that maps inputs to outputs.
The teaching material is the labels created by experts.
Divide the labeled images into two sets-- training and testing. Open the code master_script.m in MatLab. Change the following parameters:
Ø trainImageDirectoryList: This should be the directory for all input train images with experts' labels.
Ø testImageDirectoryList: This should be the directory for all input test images with experts' labels.
Ø listOfLabels: This should be names of all the labels.
Ø positiveStringLabels: These are the labels of features that the algorithm should learn to recognize.
Ø negativeStringLabels: These are the labels of features that the algorithm should learn to ignore.
Rename the CLASSIFIER before running the algorithm. A new CLASSIFIER will be generated after the training process. For example, new_model.mat is the classifier for detecting cracking on asphalt/concrete road surface. This classifier will then be used to detect target features and score the images.
