本文整理汇总了Python中cv2.cv.NamedWindow方法的典型用法代码示例。如果您正苦于以下问题:Python cv.NamedWindow方法的具体用法?Python cv.NamedWindow怎么用?Python cv.NamedWindow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cv2.cv
的用法示例。
在下文中一共展示了cv.NamedWindow方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from cv2 import cv [as 别名]
# 或者: from cv2.cv import NamedWindow [as 别名]
def main():
"""Open test color images, create display window, start the search"""
cv.NamedWindow(WNDNAME, 1)
for name in [ "../c/pic%d.png" % i for i in [1, 2, 3, 4, 5, 6] ]:
img0 = cv.LoadImage(name, 1)
try:
img0
except ValueError:
print "Couldn't load %s\n" % name
continue
# slider deleted from C version, same here and use fixed Canny param=50
img = cv.CloneImage(img0)
cv.ShowImage(WNDNAME, img)
# force the image processing
draw_squares( img, find_squares4( img ) )
# wait for key.
if cv.WaitKey(-1) % 0x100 == 27:
break
示例2: __init__
# 需要导入模块: from cv2 import cv [as 别名]
# 或者: from cv2.cv import NamedWindow [as 别名]
def __init__(self):
cv.StartWindowThread()
cv.NamedWindow('Capture Feedback')
示例3: __init__
# 需要导入模块: from cv2 import cv [as 别名]
# 或者: from cv2.cv import NamedWindow [as 别名]
def __init__(self):
cv.NamedWindow(self.window_name, cv.CV_WINDOW_AUTOSIZE)
# self.capture = cv.CaptureFromCAM(camera_index) #for some reason, this doesn't work
# self.capture = cv.CreateCameraCapture(-1)
self.capture = cv.CaptureFromCAM(0)
示例4: __init__
# 需要导入模块: from cv2 import cv [as 别名]
# 或者: from cv2.cv import NamedWindow [as 别名]
def __init__(self,threshold=25, doRecord=True, showWindows=True):
self.writer = None
self.font = None
self.doRecord=doRecord #Either or not record the moving object
self.show = showWindows #Either or not show the 2 windows
self.frame = None
#self.capture=cv.CaptureFromCAM(0)
self.capture=cv.CaptureFromFile('crash-480.mp4')
self.frame = cv.QueryFrame(self.capture) #Take a frame to init recorder
if doRecord:
self.initRecorder()
self.gray_frame = cv.CreateImage(cv.GetSize(self.frame), cv.IPL_DEPTH_8U, 1)
self.average_frame = cv.CreateImage(cv.GetSize(self.frame), cv.IPL_DEPTH_32F, 3)
self.absdiff_frame = None
self.previous_frame = None
self.surface = self.frame.width * self.frame.height
self.currentsurface = 0
self.currentcontours = None
self.threshold = threshold
self.isRecording = False
self.trigger_time = 0 #Hold timestamp of the last detection
if showWindows:
cv.NamedWindow("Image")
cv.CreateTrackbar("Detection treshold: ", "Image", self.threshold, 100, self.onChange)
示例5: __init__
# 需要导入模块: from cv2 import cv [as 别名]
# 或者: from cv2.cv import NamedWindow [as 别名]
def __init__(self, img0):
self.thresh1 = 255
self.thresh2 = 30
self.level =4
self.storage = cv.CreateMemStorage()
cv.NamedWindow("Source", 0)
cv.ShowImage("Source", img0)
cv.NamedWindow("Segmentation", 0)
cv.CreateTrackbar("Thresh1", "Segmentation", self.thresh1, 255, self.set_thresh1)
cv.CreateTrackbar("Thresh2", "Segmentation", self.thresh2, 255, self.set_thresh2)
self.image0 = cv.CloneImage(img0)
self.image1 = cv.CloneImage(img0)
cv.ShowImage("Segmentation", self.image1)
示例6: __init__
# 需要导入模块: from cv2 import cv [as 别名]
# 或者: from cv2.cv import NamedWindow [as 别名]
def __init__(self, src_image):
self.src_image = src_image
self.dst_image = cv.CloneMat(src_image)
self.hist_image = cv.CreateImage((320, 200), 8, 1)
self.hist = cv.CreateHist([hist_size], cv.CV_HIST_ARRAY, ranges, 1)
self.brightness = 0
self.contrast = 0
cv.NamedWindow("image", 0)
cv.NamedWindow("histogram", 0)
cv.CreateTrackbar("brightness", "image", 100, 200, self.update_brightness)
cv.CreateTrackbar("contrast", "image", 100, 200, self.update_contrast)
self.update_brightcont()
示例7: __init__
# 需要导入模块: from cv2 import cv [as 别名]
# 或者: from cv2.cv import NamedWindow [as 别名]
def __init__(self):
self.capture = cv.CaptureFromCAM(0)
cv.NamedWindow( "CamShiftDemo", 1 )
cv.NamedWindow( "Histogram", 1 )
cv.SetMouseCallback( "CamShiftDemo", self.on_mouse)
self.drag_start = None # Set to (x,y) when mouse starts drag
self.track_window = None # Set to rect when the mouse drag finishes
print( "Keys:\n"
" ESC - quit the program\n"
" b - switch to/from backprojection view\n"
"To initialize tracking, drag across the object with the mouse\n" )