This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use anyhow::anyhow; | |
use anyhow::Result; | |
use image::RgbImage; | |
use ndarray::{Array1, ArrayView1, ArrayView3}; | |
use opencv::{self as cv, prelude::*}; | |
fn main() -> Result<()> { | |
// Read image | |
let img = cv::imgcodecs::imread("./assets/demo_img.png", cv::imgcodecs::IMREAD_COLOR)?; | |
// Use Orb | |
let mut orb = <dyn cv::features2d::ORB>::create( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use anyhow::Result; // Automatically handle the error types | |
use opencv::{ | |
prelude::*, | |
videoio, | |
highgui | |
}; // Note, the namespace of OpenCV is changed (to better or worse). It is no longer one enormous. | |
fn main() -> Result<()> { // Note, this is anyhow::Result | |
// Open a GUI window | |
highgui::named_window("window", highgui::WINDOW_FULLSCREEN)?; | |
// Open the web-camera (assuming you have one) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[package] | |
name = "rust_numpy_ext" | |
version = "0.1.0" | |
edition = "2021" | |
[lib] | |
crate-type = ["cdylib"] | |
[dependencies] | |
ndarray = "0.15.3" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function use_all() | |
bot.Use(0) | |
bot.Use(1) | |
bot.Use(2) | |
bot.Use(3) | |
end | |
function use(i) bot.Use(i) end | |
function move_up(speed) bot.Move(0,1,speed) end | |
function move_down(speed) bot.Move(0,-1,speed) end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"wheel": "RegularWheels", | |
"components": [ | |
"LaserFinder", | |
"Sniper", | |
"MachineGun", | |
"LaserFinder" | |
], | |
"color": "#00EAFF", | |
"componentHolder": "ComponentHolder", |