Commit 445c9090 authored by dewmalFernando's avatar dewmalFernando

V1.18

parent 64a584d0
import os
import cv2 import cv2
from moviepy.video.io.VideoFileClip import VideoFileClip from moviepy.video.io.VideoFileClip import VideoFileClip
from imageEnhancement import CreateNewFolderForFrames from imageEnhancement import CreateNewFolderForFrames
from imageEnhancement import EnhaceFramesUsingGamma from imageEnhancement import ContrastEdjustments
from imageEnhancement import EnhaceFramesUsingUnsharpMasking
from imageEnhancement import FramesToVid
def FrameCapture(path): def FrameCapture(path):
...@@ -14,6 +9,7 @@ def FrameCapture(path): ...@@ -14,6 +9,7 @@ def FrameCapture(path):
folderName = CreateNewFolderForFrames.createFolder() folderName = CreateNewFolderForFrames.createFolder()
print("This is the folder name: " + folderName) print("This is the folder name: " + folderName)
# Path to video file # Path to video file
vidObj = cv2.VideoCapture(path) vidObj = cv2.VideoCapture(path)
...@@ -29,7 +25,6 @@ def FrameCapture(path): ...@@ -29,7 +25,6 @@ def FrameCapture(path):
success, image = vidObj.read() success, image = vidObj.read()
# Saves the frames with frame-count # Saves the frames with frame-count
# cv2.imwrite("E:\\#ProgrammingWork\\Python\\VideoEnhance\\a\\frame%d.jpg" % count, image)
if success == 1: if success == 1:
cv2.imwrite("E:\\BACKBONE\\image_enhancement\\Frames\\" + folderName + "\\%d.jpg" % count, image) cv2.imwrite("E:\\BACKBONE\\image_enhancement\\Frames\\" + folderName + "\\%d.jpg" % count, image)
...@@ -37,7 +32,6 @@ def FrameCapture(path): ...@@ -37,7 +32,6 @@ def FrameCapture(path):
# loading video dsa gfg intro video # loading video dsa gfg intro video
clip = VideoFileClip(path).subclip(0, 10) clip = VideoFileClip(path).subclip(0, 10)
# clip = VideoFileClip("E:\\#ProgrammingWork\\pyCharm\\imageEnhancement\\vid\\Video3.mp4").subclip(0, 10)
# getting frame rate of the clip # getting frame rate of the clip
rate = clip.fps rate = clip.fps
...@@ -46,7 +40,6 @@ def FrameCapture(path): ...@@ -46,7 +40,6 @@ def FrameCapture(path):
print("FPS : " + str(rate)) print("FPS : " + str(rate))
print("folder name in Vid to frame : " + folderName) print("folder name in Vid to frame : " + folderName)
# EnhaceFramesUsingGamma.enhanceFrames(folderName, rate)
value = EnhaceFramesUsingUnsharpMasking.enhanceFrames(folderName, rate) value = ContrastEdjustments.adjustContrast(folderName, rate)
return value return value
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment