Image Processing and Centroid Determination

3 ビュー (過去 30 日間)
Brandon
Brandon 2013 年 7 月 18 日
Hi,
I'm currently processing images to track objects and I want to determine the location of the object in pixels. I used the matlab function centroid to do this and it works perfect.
My question is I am getting numbers with decimals. ie(232.34,456.72) How are the extra significant figures being determined and can I trust these values?
Thanks in advance!

採用された回答

Image Analyst
Image Analyst 2013 年 7 月 19 日
Let's say the pixels are considered to be at the center of the number. So with this image
[0, 1, 1, 0]
There is a pixel at 2, and one at 3. So the centroid would be at 2.5. If the image is
[0, 1, 1, 1, 1, 0
0, 1, 1, 1, 1, 0]
The xCentroid is at 3.5 and the y centroid is at 1.5. As you can imagine, as you get lots more pixels, the centroid could be at some other fractional location. Does that explain it?
  1 件のコメント
Brandon
Brandon 2013 年 7 月 19 日
Yes, that makes complete sense! I don't know why I didn't think about it that way. I always tend to over think things!
Thank you!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeComputer Vision with Simulink についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by