An improved kernel density estimation with adaptive bandwidth selection for edge detection