0

I am trying to read an input image using octave and plot its RGB values as a 3 dimension plot.

I am reading image using

im = imread('image')

How can I plot this?

Also, is it possible to plot a histogram of all the 3 layers?

Thanks

4

1 回答 1

2

如前所述,Octave API 文档为您提供了图像的 MxNx3 矩阵数据集。

R/G/B 通道是im矩阵的最后一个维度。hist需要一维输入,因此我们需要对其进行重塑

hist(reshape(im(:,:,1),1,[])) # red
hist(reshape(im(:,:,2),1,[])) # green
hist(reshape(im(:,:,3),1,[])) # blue

关于 3D 图:您是指3D 散点图吗?那么 Octave 的scatter3可能会对您有所帮助。

于 2013-08-07T12:33:18.987 回答