Can you help me out:
Images call within for loop k...k values increasing. Already For loop is running original images call, both folders having a same number of images.This approach working in the initial part of code to call original images.

 채택된 답변

Jan
Jan 2017년 5월 27일
편집: Jan 2017년 5월 27일

1 개 추천

The error message is clear: you try to access the k.th element of manual_images, but this array has less than k elements. This can have many reasons, but they cannot be found in the code snippet you have posted.
Prefer fullfile instead of "[manual_directory, '/*.gif']". I assume the code is working inspite of the wrong file separator, but fullfile would adjust this.

댓글 수: 4

KALYAN ACHARJYA
KALYAN ACHARJYA 2017년 5월 27일
Thank for your reply, both original image and manual image folders having equal images (40 images)
As the initial part, the following code perfectly working to call original images. Using same K values inside this loop to call manual images.I also tried to name the only folder name in the manual directory.
Jan
Jan 2017년 5월 27일
Please do not code as screen shot. It is much easier to suggest an improvement, when the code can be copy&pate'd. Thanks.
I do not understand: "I also tried to name the only folder name in the manual directory."
Using absolute path names is much safer.
Did you read my answer? The problem is, that the array manual_images does not contain k elements. The posted code does not show, why you expect, that it does. Examine the creation of this array and check why it is shorter than you expect. Setting some brakpoints and using the debugger will help you.
KALYAN ACHARJYA
KALYAN ACHARJYA 2017년 5월 27일
Thanks a lot, I will try. I am thinking about another alternative as following-
i1=imread(complete path\Manual_Result'num2str(k)'.gif']);
Is this correct approach?
Stephen23
Stephen23 2017년 5월 27일
편집: Stephen23 2017년 5월 27일
"I assume the code is working inspite of the wrong file separator"
Actually every single version of Windows API since DOS 2.0 have accepted both \ and / as file path separators (note: as opposed to in the command line): "Contrary to popular belief, the Windows system API accepts slash, and thus all the above Unix examples should work. But many applications on Windows interpret a slash for other purposes or treat it as an invalid character, and thus require you to enter backslash — notably the cmd.exe shell (often called the "terminal" as it typically runs in a terminal window)"

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

KSSV
KSSV 2017년 5월 27일

1 개 추천

i1 = imread(manual_images(k).name) ;

댓글 수: 1

KALYAN ACHARJYA
KALYAN ACHARJYA 2017년 5월 27일
Thank for your reply, Still, shows error as following
Error in drive_seg_result (line 58)
i1=imread(manual_images(k).name);

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Images에 대해 자세히 알아보기

질문:

2017년 5월 27일

편집:

2017년 5월 27일

Community Treasure Hunt

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

Start Hunting!

Translated by