Skip to content

Commit

Permalink
Calibration with scipy (#75)
Browse files Browse the repository at this point in the history
* removed obsolete text

* added the scipy part

* added scipy optimizer for k1,k2,k3,p1,p2, affine

* can read 16 bit TIFF images and convert them to 8-bit on the fly
  • Loading branch information
alexlib authored Nov 29, 2024
1 parent 1ed7478 commit 86f258c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pyptv/ptv.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
from optv.transforms import convert_arr_metric_to_pixel

from skimage.io import imread
from skimage import img_as_ubyte
from skimage.color import rgb2gray
from pyptv import parameters as par


Expand Down Expand Up @@ -239,6 +241,11 @@ def py_sequence_loop(exp):
print(f"{imname} does not exist")
else:
img = imread(imname)
if img.ndim > 2:
img = rgb2gray(img)

if img.dtype != np.uint8:
img = img_as_ubyte(img)
# time.sleep(.1) # I'm not sure we need it here

if 'exp1' in exp.__dict__:
Expand Down

0 comments on commit 86f258c

Please sign in to comment.