rk3399的gpu测试节点在:
cat /sys/devices/platform/ff9a0000.gpu/devfreq/ff9a0000.gpu/load
如果没有使用gpu的话,是显示0@200000000Hz,0就是使用率占0%
参考下opencv官网的文档:https://opencv.org/platforms/opencl.html
我们打开摄像头 进行灰阶并高斯模糊处理为例子
1.使用CPU操作:
代码:
#include <stdio.h> #include <iostream> #include <opencv2/opencv.hpp> using namespace std; using namespace cv; int main(int argc, char **argv) { int64 start=0,end=0; VideoCapture vcap(0); Mat frame, frameGray; for(;;){ start = getTickCount(); vcap >> frame; cvtColor(frame, frameGray, CV_BGR2GRAY); GaussianBlur(frameGray, frameGray, Size(3,3), 0,0