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:

  1. remove light reflection (moving noise) in each single frame converting rgb hsv color space.
  2. apply background subtraction method cv2.backgroundsubtractormog.
  3. use erosion , dilation remove of moving particle noise.
  4. find contours of blobs in binary images, , compute rotated bounding boxes blobs.
  5. compute aspect ratios rotated bounding boxes.
  6. 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:

  1. in first 10 frames, moving fish not identified cv2.backgroundsubtractormog, adjusted history, nmixture in function, not seems work in first 10 frames. how pick moving objects in first few frames?
  2. in frames, cv2.backgroundsubtractormog can pick vague outline of fish, shown in red circle in pic below: red circle 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:

  1. try cv2.backgroundsubtractormog2
  2. try mog on difference of consecutive frames in initial frames

Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -