Filter for covariance
Ok, so this may seem a little odd but bear with me.
I have an image, and I have a line (point slope form). What I need is a way to find the covariance above the line and the covariance below the line.
I have brute forced this by copying all of the pixels above/below the line into a new cv::Mat one by one (while keeping track of count and sum color as I do this), and then calculating the convariance manually.
While I am geting the results that I want this is incrediblly slow. Ideally I want to add GPU acceleration however because cv::GpuMat doesn't have direct access I cant exclude the unwanted pixels from either the count or the sum color.
I believe the key is to use some kind of filter however that concept is completly foreign and I am having trouble understanding what I need to do using the documentation.
Could someone please help me bring these cookies to a lower shelf.
Thanks
L.
Can you give an example image?
Test Image