I got an error to the part that used to work no problem. Why?

8 ビュー (過去 30 日間)
Asuka
Asuka 2024 年 8 月 1 日
編集済み: amit 2025 年 11 月 6 日 22:26
I didn't change any of that part, but it suddenly returns shown error.
  1 件のコメント
Torsten
Torsten 2024 年 8 月 1 日
We don't know where the function "overwriteGTruthLocations" is located, but you will have to find it and put it on the MATLAB path.

サインインしてコメントする。

回答 (2 件)

colordepth
colordepth 2024 年 8 月 8 日
Hi Asuka,
I see that you are working on MathWorks' "Object Tracking and Motion Detection with Computer Vision" course. For the wood knots detection project, the helper function “overwriteGTruthLocations” is located at the bottom of the script. Running that cell should resolve the error related to the unrecognized function.
Hope this helps!
  1 件のコメント
Asuka
Asuka 2024 年 8 月 31 日
Thank you for your comment. Now, I reopened the file, and got a different type of error as attached. The file path seems correct, but it still says file path is wrong. Do you have any idea why this happens?

サインインしてコメントする。


amit
amit 2025 年 11 月 6 日 22:26
編集済み: amit 2025 年 11 月 6 日 22:26
Thanks. I found the function. Sharing for others -
function testPath = overwriteGTruthLocations(gTruthTrain)
% Find the location of the image files
trainPath = fileparts(which("IMG_3177.JPG"));
if isempty(trainPath)
error("The course files are not on the MATLAB search path." + ...
"Follow the instructions when downloading the course " + ...
"files to add them to your path.")
end
% Overwrite locations for images
currentPath = string(fileparts(gTruthTrain.DataSource.Source{1}));
changeFilePaths(gTruthTrain,[currentPath, trainPath]);
% Save the test path
testPath = erase(trainPath,'Train') + "Test";
end

カテゴリ

Help Center および File ExchangeImage Data Workflows についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by