-
Notifications
You must be signed in to change notification settings - Fork 58
/
Copy pathimage_RBPF.py
55 lines (38 loc) · 950 Bytes
/
image_RBPF.py
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
44
45
46
47
48
49
50
51
52
53
54
# -*- coding: utf-8 -*-
"""
image.py
author: Keita Nagara 永良慶太 (University of Tokyo) <nagara.keita()gmail.com>
This class is called from "Main.py", and process image data.
methods:
processData(data) <- called from "Main.py"
"""
import sys
from math import *
import cv2 as cv
import numpy as np
import Util
from keypoint import KeyPoint
class ImageRBPF:
def __init__(self):
pass
def init(self):
#state.py
#self.state.init() #this is also called in sensor.py
#variables
pass
def setState(self,_state):
#state.py
self.state = _state
#Set new data and Execute all functions
def processData(self,time_,data):
#if nomatch then nothing to do
if(data[0] == "nomatch"):
#print("nomatch")
self.state.setImageData(0.0,"nomatch")
return
time = (float(long(time_) / 1000.0))
keypoints = []
for d in data:
if(d != ''):
keypoints.append(KeyPoint(d))
self.state.setImageData(time,keypoints)