Skip to content

Instantly share code, notes, and snippets.

View Machine-Jonte's full-sized avatar

Jonathan Österberg Machine-Jonte

View GitHub Profile
@Machine-Jonte
Machine-Jonte / jon_bot.json
Last active April 6, 2022 19:24
Bot for game
{
"wheel": "RegularWheels",
"components": [
"LaserFinder",
"Sniper",
"MachineGun",
"LaserFinder"
],
"color": "#00EAFF",
"componentHolder": "ComponentHolder",
@Machine-Jonte
Machine-Jonte / jonbot.lua
Last active April 6, 2022 19:10
Bot script for game
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
@Machine-Jonte
Machine-Jonte / Cargo.toml
Last active February 21, 2022 16:41
medium_python_rust_binding
[package]
name = "rust_numpy_ext"
version = "0.1.0"
edition = "2021"
[lib]
crate-type = ["cdylib"]
[dependencies]
ndarray = "0.15.3"
@Machine-Jonte
Machine-Jonte / opencv_rust_tutorial_medium_cam.rs
Created February 13, 2022 23:57
opencv_rust_tutorial_medium_cam
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)
@Machine-Jonte
Machine-Jonte / opencv_rust_tutorial_orb.rs
Last active February 13, 2022 23:55
opencv_rust_tutorial_medium
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(