Skip to content

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Latest commit

 

History

17 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CropDetect

A program designed to detect 'bad eges', blanking issues ( inconsistency of black bars )
in video files.


This software's aim is to detect small black bars that can appear during the color grading process.This kind of issue is often caused by resized or tilt during color grading?
It runs on Macos 10.14 and up. It should be possible to run it on Windows and Linux with a few code tweaks. Let me know if you're interested

Features

  • Video Codec and resolution agnostic (thanks to the ffmpeg library)
  • Reports files as HTML and EDL to import in DaVinci Resolve
  • Adjustable resolution offsets

Download & Installation

Download installer (Macos 10.14+)

The installer can be found in the Release a section or through this alternative link

Build from source

You must have Python 3.6 installed on your system.

In an empty directory execute the following commands :

Start by cloning this repository

git clone https://github.com/NicolasReaItalo/CropDetect.git
cd CropDetect

Create a virtual environment

python3.6 -m venv env
source env/bin/activate

Upgrade pip and install the libraries

pip install --upgrade pip
pip install -r requirements.txt

Lauch the program with :

fbs run

Or buid the executable with :

fbs freeze

Once the executable is built you can create an installer with :

fbs installer

Usage

  1. Add video files to test with the "Add job" button
  2. Foreach job you can specify the report folder location
  3. The start and end frames of th analysis
  4. The pixel offsets (to avoid false positive on masters with inner blanking)
  5. Press the start button to begin the analysis on all the job in the queue

Once the analysis is complete, you can open the report folder.

Open the html report to get a summary of the detected issues.

Use the EDL file in Da Vinci Resolve

  1. Create a new project
  2. Import the tested video file
  3. Create a new timeline using this clip
  4. The timeline start TC must be set at 00:00:00:00
  5. Open the timeline and import the EDL as timeline markers
  6. The detected issues appear as red markers on the timeline

Detection method

The black bars detection is performed by slicing the outermost lines (Up,Left,Right,Down) and checking these against color level and variance tresholds.
    def test_line_blanking(self, line):
        b_max = numpy.max(line[:, :, 0])
        g_max = numpy.max(line[:, :, 1])
        r_max = numpy.max(line[:, :, 2])


        if (b_max <= LUMA_TRESHOLD and g_max <= LUMA_TRESHOLD and r_max <= LUMA_TRESHOLD):

            nb_line = cv2.cvtColor(line, cv2.COLOR_BGR2GRAY)
            var_line = numpy.var(nb_line)
            if var_line <= VAR_TRESHOLD:
                return True
        return False

Libraries

License

CropDetect is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

CropDetect is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages