Image centroid in matlab
이전 댓글 표시
I have about 400 images I need to find its centroid in such a way that all other images have the same centroid in respect to the first image centroid (44.5 79.6). I was able to do it manually by calculating for each image as below.But it quite tedious doing it for 400 images. Please I need help/code that can execute the task.Thanks
Im1 = imread('image1.png');
[x,y] = ait_centroid(Im1);
Im01=uint16(Im1);
Im2 = imread('image2.png');
[x,y] = ait_centroid(Im2);
Im02=circshift(Im2, [-2 -4]); [x,y] = ait_centroid(Im02);
Im02=uint16(Im02);
Im3 = imread('image3.png'); [x,y] = ait_centroid(Im3); Im03=circshift(Im3, [-3 -5]); [x,y] = ait_centroid(Im03); Im03=uint16(Im03);
답변 (1개)
Sean de Wolski
2011년 6월 23일
0 개 추천
댓글 수: 2
kiki
2011년 6월 23일
Sean de Wolski
2011년 6월 23일
just subtract their centroid from im1's centroid to get your displacement vector. The translate with circshift or, if you have the IPT, my imtranslate:
http://www.mathworks.com/matlabcentral/fileexchange/27251-imtranslate
카테고리
도움말 센터 및 File Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!