Get the App
SLTechnology News&Howtos  ›  Development  › 

How to realize silky change video clip based on Python

Shulou Source: shulou.com Published: 2022-06-01 01:38:10 09月30日 Update

This article introduces the relevant knowledge of "how to achieve silky change video clip based on Python". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Requirements for software, hardware and skills

CPU had better be above I7-8750, or the overall production will be very slow.

Python version 3.6 or above

As it involves deep learning modules, graphics cards are needed from now on.

Color change description

Support a wide range of color spaces. For example, the conversion between RGB, HSL/HSV, CMY/CMYK and other color spaces. For example, XYZ to sRGB,Spectral to XYZ,CIE Lab to Adobe RGB.

Color difference calculation.

Color adaptation (changing the light source).

RGB to hexadecimal and vice versa.

Python application plug-in

Colormath and MiVOS apply color conversion adjustment and module interaction, respectively.

Thinking process

You might wonder if this thing came out?

First of all, you need to understand the method of color switching.

A simple example of CIE Lab-to-CIE XYZ conversion.

From colormath.color_objects import LabColor, XYZColorfrom colormath.color_conversions import convert_colorlab = LabColor (0.903, 16.296,-2.22) xyz = convert_color (lab, XYZColor)

Want to use different RGB spaces for conversion

From colormath.color_objects import XYZColor, HSLColor, AdobeRGBColorfrom colormath.color_conversions import convert_colorxyz = XYZColor (0.1,0.2,0.3) hsl = convert_color (xyz, HSLColor, through_rgb_type=AdobeRGBColor) # convert back to XYZ, ensuring that the same RGB color space is used in return. Xyz2 = convert_color (hsl, XYZColor, through_rgb_type=AdobeRGBColor)

Delta E equation

From colormath.color_objects import LabColorfrom colormath.color_diff import delta_e_cie1976# reference color color1 = LabColor (lab_l=0.9, lab_a=16.3, lab_b=-2.22) # Color to compare with reference color2 = LabColor (lab_l=0.7, lab_a=14.2, lab_b=-1.80) # delta E value as floating point delta_e = delta_e_cie1976 (color1, color2) MiVOS module interactive

You can understand this place as replacing the corresponding color points frame by frame and finally composing the effect image.

This is the end of the content of "how to achieve silky change video clip based on Python". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Tags: Color space module color video video clip clip interactive content more knowledge reference learning application different same curious learned next between Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft Redmi MySQL Xiaomi Linux