1 保存低质量图片
std::vector <int> compression_params;
compression_params.push_back(cv::IMWRITE_JPEG_QUALITY);
compression_params.push_back(40);
cv::imwrite("xxxxx",frame,compression_params);
2 重新打开RTSP视频
cap2.open("rtsp://xxxx:xxxx@ip:554/stream1&channel=1");
3 brew 安装opencv后无法找到
需要在CMakeLists.txt手动指定
set(OpenCV_DIR "/opt/homebrew/Cellar/opencv/4.6.0/lib/cmake")
find_package(OpenCV REQUIRED)
include_directories("/opt/homebrew/Cellar/opencv/4.6.0/include")
4 undefined reference to symbol ‘pthread_create@@GLIBC_2.2.5‘
解决方法:在CmakeLists.txt文件中加入以下代码:
set(CMAKE_CXX_FLAGS -pthread)
5 C/C++报错undefined reference to `omp_get_thread_num‘
解决方法:在CmakeLists.txt文件中加入以下代码:
FIND_PACKAGE( OpenMP REQUIRED)
if(OPENMP_FOUND)
message("OPENMP FOUND")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
endif()
6 删除 /usr/local/aegis/aegis_client/aegis_11_37/AliYunDun
进入 阿里云安全中心 --> 功能设置 -->客户端设置
右边有卸载客户端按钮(我的卸载了,没按钮)
7 阿里云设置swap
dd if=/dev/zero of=swap bs=1024 count=8000000 #8G
sudo chmod 600 swap
sudo mkswap -f swap
sudo swapon swap
echo "/var/swapfile swap swap defaults 0 0" >> /etc/fstab
swapoff /var/swapfile #停止