R Presentation

Jason Jylee
2014/11/26

Outline

  • EBImage

  • image

  • levelplot (Lattice)

  • PCA for image

  • Google map

EBImage

EBImage

## Load the library by the following command
## source("http://bioconductor.org/biocLite.R")
## biocLite("EBImage")
library(EBImage)
  • an R package which provides general purpose functionality for the reading, writing, processing and analysis of images.

  • offers tools to transform the images, segment cells and extract quantitative cellular descriptors.

  • Author: Andrzej Oles, Gregoire Pau, Mike Smith, Oleg Sklyar, Wolfgang Huber, with contributions from Joseph Barry and Philip A. Marais.

Image Properties

Image <- readImage("C:/Users/asusnb/Desktop/picture.JPG")
print(Image)
Image
  colormode: Color 
  storage.mode: double 
  dim: 960 720 3 
  nb.total.frames: 3 
  nb.render.frames: 1 

imageData(object)[1:5,1:6,1]:
          [,1]      [,2]      [,3]      [,4]      [,5]      [,6]
[1,] 0.5921569 0.5921569 0.5843137 0.5803922 0.5372549 0.4470588
[2,] 0.5490196 0.5568627 0.5607843 0.5843137 0.5803922 0.5333333
[3,] 0.5921569 0.5882353 0.5803922 0.5921569 0.5921569 0.5647059
[4,] 0.6117647 0.6039216 0.5803922 0.5803922 0.5843137 0.5647059
[5,] 0.5568627 0.5568627 0.5490196 0.5607843 0.5882353 0.5882353

Our Image

#Use display(Image) to show the picture.

Brightness

Lighter_Image <- Image + 0.2
Darker_Image <- Image - 0.2
#display(Lighter_Image); display(Darker_Image)
                 Brighter                     Darker

Contrast

Low_Image <- Image*0.5
High_Image <- Image*2
#display(Low_Image); display(High_Image)
                     Low              High