I have a centroid(x,y) of object in image..How to extract patch from image around centroid

Hi, There are objects( nucleus) in an image.i have the centre(x,y) values of objects ...I want to extract patches from image around the center...The patch center will be the center(x,y) of object. Please help.

답변 (1개)

subImage = grayImage(row1:row2, column1:column2);
or you can use imcrop().

댓글 수: 4

I want to extract patch of 80 by 80.. i am sorry
forgot to mention this in question...I am also attaching patch...problem is that the object center is not patch center.
My answer is the same. Don't you know the starting and ending rows and columns of that patch?
No i just know the centroid co-ordinates... centre(x,y) value.
Then use simple math
row1 = int32(y - 40);
row2 = row1 + 79;
column1 = int32(x - 40);
column2 = column1 + 79;
subImage = rgbImage(row1:row2, column1:column2, :);

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

카테고리

도움말 센터File Exchange에서 Images에 대해 자세히 알아보기

질문:

2015년 3월 11일

댓글:

2015년 3월 13일

Community Treasure Hunt

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

Start Hunting!

Translated by