2019-09-18 09:00:40 -0600 | asked a question | Why is max not equal to beta after using normalize? Why is max not equal to beta after using normalize? I'm doing a simple template matching on an RGB image with an RGB tem |
2014-07-10 19:41:07 -0600 | asked a question | VideoCapture returns empty frames on Windows after a while I have a program which loads a video and does all sorts of stuff, irrelevant to this question. I use Ubuntu Linux, where it works without issue. Now I need it to run on Windows. When I compile and run it, at first it works fine. But at some point, VideoCapture starts returning empty frames. It differs from video to video exactly when it happens, usually around 13000-15000 frames into the video. The stopping point is the same every time I run the program on the same video, so at least it is deterministic. I have created a very simple program in which the problem also happens: That is as barebones as I can do. When I run it with some of the videos I have captured, as mentioned it stops after several thousand frames. To verify that it is not my videos that are the problem, I downloaded the Open Source animation movie Elephants Dream in DivX (my own videos are Xvid). When I run the program with this, it stops after 74 frames: I'm considering if it is somehow a codec problem, but it does read the first frames just fine. I have Xvid and FFDShow installed on the Windows machine. Any ideas? I hardly know where to begin the debugging. |
2014-03-13 13:40:40 -0600 | received badge | ● Supporter (source) |
2013-02-22 05:54:13 -0600 | received badge | ● Editor (source) |
2013-02-22 05:52:08 -0600 | answered a question | OpenCV Draw draw contours of 2 largest objects A simple approach could be to judge the size by the number of points in the contour and simply remove all contours which are not one of the two biggest. Something like this (right after findContours): I have not tested the above code, but I think it should more or less work. If you want to use the actual areas you can calculate the area of the contours with contourArea and store the actual area instead of the vector size in contourSizes. The code above should still work in that case. |