How origin is moved to the centroid of an image

조회 수: 8 (최근 30일)
Abul Abbas
Abul Abbas 2021년 2월 11일
댓글: Rik 2021년 2월 15일
I have an image say NXN and i want to move the origin of the image to the centroid location.
  댓글 수: 4
Matt J
Matt J 2021년 2월 11일
Centroid is the centre of mass of the blob, say i have the image centre at [134,235]
If the size of your image is 267 x 469 then its center will always be at [134,235]. It cannot "move".
Maybe you mean you want to move the blob to the center of the image?
Abul Abbas
Abul Abbas 2021년 2월 11일
yes i want to move the blob to the center of the image

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

채택된 답변

Matt J
Matt J 2021년 2월 11일
편집: Matt J 2021년 2월 11일
newImage = imtranslate(oldImage,[134,235] - [155,250])
  댓글 수: 3
Abul Abbas
Abul Abbas 2021년 2월 11일
how to substitute p(x/a+x1,y/a+x2) to p(x,y),where p(x,y) is original image, x1 and x2 are the centroid of p(x,y),x1=m10/m00,x2=m01/m00,a=sqrt(β/m00),β is a predetermined value. In fact, this is doing scale and translation normalization
Rik
Rik 2021년 2월 15일
(this latter comment was posted as a separate question)

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

추가 답변 (1개)

Matt J
Matt J 2021년 2월 11일
편집: Matt J 2021년 2월 11일
The image coordinate system is not something that is given to you, and that you have to "move". It is something you create using imref2d,
You can use it to put your origin anywhere you want.
  댓글 수: 1
Abul Abbas
Abul Abbas 2021년 2월 11일
I have the image centre at [134,235] and my centroid location is at [155,250]. I want to move the image centre from [134,235] to [155,250]

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

카테고리

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