r - 如何将JPEG转换为R中的图像矩阵

标签 r image matrix jpeg

我需要将 JPEG 图像转换为矩阵。我想在矩阵上运行 SVD。

我用过

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

我想最好在灰度中获得“myjpg”的图像矩阵。是否有一个 R 命令可以做到这一点。

谢谢

最佳答案

您正在寻找:

imagedata(myjpg, type="grey")

关于r - 如何将JPEG转换为R中的图像矩阵,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25050974/

相关文章:

r - geom_smooth 在数据子集上

c++ - RStudio 与 Rcpp 一起不断崩溃

python - 如何在 OpenCV 中重新绘制皮肤?

php - Doctrine 2 ODM MongoDB 从内存中将图像存储在 GridFS 中

java - 网络服务器不显示图像

python - 乘以特定维度矩阵

r - ggplot facet_wrap 中的 Unicode(en_US.UTF-8 语言环境)

r - 调解 R 包 p 值 : workaround to get more significant digits?

algorithm - 最小面积矩阵覆盖

python - 将 Pandas 数据框转换为 RCV