[英]error with python saying invalid syntax trying to create list of struct
在“相机后方交会”的关键帧中,我试图创建一个出现在帧中的点的列表,然后尝试创建一个包含以下帧中相应点的列表,以保持跟踪视频中的点以找到之间的K矩阵。他们。
我有以下课程存储每个框架中的点,并为每个框架创建一个点列表,并沿所有框架跟踪它们。
class PointsCorrespondence:
"""
Stores the point of a specific index.
"""
# A point is represented as (coordinate X, coordinate Y)
Point = (float, float)
# A point with corresponding same point is represented as (coordinates, index of the corresponding point or -1 if there is no corresponding point).
PointWithCorrespondence = (Point, int)
# Contains the points represented as one list of notable points for each frame.
_pointsPerFrame : [[PointWithCorrespondence]]
def __init__(self, pointsPerFrame : [[PointWithCorrespondence]]):
self._pointsPerFrame = pointsPerFrame
当我尝试运行此代码以在其中存储点时,出现以下错误:
追溯(最近一次通话最后一次):导入pointTracking文件中的文件“ main.py”,第4行,行17中的“ /home/k/Desktop/CV/project/insertc/project12345/pointTracking.py”
_pointsPerFrame : [[PointWithCorrespondence]] ^ SyntaxError: invalid syntax
实际上,我不知道为什么会收到该错误,因此我尝试了很多方法来检查python语法样式。
我正在使用python 3.4
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.