2020-11-05 14:26:40 -0600 | received badge | ● Student (source) |
2017-02-21 03:30:03 -0600 | asked a question | Effective way to automatically set NoiseSigma in BackgroundSubtractorMOG? Hey there, I'm trying to make a program that detects people in CCTV footage and I've made a lot of progress. Unfortunately, the amount of noise in the videos varies a lot between different cameras and time of day, so with each of the sample videos. This means that the NoiseSigma needed varies from 1-25. I've used a fastNlMeansDenoisingColored function and that helped a bit, but the NoiseSigma is still an issue. Would it be effective to maybe loop through the video once, and somehow get an idea for how noisy the video is and make a relationship for noise vs NoiseSigma? Any ideas would be welcome. |
2017-02-20 07:12:47 -0600 | commented answer | OpenCV issue with drawing Farneback optical flow in ROI. This solved it: |
2017-02-20 07:12:06 -0600 | commented answer | OpenCV issue with drawing Farneback optical flow in ROI. @berak I'VE DONE IT! I just changed the flowatxy declaration to: const Point2f& flowatxy=flow.at<point2f>( pt1.y+y , pt1.x+x ); |
2017-02-20 05:27:40 -0600 | commented answer | OpenCV issue with drawing Farneback optical flow in ROI. @berak Well, this might be better but it still isn't right. Now it draws it up in the top left corner, which makes sense if you look at the first points in the line function. The for loops will start plotting the line at (0,0) and then (1,0) and so on. But at least now, it seems like it is plotting the correct flow for the ROI, just in the wrong place. If that makes sense. |
2017-02-20 04:52:25 -0600 | commented answer | Grabbing the image skips current (or next) frame. @Farshadhn If you post your code, it will be easier to help. Is the issue with the video playing to fast when you imshow it or when you save it? For the imshow, make sure that the waitKey at the end is 1000/fps and that there isn't any grab inside the if(frame.empty()) loop. |
2017-02-20 04:36:15 -0600 | asked a question | OpenCV issue with drawing Farneback optical flow in ROI. Hey hey, I've written a code to create bounding boxes and draw the Farneback optical flow inside. The optical flow is calculated normally before hand and then it is drawn separately for each ROI box. The problem comes when I draw the flow. The flow comes out looking normal, but shifted down and right. Here's the output, notice the bottom right has the flow of the moving person. Here is the frame with the flow drawn everywhere, showing where the flow should be drawn. The code attached is stripped down for simplicity, so excuse me if there are a few undeclared Matrices or something. |
2017-02-14 05:16:16 -0600 | received badge | ● Enthusiast |
2017-02-13 01:19:29 -0600 | commented answer | Grabbing the image skips current (or next) frame. Perfect! The problem was in the "if (!cap.grab())" loop, as that method caused a second grab. If I use the frame.empty instead, it works out great! Thanks a bunch. |
2017-02-13 01:17:25 -0600 | received badge | ● Supporter (source) |
2017-02-13 01:17:24 -0600 | received badge | ● Scholar (source) |
2017-02-12 10:30:34 -0600 | commented question | Grabbing the image skips current (or next) frame. Yeah, sure sure. I had a video writer with CV_CAP_PROP_FPS or something set as the fps, but I took it out as I was trying to strip the code to see where it skipped the frame. I've never played a video using imshow(currentimage0) though, I always use imshow(currentimage). Do you think it would make a difference if I didn't use cap>>currentimage every loop, and instead used it once before the loop and then called currentimage0 to display? Edit: Do you think if I remove the cap>>currentImage and make a Mat currentImage= cap after the if loop, it will stop grabbing twice? That seems positive. |
2017-02-10 08:30:36 -0600 | asked a question | Grabbing the image skips current (or next) frame. Hey there, I've recently realised that all of my output videos are twice as fast as the original, so i made the program print out the current frame and noticed that it was increasing by 2 each time (2,4,6,8...). When I removed the "cap>>currentImage;" it printed 1,2,3,4,... I just don't understand why this is happening. Is there a mistake in the way I'm printing the frame? Any help would be appreciated. |
2017-02-06 03:28:12 -0600 | commented answer | Video feed starts white and it's messing with my background subtraction Some great suggestions up there! I'm thinking of taking a frame from somewhere in the middle and using it as a 'template frame'-type thing. And then getting the value of that image and adjusting the brightness of each frame until it's that value, do you think that will be affective? I like the sound of changing the learning rate as the lighting gets better. Would the learning rate in BackgroundSubtractorMOG be the history parameter? |
2017-02-03 04:51:51 -0600 | answered a question | How to scan line by line in an image array I'm not sure how to check for binary, but this works for scanning through each pixel. |
2017-02-02 02:32:47 -0600 | asked a question | Video feed starts white and it's messing with my background subtraction Hey there, I've made an motion tracker in C++ and I'm running into issues with the video feed. The video starts off white and then the brightness fades as the camera adjusts to the brightness. I'm using BackgroundSubtractorMOG and it detects this as a constantly changing background. Is there anyway to auto detect the brightness and keep it at a certain level, or even just detect when an image is too bright to detect and only apply the subtractor when it reaches an acceptable level? |