how to solve "Attempt to grow array along ambiguous dimension." error?

3 views (last 30 days)
I recived an error when i run my code in matlab as Attempt to grow array along ambiguous dimension.How can i solve it.here i attached my code.Those two images(img1,img2) are 8 depth image.
img1 = imread('PlotEdited.bmp');
img2 = imread('002skullOnly.bmp');
figure(1);
imshowpair(img1,img2,'montage'); % Show two images
[optimizer,metric]=imregconfig('multimodal');
registered=imregister(img1,img2,'similarity',optimizer,metric); % Register images
[centres,radii] = imfindcircles(registered, [20 25],...
'objectPolarity','dark',...
'sensitivity',0.94);
figure(2);imshow(registered);
viscircles(centres,radii);
BW=imbinarize(registered(:,:,1));
img=registered;
img(repmat(~registered,1,1,3))=255; %%ERROR Attempt to grow array along ambiguous dimension
figure(3);imshow(img);
figure(4);
imshowpair(registered,img2);title('Registration','fontSize',12)
saveas(4,'002Registered.bmp','bmp');

Answers (0)

Categories

Find more on Images in Help Center and File Exchange

Products


Release

R2018a

Community Treasure Hunt

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

Start Hunting!