フィルターのクリア

Read image using imread based on the number of loop

3 ビュー (過去 30 日間)
MOHAMMAD AZRUL AIMAN
MOHAMMAD AZRUL AIMAN 2021 年 1 月 12 日
Hello, i need some help. im using imwrite to get the process image using ip cam and rename it base on the number of looping (example if first loop image name will be im0.jpg). that have been success. but the problem happen when i want to read back the image bafore this using number of their loop.
like when in the first loop, it will generate im0.jpg
then i want to read back the image im0.jpg in the directory.
This process happen continuously until im1.jpg, im2.jpg, im3.jpg.
while (i<==50)
%process data~~
imwrite(data,sprintf('im%d.jpg',i))
b = imread(['folder_path\im''num2str(i)''.jpg']); %error happen here
  2 件のコメント
KSSV
KSSV 2021 年 1 月 12 日
What error? I think image is not present in the folder.
MOHAMMAD AZRUL AIMAN
MOHAMMAD AZRUL AIMAN 2021 年 1 月 12 日
Yeah. i change the folder directory and remove the sign at num2str and it workss. thank you <3

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

回答 (1 件)

Walter Roberson
Walter Roberson 2021 年 1 月 12 日
filename = fullfile('folder_path', sprintf('im%d.jpg', i));
b = imread(filename);
  1 件のコメント
MOHAMMAD AZRUL AIMAN
MOHAMMAD AZRUL AIMAN 2021 年 1 月 12 日
thank you for your answers

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

カテゴリ

Help Center および File ExchangeImages についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by