python - OpenCV HOG Descriptor Parameters -


i trying detect people camera's feed using cv2.hogdescriptor() , using default people classifier.

the recognizer kinda works having issue understanding values assign winstride, padding,scale , groupthreshold respectively.

currently, camera feed's frame size 1280 x 720 , resize 400 x 400 perform detectmultiscale parameters

hogparams = {'winstride': (8, 8), 'padding': (32, 32), 'scale': 1.05, 'finalthreshold': 2} 

based off of answer, understand these parameters , represent.

my question is, there way of mapping image size these values? mathematical equation? estimation method? not asking concrete or method gives values, better trial , error or magic numbers.

most of references , tutorials pretty use magic numbers without giving proposition of how attained them.

ps: here's visual aid in case you're still not sure of question i looking cloud

there no silver bullet here. unfortunately handwavy optimal solution vary input data input data.

here little guidance:

  • if stride > window size detector might not run on person. think of stride in relation window size e.g. 64/8.
  • if scale~1 not happen. values 1.2, 1.3 better. parameter scales image down, , runs detector again. hope is, if people big detector in first run, might right size after scaling down. e.g. if detector size default 64x128, person in image 150px high, detector might not realize it's person can view legs, or torso @ once. if scale down 150 / 1.2 = 125 person might detected. (silly numbers. plausible detect person if 150px. idea.)

the best way go experiment little. choose images/video think representative of use case, create end-to-end setup, , play around couple of different parameter settings. if persons not detected think sizes in relation detector size. bigger that? smaller? if smaller perhaps increase scale-factor, or increase number of levels. if bigger, downscale input image more.

.. 1280 x 720 , resize 400 x 400...

side note: if resizing without cropping bad results. either resize same aspect ratio such 711x400, or crop initial image square before resizing.


Comments

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - InvalidDataAccessApiUsageException: Parameter value element did not match expected type -