R-beginner question:
I wanted to convert an RGB image to grayscale and display / plot it using an image ()
library(EBImage)
orig = readImage("c:/test/b/s2.png")
gray = orig
colorMode(gray) = Grayscale
display(gray)
image(gray)
Image converted colorMode (gray) = Grayscale is not compatible with the image function. Does Crayscale image in R EBImage have more than one channel?
Then I converted it manually and was able to call the image () on it
r = channel(orig,"r")
g = channel(orig,"g")
b = channel(orig,"b")
gray1 = 0.21*r+0.71*g+0.07*b
display(gray1)
image(gray1)
However, grayscale images were slightly different from the intensity. Is there a way to convert RGB to single gray channel in R EBImage?
EDIT
To answer the question why EBImage:
. . (img2) (img1) EBImage:
blotgraph = resize(gblur(gray1,3),200,1)
plot(blotgraph, type="l")
, EBImage

