필터 지우기
필터 지우기

problem in cropping image by using imcrop function.

조회 수: 3 (최근 30일)
fred bnm
fred bnm 2016년 7월 6일
답변: Image Analyst 2016년 7월 6일
Hi, i have an image in size of [960 1440]. i want cropping rectangle in the center of image. my desire output after cropping = image in size [960 960] in the center of original image.please guide me. my code :
a = ones(960 1440);
[m,n] = size(a);
%center of image = [m/2 n/2]
cropped = imcrop(a,[480 480 m/2 n/2);

채택된 답변

Image Analyst
Image Analyst 2016년 7월 6일
Try this:
croppedImage = a(:, 240:(240+959));

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by