Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试使用 Matlab 从图像中剪下圆圈。
c(1) 和 c(2) 是圆心的 x,y 坐标,r 是半径。
mask = bsxfun(@plus, (1:256) - c(1)^2, (transpose(1:256) - c(2)^2)) < r^2; figure imshow(im(mask));
一切似乎都有效,但我得到的不是面具,而是一个向量。
它是((1:256) - c(1))^2代替(1:256) - c(1)^2
((1:256) - c(1))^2
(1:256) - c(1)^2
mask = bsxfun(@plus, ((1:256) - c(1)).^2, (transpose(1:256) - c(2)).^2) < r^2; figure imshow((mask));