Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
#######################################
LSPyIV --TRANSFORMATION MODULE
#######################################
Python LSPIV tools
Contains all definitions/functions that deals with
transformations between coordinate systems (image/world)
"""
import numpy as np
class GRP:
"""Groud Reference Points class"""
def __init__(self):
# World coordinates
self.X = -99.99
self.Y = -99.99
self.Z = -99.99
# Image coordinates
self.i = -99
self.j = -99
class imgRef:
"""Image References for transformations"""
def __init__(self):
self.xyMin = (-99.99,-99.99)
self.xyMax = (-99.99,-99.99)
self.res = -99.99
self.ninj = (-99,-99)# Size of ORIGINAL image
class camera:
"""Camera class. contains many informations that could also be used for other purposes"""
def __init__(self):
self.position = [] # usually 3-D vector (numpy array)
self.angles = [] # usually 3D vector (numpy array)
self.intrinsic = {} # dict containing intrinsic parameters
self.scale = -99 # used for orthophotographic camera (equals to zoom factor)
self.fps = -99
self.resolution = -99 # resolution of the camera (usually in m/pix or pix/m)
self.resolutionInfo = "" # enter here the unit of resolution to avoid confusions
self.imagesize = () # size of image (tuple)