Close
There are some techniques make edge mask more neatly.

1) before applying edge detection, raise gamma. it masking more darks, and less brights.
2) apply surface blur after edge detected. it makes surfaces easily mask out with leveling.
3) of cause, leveling is the most important part of edge masking.
4) after made a edge mask, apply a greyscale mask again with overlay mode at the edge mask. it can preserve more darks.