Mercurial > hg > nsaunier > traffic-intelligence
comparison python/cvutils.py @ 772:e92a96f2bdd3 dev
minor bug corrections
| author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
|---|---|
| date | Fri, 29 Jan 2016 17:43:57 -0500 |
| parents | dfdb2a3722cc |
| children | b6d3bf350789 |
comparison
equal
deleted
inserted
replaced
| 771:bd13937818a4 | 772:e92a96f2bdd3 |
|---|---|
| 452 | 452 |
| 453 # If found, add object points, image points (after refining them) | 453 # If found, add object points, image points (after refining them) |
| 454 if ret: | 454 if ret: |
| 455 print 'Found pattern in '+fname | 455 print 'Found pattern in '+fname |
| 456 | 456 |
| 457 if(secondPassSearch): | 457 if secondPassSearch: |
| 458 corners = cv2.cornerSubPix(gray, corners, (11,11), (-1,-1), criteria) | 458 corners = cv2.cornerSubPix(gray, corners, (11,11), (-1,-1), criteria) |
| 459 | 459 |
| 460 objpoints.append(objp) | 460 objpoints.append(objp) |
| 461 imgpoints.append(corners) | 461 imgpoints.append(corners) |
| 462 | 462 |
| 463 # Draw and display the corners | 463 # Draw and display the corners |
| 464 if(display): | 464 if display: |
| 465 img = cv2.drawChessboardCorners(img, (checkerBoardSize[1],checkerBoardSize[0]), corners, ret) | 465 img = cv2.drawChessboardCorners(img, (checkerBoardSize[1],checkerBoardSize[0]), corners, ret) |
| 466 if(img): | 466 if img is not None: |
| 467 cv2.imshow('img',img) | 467 cv2.imshow('img',img) |
| 468 cv2.waitKey(0) | 468 cv2.waitKey(0) |
| 469 | 469 |
| 470 ## Close up image loading and calibrate | 470 ## Close up image loading and calibrate |
| 471 cv2.destroyAllWindows() | 471 cv2.destroyAllWindows() |
