OpenCV: How to use HOGDescriptor::detect method?

前端 未结 2 642
逝去的感伤
逝去的感伤 2021-02-02 01:13

I have succeeded in tracking moving objects in a video. \"http://ww1.sinaimg.cn/mw690/63a9e398jw1ecn39e3togj20jv0g1gnv.jpg\"

2条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-02 02:10

    • If you don't cmake OpenCV with CUDA enabled, calling gpu::HOGDescriptor::detect will be equal to call HOGDescriptor::detect. No GPU is called.

    • Also for code, you can use

      GpuMat img;
      vector found_locations;
      gpu::HOGDescriptor::detect(img, found_locations);
      if(!found_locations.empty())
      {
          // img contains/is a real person 
      }
      

    Edit:

    However I want to decide if an object is person or not.

    I don't think that you need this step. HOGDescriptor::detect itself is used to detect people, so you don't need to verify them as they are supposed to be people according to your setup. On the other hand, you can setup its threshold to control its detected quality.

提交回复
热议问题