|
发表于 2018-4-19 14:38:28
只看该作者
沙发
安装缺少的一些库后,opencv编译如下:
Looking for ccache - not found
Found ZLIB: /usr/lib/aarch64-linux-gnu/libz.so (found suitable version "1.2.8", minimum required is "1.2.3")
Could NOT find JPEG (missing: JPEG_LIBRARY JPEG_INCLUDE_DIR)
Could NOT find Jasper (missing: JASPER_LIBRARIES JASPER_INCLUDE_DIR)
Found ZLIB: /usr/lib/aarch64-linux-gnu/libz.so (found version "1.2.8")
Checking for module 'gtk+-3.0'
No package 'gtk+-3.0' found
Looking for linux/videodev.h
Looking for linux/videodev.h - not found
Looking for linux/videodev2.h
Looking for linux/videodev2.h - found
Looking for sys/videoio.h
Looking for sys/videoio.h - not found
Checking for module 'libgphoto2'
Found libgphoto2, version 2.5.9
Could not find OpenBLAS include. Turning OpenBLAS_FOUND off
Could not find OpenBLAS lib. Turning OpenBLAS_FOUND off
Could NOT find Atlas (missing: Atlas_CBLAS_INCLUDE_DIR Atlas_CLAPACK_INCLUDE_DIR Atlas_CBLAS_LIBRARY Atlas_BLAS_LIBRARY Atlas_LAPACK_LIBRARY)
A library with BLAS API not found. Please specify library location.
LAPACK requires BLAS
A library with LAPACK API not found. Please specify library location.
Could NOT find Pylint (missing: PYLINT_EXECUTABLE)
Could NOT find Matlab (missing: MATLAB_MEX_SCRIPT MATLAB_INCLUDE_DIRS MATLAB_ROOT_DIR MATLAB_LIBRARIES MATLAB_LIBRARY_DIRS MATLAB_MEXEXT MATLAB_ARCH MATLAB_BIN)
VTK is not found. Please set -DVTK_DIR in CMake to VTK build directory, or to VTK install subdirectory with VTKConfig.cmake file
Module opencv_videostab disabled because opencv_features2d dependency can't be resolved!
Processing WORLD modules...
module opencv_core...
module opencv_imgproc...
module opencv_photo...
module opencv_video...
module opencv_imgcodecs...
module opencv_videoio...
module opencv_highgui...
Processing WORLD modules... DONE
Excluding from source files list: /home/firefly/Workspace/opencv-3.4.0/modules/core/src/convert.sse4_1.cpp
Excluding from source files list: /home/firefly/Workspace/opencv-3.4.0/modules/core/src/convert.avx2.cpp
Excluding from source files list: /home/firefly/Workspace/opencv-3.4.0/build/modules/world/mathfuncs_core.sse2.cpp
Excluding from source files list: /home/firefly/Workspace/opencv-3.4.0/build/modules/world/mathfuncs_core.avx.cpp
Excluding from source files list: /home/firefly/Workspace/opencv-3.4.0/build/modules/world/mathfuncs_core.avx2.cpp
Excluding from source files list: /home/firefly/Workspace/opencv-3.4.0/build/modules/world/stat.sse4_2.cpp
Excluding from source files list: /home/firefly/Workspace/opencv-3.4.0/build/modules/world/stat.avx2.cpp
Excluding from source files list: /home/firefly/Workspace/opencv-3.4.0/modules/imgproc/src/corner.avx.cpp
Excluding from source files list: /home/firefly/Workspace/opencv-3.4.0/modules/imgproc/src/resize.avx2.cpp
Excluding from source files list: /home/firefly/Workspace/opencv-3.4.0/modules/imgproc/src/resize.sse4_1.cpp
Excluding from source files list: /home/firefly/Workspace/opencv-3.4.0/modules/imgproc/src/imgwarp.avx2.cpp
Excluding from source files list: /home/firefly/Workspace/opencv-3.4.0/modules/imgproc/src/imgwarp.sse4_1.cpp
Excluding from source files list: /home/firefly/Workspace/opencv-3.4.0/modules/imgproc/src/undistort.avx2.cpp
Excluding from source files list: /home/firefly/Workspace/opencv-3.4.0/modules/imgproc/src/filter.avx2.cpp
Excluding from source files list: /home/firefly/Workspace/opencv-3.4.0/build/modules/world/accum.sse2.cpp
Excluding from source files list: /home/firefly/Workspace/opencv-3.4.0/build/modules/world/accum.avx.cpp
General configuration for OpenCV 3.4.0 =====================================
Version control: unknown
Platform:
Timestamp: 2018-04-17T03:05:12Z
Host: Linux 4.4.77 aarch64
CMake: 3.5.1
CMake generator: Unix Makefiles
CMake build tool: /usr/bin/make
Configuration: Release
CPU/HW features:
Baseline: NEON FP16
required: NEON
disabled: VFPV3
C/C++:
Built as dynamic libs?: YES
C++ Compiler: /usr/bin/c++ (ver 5.4.0)
C++ flags (Release): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-comment -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG -DNDEBUG
C++ flags (Debug): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-comment -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -fvisibility=hidden -fvisibility-inlines-hidden -g -O0 -DDEBUG -D_DEBUG
C Compiler: /usr/bin/cc
C flags (Release): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Winit-self -Wno-narrowing -Wno-comment -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -fvisibility=hidden -O3 -DNDEBUG -DNDEBUG
C flags (Debug): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Winit-self -Wno-narrowing -Wno-comment -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -fvisibility=hidden -g -O0 -DDEBUG -D_DEBUG
Linker flags (Release):
Linker flags (Debug):
ccache: NO
Precompiled headers: NO
Extra dependencies: dl m pthread rt
3rdparty dependencies:
OpenCV modules:
To be built: core highgui imgcodecs imgproc photo video videoio world
Disabled: calib3d features2d flann js ml objdetect python_bindings_generator shape stitching superres
Disabled by dependency: videostab
Unavailable: cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev java python2 python3 ts viz
Applications: -
Documentation: NO
Non-free algorithms: NO
GUI:
GTK+: YES (ver 2.24.30)
GThread : YES (ver 2.52.3)
GtkGlExt: NO
VTK support: NO
Media I/O:
ZLib: /usr/lib/aarch64-linux-gnu/libz.so (ver 1.2.8)
JPEG: libjpeg (ver 90)
WEBP: build (ver encoder: 0x020e)
PNG: /usr/lib/aarch64-linux-gnu/libpng.so (ver 1.2.54)
JPEG 2000: build (ver 1.900.1)
OpenEXR: build (ver 1.7.1)
Video I/O:
GStreamer:
base: YES (ver 1.12.2)
video: YES (ver 1.12.2)
app: YES (ver 1.12.2)
riff: YES (ver 1.12.2)
pbutils: YES (ver 1.12.2)
libv4l/libv4l2: NO
v4l/v4l2: linux/videodev2.h
gPhoto2: YES
Parallel framework: pthreads
Trace: YES (built-in)
Other third-party libraries:
Lapack: NO
Eigen: NO
Custom HAL: YES (carotene (ver 0.0.1))
OpenCL: YES (no extra features)
Include path: /home/firefly/Workspace/opencv-3.4.0/3rdparty/include/opencl/1.2
Link libraries: Dynamic load
Python (for build): /usr/bin/python2.7
Matlab: NO
Install to: /usr/local
-----------------------------------------------------------------
Configuring done
这样编译可以成功,但是运行如下代码的时候,提示错误,具体如下:
代码:
#include <iostream>
#include <opencv2/opencv.hpp>
cv::Mat frame;
cv::VideoCapture capture;
long g_count = 0;
int main()
{
std::cout<<"open cam "<<std::endl;
if(!capture.open("test.mp4"))
{
std::cout<<"open cam failed"<<std::endl;
//return -1;
}
while(1)
{
std::cout<<"capture frame "<<std::endl;
capture>>frame;
if(frame.cols > 0 && frame.rows > 0)
{
std::cout<<"imshow frame "<<std::endl;
cv::imshow("0",frame);
}
if(cv::waitKey(30)==27) break;
}
return 0;
}
报错:
mpi: mpp version: 5849089 author: Herman Chen [mpp]: Add temporally patch for blocking issue
hal_h264d_api: hal_h264d_init mpp_buffer_group_get_internal used ion In
mpp_rt: NOT found ion allocator
mpp_rt: found drm allocator
OpenCV Error: Unspecified error (GStreamer: your gstreamer installation is missing a required plugin
) in handlemessage, file /home/firefly/Workspace/opencv-3.4.0/modules/videoio/src/cap_gstreamer.cpp, line 1869
VIDEOIO(cvCreateCapture_GStreamer (CV_CAP_GSTREAMER_FILE, filename)): raised OpenCV exception:
/home/firefly/Workspace/opencv-3.4.0/modules/videoio/src/cap_gstreamer.cpp:1869: error: (-2) GStreamer: your gstreamer installation is missing a required plugin
in function handlemessage
这是错在哪里?gstreamer没装好?
|
|