Update: I have been working in simulink today and have made a small bit of progress. Right now the model includes: open multimedia file -> edge detection using sobel with output as a binary and a threshold -> bottom-hat using strel rectangle -> output to an image. Attached is a frame from the video. I am trying to count the ties in the video.
My first question is: Is Sobel Edge detection the best method to isolate the ties? I have been playing around with the threshold but I don't quite understand the meaning of the threshold values.