简体   繁体   中英

how to convert a JPEG to an image matrix in R

I need to convert a JPEG image to a matrix. I want to run SVD on the matrix.

I had used

library(jpeg)
library(biOps)
myjpg <- readJpeg("Snapshot_1.jpg")
> dim(myjpg)
[1] 398 506   3

I want to get an image matrix of "myjpg" in grey scale preferably. Is there an R command which does that.

Thanks

您正在寻找:

imagedata(myjpg, type="grey")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM