Meanshift sample/tutorial possible bug (Bug #3474)


Added by Blaž Šnuderl about 11 years ago. Updated almost 11 years ago.


Status:Done Start date:2014-01-03
Priority:Low Due date:
Assignee:Blaž Šnuderl % Done:

100%

Category:python bindings
Target version:-
Affected version:branch 'master' (3.0-dev) Operating System:Any
Difficulty:Easy HW Platform:Any
Pull request:

Description

Hi. I have been looking at the Meanshift sample code located at http://docs.opencv.org/trunk/doc/py_tutorials/py_video/py_meanshift/py_meanshift.html

I think it contains a bug where in the part where it is calculating a histogram for the target model.

A frame containing the target object is created but in subsequent code it is never used. From my understanding only the target object should be used to create the histogram.


roi = frame[r:r+h, c:c+w]
//roi created in the line above should be used here, instead whole fram is used
hsv_roi = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV)
mask = cv2.inRange(hsv_roi, np.array((0., 60.,32.)), np.array((180.,255.,255.)))
roi_hist = cv2.calcHist([hsv_roi],[0],mask,[180],[0,180])
cv2.normalize(roi_hist,roi_hist,0,255,cv2.NORM_MINMAX)


History

Updated by Anna Kogan about 11 years ago

Hello Blaž,

Thank you for reporting the problem. If you could work on a solution on your side, a contribution (see How_to_contribute) would be very appreciated!

Updated by Andrew Senin about 11 years ago

  • Assignee changed from Vadim Pisarevsky to Blaž Šnuderl
  • Status changed from New to Open

Updated by Yash Vadalia almost 11 years ago

  • Status changed from Open to Done

Updated by Yash Vadalia almost 11 years ago

  • % Done changed from 0 to 100

Also available in: Atom PDF