Dosen : Prof.Dr. Suhartono M.Kom
Lembaga : UIN Maliki Malang
Selamat Malam, pada kesempatan kali ini saya akan memberikan sebuah cara untuk menganalisis suatu gambar dalam bentuk matrix, caranya bisa dilihat di bawah ini
library(EBImage)
Image <- readImage("C://Users/LENOVO/Documents/ENGGAR/WALLPAPER/megumin.jpg")
print(Image)
## Image
## colorMode : Color
## storage.mode : double
## dim : 2000 1414 3
## frames.total : 3
## frames.render: 1
##
## imageData(object)[1:5,1:6,1]
## [,1] [,2] [,3] [,4] [,5] [,6]
## [1,] 0.2078431 0.2352941 0.2392157 0.2235294 0.2352941 0.2313725
## [2,] 0.2274510 0.2588235 0.2588235 0.2431373 0.2549020 0.2509804
## [3,] 0.2392157 0.2705882 0.2666667 0.2549020 0.2627451 0.2588235
## [4,] 0.2274510 0.2588235 0.2549020 0.2431373 0.2509804 0.2509804
## [5,] 0.2235294 0.2549020 0.2509804 0.2392157 0.2549020 0.2549020
hist(Image)
Image1 <- Image + 0.2
Image2 <- Image - 0.2
par(mfrow= c(1,2))
plot(Image1)
plot(Image2)
Image3 <- Image * 0.5
Image4 <- Image * 2
par(mfrow = c(1,2))
plot(Image3)
plot(Image4)
Image5 <- Image ^ 2
Image6 <- Image ^ 0.7
par(mfrow= c(1,2))
plot(Image5)
plot(Image6)
display(Image[189:700, 95:300,])
Imagetr <- translate(rotate(Image, 45), c(50, 0))
display(Imagetr)
colorMode(Image) <- Grayscale
display(Image)
## Only the first frame of the image stack is displayed.
## To display all frames use 'all = TRUE'.
fLow <- makeBrush(21, shape= 'disc', step=FALSE)^2
fLow <- fLow/sum(fLow)
Image.fLow <- filter2(Image, fLow)
display(Image.fLow)
## Only the first frame of the image stack is displayed.
## To display all frames use 'all = TRUE'.
fHigh <- matrix(1, nc = 3, nr = 3)
fHigh[2, 2] <- -8
Image.fHigh <- filter2(Image, fHigh)
display(Image.fHigh)
## Only the first frame of the image stack is displayed.
## To display all frames use 'all = TRUE'.
Daftar Pustaka :
https://thinkstudioo.blogspot.com/2018/03/analisis-image-menggunakan-ebimage-di-r.html
https://thinkstudioo.blogspot.com/2018/03/analisis-image-menggunakan-ebimage-di-r_6.html