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!