OpenCV 4.12.0
开源计算机视觉
加载中...
搜索中...
无匹配项
cv::SIFT 类参考抽象

此类使用 D. Lowe [176] 的尺度不变特征变换(SIFT)算法提取关键点并计算描述符。 更多...

#include <opencv2/features2d.hpp>

cv::SIFT 的协作图

公共成员函数

virtual double getContrastThreshold () const =0
 
virtual String getDefaultName () const CV_OVERRIDE
 
virtual double getEdgeThreshold () const =0
 
virtual int getNFeatures () const =0
 
virtual int getNOctaveLayers () const =0
 
virtual double getSigma () const =0
 
virtual void setContrastThreshold (double contrastThreshold)=0
 
virtual void setEdgeThreshold (double edgeThreshold)=0
 
virtual void setNFeatures (int maxFeatures)=0
 
virtual void setNOctaveLayers (int nOctaveLayers)=0
 
virtual void setSigma (double sigma)=0
 
- 继承自 cv::Feature2D 的公共成员函数
virtual ~Feature2D ()
 
virtual void compute (InputArray image, std::vector< KeyPoint > &keypoints, OutputArray descriptors)
 计算图像(第一种变体)或图像集(第二种变体)中检测到的一组关键点的描述符。
 
virtual void compute (InputArrayOfArrays images, std::vector< std::vector< KeyPoint > > &keypoints, OutputArrayOfArrays descriptors)
 
virtual int defaultNorm () const
 
virtual int descriptorSize () const
 
virtual int descriptorType () const
 
virtual void detect (InputArray image, std::vector< KeyPoint > &keypoints, InputArray mask=noArray())
 检测图像(第一种变体)或图像集(第二种变体)中的关键点。
 
virtual void detect (InputArrayOfArrays images, std::vector< std::vector< KeyPoint > > &keypoints, InputArrayOfArrays masks=noArray())
 
virtual void detectAndCompute (InputArray image, InputArray mask, std::vector< KeyPoint > &keypoints, OutputArray descriptors, bool useProvidedKeypoints=false)
 
virtual bool empty () const CV_OVERRIDE
 如果检测器对象为空,则返回 true。
 
virtual void read (const FileNode &) CV_OVERRIDE
 从文件存储中读取算法参数。
 
void read (const String &fileName)
 
void write (const Ptr< FileStorage > &fs, const String &name) const
 
void write (const String &fileName) const
 
virtual void write (FileStorage &) const CV_OVERRIDE
 将算法参数存储到文件存储中。
 
void write (FileStorage &fs, const String &name) const
 
- 继承自 cv::Algorithm 的公共成员函数
 Algorithm ()
 
virtual ~Algorithm ()
 
virtual void clear ()
 清除算法状态。
 
virtual void save (const String &filename) const
 
void write (const Ptr< FileStorage > &fs, const String &name=String()) const
 
void write (FileStorage &fs, const String &name) const
 

静态公共成员函数

static Ptr< SIFTcreate (int nfeatures, int nOctaveLayers, double contrastThreshold, double edgeThreshold, double sigma, int descriptorType, bool enable_precise_upscale=false)
 创建具有指定 `descriptorType` 的 SIFT
 
static Ptr< SIFTcreate (int nfeatures=0, int nOctaveLayers=3, double contrastThreshold=0.04, double edgeThreshold=10, double sigma=1.6, bool enable_precise_upscale=false)
 
- 继承自 cv::Algorithm 的静态公共成员函数
template<typename _Tp >
static Ptr< _Tpload (const String &filename, const String &objname=String())
 从文件中加载算法。
 
template<typename _Tp >
static Ptr< _TploadFromString (const String &strModel, const String &objname=String())
 从字符串加载算法。
 
template<typename _Tp >
static Ptr< _Tpread (const FileNode &fn)
 从文件节点读取算法。
 

额外继承的成员

- 继承自 cv::Algorithm 的保护成员函数
void writeFormat (FileStorage &fs) const
 

详细描述

此类使用 D. Lowe [176] 的尺度不变特征变换(SIFT)算法提取关键点并计算描述符。

成员函数文档

◆ create() [1/2]

static Ptr< SIFT > cv::SIFT::create ( int nfeatures,
int nOctaveLayers,
double contrastThreshold,
double edgeThreshold,
double sigma,
int descriptorType,
bool enable_precise_upscale = false )
static
Python
cv.SIFT.create([, nfeatures[, nOctaveLayers[, contrastThreshold[, edgeThreshold[, sigma[, enable_precise_upscale]]]]]]) -> retval
cv.SIFT.create(nfeatures, nOctaveLayers, contrastThreshold, edgeThreshold, sigma, descriptorType[, enable_precise_upscale]) -> retval
cv.SIFT_create([, nfeatures[, nOctaveLayers[, contrastThreshold[, edgeThreshold[, sigma[, enable_precise_upscale]]]]]]) -> retval
cv.SIFT_create(nfeatures, nOctaveLayers, contrastThreshold, edgeThreshold, sigma, descriptorType[, enable_precise_upscale]) -> retval

创建具有指定 `descriptorType` 的 SIFT

参数
nfeatures要保留的最佳特征数。特征按其分数(在 SIFT 算法中以局部对比度衡量)进行排名
nOctaveLayers每个八度中的层数。3 是 D. Lowe 论文中使用的值。八度数根据图像分辨率自动计算。
contrastThreshold用于过滤掉半均匀(低对比度)区域中弱特征的对比度阈值。阈值越大,检测器生成的特征越少。
注意
应用过滤时,对比度阈值将除以 `nOctaveLayers`。当 `nOctaveLayers` 设置为默认值且您想使用 D. Lowe 论文中使用的值 0.03 时,请将此参数设置为 0.09。
参数
edgeThreshold用于过滤掉边缘状特征的阈值。请注意,其含义与 `contrastThreshold` 不同,即 `edgeThreshold` 越大,过滤掉的特征越少(保留的特征越多)。
sigma应用于八度 #0 输入图像的高斯 σ 值。如果您的图像是用弱相机和软镜头拍摄的,您可能需要减小此值。
descriptorType描述符的类型。仅支持 CV_32F 和 CV_8U。
enable_precise_upscale是否启用尺度金字塔中的精确上采样,该采样将索引 \(\texttt{x}\) 映射到 \(\texttt{2x}\)。这可以防止定位偏差。默认情况下禁用此选项。

◆ create() [2/2]

static Ptr< SIFT > cv::SIFT::create ( int nfeatures = 0,
int nOctaveLayers = 3,
double contrastThreshold = 0.04,
double edgeThreshold = 10,
double sigma = 1.6,
bool enable_precise_upscale = false )
static
Python
cv.SIFT.create([, nfeatures[, nOctaveLayers[, contrastThreshold[, edgeThreshold[, sigma[, enable_precise_upscale]]]]]]) -> retval
cv.SIFT.create(nfeatures, nOctaveLayers, contrastThreshold, edgeThreshold, sigma, descriptorType[, enable_precise_upscale]) -> retval
cv.SIFT_create([, nfeatures[, nOctaveLayers[, contrastThreshold[, edgeThreshold[, sigma[, enable_precise_upscale]]]]]]) -> retval
cv.SIFT_create(nfeatures, nOctaveLayers, contrastThreshold, edgeThreshold, sigma, descriptorType[, enable_precise_upscale]) -> retval
参数
nfeatures要保留的最佳特征数。特征按其分数(在 SIFT 算法中以局部对比度衡量)进行排名
nOctaveLayers每个八度中的层数。3 是 D. Lowe 论文中使用的值。八度数根据图像分辨率自动计算。
contrastThreshold用于过滤掉半均匀(低对比度)区域中弱特征的对比度阈值。阈值越大,检测器生成的特征越少。
注意
应用过滤时,对比度阈值将除以 `nOctaveLayers`。当 `nOctaveLayers` 设置为默认值且您想使用 D. Lowe 论文中使用的值 0.03 时,请将此参数设置为 0.09。
参数
edgeThreshold用于过滤掉边缘状特征的阈值。请注意,其含义与 `contrastThreshold` 不同,即 `edgeThreshold` 越大,过滤掉的特征越少(保留的特征越多)。
sigma应用于八度 #0 输入图像的高斯 σ 值。如果您的图像是用弱相机和软镜头拍摄的,您可能需要减小此值。
enable_precise_upscale是否启用尺度金字塔中的精确上采样,该采样将索引 \(\texttt{x}\) 映射到 \(\texttt{2x}\)。这可以防止定位偏差。默认情况下禁用此选项。

◆ getContrastThreshold()

virtual double cv::SIFT::getContrastThreshold ( ) const
纯虚函数
Python
cv.SIFT.getContrastThreshold() -> retval

◆ getDefaultName()

virtual String cv::SIFT::getDefaultName ( ) const
virtual
Python
cv.SIFT.getDefaultName() -> retval

返回算法字符串标识符。当对象保存到文件或字符串时,此字符串用作顶层 xml/yml 节点标签。

重新实现自 cv::Feature2D

◆ getEdgeThreshold()

virtual double cv::SIFT::getEdgeThreshold ( ) const
纯虚函数
Python
cv.SIFT.getEdgeThreshold() -> retval

◆ getNFeatures()

virtual int cv::SIFT::getNFeatures ( ) const
纯虚函数
Python
cv.SIFT.getNFeatures() -> retval

◆ getNOctaveLayers()

virtual int cv::SIFT::getNOctaveLayers ( ) const
纯虚函数
Python
cv.SIFT.getNOctaveLayers() -> retval

◆ getSigma()

virtual double cv::SIFT::getSigma ( ) const
纯虚函数
Python
cv.SIFT.getSigma() -> retval

◆ setContrastThreshold()

virtual void cv::SIFT::setContrastThreshold ( double contrastThreshold)
纯虚函数
Python
cv.SIFT.setContrastThreshold(contrastThreshold) ->

◆ setEdgeThreshold()

virtual void cv::SIFT::setEdgeThreshold ( double edgeThreshold)
纯虚函数
Python
cv.SIFT.setEdgeThreshold(edgeThreshold) ->

◆ setNFeatures()

virtual void cv::SIFT::setNFeatures ( int maxFeatures)
纯虚函数
Python
cv.SIFT.setNFeatures(maxFeatures) ->

◆ setNOctaveLayers()

virtual void cv::SIFT::setNOctaveLayers ( int nOctaveLayers)
纯虚函数
Python
cv.SIFT.setNOctaveLayers(nOctaveLayers) ->

◆ setSigma()

virtual void cv::SIFT::setSigma ( double sigma)
纯虚函数
Python
cv.SIFT.setSigma(sigma) ->

此类的文档生成自以下文件