File: chessboard.py

package info (click to toggle)
opencv 2.1.0-3%2Bsqueeze1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 68,800 kB
  • ctags: 52,010
  • sloc: cpp: 554,793; xml: 475,942; ansic: 153,396; python: 18,622; sh: 428; makefile: 111
file content (18 lines) | stat: -rwxr-xr-x 505 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/python
from opencv.cv import *
from opencv.highgui import *
import sys

if __name__ == "__main__":
    cvNamedWindow("win")
    filename = sys.argv[1]
    im = cvLoadImage(filename, CV_LOAD_IMAGE_GRAYSCALE)
    im3 = cvLoadImage(filename, CV_LOAD_IMAGE_COLOR)
    chessboard_dim = cvSize( 5, 6 )
    
    found_all, corners = cvFindChessboardCorners( im, chessboard_dim )

    cvDrawChessboardCorners( im3, chessboard_dim, corners, found_all )
    
    cvShowImage("win", im3);
    cvWaitKey()