Skip to content

Instantly share code, notes, and snippets.

View dimidagd's full-sized avatar
🏠
Working from home

dimidagd

🏠
Working from home
  • Denmark
View GitHub Profile
@dimidagd
dimidagd / main.py
Created March 1, 2022 15:43
snippet
from typing import Any
import numpy as np
from nptyping import NDArray
def main(name):
# Use a breakpoint in the code line below to debug your script.
print(f'Hi, {name}') # Press Ctrl+F8 to toggle the breakpoint.
f: NDArray[(3, 3), Any] = lambda A, f: A ** f
ak = 3
n = 2
@dimidagd
dimidagd / map_matching.py
Created July 27, 2020 11:33
linear polar conversions
kernel = (5,5)
self.img = cv2.blur(self.img, kernel)
# Polar blur
polar_img = cv2.blur(cv2.linearPolar(self.img.copy(), (self.imgWidth/2,self.imgHeight/2), self.imgHeight/2, cv2.WARP_POLAR_LINEAR+cv2.WARP_FILL_OUTLIERS), kernel)
cart_img = cv2.linearPolar(polar_img.copy(), (self.imgHeight/2,self.imgWidth/2), self.imgHeight/2, cv2.WARP_INVERSE_MAP+cv2.WARP_POLAR_LINEAR+cv2.WARP_FILL_OUTLIERS)
self.img = cart_img
import random, sys
################################################################################
# the x and y in our function (x - y + 7) (aka. dimensions)
number_of_variables = 3
# the minimum possible value a pose difference can have
min_values = [-10, -10, -3.14/2]
@dimidagd
dimidagd / pso.py
Created July 24, 2020 08:21 — forked from halolimat/pso.py
A module that solves a minimization problem using Particle Swarm Optimization (PSO)
#!/usr/bin/env python
################################################################################
# File name: pso.py #
# Description: A module that solves a minimization problem using PSO #
#------------------------------------------------------------------------------#
# Author: Hussein S. Al-Olimat #
# Email: hussein@knoesis.org #
#------------------------------------------------------------------------------#
# Date-last-modified: Nov 7, 2016 #