Why do I get error using graph cut method for segmentation?
이전 댓글 표시
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);
댓글 수: 1
Image Analyst
2022년 12월 26일
I don't know. What do you think you can you do to help us help you?
If you have any more questions, then attach your data and code to read it in with the paperclip icon after you read this:
And don't use i for the name of your image. It's the imaginary variable. Call it grayImage or something descriptive.
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Image Segmentation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!