使用 OpenCV4Android,我如何消除 HSV 图像的值分量,以便算法对光照条件变得不那么敏感?

Using OpenCV4Android, how do I dismiss the Value component of an HSV image, so that algorithms become less sensitive to light conditions?

在这个关于OpenCV4Android的初学者教程中,写到,

The HSV and HLS decompose colors into their hue, saturation and value/luminance components, which is a more natural way for us to describe colors. You might, for example, dismiss the value component, making your algorithm less sensitive to the light conditions of the input image.

问题是我该怎么做?例如,在这个 sample application (say in the onTouch() method of this class 中,其中 touchedRegionHsv 是在第 138 行计算的),我如何 remove/dismiss HSV 的 Value 组件,以便算法变得不那么敏感光照条件?

好吧,正如我所见,您只是添加了 3 个通道并将它们除以像素数,也许您可​​以使用以下方法删除此通道:

for(int i=0; i<touchedRegionHsv.height; i++){
    for(int j=0; j<touchedRegionHsv.width; j++){
        cv.SetReal3D(touchedRegionHsv, i, j, 2, 0)
    }
}

希望对你有用,干杯!