[Python] OpenCV imshow shows very grainy image. How to fix this?

Discussão em 'Python' iniciado por Stack, Abril 9, 2025.

  1. Stack

    Stack Membro Participativo

    I have a CT image that look like this when I plot it using dicom: [​IMG]

    But when I try to use opencv, it appears like this:

    [​IMG]

    Array is dtype=uint16. My code to visualize in OpenCV:

    img = np.array(ct_img * 255, dtype = np.uint16)
    cv2.imshow('Annotated',img)
    cv2.waitKey(0)


    Please help fix the image. Image quality gets worse when I convert to np.uint32 or np.unint8

    Continue reading...

Compartilhe esta Página