如何改进opencv中的特征检测 [英] How to improve features detection in opencv

查看:162
本文介绍了如何改进opencv中的特征检测的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个项目,我需要使用opencv检测图像上的功能。



我正在使用

  SURF检测器; 
SURF提取器;
BFMatcher匹配器;

用于检测,提取和匹配点。它适用于某些图像,但在其他一些图像上失败。



例如,系统在此图像上失败:





显然,此图像具有一些纹理,并且特征检测器应检测它们,但未检测到任何特征,因此不会生成匹配。



如何改进此特征检测?



我可以使用任何图像处理技术吗?



我还能使用哪种其他探测器帮助在这个问题上?

解决方案

我没有使用过SURF,而是使用了ORB算法。为了改进功能检测,我尝试了几种过滤器。我获得的最好结果是使用滤波器Equalize Histogram和Fast Fourier Transform的组合。



均衡直方图滤镜:它增强了无意义的细节,并隐藏了重要但很小的高对比度像素,这些像素被视为噪声。直方图均衡采用单调非线性映射,重新分配输入图像中像素的强度值,使得输出图像包含均匀的强度分布(即平直方图)



快速傅里叶变换滤镜:它将图像分解为正弦和余弦分量。由此滤波器执行的变换的输出表示频域中的图像,而输入图像是等效的空间域。在傅里叶域图像中,每个点代表空间域图像中包含的特定频率。



我不确定,但我认为在OpenCV中没有FFT过滤器,所以你可能需要使用另一个库。



Edit1
我有一个代码,不幸的是它在Java而不是C ++。但是如果你将应用相同的过滤器,结果将是相同的。 FFT是DFT的有效实现。 此处对此进行了描述。它也可能是答案四个您最近的问题。


I am working on a project that I need to detect features on images using opencv.

I am using

SURF detector;
SURF extractor;
BFMatcher matcher;

for detection, extraction and matching points. It works well for some images, but fails on some other images.

For example, the system fails on this image:

Apparently, this image has some texture and the feature detector should detect them, but no feature is detected and consequently no match is generated.

How can I improve this feature detection?

Can I use any image processing technique for this?

Is there any other detector that I can use which help in this problem?

解决方案

I haven't used SURF, but used ORB algorithm. And to improve feature detection I've experimented several filters. The best results I've obtained was with combination of filters Equalize Histogram and Fast Fourier Transform.

Equalize Histogram filter: It enhances meaningless detail and hides important but small high-contrast pixels, which are assumed as noise. Histogram equalization employs a monotonic, non-linear mapping which re-assigns the intensity values of pixels in the input image such that the output image contains a uniform distribution of intensities (i.e. a flat histogram)

Fast Fourier Transform filter: It decomposes the image into its sine and cosine components. The output of the transformation performed by this filter represents the image in the frequency domain, while the input image is the spatial domain equivalent. In the Fourier domain image, each point represents a particular frequency contained in the spatial domain image.

I'm not sure, but I think that in OpenCV there is no FFT filter, so probably you will need to use another library.

Edit1: I have a code, but unfortunately it is in Java and not in C++. But if you will apply the same filters, the result will be the same. Here is the documentation of Eqaulize Histogram. And to apply FFT filter I've used ImageJ, which is Java library. You can try to find something similar to this library, like this one.

Edit2: ImageJ code to apply FFT filter

import ij.plugin.filter.FFTFilter;
...
FFTFilter fft = new FFTFilter();
ImageProcessor ip = new ColorProcessor(bufImage);
ImagePlus imgPlus = new ImagePlus();

imgPlus.setImage(bufImage);

try{
   fft.setup(null, imgPlus); 
}catch(Exception e){e.printStackTrace();}
fft.run(ip);

Edit3: Here are examples of detected features before and after applying mentioned filters.

  1. SURF without any filter:
  2. SURF with EH + FFT:
  3. ORB with EH + FFT:

As you can see with SURF algorithm, there are too many redundant information to perform matching. So I suggest you to use ORB algorithm. Also the advantages of ORB is that it is free to use, efficient and stable to image rotation and scale. You can also smooth the image before applying EH+FFT to detect features only on corners.

Edit4: I've also found useful information about FFT. According to this topic FFT is an efficient implementation of DFT. Which is described here. It is also could be the answer four your recent question.

这篇关于如何改进opencv中的特征检测的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆