ANDROID - color detection using openCV - how to?

前端 未结 4 1296
谎友^
谎友^ 2021-01-31 12:56

my goal is to display a threshed image using the HSV color space in a way that only yellow objects will be shown. i use this code (based on a code given by the openCV 2.3.1 andr

4条回答
  •  臣服心动
    2021-01-31 13:30

    why is it COLOR_RGB2HSV? shouldnt it be COLOR_HSV2RGB?

    I would say that it should :). Looks like a problem on how opencv grabs the pixels. Check that both your input and output images have the same size and numberof channels.

    This

    capture.retrieve(mHSV, Highgui.CV_CAP_ANDROID_COLOR_FRAME_RGBA);
    

    looks also weird to me, Are you storing the RGBA image that you get into an image at HSV format? That would explain the problem. Try to do something like that : RGB(capture retrieve) => HSV(cvt color) => color detection => RGB (cvt color again)

提交回复
热议问题