I'm testing some algorithms to improve the image quality my hardware is getting. I have a vane in the image and would like to highlight the object contained in it.
Iusedthecodebelowtodotheequalizationoftheimage,butIdidnotsucceed.
importcv2importnumpyasnpdefhistogram_equalize(img):b,g,r=cv2.split(img)red=cv2.equalizeHist(r)green=cv2.equalizeHist(g)blue=cv2.equalizeHist(b)returncv2.merge((blue,green,red))img=cv2.imread('pos20.jpg')img_yuv=cv2.cvtColor(img,cv2.COLOR_BGR2YUV)#equalizethehistogramoftheYchannelimg_yuv[:,:,0]=cv2.equalizeHist(img_yuv[:,:,0])#converttheYUVimagebacktoRGBformatimg_output=cv2.cvtColor(img_yuv,cv2.COLOR_YUV2BGR)cv2.imshow('Colorinputimage',img)cv2.imshow('Histogramequalized',img_output)cv2.imwrite('20.jpg',img_output)cv2.waitKey(0)
Outputresult:
What is the best algorithm to improve image quality and highlight the edge of the object?