Info

この質問は閉じられています。 編集または回答するには再度開いてください。

How does the following code works?

3 ビュー (過去 30 日間)
Dhanubala A
Dhanubala A 2018 年 2 月 19 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
r_idx = random('unid', size(listing, 1));
im_input = imread(strcat('D:\project\CVPR17_training_code\data_generation\image\input\', listing(r_idx).name));
I found this code .But ,I couldn't understand how the random() and size() function works.Please explain this...
  3 件のコメント
Dhanubala A
Dhanubala A 2018 年 2 月 19 日
When i run your code,the following error occurs. "Error using imread (line 349) File "D:\project\CVPR17_training_code\data_generation\image\label\931_4.jpg" does not exist.
Error in generate_train (line 31) im_label = imread(strcat('D:\project\CVPR17_training_code\data_generation\image\label\', listing(r_idx).name)); % label: clean image"
Walter Roberson
Walter Roberson 2018 年 2 月 19 日
As an outside person, I have no reason to expect that you have given the correct path to the files.
You should learn how to use fullfile()
projectdir = 'D:\etc'
listing = dir( fullfile(projectdir, '*.jpg'));
ridx = randi(length (listing))
thisfile = fullfile (projectdir, listing(ridx).name));
imread(thisfile)

回答 (0 件)

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by