embeded cv Python module into cv2.

This commit is contained in:
Vadim Pisarevsky
2011-07-12 12:56:03 +00:00
parent 9b464199d6
commit 569b1ad582
55 changed files with 171 additions and 241 deletions

View File

@@ -1,4 +1,4 @@
import cv
import cv2.cv as cv
import time
cv.NamedWindow("camera", 1)

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
import cv
import cv2.cv as cv
def is_rect_nonzero(r):
(_,_,w,h) = r

View File

@@ -1,5 +1,5 @@
#!/usr/bin/python
import cv
import cv2.cv as cv
import sys
import urllib2

View File

@@ -3,7 +3,7 @@
print "OpenCV Python version of contours"
# import the necessary things for OpenCV
import cv
import cv2.cv as cv
# some default constants
_SIZE = 500

View File

@@ -3,7 +3,7 @@
print "OpenCV Python version of convexhull"
# import the necessary things for OpenCV
import cv
import cv2.cv as cv
# to generate random values
import random

View File

@@ -5,7 +5,7 @@ Find Squares in image by finding countours and filtering
#otherwise ok
import math
import cv
import cv2.cv as cv
def angle(pt1, pt2, pt0):
"calculate angle contained by 3 points(x, y)"

View File

@@ -1,4 +1,4 @@
import cv
import cv2.cv as cv
import urllib2
from sys import argv

View File

@@ -6,7 +6,7 @@ delaunay triangulation and voronoi tesselation
Original Author (C version): ?
Converted to Python by: Roman Stanchak
"""
import cv
import cv2.cv as cv
import random
def draw_subdiv_point( img, fp, color ):

View File

@@ -1,5 +1,5 @@
#!/usr/bin/python
import cv
import cv2.cv as cv
import sys
import urllib2

View File

@@ -1,5 +1,5 @@
#!/usr/bin/python
import cv
import cv2.cv as cv
import sys
import urllib2

View File

@@ -1,6 +1,6 @@
#!/usr/bin/python
import sys
import cv
import cv2.cv as cv
import urllib2
wndname = "Distance transform"

View File

@@ -1,4 +1,4 @@
import cv
import cv2.cv as cv
import time
from pydmtx import DataMatrix
import numpy

View File

@@ -4,7 +4,7 @@ import colorsys
print "OpenCV Python version of drawing"
import cv
import cv2.cv as cv
def random_color(random):
"""

View File

@@ -4,7 +4,7 @@ print "OpenCV Python version of edge"
import sys
import urllib2
import cv
import cv2.cv as cv
# some definitions
win_name = "Edge"

View File

@@ -7,7 +7,7 @@ Original C implementation by: ?
Python implementation by: Roman Stanchak, James Bowman
"""
import sys
import cv
import cv2.cv as cv
from optparse import OptionParser
# Parameters for haar detection

View File

@@ -2,7 +2,7 @@
import sys
import random
import urllib2
import cv
import cv2.cv as cv
im=None;
mask=None;

View File

@@ -13,7 +13,7 @@ Python implementation by: Roman Stanchak, James Bowman
import sys
import urllib2
import random
import cv
import cv2.cv as cv
def contour_iterator(contour):
while contour:

View File

@@ -3,7 +3,7 @@
import sys
from math import sin, cos, sqrt, pi
import cv
import cv2.cv as cv
import urllib2
# toggle between CV_HOUGH_STANDARD and CV_HOUGH_PROBILISTIC

View File

@@ -1,7 +1,7 @@
#!/usr/bin/python
import urllib2
import sys
import cv
import cv2.cv as cv
class Sketcher:
def __init__(self, windowname, dests):

View File

@@ -12,7 +12,7 @@
Pressing ESC will stop the program.
"""
import urllib2
import cv
import cv2.cv as cv
from math import cos, sin, sqrt
import sys

View File

@@ -1,6 +1,6 @@
#!/usr/bin/python
import urllib2
import cv
import cv2.cv as cv
from random import randint
MAX_CLUSTERS = 5

View File

@@ -1,6 +1,6 @@
#!/usr/bin/python
import urllib2
import cv
import cv2.cv as cv
import sys
if __name__ == "__main__":

View File

@@ -5,7 +5,7 @@ print "OpenCV Python version of lkdemo"
import sys
# import the necessary things for OpenCV
import cv
import cv2.cv as cv
#############################################################################
# some "constants"

View File

@@ -1,7 +1,7 @@
#!/usr/bin/python
import sys
import urllib2
import cv
import cv2.cv as cv
src=None
dst=None

View File

@@ -1,7 +1,7 @@
#!/usr/bin/python
import urllib2
import cv
import cv2.cv as cv
from random import randint
def roundxy(pt):

View File

@@ -1,6 +1,6 @@
#! /usr/bin/env python
import cv
import cv2.cv as cv
cap = cv.CreateFileCapture("../c/tree.avi")
img = cv.QueryFrame(cap)

View File

@@ -1,7 +1,7 @@
#!/usr/bin/python
import sys
import urllib2
import cv
import cv2.cv as cv
src = 0
image = 0

View File

@@ -3,7 +3,7 @@ import urllib2
import sys
import time
from math import cos, sin
import cv
import cv2.cv as cv
CLOCKS_PER_SEC = 1.0
MHI_DURATION = 1

View File

@@ -1,7 +1,7 @@
#!/usr/bin/python
import urllib2
import sys
import cv
import cv2.cv as cv
import numpy
# SRGB-linear conversions using NumPy - see http://en.wikipedia.org/wiki/SRGB

View File

@@ -1,7 +1,7 @@
#!/usr/bin/python
import urllib2
import sys
import cv
import cv2.cv as cv
import numpy
if __name__ == "__main__":

View File

@@ -1,5 +1,5 @@
#!/usr/bin/python
import cv
import cv2.cv as cv
class PyrSegmentation:
def __init__(self, img0):

View File

@@ -7,7 +7,7 @@
import urllib2
from math import sqrt
import cv
import cv2.cv as cv
thresh = 50
img = None

View File

@@ -1,7 +1,7 @@
#!/usr/bin/python
import urllib2
import sys
import cv
import cv2.cv as cv
class Sketcher:
def __init__(self, windowname, dests):