python - Object Tracking using OpenCV -
i have video clip fish swimming in flume , small particles floating on surface. so, moving objects swimming fish , hundreds of particles. here link of video sample.
my interest locate fish correctly in each single frame.
currently, procedures below:
- remove light reflection (moving noise) in each single frame converting rgb hsv color space.
 - apply background subtraction method 
cv2.backgroundsubtractormog. - use erosion , dilation remove of moving particle noise.
 - find contours of blobs in binary images, , compute rotated bounding boxes blobs.
 - compute aspect ratios rotated bounding boxes.
 - identify fish in foreground frames using simple criteria: if blob occupies more 1 pixel, check aspect ratio of rotated bounding box. if has largest aspect ratio, considered fish.
 
my questions are:
- in first 10 frames, moving fish not identified 
cv2.backgroundsubtractormog, adjustedhistory,nmixturein function, not seems work in first 10 frames. how pick moving objects in first few frames? - in frames, 
cv2.backgroundsubtractormogcan pick vague outline of fish, shown in red circle in pic below:
 is there method fill spotted outline , identify fish? 
here link of my code.
thank you!
your input image isn't proper understand scenario but, methods can think of:
- try cv2.backgroundsubtractormog2
 - try mog on difference of consecutive frames in initial frames
 
Comments
Post a Comment