Iterate points for OpenCV's Line function
I'm trying to iterate from two tuples to create a line connection previous points to currents points.
for (x,y) in currFeatures and (px,py) in self.prev_draw_features:
cv.line(new_image, (px,py),(x,y),cv.RGB(125, 20,200),5)
Which then leads me to this error:
[ERROR] [WallTime: 1309631642.294530] bad callback: <bound method="" cached_subscriber.callback="" of="" <__main__.cached_subscriber="" instance="" at="" 0x2bbb290="">> Traceback (most recent call last): File "/opt/ros/diamondback/stacks/ros_comm/clients/rospy/src/rospy/topics.py", line 563, in _invoke_callback cb(msg) File "**", line 70, in callback for (x,y) in currFeatures and (px,py) in self.prev_draw_features: NameError: global name 'px' is not defined
Is it possible to iterate between two tuples at the exact same time, or will I need to construct a new variable to iterate between the elements. Keep in mind that the tuples may not be equal (which probably negates my "and" statement.
Thanks.