-1

我想绘制我的 RGB 图像的 3D 直方图。下面是我的代码:

from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
import numpy as np
from scipy.misc import imread
import pylab

fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
img1 = imread('image.jpg')
img_reshaped = img1.reshape(img1.shape[0] * img1.shape[1], img1.shape[2])

hist, edges = np.histogramdd(img_reshaped, bins=(100, 100, 100))

请告诉我如何绘制hist我获得的直方图。

4

1 回答 1

0

您是否看过 matplotlib 库中的 3d 直方图示例?

见: http: //matplotlib.org/examples/mplot3d/hist3d_demo.html

于 2013-03-20T13:12:30.843 回答