本文介绍了七个胡不变时刻的意义从OpenCV函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道七个不变的时刻是对象的翻译,旋转和缩放变化,以便独立地识别这些因素。



为什么我使用来自OpenCV的函数moments提取中心矩,然后我使用函数HuMoments获得以下二进制化图像的七个不变时刻:



img src =https://i.stack.imgur.com/ALUHH.jpgalt =enter image description here>



我的第一个问题是关于使用OpenCV的函数moments。第二个参数是binaryImage,我设置为true,因为它是一个二进制图像,是否正确?



我的第二个疑问是关于函数HuMoments :七个不变的时刻。我不明白这个数据。



非常感谢!干杯!

解决方案

第一个问题



图片。如果更多的对象,并想要找到每一个的时刻,使用轮廓。访问:



第二个问题:



关于它在看到你的问题之后)



HuMoments由Mr.Ming Kuei Hu在他的论文。



在那篇文章中,他解释他们(当然有高数学内容的帮助)。


当你使用moments()函数找到时刻,返回三种类型的时刻,空间时刻(Mji),中心时刻(MUji)和中心归一化时刻(NUji)。查看的文档



在第4-C节的末尾,胡说,在七个关系中(),前六个是不变的翻译,大小和旋转,而第七个是偏斜不变,这有助于区分镜像。



我搜索了很多关于Hu Moments的意思。但是所有的论文都说同样的对话:七个胡子时刻是从中心时刻计算的,它们对尺寸,位置和取向是不变的。



Gary Bradsky先生的OpenCVLearning OpenCV的古典书给出了一些见解,告诉我们探索更多。


I understand that the seven hu invariant moments are for translation, rotation, and scale change of the object, in order to recognize the object independently these factors.

That's why I used the function "moments" from OpenCV to extract the central moments, then I used the function HuMoments to get the seven invariant moments of the following binarized image :

My first question is regarding the use of the function "moments" from OpenCV. The second parameter is "binaryImage" and I set it true, because it's a binary image, is it ok?

My second doubt is regarding the output of the function "HuMoments": the seven hu invariant moments. I don't understand this data. what data is related to rotation, what for translation and what for scale change?.

Many thanks!, cheers!

解决方案

First question :

It is ok to do so since you have single object in image. If more objects, and want to find moments for each, use contours. Visit : http://opencvpython.blogspot.in/2012/06/contours-3-extraction.html

Second Question :

(I am too thinking about it after seeing your questions)

HuMoments were brought to light by Mr.Ming Kuei Hu in his paper " Visual Pattern Recognition by Moment Invariants " in 1962.

In that paper, he explains them ( with help of high mathematics content, of course). You can check it if you need.

He states :

When you find the moments using moments() function, it returns three types of moments, spatial moments (Mji), Central Moments (MUji) and Central Normalized Moments ( NUji). Check out the docs for moments()

At the end of section 4-C, Hu states that, out of seven relations ( Visit here to see them), first six are invariant to translation, size and rotation, while seventh one is skew invariant, which helps to distinguish mirror images.

I searched a lot about what Hu Moments values means. But all papers says the same dialog : " Seven Hu Moments are calculated from Central Moments which are invariant to size, position and orientation ". They don't say what individual values mean.

And the classical book of OpenCV "Learning OpenCV" by Mr.Gary Bradsky has given some insights telling us to explore more. (Refer page 254)

这篇关于七个胡不变时刻的意义从OpenCV函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-11 22:29