How to use the vidgear.gears.stabilizer.Stabilizer function in vidgear

To help you get started, we’ve selected a few vidgear examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github abhiTronix / vidgear / vidgear / gears / videogear.py View on Github external
from .stabilizer import Stabilizer
			s_radius, border_size, border_type = (25, 0, 'black')
			if options:
				if "SMOOTHING_RADIUS" in options:
					if isinstance(options["SMOOTHING_RADIUS"],int):
						s_radius = options["SMOOTHING_RADIUS"] #assigsn special parameter to global variable
					del options["SMOOTHING_RADIUS"] #clean
				if "BORDER_SIZE" in options:
					if isinstance(options["BORDER_SIZE"],int):
						border_size = options["BORDER_SIZE"] #assigsn special parameter
					del options["BORDER_SIZE"] #clean
				if "BORDER_TYPE" in options:
					if isinstance(options["BORDER_TYPE"],str):
						border_type = options["BORDER_TYPE"] #assigsn special parameter
					del options["BORDER_TYPE"] #clean
			self.stabilizer_obj = Stabilizer(smoothing_radius = s_radius, border_type = border_type, border_size = border_size, logging = logging)
			#log info
			if logging:
				print('Enabling Stablization Mode for the current video source!')

		if enablePiCamera:
			# only import the pigear module only if required
			from .pigear import PiGear

			# initialize the picamera stream by enabling PiGear Class
			self.stream = PiGear(resolution=resolution, framerate=framerate, colorspace = colorspace, logging = logging, time_delay = time_delay, **options)

		else:
			# otherwise, we are using OpenCV so initialize the webcam
			# stream by activating CamGear Class
			self.stream = CamGear(source=source, y_tube = y_tube, backend = backend, colorspace = colorspace, logging = logging, time_delay = time_delay, **options)