python - sift算法颜色不变吗?

标签 python opencv opencv3.0 sift

我将使用 sift 来识别某种类型的对象,如果该对象的颜色发生变化,它能识别出来吗?我将使用 opencv 库进行筛选 cv2.xfeatures2d.SIFT_create()

最佳答案

SIFT 仅对灰度图像进行操作。在 Lowe's 的结论中paper ,他指出:

The features described in this paper use only a monochrome intensity image, so further distinctiveness could be derived from including illumination-invariant color descriptors (Funt and Finlayson, 1995; Brown and Lowe, 2002).

OpenCV implementation在提取特征之前将彩色图像转换为灰度图像。

static Mat createInitialImage( const Mat& img, bool doubleImageSize, float sigma )
{
    /* ... */
    Mat gray, gray_fpt;
    if( img.channels() == 3 || img.channels() == 4 )
    {
        cvtColor(img, gray, COLOR_BGR2GRAY);
        gray.convertTo(gray_fpt, DataType<sift_wt>::type, SIFT_FIXPT_SCALE, 0);
    }
    else
        img.convertTo(gray_fpt, DataType<sift_wt>::type, SIFT_FIXPT_SCALE, 0);
    /* ... */
}

关于python - sift算法颜色不变吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40694713/

相关文章:

python - SQLAlchemy 中的多对多查询

python - Jinja2 为 Google App Engine 模型返回 "None"字符串

python - opencv中cvtColor()之前Numpy 8位图像转换为16/32位图像

c# - 如何使用 FindChessboardCorners

ios - 没有匹配函数调用 'MatToUIImage'

android - 为什么 OpenCV4Android 的 pointPolygonTest() 方法为每个像素返回-1?

python - 从线中查找点距离 - python

visual-studio-2010 - 如何在VS2010 Windows 7中安装tbb_dedug.dll?

opencv - OpenCV const矩阵-不总是const吗?

python - 优化列表理解的并行实现