Object Tracking In Real Time Via Opencv And Python
Solution 1:
I don't know camshift very well, but i'm guessing you are using opencv implementation. The below code is a snippet from the opencv example:
hsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV)
dst = cv2.calcBackProject([hsv],[0],roi_hist,[0,180],1)
# apply meanshift toget the new location
ret, track_window = cv2.CamShift(dst, track_window, term_crit)
For the first image, choosing the dst
as large as the frame size should solve your problem. Otherwise you can use a sliding window approach to locate the target in the first frame.
On the other hand, the term real time really depends on your requirements and deployment environment in such aspects:
- frame rate of input video
- resolution of the frames
- color scheme of the frame (rgb, yuv, gray, hsv, ...)
- maximum/minimum target size
- maximum target speed (pixels/frame)
- should it be robust to occlusions?
- what's the most specific properties of your targets: cars, human/animals, solid objects, changing shape, turning, ...
- are you using a CPU, DSP or GPU?
- ...
Since all of the considerations above would be really effective on your choice, i cannot recommend you a specific one. This one may be useful for example.
I would dig into IEEE explore and make a search such as real time object tracking
. I did one for you :) Here is your best start point, i guess.
Hope this helps. Gokhan.
Post a Comment for "Object Tracking In Real Time Via Opencv And Python"