MatchHistogram

From Avisynth wiki
Jump to: navigation, search
Abstract
Author LaTo, Dubhater, Asd-g
Version v2.1.2
Download MatchHistogram-2.1.2.7z
Category Adjustment Filters
License Open source
Discussion Doom9 Thread

Contents

Description

MatchHistogram modifies one clip's histogram to match the histogram of another clip.

Will produce weird results if frame contents are dissimilar.

Should be used for analysis only, not for production.

Requirements


*** vcredist_x86.exe required for MatchHistogram-x86
*** vcredist_x64.exe required for MatchHistogram-x64


Syntax and Parameters

MatchHistogram (clip clip1 , clip clip2, clip "clip3", bool "raw", bool "show", bool "debug", int "smoothing_window", bool "y", bool "u", bool "v")


clip   =
Clip1: must have constant format and dimensions and 8 bits per sample, and it must not be RGB.


clip   =
Clip2: clip whose histogram is to be copied.
Must have the same format and dimensions as clip1.


clip  clip3 = clip1
Clip3: clip to be modified to match clip2's histogram.
Must have the same format as clip1 and constant dimensions.
If this parameter is not passed then clip1 is used instead.
Default: clip1


bool  raw = false
Use the raw histogram without postprocessing.


bool  cpu = false
Show calculated curve on video frame.
This parameter has no effect when debug=true.


bool  debug = false
Return 256x256 clip with calculated data.


int  smoothing_window = 8
Window used when smoothing the curve.
A value of 0 disables the smoothing.
This parameter has no effect when raw=true.


bool  y = true
bool  u = false
bool  v = false
Select which planes to process. Any unprocessed planes will be copied from the third clip.


Examples

clip1 = AviSource("blah.avi")  # clip 1 is the source
clip2 = AviSource("blah2.avi") # clip 2 is the target

MatchHistogram(clip1, clip2, raw=false, show=false, debug=false, smoothing_window=8, y=true, u=false, v=false)

The difference between clip1 and clip2 is calculated. That difference is applied on clip3, which defaults to using clip1 if no other clip is given. You can apply the difference between clip1 and clip2 on any clip with the same format and dimension as clip1.

Changelog

Version         Date            Changes
v2.1.2 2020/08/08 - Now clip3 is optional. - AviSynth+: self-registers as MT_NICE_FILTER.
v2.1.1 2020/06/03 - Fixed memory misalignment for AviSynth 2.6.
v2.1.0 2020/05/17 - Move project to GitHub - Update to AviSynth+'s v8 interface
2020/04/22 - Author: asd - Backport VS port MatchHistogram v2 by dubhater - Compiled with MSVC 2019 (Clang 9).
2015/07/12 - Initial release by LaTo


Archived Downloads

Version Download Mirror
2015/07/12 MatchHistogram.7z MatchHistogram.7z


External Links

  • GitHub - Source code repository.
  • GitHub - Source code repository (VapourSynth port).




Back to External Filters

Personal tools