Ask Your Question

everphilski's profile - activity

2017-03-23 23:51:33 -0600 commented question Specify ffmpeg encoder in VideoCapture

berak - thanks. I can't find good documentation on this. Is there an example you could point me to?

2017-03-23 23:47:06 -0600 received badge  Enthusiast
2017-03-20 14:02:30 -0600 answered a question Detect multiple color markers

The way I would do it is 1) Build a database of HSV color ranges for each of the fluorescent markers 2) Loop over the video, convert each frame to HSV, then loop over each fluorescent color using cv2.inRange 3) The output of cv2.inRange is a binary image where white is a match and black is not - you can now use each of these images to find the center of the match. If there is noise, You may also need to dilate and erode to remove noise - look at cv2.dilate and cv2.erode. 4) repeat 2-3 until video is complete. Track centers of each color from frame to frame.

2017-03-20 13:52:20 -0600 asked a question Specify ffmpeg encoder in VideoCapture

I'm using an Orange Pi with a built in CSI webcam. On the command line with ffmpeg I can get 30+ frames a second no problem using the hardware-accelerated cedrus encoder.

From OpenCV, using the v4l2 bindings is much slower - I get about 10 frames per second in the best case. And it's no better if I specify CAP_FFMPEG because it isn't using the hardware-accelerated encoder.

Is there a way to either (a) specify an encoder in OpenCV VideoCapture (API suggests no) (b) a straightforward way to pipe output from an ffmpeg process to OpenCV VideoCApture (c) is there a third method I'm missing?

thanks philip

2017-03-18 19:33:52 -0600 received badge  Editor (source)
2017-03-18 19:31:09 -0600 asked a question break up contours found by findContours

Good Evening,

I'm trying to use OpenCV to detect remote controlled robots in an arena. These robots typically contrast well with the surroundings so my approach has been to use the Canny detector to find edges and then use findContours to filter out contours I don't care about. (Please refer to linked image) For example in the top left image I don't care about the long straight lines that are caused by the edge of the arena. In general I can discard these by aspect ratio. However in some cases (bottom left) findContours keeps multiple lines in one contour and then fills in a box (grey in bottom right)

My question is, is there a way to break up these lines output from findContours ?

I have played with thresholds on the Canny detctor and while higher quality does tend to break up those lines it also loses track on those robots (which apparently are not high quality features! :) )

image description

I tried feeding my Canny image into HoughLinesP to remove lines. After some tweaking the situation is improved (see figure) now I just have small triangles instead of large quadrilateral.

image description

I am still looking for a solution to break up lines remaining in the canny image.

thanks

philip