什么免费网站可以链接域名,制作动画的网站模板,领手工在家做的网站2019,大学 两学一做专题网站opencv-rust 系列: 1, 安装及运行自带示例和测试程序 运行环境: ubuntu ; rust 已安装; 对rust的掌握为三脚猫程度一. opencv-rust安装:二. 运行自带examples和tests 运行环境: ubuntu ; rust 已安装; 对rust的掌握为三脚猫程度
一. opencv-rust安装:
安装软件: sudo apt in… opencv-rust 系列: 1, 安装及运行自带示例和测试程序 运行环境: ubuntu ; rust 已安装; 对rust的掌握为三脚猫程度一. opencv-rust安装:二. 运行自带examples和tests 运行环境: ubuntu ; rust 已安装; 对rust的掌握为三脚猫程度
一. opencv-rust安装:
安装软件: sudo apt install libopencv-dev clang libclang-dev llvm (clang就是llvm部分)查看版本: sudo apt show libopencv-dev 目前20241006支持OPENCV 4.6.0
二. 运行自带examples和tests
安装最新的opencv库,命令: cargo add opencv ( 此时20241006, 库版本为 0.93.1 )使用命令: locate opencv-0.93 找到库所在目录复制一份到本地, 例如: cp -av /home/wzw/.cargo/registry/src/index.crates.io-6f17d22bba15001f/opencv-0.93.1 ./运行自带示例(示例在examples目录中) 命令如: cargo run --example video_capture ( 摄像并显示 )命令如: cargo run --example video_facedetect ( 人脸测试 )备注: examples/ 目录中的程序都可以试试, 有些程序运行需要参数 运行自带的测试程序 命令: cargo test 报错: error[E0599]: no method named points_vec found for struct RotatedRect in the current scope -- tests/core_only_latest_opencv.rs:11:7修改程序: tests/core_only_latest_opencv.rs 被替换内容: let mut vec_pts Vector::new(); rect.points_vec(mut vec_pts)?; assert_eq!(Point2f::new(50., 50.), vec_pts.get(0)?); assert_eq!(Point2f::new(150., 50.), vec_pts.get(1)?); assert_eq!(Point2f::new(150., 150.), vec_pts.get(2)?); assert_eq!(Point2f::new(50., 150.), vec_pts.get(3)?);替换成: let mut vec_pts [Point2f::new(0.0, 0.0); 4]; rect.points(mut vec_pts)?; assert_eq!(Point2f::new(50., 50.), *vec_pts.get(0).unwrap()); assert_eq!(Point2f::new(150., 50.), *vec_pts.get(1).unwrap()); assert_eq!(Point2f::new(150., 150.), *vec_pts.get(2).unwrap()); assert_eq!(Point2f::new(50., 150.), *vec_pts.get(3).unwrap()); 现在再 cargo test 就可以运行通过了. ( 有两个 warning 可以忽略 )