eo-learn icon indicating copy to clipboard operation
eo-learn copied to clipboard

Edge extraction task from deliverable 4.7

Open bsircelj opened this issue 5 years ago • 3 comments

This is different edge task from the previous one. It has different approach (Canny) to computing edges and it computes a timeless mask of of edges from single patch based on multiple features during the whole year.

This mask was used for masking edges of parcels for LPIS classification to avoid any potential mixed class instances.

Mask is computed in several steps:

  • Individual image edge calculation.
    • Each image is firstly blurred with a Gaussian filter (cv2.GaussianBlur), then edges are computed using edge detector cv2.Canny), finally dilation and erosion are applied for filling potential holes.
  • Individual image weight calculation
    • Each edge pixel's contribution is adjusted based on that feature's values in the vicinity. The weights are calculated by normalizing and blurring image with a Gaussian filter (cv2.GaussianBlur).
  • Yearly feature mask calculation by joining single weighted edge images for each feature
    • Weight mask is calculated by summing all weights for each pixel through the whole year. The pixels where do not contain an edge have a weight of 0, those who do, have a weight proportional to the weight calculated in the previous step. The idea of this is that we should prioritize edges which were calculated during the high vegetation period and ignore edges calculated during the off season eg. winter.
  • Final temporal mask calculation by joining all the yearly feature masks
    • Pixels are included only, if total sum of all feature's weights for that pixel exceeds the weight threshold.

bsircelj avatar Jul 23 '20 12:07 bsircelj

Mask computed on the test patch with default parameters. test_edges

bsircelj avatar Jul 23 '20 12:07 bsircelj

@bsircelj is #146 still relevant or does this PR replace it?

mlubej avatar Aug 06 '20 10:08 mlubej

@bsircelj is #146 still relevant or does this PR replace it?

It is as it has different methods. Here is emphasis on a single mask computed from multiple features and times but uses just one method. I guess they could be joined so that different methods are also used here. The @jO-Osko's function could be called when the cv2.canny is called here. Although I'm not sure what is the point of all that thresholding options as canny is the standard edge detector that works fine. Also it doesn't seem that @jO-Osko will work on that PR anymore.

bsircelj avatar Aug 06 '20 11:08 bsircelj

Thank you for the contribution. Sadly, due to inactivity, it has become outdated. I am closing this merge request for now, but feel free to reopen and update it if you wish for the feature to be integrated.

zigaLuksic avatar Mar 14 '23 12:03 zigaLuksic