2015-06-10 22:00:35 -07:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
|
|
|
import numpy as np
|
|
|
|
import itertools as it
|
|
|
|
from copy import deepcopy
|
|
|
|
import sys
|
|
|
|
|
|
|
|
|
|
|
|
from animation import *
|
|
|
|
from mobject import *
|
|
|
|
from constants import *
|
|
|
|
from region import *
|
2015-08-17 13:19:34 -07:00
|
|
|
from scene import Scene, SceneFromVideo
|
2015-06-10 22:00:35 -07:00
|
|
|
from script_wrapper import command_line_create_scene
|
|
|
|
|
|
|
|
|
2015-08-17 13:19:34 -07:00
|
|
|
class SampleScene(SceneFromVideo):
|
2015-06-10 22:00:35 -07:00
|
|
|
def construct(self):
|
2015-08-21 19:58:36 -07:00
|
|
|
path = os.path.join(MOVIE_DIR, "EdgeDetectedCountingInBinary35-75.mp4")
|
|
|
|
SceneFromVideo.construct(self, path, time_range = (3, 5))
|
|
|
|
self.apply_gaussian_blur(sigmaX = 10)
|
|
|
|
self.make_all_black_or_white()
|
|
|
|
self.name = "BlurEdgeBlurBold"
|
2015-08-17 13:19:34 -07:00
|
|
|
|
2015-08-21 19:58:36 -07:00
|
|
|
# self.animate_over_time_range(
|
|
|
|
# 0, 3,
|
|
|
|
# ApplyMethod(Dot().to_edge(LEFT).to_edge, RIGHT)
|
|
|
|
# )
|
|
|
|
|
|
|
|
def make_all_black_or_white(self):
|
|
|
|
self.frames = [
|
|
|
|
255*(frame != 0).astype('uint8')
|
|
|
|
for frame in self.frames
|
|
|
|
]
|
2015-08-17 13:19:34 -07:00
|
|
|
|
2015-06-10 22:00:35 -07:00
|
|
|
|
|
|
|
if __name__ == "__main__":
|
2015-06-19 08:31:02 -07:00
|
|
|
command_line_create_scene()
|