How to resize a specific part of an image?
이전 댓글 표시
Hello,
Does anyone know how I can resize a specific object in an image while the other dimensions are the same? Imagine we have a small circle inside of a big circle; how can I increase the size of the bigger circle while the smaller is constant, or how can I decrease the size of the smaller circle while the bigger circle is constant?
Thanks.
Here, I have created an example by magic select in paint 3D.

채택된 답변
추가 답변 (2개)
yes,sir,may be make the target thin,such as
im = imread('https://www.mathworks.com/matlabcentral/answers/uploaded_files/949514/image.jpeg');
im2 = imcrop(im, [3 3 199 199]);
bw = im2bw(im2);
bw2 = ~imfill(~bw, 'holes');
sz = size(bw);
bw3 = bwselect(bw, round(sz(2)/2), round(sz(1)/2));
% bwmorph
bw3 = bwmorph(bw3, 'thin', 5);
bw2(bw3) = 1;
figure; montage({mat2gray(bw),mat2gray(bw2)}, 'Size', [1 2], 'BackgroundColor', 'r', 'BorderSize', [2 2]);
카테고리
도움말 센터 및 File Exchange에서 Convert Image Type에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!










