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
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
As already stated, the Octave API doc gives you an MxNx3 matrix data set of your image.
The R/G/B channels are the last dimensions of your im matrix. hist needs 1d input, so we'll need to reshape it:
hist(reshape(im(:,:,1),1,[])) # red
hist(reshape(im(:,:,2),1,[])) # green
hist(reshape(im(:,:,3),1,[])) # blue
About the 3D plot: do you mean a 3D scatter plot? Then Octave's scatter3 might help you.