Mercurial > hg > nsaunier > traffic-intelligence
comparison trafficintelligence/storage.py @ 1256:56d0195d043e
cleaning indicators (no more time interval) and runtimeerror with arccos
| author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
|---|---|
| date | Wed, 03 Apr 2024 14:41:20 -0400 |
| parents | c0fe55a6b82f |
| children | e59a0a475a0a |
comparison
equal
deleted
inserted
replaced
| 1255:c0fe55a6b82f | 1256:56d0195d043e |
|---|---|
| 1448 worldCorners = compute3Dbox(anno_list_temp) | 1448 worldCorners = compute3Dbox(anno_list_temp) |
| 1449 # take first 4 lines of corners, x,y,_ # x0, y0, _ = boxes3d[0] | 1449 # take first 4 lines of corners, x,y,_ # x0, y0, _ = boxes3d[0] |
| 1450 xCoords = worldCorners[:4,0] | 1450 xCoords = worldCorners[:4,0] |
| 1451 yCoords = worldCorners[:4,1] | 1451 yCoords = worldCorners[:4,1] |
| 1452 t.addPositionXY(xCoords.mean(), yCoords.mean()) | 1452 t.addPositionXY(xCoords.mean(), yCoords.mean()) |
| 1453 for i in range(4): | 1453 for j in range(4): |
| 1454 featureTrajectories[i].addPositionXY(xCoords[i], yCoords[i]) | 1454 featureTrajectories[j].addPositionXY(xCoords[j], yCoords[j]) |
| 1455 # check https://docs.opencv.org/3.4/d9/d0c/group__calib3d.html#ga1019495a2c8d1743ed5cc23fa0daff8c | 1455 # check https://docs.opencv.org/3.4/d9/d0c/group__calib3d.html#ga1019495a2c8d1743ed5cc23fa0daff8c |
| 1456 if interval.length()>1: | 1456 if interval.length()>1: |
| 1457 objects.append(moving.MovingObject(num = objNum, timeInterval = interval, positions = t, velocities = t.differentiate(True), userType = userType, features = [moving.MovingObject(num = featureNum+i, timeInterval = copy(interval), positions = featureTrajectories[i], velocities = featureTrajectories[i].differentiate(True)) for i in range(4)])) | 1457 objects.append(moving.MovingObject(num = objNum, timeInterval = interval, positions = t, velocities = t.differentiate(True), userType = userType, features = [moving.MovingObject(num = featureNum+i, timeInterval = copy(interval), positions = featureTrajectories[i], velocities = featureTrajectories[i].differentiate(True)) for i in range(4)])) |
| 1458 featureNum += 4 | 1458 featureNum += 4 |
| 1459 | 1459 |
