image resampling to modify mesh
이전 댓글 표시
hello,
I would like some advice on this: I have an image characterized by a rectangular mesh and I would like to convert it to a square mesh by resampling.
Thanks for your suggestions
댓글 수: 2
That's awfully vague. An example of the expected inputs and outputs would help. Otherwise, all I can suggest is imresize().
% a "rectangular mesh"
sz = [101 301];
A = zeros(sz);
A(:,1:20:sz(2)) = 1;
A(1:10:sz(1),:) = 1;
% show it
% the cells are rectangular, so is the image.
imshow(A)
% resize it
B = imresize(A,sz.*[2 1],'nearest');
% show it
% the cells are square, but the image is rectangular
imshow(B)
% resize it
C = imresize(A,sz(2).*[1 1],'nearest');
% show it
% the image is square, but the cells are rectangular
imshow(C)
Federico Paolucci
2022년 12월 17일
편집: Federico Paolucci
2022년 12월 17일
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Contrast Adjustment에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


