diff options
author | Franklin Wei <franklin@rockbox.org> | 2019-12-15 14:02:59 -0500 |
---|---|---|
committer | Franklin Wei <franklin@rockbox.org> | 2019-12-15 14:02:59 -0500 |
commit | 0ab44fded43696d9ec1de41247b0ba821a148a22 (patch) | |
tree | ee4646e5cdab97bcf255c73047f08bba956c8e1d | |
parent | 6590d16e77c40123a72cdf02f60eb23c6de4b9bb (diff) | |
download | sloreg-0ab44fded43696d9ec1de41247b0ba821a148a22.zip sloreg-0ab44fded43696d9ec1de41247b0ba821a148a22.tar.gz sloreg-0ab44fded43696d9ec1de41247b0ba821a148a22.tar.bz2 sloreg-0ab44fded43696d9ec1de41247b0ba821a148a22.tar.xz |
Filter out central saturation region
-rw-r--r-- | gabor.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -235,6 +235,13 @@ void floodFill(int x, int y, Mat map, Mat visited, unsigned char target, unsigne } } +Mat removeSatRegion(Mat mask, Mat orig) { + Rect roi = selectROI("select saturation region", orig); + + rectangle(mask, roi, Scalar(0), FILLED); + return mask; +} + // flood fill in from the border to isolate the center region // in visited, != 0 means not visited, 0 means visited void borderFlood(Mat map, Mat visited) { @@ -358,6 +365,9 @@ int main() // clean up mask -- remove islands and holes Mat mask = cleanMask(threshed); + // remove saturation region from mask + mask = removeSatRegion(mask, img); + imshow("mask", mask); // if you want a magenta background |