OpenCV Q&A Forum - RSS feedhttp://answers.opencv.org/questions/OpenCV answersenCopyright <a href="http://www.opencv.org">OpenCV foundation</a>, 2012-2018.Fri, 08 Jun 2018 15:46:19 -0500Local Mean and Variancehttp://answers.opencv.org/question/193393/local-mean-and-variance/I have an artificial flow field given by a homography transform. I want to compare this flow field to the results of an optical flow algorithm. I want to do a pixel-wise comparison in a statistical manner. It seems to me that I can best do this by comparing the optical flow value to the statistics of the local neighborhood of the homography flow. See [this paper](https://www.researchgate.net/profile/Thomas_Castelli3/publication/283462638_Moving_object_detection_for_unconstrained_low-altitude_aerial_videos_a_pose-independant_detector_based_on_Artificial_Flow/links/56390bb208aecf1d92a9bc69.pdf) for inspiration.
My question is, what OpenCV functions can I use to calculate the local mean and variance over some window?Fri, 08 Jun 2018 10:34:08 -0500http://answers.opencv.org/question/193393/local-mean-and-variance/Comment by Tetragramm for <p>I have an artificial flow field given by a homography transform. I want to compare this flow field to the results of an optical flow algorithm. I want to do a pixel-wise comparison in a statistical manner. It seems to me that I can best do this by comparing the optical flow value to the statistics of the local neighborhood of the homography flow. See <a href="https://www.researchgate.net/profile/Thomas_Castelli3/publication/283462638_Moving_object_detection_for_unconstrained_low-altitude_aerial_videos_a_pose-independant_detector_based_on_Artificial_Flow/links/56390bb208aecf1d92a9bc69.pdf">this paper</a> for inspiration.</p>
<p>My question is, what OpenCV functions can I use to calculate the local mean and variance over some window?</p>
http://answers.opencv.org/question/193393/local-mean-and-variance/?comment=193414#post-id-193414Yep, that stack overflow answer is correct.
You'd probably want to use the blur function, not the separable dog filter. blur uses a separable box filter with a O(1) cost, relative to the size of the box. Meaning an area 51x51 takes no longer than an area of 5x5.Fri, 08 Jun 2018 15:46:19 -0500http://answers.opencv.org/question/193393/local-mean-and-variance/?comment=193414#post-id-193414Comment by LBerger for <p>I have an artificial flow field given by a homography transform. I want to compare this flow field to the results of an optical flow algorithm. I want to do a pixel-wise comparison in a statistical manner. It seems to me that I can best do this by comparing the optical flow value to the statistics of the local neighborhood of the homography flow. See <a href="https://www.researchgate.net/profile/Thomas_Castelli3/publication/283462638_Moving_object_detection_for_unconstrained_low-altitude_aerial_videos_a_pose-independant_detector_based_on_Artificial_Flow/links/56390bb208aecf1d92a9bc69.pdf">this paper</a> for inspiration.</p>
<p>My question is, what OpenCV functions can I use to calculate the local mean and variance over some window?</p>
http://answers.opencv.org/question/193393/local-mean-and-variance/?comment=193407#post-id-193407What's problem ? you can apply same method for covariance (not in polar of course) :
blur((x-blur(x)) (y-blur(y))
x-blur(x) can be done with separable dog filterFri, 08 Jun 2018 14:24:41 -0500http://answers.opencv.org/question/193393/local-mean-and-variance/?comment=193407#post-id-193407Comment by Der Luftmensch for <p>I have an artificial flow field given by a homography transform. I want to compare this flow field to the results of an optical flow algorithm. I want to do a pixel-wise comparison in a statistical manner. It seems to me that I can best do this by comparing the optical flow value to the statistics of the local neighborhood of the homography flow. See <a href="https://www.researchgate.net/profile/Thomas_Castelli3/publication/283462638_Moving_object_detection_for_unconstrained_low-altitude_aerial_videos_a_pose-independant_detector_based_on_Artificial_Flow/links/56390bb208aecf1d92a9bc69.pdf">this paper</a> for inspiration.</p>
<p>My question is, what OpenCV functions can I use to calculate the local mean and variance over some window?</p>
http://answers.opencv.org/question/193393/local-mean-and-variance/?comment=193400#post-id-193400Bonus points for covariance. Rather than simply independent x and y variance.Fri, 08 Jun 2018 11:48:33 -0500http://answers.opencv.org/question/193393/local-mean-and-variance/?comment=193400#post-id-193400Comment by Der Luftmensch for <p>I have an artificial flow field given by a homography transform. I want to compare this flow field to the results of an optical flow algorithm. I want to do a pixel-wise comparison in a statistical manner. It seems to me that I can best do this by comparing the optical flow value to the statistics of the local neighborhood of the homography flow. See <a href="https://www.researchgate.net/profile/Thomas_Castelli3/publication/283462638_Moving_object_detection_for_unconstrained_low-altitude_aerial_videos_a_pose-independant_detector_based_on_Artificial_Flow/links/56390bb208aecf1d92a9bc69.pdf">this paper</a> for inspiration.</p>
<p>My question is, what OpenCV functions can I use to calculate the local mean and variance over some window?</p>
http://answers.opencv.org/question/193393/local-mean-and-variance/?comment=193395#post-id-193395[Stackoverflow](https://stackoverflow.com/questions/11456565/opencv-mean-sd-filter)Fri, 08 Jun 2018 10:38:11 -0500http://answers.opencv.org/question/193393/local-mean-and-variance/?comment=193395#post-id-193395