Change the file paths to the data source and pixel label data in a groundTruth object.
Load a groundTruth object containing ground truth data into the workspace. The data source and pixel label data of the object contains file paths corresponding to an image sequence showing a building. MATLAB® displays a warning that the path to the data source cannot be found.
Warning: The data source points to a directory that cannot be found.
'C:\CFP\building'
Update the DataSource using <a href="matlab:doc('changeFilePaths')">changeFilePaths</a> method.
Display the current path to the data source.
Specify the current path to the data source and an alternative path and store these paths in a cell array. Use the changeFilePaths function to update the data source path based on the paths in the cell array. Because the function does not find the pixel label data at the specified new path, it returns the current unresolved paths.
unresolvedPaths = 5×1 string
"C:\CFP\building\PixelLabelData\Label_1.png"
"C:\CFP\building\PixelLabelData\Label_2.png"
"C:\CFP\building\PixelLabelData\Label_3.png"
"C:\CFP\building\PixelLabelData\Label_4.png"
"C:\CFP\building\PixelLabelData\Label_5.png"
Verify that the paths in the groundTruth object match the unresolved paths returned by the changeFilePaths function. The unresolved paths are stored in the LabelData property of the groundTruth object, in the PixelLabelData column.
ans = 5×1 cell
{'C:\CFP\building\PixelLabelData\Label_1.png'}
{'C:\CFP\building\PixelLabelData\Label_2.png'}
{'C:\CFP\building\PixelLabelData\Label_3.png'}
{'C:\CFP\building\PixelLabelData\Label_4.png'}
{'C:\CFP\building\PixelLabelData\Label_5.png'}
Specify the current path and an alternative path for the pixel label files and change the file paths. The function updates the paths for all pixel labels. Because the function resolves all paths, it returns an empty array of unresolved paths.
unresolvedPaths =
0×0 empty string array
To view the new data source path, use the gTruth.DataSource command. To view the new pixel label data paths, use the gTruth.LabelData.PixelLabelData command.