24 lines
776 B
Python
24 lines
776 B
Python
# -*- coding: utf-8 -*-
|
|
"""
|
|
Created on Thu Mar 29 12:16:17 2018
|
|
@author: That guy that turns his pen all the fucking time.
|
|
|
|
The purpose of this code is to make the spatial calibration for DaVis images. It consist in taking a doble-image, separate them in two and superimpose them.
|
|
|
|
It also calculates the magnification in the picture [pixels]<->[mm]
|
|
"""
|
|
|
|
|
|
"We tried to do this as cleanly as possible so that some PhD student in the future won't get on a plane at 2:00am and come hunt us down with a crowbar."
|
|
|
|
import cv2
|
|
import numpy as np
|
|
import ReadIM
|
|
from skimage import exposure
|
|
import glob
|
|
from pynverse import inversefunc
|
|
import scipy
|
|
|
|
function = tanh_fit(x_full, *popt)
|
|
cube = (lambda x: x**3)
|
|
invcube = inversefunc(cube, y_values = 3) |