[Tutor] How to count vehicle? I'm trying but my code don't increasing..

Whees Northbee ch.de2.2309 at gmail.com
Mon Sep 1 19:54:03 CEST 2014


>What is the value of y here?
(x,y,w,h)=cv2.boundingRect(contour), where x,y is the left up position from
contour, and w,h is width and height of contour..

>*                 if w > 10 and h > 15:*

*this code I used, because there's a lot small blob from video
shaking, or the movement of trees.. And yes, the condition is true*

>*                     cv2.rectangle(frame, (x,y), (x+w,y+h), (180, 0, 0), 1)
*>*                     x1=w/2      #to find centroid
*>*                     y1=h/2
*>*                     cx=x+x1
*>*                     cy=y+y1*

>What's the value of cy?
cy and cx is the coordinate of center of rectangle.. the value is cartesian
coordinate like (136,60)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20140902/37ab9f87/attachment.html>


More information about the Tutor mailing list