本文介绍了OpenCV轮廓时刻?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

轮廓的瞬间是什么?有人可以用简单的非数学术语解释这个问题吗?可能有一个例子?官方解释是对轮廓中的所有像素的积分。我不知道什么集成。还有什么可以轮廓的时刻用于?具体示例请



感谢

解决方案

但是没有链接。



无论如何,黑色/白色图像的0度的瞬间,黑色= 0和白色= 1:这只是



x轴的第一度的时刻和x轴的某个特定点X的时刻:这是白色像素的总和距离XIe的像素距离它是他们的位置wrt的总和。如果你除以白色像素的数量(第0时刻),你得到平均白色像素位置wrt。



这个想法推广到sumOf(pixelValue(position)*位置^度)。对于0度,最后一部分只是1,所以你简单的总和像素值。对于1学位,它成为一个职位的总和,可以给你一个平均位置,而对于2学位,它可以给你一种方向。



对于更多和更准确的细节,google吧。 : - )



干杯& hth。,


What are moments of a contour? Could someone explain this in simplistic, non-mathematical terms? Possibly with an example? The official explanation is "integration over all the pixels in a contour". I have no idea what integration. And also what can contour moments be used for? specific examples please

Thanks

解决方案

I saw a great explanation somewhere but do not have the link.

Anyway, moment of 0th degree for a black/white image with black=0 and white=1: this is simply the sum of the pixels, i.e. the number of white pixels.

Moment of 1st degree for x-axis and some particular point X on the x-axis: this is the sum of the white pixel distances from X. I.e. it is the sum of their positions wrt. X. If you divide this by the number of white pixels (0th moment) you get the average white pixel position wrt. X.

And similarly for y-axis.

This idea generalizes to sumOf( pixelValue(position)*position^degree ). For degree 0 the last part is just 1 so that you simply sum the pixel values. For degree 1 it becomes a sum of positions, which can give you an average position, and for degree 2 it can reportedly give you a kind of direction.

For more and more accurate details, google it. :-)

Cheers & hth.,

这篇关于OpenCV轮廓时刻?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-22 17:09
查看更多