I'm working on a program to track the speed of polymer growth and am having trouble getting all the noise out. It mainly uses openCV and works like this:
1 split video into frames (a frame included in this post for context: (https://i.stack.imgur.com/fVxVy.jpg))
2 do a gaussian blur using openCV to smooth the grainy background
3 threshold the frames to make the polymers white and the background black
4 subtract consecutive frames, this gets a new set of frames that show only the movement between frames
(velocity)
5 use cv2.findContour and cv2.minEnclosingCircle I get the diameter of the contours, which is how fast the velocity of each point is.
My problem is that, while this gets rid of the background noise, it doesn't get rid of noise created from the polymers wiggling side to side at they grow. Because this is picked up as changing between frames, I get contours for the growth of the tips AND contours along the sides of the polymer where it shifted. (same picture but with markings showing the what the contours would look like: (https://i.stack.imgur.com/cPvW4.png) )
Using openCV select a region of interest (ROI) and the built in tracker to manually select and only watch the tips was incredibly finicky and the tracjer would often get stuck in one position or jump around the screen.
So far the most successful thing I tried was going through the difference frames (from step 4) "for n in frames, sum frames 0 to (n-1) and subtract from frame n" this makes it so any pixel that becomes white can only do so once, since all frame up to the present are added together and then subtracted from the present frame. This helps gets some of the noise out, but not enough to be able to simply get all contour sizes from the whole image and call each one a tip growing.
I'm currently trying to get the excess noise out by looking at 3 frames at a time (previous, current, future) and matching each contour in present to where is came from in previous and where it went in future. But I'm having trouble connecting the pixels to the contours they are part of.
To sum it up, I'm looking for ideas of how to only collect information on the tips while ignoring information about the wiggles.