本文整理汇总了Python中SeaGoatVision.server.core.filter.Filter类的典型用法代码示例。如果您正苦于以下问题:Python Filter类的具体用法?Python Filter怎么用?Python Filter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Filter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self):
Filter.__init__(self)
self.kernel_erode_height = Param(
"Kernel Erode Height",
3,
min_v=1,
max_v=255)
self.kernel_erode_width = Param(
"Kernel Dilate Width",
3,
min_v=1,
max_v=255)
self.kernel_dilate_height = Param(
"Kernel Erode Height",
5,
min_v=1,
max_v=255)
self.kernel_dilate_width = Param(
"Kernel Dilate Width",
5,
min_v=1,
max_v=255)
self.sections = Param("Sections", 5, min_v=1, max_v=10)
self.min_area = Param("Minimum Area", 1000, min_v=1, max_v=65535)
self.configure()
示例2: __init__
def __init__(self):
Filter.__init__(self)
self.face_detect_name = os.path.join('data',
'facedetect',
'haarcascade_frontalface_alt.xml')
self.face_cascade = cv2.CascadeClassifier()
assert self.face_cascade.load(self.face_detect_name)
示例3: __init__
def __init__(self):
Filter.__init__(self)
self.convert_color = Param("Convert choice", 1, min_v=0, max_v=4)
desc = "0 = original\n1 = BGR TO YUV\n2 = BGR TO HSV\n3 = BGR TO RGB\n\
4 = BGR TO GRAY"
self.convert_color.set_description(desc)
示例4: __init__
def __init__(self):
Filter.__init__(self)
self.area_min = Param("Area Min", 300, min_v=1, max_v=100000)
self.area_max = Param("Area Max", 35000, min_v=1, max_v=100000)
self._kernel = cv2.getStructuringElement(
cv2.MORPH_RECT, (3, 3), (0, 0))
示例5: __init__
def __init__(self):
Filter.__init__(self)
self.circley = Param("Circley", 0, min_v=0, max_v=200)
self.circlex = Param("Circlex", 0, min_v=0, max_v=200)
self.colorr = Param("colorr", 0, min_v=0, max_v=255)
self.colorg = Param("colorg", 0, min_v=0, max_v=255)
self.colorb = Param("colorb", 255, min_v=0, max_v=255)
示例6: __init__
def __init__(self):
Filter.__init__(self)
self.case = 'test'
self.resize = False
self.strength = Param("strength", 0.0, min_v=0.0, max_v=3.0)
self.naturalness = Param("naturalness", 10, min_v=0, max_v=10)
# self.sub_lum = Param("sub_lum", 100, min_v=0, max_v=255)
# self.shift_x = Param("shift_x", 0, min_v=-800, max_v=800)
# self.shift_y = Param("shift_y", 0, min_v=-600, max_v=600)
self.show_image = Param("show_images", 1, min_v=1, max_v=10)
self.limit_image = Param("limit_image", 4, min_v=1, max_v=10)
self.debug_show = Param(
"show_debug",
"show_normal",
lst_value=[
"show_normal",
"show_sat",
"show_con"])
self.show_hdr = Param("show_hdr", False)
self.index = 0
self.images = []
self.imgs = []
self.first_time = True
示例7: __init__
def __init__(self):
Filter.__init__(self)
self.canny1 = Param("Canny1", 50, min_v=1, max_v=256)
self.canny2 = Param("Canny2", 200, min_v=1, max_v=256)
self.rho = Param("Rho", 1, min_v=1, max_v=256)
self.theta = Param("Theta", 180, min_v=0, max_v=360)
self.threshold = Param("Threshold", 100, min_v=1, max_v=256)
self.line_size = Param("Line Size", 1000, min_v=1, max_v=2000)
示例8: __init__
def __init__(self):
Filter.__init__(self)
self.kernel_width = Param("Kernel Width", 3, min_v=1, max_v=256)
self.kernel_height = Param("Kernel Height", 3, min_v=1, max_v=256)
self.anchor_x = Param("Anchor X", -1)
self.anchor_y = Param("Anchor Y", -1)
self.iterations = Param("Iteration,", 1, min_v=1)
self.configure()
示例9: __init__
def __init__(self):
Filter.__init__(self)
self.blue = Param("Blue", 20, min_v=1, max_v=256, thres_h=256)
self.green = Param("Green", 20, min_v=1, max_v=256, thres_h=256)
self.red = Param("Red", 20, min_v=1, max_v=256, thres_h=256)
self._barray = None
self._garray = None
self._rarray = None
self.configure()
示例10: __init__
def __init__(self):
Filter.__init__(self)
path_frontal_face = os.path.join('/', 'usr', 'share', 'opencv',
'haarcascades',
'haarcascade_frontalface_alt.xml')
self.face_detect_name = os.path.join('data',
'facedetect',
path_frontal_face)
self.face_cascade = cv2.CascadeClassifier()
assert self.face_cascade.load(self.face_detect_name)
示例11: __init__
def __init__(self):
# this subclass of Filter
Filter.__init__(self)
self.params = {}
cppfunc(
self.params,
self.py_init_param,
self.notify_output_observers,
self.dct_global_param,
self.py_init_global_param)
示例12: __init__
def __init__(self):
Filter.__init__(self)
self.nb_face = 1
self.eye_detect_name = os.path.join('data', 'facedetect',
'haarcascade_eye_tree_eyeglasses.xml')
self.face_detect_name = os.path.join('data', 'facedetect',
'haarcascade_frontalface_alt.xml')
self.eye_cascade = cv2.CascadeClassifier()
self.face_cascade = cv2.CascadeClassifier()
self.eye_cascade.load(self.eye_detect_name)
self.face_cascade.load(self.face_detect_name)
self.notify_filter = Param("notify", False)
示例13: __init__
def __init__(self):
Filter.__init__(self)
self.topleftx = Param("Top Left X", 0, min_v=0, max_v=640)
self.toplefty = Param("Top Left TY", 0, min_v=0, max_v=480)
self.bottomleftx = Param("Bottom Left X", 100, min_v=0, max_v=640)
self.bottomlefty = Param("Bottom Left Y", 480, min_v=0, max_v=480)
self.toprightx = Param("Top Right X", 640, min_v=0, max_v=640)
self.toprighty = Param("Top Right Y", 0, min_v=0, max_v=480)
self.bottomrightx = Param("Bottom Right X", 540, min_v=0, max_v=640)
self.bottomrighty = Param("Bottom Right Y", 480, min_v=0, max_v=480)
self.mmat = None
self.configure()
示例14: __init__
def __init__(self):
Filter.__init__(self)
self.nb_face = 1
# linux path
path_frontal_face = os.path.join('/', 'usr', 'share', 'opencv',
'haarcascades',
'haarcascade_frontalface_alt.xml')
self.face_detect_name = os.path.join(
'data', 'facedetect', path_frontal_face)
self.face_cascade = cv2.CascadeClassifier()
self.face_cascade.load(self.face_detect_name)
self.notify_filter = Param("notify", False)
示例15: __init__
def __init__(self):
Filter.__init__(self)
self.dct_color_choose = {"red": (0, 0, 255), "green": (0, 255, 0),
"blue": (255, 0, 0)}
self.color_rect = self.dct_color_choose["red"]
self.i_text_size = 1.0
# add params
self.show_output = Param("enable_output", True)
self.show_output.set_description("Enable to show rectangle.")
self.color_rectangle = Param("color_rectangle", "red",
lst_value=self.dct_color_choose.keys())
self.color_rectangle.set_description(
"Change the RGB color of the rectangle.")
self.color_rectangle.add_group("rectangle")
self.show_rectangle = Param("show_rectangle", True)
self.show_rectangle.set_description(
"Colorize a rectangle around the face.")
self.show_rectangle.add_group("rectangle")
self.border_rec_size = Param("border_rec_size", 3, min_v=1, max_v=9)
self.border_rec_size.set_description(
"Change the border size of the rectangle.")
self.border_rec_size.add_group("rectangle")
self.show_text = Param("enable_text", True)
self.show_text.set_description("Show text upper the rectangle.")
self.show_text.add_group("message")
self.text_face = Param("text_face", "")
self.text_face.set_description("The text to write on the rectangle.")
self.text_face.add_group("message")
self.text_size = Param("text_size", self.i_text_size, min_v=0.1,
max_v=4.9)
self.text_size.set_description("Change the text size.")
self.text_size.add_group("message")
self.nb_face = 1
# linux path
path_frontal_face = os.path.join('/', 'usr', 'share', 'opencv',
'haarcascades',
'haarcascade_frontalface_alt.xml')
self.face_detect_name = os.path.join('data', 'facedetect',
path_frontal_face)
self.face_cascade = cv2.CascadeClassifier()
self.face_cascade.load(self.face_detect_name)