Getting error while using the segmentImage(RGB) function to segment images by graph cut

조회 수: 1 (최근 30일)
I generated a segmentImage(RGB) function by choosing my desired foreground and background region using graph cut method. This function is working well with the original image I used to create the function. However, when I use this segmentImage(RGB) function to perform the same segmentation on another image, I get the following error message:
1)Error using lazysnapping>getIndices (line 297) Linear indices cannot exceed the number of elements in the label matrix.
2)Error in lazysnapping>validateInputs (line 258) foregroundInd = getIndices(foreground, size(L));
3)Error in lazysnapping (line 160) [foregroundInd,backgroundInd,is3D] = validateInputs(A,L,foreground,background);
4)Error in ImageAnalysis_v04_GraphCut>segmentImage_g (line 125) BW = lazysnapping(scaledX,L2,foregroundInd,backgroundInd);
5)Error in ImageAnalysis_v04_GraphCut (line 11) [g_BW,g_maskedImage] = segmentImage_g(i);
What is the reason for these errors? Thanks.
  댓글 수: 1
Madhab
Madhab 2022년 12월 26일
@Shashank Hey, I am having exactly the same problem. If you solved it, can you please me guide the solution. Thanks.

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Statistics and Machine Learning Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by