Currently, I am trying to use Hessian matrix to detect wrinkles on the forehead. How could I remove out noises around these wrinkles? Below are my current code and result.
from skimage.feature import hessian_matrix, hessian_matrix_eigvals
image = cv2.imread("forehead.jpg")
gray = cv2.cvtColor(image, cv2.COLOR_RGB2GRAY)
def detect_ridges(gray, sigma=1.0):
H_elems = hessian_matrix(gray, sigma=sigma)
maxima_ridge, minima_ridge = hessian_matrix_eigvals(H_elems)
return maxima_ridge, minima_ridge
a, b = detect_ridges(gray, sigma=1.0)
fig, axs = plt.subplots(1, 2, figsize=(20, 20))
axs[0].imshow(gray, cmap="gray")
axs[1].imshow(a, cmap="gray")



You could first pre-process the image with an edge preserving filter like bilateralFilter(), edgePreservingFilter() etc. A nice tutorial is here.
Edge preserving filters, cartooning an image etc are big topics with several interesting algorithms. Here is one well cited paper, which also has shared code: 100+ Times Faster Weighted Median Filter.
With the right settings, most likely, the wrinkles will remain while the texture-like patterns will be smoothed out.