I am analysing images in MATLAB and the code I have is running fine for most images.
I get the error: "Attempt to grow array along ambiguous dimension." for some images.
Why is this happening? I assume that the code is correct, as it works for most images...
The code runs into the issue here:
RminusBdouble = double(Iplan(:,:,1))- double(Iplan(:,:,3));
ROIx = [transects.x(1,:) fliplr(transects.x(2,:))];
ROIy = [transects.y(1,:) fliplr(transects.y(2,:))];
Imask = ~inpoly([X(:) Y(:)],[ROIx',ROIy']);
RminusBdouble(Imask) = NaN;
c = contours(X,Y,RminusBdouble,[thresh thresh]);