Wrong colours with cv2.imdecode (python opencv)
问题 I try to display the image located here: http://skyservice.pha.jhu.edu/DR12/ImgCutout/getjpeg.aspx?ra=118.70299999999999&dec=45.721000000000004&width=10&height=10&scale=0.6 The image looks like this: I use this code: import matplotlib.pyplot as plt import numpy as np import urllib import cv2 url = 'http://skyservice.pha.jhu.edu/DR12/ImgCutout/getjpeg.aspx?ra=118.70299999999999&dec=45.721000000000004&width=10&height=10&scale=0.6' def url_to_image(url): resp = urllib.request.urlopen(url) image