Hi,
Iam using the python api for detecting the baecodes. I works fine while detecting vectors and intersections but while detecting Barcodes there is an error says " SwigPyObject’ object has no attribute 'm_x".
Here is the code I am using
import pixy
from ctypes import *
from pixy import *
pixy.init()
pixy.change_prog(“line”)
print(“Pixy has started”)
class Barcode (Structure):
fields = [
(“m_x”, c_uint),
(“m_y”, c_uint),
(“m_flags”, c_uint),
(“m_code”, c_uint)]
class Vector (Structure):
fields = [
(“m_x0”, c_uint),
(“m_x1”, c_uint)]
barcodes = BarcodeArray(100)
vectors = VectorArray(100)
frame = 0
while 1:
line_get_all_features()
b_count = line_get_barcodes(100, barcodes)
v_count = line_get_vectors(100, vectors)
if b_count > 0 or v_count:
print(b_count)
print ‘frame %3d:’ %(frame)
frame = frame + 1
for index in range(0, b_count):
print’[BARCODE: x=%3d y=%3d]’ %( barcodes[index].m_x, barcodes[index].m_y)
Can you please help me. (Sorry about the code, I don’t know how to format it for indenting )
Thanks in advance