Getting error while using the segmentImage(RGB) function to segment images by graph cut
Show older comments
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 Comment
Answers (0)
Categories
Find more on Image Segmentation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!