r - videoplayR 的 github_install 和 R CMD INSTALL 失败

标签 r opencv

我试图从 github 安装包 videoplayR 但没有这样做。我尝试了两种方法:
1.使用README文件中提到的安装指南。它给出了以下错误:

> install_github("sjmgarnier/videoplayR")

Downloading github repo sjmgarnier/videoplayR@master Error in function (type, msg, asError = TRUE) :



2. 使用 R CMD SHLIB 等在运行 R CMD 检查时会出现以下错误。它是 install.out 文件的一部分:

* installing source package ‘videoplayR’ ...

** libs

g++ -I/usr/share/R/include -DNDEBUG -I"/home/nandy/R/x86_64-pc-linux-gnu-

library/3.1/Rcpp/include" -I"/home/nandy/R/x86_64-pc-linux-gnu-

library/3.1/RcppArmadillo/include" pkg-config --cflags opencv Rscript -e <p>'Rcpp:::CxxFlags()' -fpic -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -

Werror=format-security -D_FORTIFY_SOURCE=2 -g -c RcppExports.cpp -o RcppExports.o

g++ -I/usr/share/R/include -DNDEBUG -I"/home/nandy/R/x86_64-pc-linux-gnu-

library/3.1/Rcpp/include" -I"/home/nandy/R/x86_64-pc-linux-gnu-

library/3.1/RcppArmadillo/include" pkg-config --cflags opencv Rscript -e <p>'Rcpp:::CxxFlags()' -fpic -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -

Werror=format-security -D_FORTIFY_SOURCE=2 -g -c Video.cpp -o Video.o

Video.cpp: In member function ‘double Video::current_frame()’:

Video.cpp:42:25: error: ‘CV_CAP_PROP_POS_FRAMES’ was not declared in this scope

return(inputVideo.get(CV_CAP_PROP_POS_FRAMES)); ^

Video.cpp: In member function ‘void Video::set_current_frame(int)’:

Video.cpp:46:18: error: ‘CV_CAP_PROP_POS_FRAMES’ was not declared in this scope

inputVideo.set(CV_CAP_PROP_POS_FRAMES, n); ^

Video.cpp: In member function ‘void Video::next_frame_cv()’:

Video.cpp:63:22: error: ‘CV_CAP_PROP_POS_FRAMES’ was not declared in this scope

if (inputVideo.get(CV_CAP_PROP_POS_FRAMES) == inputVideo.get(CV_CAP_PROP_FRAME_COUNT)) { ^

Video.cpp:63:64: error: ‘CV_CAP_PROP_FRAME_COUNT’ was not declared in this scope

if (inputVideo.get(CV_CAP_PROP_POS_FRAMES) == inputVideo.get(CV_CAP_PROP_FRAME_COUNT)) { ^

Video.cpp: In member function ‘void Video::get_frame_cv(int)’:

Video.cpp:76:27: error: ‘CV_CAP_PROP_FRAME_COUNT’ was not declared in this scope

if (n > inputVideo.get(CV_CAP_PROP_FRAME_COUNT)) { ^

Video.cpp:80:18: error: ‘CV_CAP_PROP_POS_FRAMES’ was not declared in this scope

inputVideo.set(CV_CAP_PROP_POS_FRAMES, n); ^

Video.cpp: In member function ‘int Video::length()’:

Video.cpp:91:25: error: ‘CV_CAP_PROP_FRAME_COUNT’ was not declared in this scope return(inputVideo.get(CV_CAP_PROP_FRAME_COUNT)); ^



我猜问题 2 是由于 OpenCV 的版本问题而发生的。我对吗?有没有办法解决这个问题?

最佳答案

  • 看起来类似于以下 2 个报告的问题:https://github.com/hadley/devtools/issues/650https://github.com/hadley/devtools/issues/467 .看来您需要将系统(我认为是 Linux)更新到最新版本的 Curl。
  • 我相信这是我的错。上次我提交对 GitHub 存储库的更改时,我忘记排除已编译的共享对象 videoplayR.so。如果您使用的操作系统与我的不同(OSX Yosemite),那肯定是您遇到问题的原因。我修复了它,现在它也应该在您的计算机上很好地编译。

  • 仅供引用,我使用 OpenCV 2.4.9 和 2.4.10 编译并运行了该软件包,但它应该适用于任何 2.4.X 版本的 OpenCV(从未尝试过最新的 OpenCV 3.0 beta)。

    关于r - videoplayR 的 github_install 和 R CMD INSTALL 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27644937/

    相关文章:

    r - 地址匹配的分层模糊匹配策略

    python - 无法使用plt.imshow显示图片

    R 并排条形图,按 bin 大小绘制比例尺

    r - 如何调整plotmatrix中的图形设置?

    image - 从一组图片中检测(并去除)划痕

    Python OpenCV 找到图像中的所有三角形

    python - python中的对象跟踪

    opencv - 将 Mat 数组从 jni 返回到 java

    r - 使用二进制值时 R 中的直方图

    r - R Markdown中的图形大小