Which channel I can use to convert hist image to color image?

62 Views Asked by At

This is the original image

enter image description here

Code for applying equalizeHist to image:

PhotoImage_hist = resized_img
hist_image = resized_img
def histogram():
    global PhotoImage_hist,hist_image,gray_image
    hist_image = cv2.equalizeHist(gray_image)
    PhotoImage_hist = Image.fromarray(hist_image)
    PhotoImage_hist = ImageTk.PhotoImage(PhotoImage_hist)
    canvas_hist.create_image(0, 0, anchor=NW, image=PhotoImage_hist)

It is the image after applying equalizeHist:

enter image description here

After applying cvtColor to equalize image, it is not showing color image

PhotoImage_color = resized_img
color_img = resized_img
def coloredHist():
    global PhotoImage_color,hist_image,color_img
    color_img = cv2.cvtColor(hist_image,cv2.COLOR_GRAY2BGR)
    PhotoImage_color = Image.fromarray(color_img)
    PhotoImage_color = ImageTk.PhotoImage(PhotoImage_color)
    canvas_color.create_image(0, 0, anchor=NW, image=PhotoImage_color)

This is the output after applying cv2.cvtColor(hist_image,cv2.COLOR_GRAY2BGR)

enter image description here

Is there any other channel I can use to gain result my specific result??

0

There are 0 best solutions below