function allCenters = getDominoValues(BW, bbox, colorIm)
for i = 1:length(bbox) dominoImage = imcrop(BW, bbox(i,:)); [centers, radii] = imfindcircles(dominoImage, [3 8]); dominoImageOffset = repmat(double(bbox(i,1:2)), (length(centers)/2), 1); absoluteCenters{i} = centers(:,:) + dominoImageOffset(:,:); allRadii{i} = radii; end J = colorIm; for i = 1:length(bbox) J = insertMarker(J, absoluteCenters{i}); end imshow(J);
At the moment I am getting the following message "Error using + Matrix dimenions must agree" when "absoluteCenters{i} = centers(:,:) + dominoImageOffset(:,:);" is executed. I have executed the same line in the command script, and I get no error messages.
Does anyone know why this might be happening?
Thanks.
Best Answer