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

In this beginner's tutorial on OpenCV4Android, it is written,

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.

The question is that how can I do that? For example in this sample application (say in the onTouch() method of this class where touchedRegionHsv is calculated on Line#138), how can I remove/dismiss the Value component of the HSV, so that the algorithms become less sensitive to the light conditions?


Well, as I can see you are only adding the 3 channel and dividing them by the number of pixels, maybe you can remove this channel by using:

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

Hope this can be useful to you, cheers!

Need Your Help

How do I properly embed third-party frameworks in my Cocoa application?

cocoa xcode macos

I am writing a Cocoa application that makes use of the ParseKit framework ( I've included the Framework in the proper folder, added a Copy Files build phase, and added it ...

Why Response.Redirect causes System.Threading.ThreadAbortException?

c# .net-3.5

When I use Response.Redirect(...) to redirect my form to a new page I get the error: