필터 지우기
필터 지우기

Image cropping across multiple files

조회 수: 1 (최근 30일)
Nilushi Dissanayake
Nilushi Dissanayake 2011년 1월 27일
There are 4 images, and I want to crop them by using coding. But I want to crop one image by using imcrop command and other 3 images should automatically cropped the same place i cropped the image 1. As an example there are
  • 1.bmp,
  • 2.bmp,
  • 3.bmp,
  • 4.bmp,
I want to give cropping parameters to only 1.bmp image and other images will be cropped the same place and view the crop images in a fig format.

채택된 답변

Ashish Uthama
Ashish Uthama 2011년 1월 27일
You ought to be able to accomplish this with imcrop itself.
First use this:
[I1c rect] = imcrop(I1)
Which returns the cropping rectangle in rect, a four-element position vector.
Then
I2c = imcrop(I2, rect)
Which crops the image I2. rect is a four-element position vector[xmin ymin width height] that specifies the size and position of the crop rectangle obtained from the first image.
  댓글 수: 1
Nilushi Dissanayake
Nilushi Dissanayake 2011년 1월 29일
thank you very much Ashish,,

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Images에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by