Skip to content

Instantly share code, notes, and snippets.

View Harimus's full-sized avatar

Dan Ogawa Lillrank Harimus

View GitHub Profile
""" A hand-eye calibration with minimal (numpy) dependency
The calibration algorithm is from 'Hand-eye calibration using dual quaternion'
by Konstantinos Daniilidis 1998.
It comes with helper functions for rotation/quaternion transformations.
Some of them are ported from https://github.com/crigroup/baldor
The main algorithm is the same one used in Moveit hand-eye calibration.
"""
import numpy as np
@Harimus
Harimus / laplacian_pyramid_loss.py
Last active October 25, 2025 18:56
PyTorch implementation of Laplacian Pyramid Loss. Only 2D images, the code only takes stride=1, but kernel size can be modified.
import torch
import numpy as np
import torch.nn.functional as F
def gaussian_kernel(size=5, device=torch.device('cpu'), channels=3, sigma=1, dtype=torch.float):
# Create Gaussian Kernel. In Numpy
interval = (2*sigma +1)/(size)
ax = np.linspace(-(size - 1)/ 2., (size-1)/2., size)