킹남지 컴퍼니

  • 홈
  • 태그
  • 방명록

matplotlib 1

matplotlib.pyplot 흑백 이미지 출력이 정상적으로 안되는 경우 (plt.imshow(), cmap)

matplotlib.pyplot.imshow()로 흑백 이미지를 출력할 때 이상한 색상으로 출력되는 경우가 있습니다. 이미지 확인 먼저, Opencv를 통해 이미지를 불러와서 컬러 그대로 출력해보겠습니다. (Colab에서 실행한 코드입니다.) # 라이브러리 import numpy as np import matplotlib.pyplot as plt import cv2 img_1 = cv2.imread('/content/drive/MyDrive/opencv/cat.jpeg', cv2.IMREAD_COLOR) # 이미지를 [B, G, R] 순의 numpy 객체로 반환 img_rgb = cv2.cvtColor(img_1, cv2.COLOR_BGR2RGB) plt.imshow(img_rgb) plt.show() ..

파이썬 Python 2021.12.23
1
더보기
프로필사진

  • 분류 전체보기 (74)
    • Me (1)
    • 머신러닝, 딥러닝 ML, DL (20)
      • 이론 (15)
      • Pytorch (4)
      • Tensorflow, Keras (1)
    • 파이썬 Python (6)
    • 수학 Mathematics (3)
      • 선형대수학 Linear Algebra (0)
      • 수치해석학 Numerical Analysis (1)
      • 수리통계학 Mathematical Statisti.. (1)
      • 여러가지 (1)
    • 컴퓨터 공학 Computer Engineering (18)
      • 데이터베이스 Database (9)
      • 병렬 컴퓨팅 Parallel Computing (3)
      • 컴퓨터 구조 Computer Architectur.. (4)
      • 컴퓨터 비전 Computer Vision (1)
      • 알고리즘 Algorithm (1)
    • 논문 리뷰 Paper Review (17)
    • 기타 (9)

최근댓글

최근글과 인기글

  • 최근글
  • 인기글

방문자수Total

  • Today :
  • Yesterday :

Copyright © Kakao Corp. All rights reserved.

티스토리툴바