Changes between Version 5 and Version 6 of denoise


Ignore:
Timestamp:
Jun 20, 2024, 8:07:38 PM (2 years ago)
Author:
MasterQuestionable
Comment:

͏    Revert for misinformation.

͏    Also please check:
͏    ​https://trac.ffmpeg.org/wiki/denoise?action=diff&version=3
͏    .
͏    Amount of line-break conveys semantic meaning.
͏    So are spacing, paragraphing and punctuation. (in brief, every bit matters)

͏    Partly experimental indeed. However functionally sufficient.

͏    Also note: I wrote notable portion of <WikiFormatting>.


͏    The clumsy workaround is perhaps blame-worthy: but it has to, for the proper presentation.
͏    Blame Unicode, W3C for the source of havoc.

Legend:

Unmodified
Added
Removed
Modified
  • denoise

    v5 v6  
    1 = Denoise
     1͏= Denoise =
    22
    3 Denoise is removing the signal insignificant or unsensible [1] in intended view.
    4 Which shall improve compressibility due to reduced entropy (effective amount of information); and subjectively improve quality.
     3͏    Denoise is removing the signal insignificant or unsensible [1] in intended view.\\
     4͏    Which shall improve compressibility due to reduced entropy (effective amount of information); and subjectively improve quality.\\
     5[ [1]\\
     6͏    "insignificant" is that cannot be seen.\\
     7͏    "unsensible" is that does not make sense. ]
    58
    6 [1] "insignificant" is that cannot be seen.  "unsensible" is that does not make sense.
     9͏    Typical denoise is value clamp based:\\
     10͏    Transform the data into frequency domain (via Fourier Transform alike), or Wavelet:\\
     11͏    [ https://scikit-image.org/docs/stable/auto_examples/filters/plot_denoise_wavelet.html ]\\
     12͏    And allow passing only certain range.
    713
    8 Typical denoise is value clamp based:
    9 Transform the data into frequency domain (via Fourier Transform alike), or Wavelet:
    10 [ https://scikit-image.org/docs/stable/auto_examples/filters/plot_denoise_wavelet.html ]
    11 And allow passing only certain range.
     14͏    FFT (Fast Fourier Transform) is fast implementation of DFT (Discrete Fourier Transform): which asserts 2!^n input length (to speed-up).\\
     15͏    [ !^ https://www.ni.com/docs/en-US/bundle/diadem/page/genmaths/genmaths/calc_fouriertransform.htm#d20e91 ]\\
     16͏    DCT (Discrete Cosine Transform) is cut-down variant of DFT that uses only cosine transform; thus of reduced complexity but also minimum resolution:\\
     17͏    DFT: 2 * π / N\\
     18͏    DCT: 2 * π / (2 * N)\\
     19͏    ; somewhat comparable to "full_chroma_int": (not complexity-wise)\\
     20͏    https://github.com/MasterInQuestion/attach/commit/e18e5cd26b9d27bacefa685ba70d0d41bc7d7cbc#diff-75a0130f1814ba26c23e3a6fc6ce5046620163061d392086bc55e2c13c145bf9L264
    1221
    13 FFT (Fast Fourier Transform) is fast implementation of DFT (Discrete Fourier Transform): which asserts 2!^n input length (to speed-up).
    14 [ !^ https://www.ni.com/docs/en-US/bundle/diadem/page/genmaths/genmaths/calc_fouriertransform.htm#d20e91 ]
     22͏    Discrete Cosine Transform, Fourier Transform:\\
     23͏    https://users.dimi.uniud.it/~antonio.dangelo/MMS/2013/lessons/L11lecture.pdf\\
     24͏    https://users.dimi.uniud.it/~antonio.dangelo/MMS/2013/lessons/L03lecture.pdf\\
     25͏    https://www.youtube.com/watch?v=k3byqIaULb8\\
     26͏    https://www.google.com/search?hl=en&gl=ca&num=100&filter=0&q=site:users.dimi.uniud.it/~antonio.dangelo/MMS+inurl:lessons
    1527
    16 DCT (Discrete Cosine Transform) is cut-down variant of DFT that uses only cosine transform; thus of reduced complexity but also minimum resolution:
    17 DFT: 2 * π / N
    18 DCT: 2 * π / (2 * N)
    19 ; somewhat comparable to "full_chroma_int": (not complexity-wise) [https://github.com/MasterInQuestion/attach/commit/e18e5cd26b9d27bacefa685ba70d0d41bc7d7cbc#diff-75a0130f1814ba26c23e3a6fc6ce5046620163061d392086bc55e2c13c145bf9L264]
     28͏    Fourier vs. Wavelet Transform:\\
     29͏    https://builtin.com/data-science/wavelet-transform#main-content\\
     30\\
     31\\
     32͏    This article currently mainly covers video denoise.\\
     33͏    Info on audio denoise shall be added later.\\
     34\\
     35\\
     36͏== Video ==[=#Video]
    2037
    21 Discrete Cosine Transform, Fourier Transform:
     38͏    FFmpeg supports 8 dedicated [1] video denoise filters:\\
     39͏    [https://ffmpeg.org/ffmpeg-filters.html#bm3d ͏"bm3d"] (BM3D: Block-Matching 3D)\\
     40͏    [https://ffmpeg.org/ffmpeg-filters.html#nlmeans ͏"nlmeans"] (NLM: Non-Local Means)\\
     41͏    [https://ffmpeg.org/ffmpeg-filters.html#fftdnoiz ͏"fftdnoiz"] (FFT then frequency clamp)\\
     42͏    [https://ffmpeg.org/ffmpeg-filters.html#dctdnoiz ͏"dctdnoiz"] (DCT)\\
     43͏    [https://ffmpeg.org/ffmpeg-filters.html#hqdn3d ͏"hqdn3d"]\\
     44͏    [https://ffmpeg.org/ffmpeg-filters.html#vaguedenoiser ͏"vaguedenoiser"]\\
     45͏    [https://ffmpeg.org/ffmpeg-filters.html#owdenoise ͏"owdenoise"] (Overcomplete Wavelet)\\
     46͏    [https://ffmpeg.org/ffmpeg-filters.html#atadenoise ͏"atadenoise"] (Adaptive Temporal Averaging)\\
     47[1] Not counting [https://ffmpeg.org/ffmpeg-filters.html#pp ͏"pp"] (much defunct "libpostproc"), general manipulation [https://ffmpeg.org/ffmpeg-filters.html#fftfilt ͏"fftfilt"] alike.\\
     48͏    .\\
     49͏    More info:\\
     50͏    https://stackoverflow.com/questions/74831282#75348463\\
     51͏    https://forum.shotcut.org/t/8631/12\\
     52͏    https://old.reddit.com/r/ffmpeg/comments/a5ejgi?sort=old#ebyev3t
    2253
    23 - [https://users.dimi.uniud.it/~antonio.dangelo/MMS/2013/lessons/L11lecture.pdf]
    24 - [https://users.dimi.uniud.it/~antonio.dangelo/MMS/2013/lessons/L03lecture.pdf]
    25 - [https://www.youtube.com/watch?v=k3byqIaULb8]
    26 - [https://www.google.com/search?hl=en&gl=ca&num=100&filter=0&q=site:users.dimi.uniud.it/~antonio.dangelo/MMS+inurl:lessons]
     54͏    "bm3d" and "nlmeans" would be of most interest: for best quality.\\
     55͏    More details:\\
     56͏    https://stanford.edu/class/ee367/Winter2020/report/zhou_m_report.pdf\\
     57͏    https://webpages.tuni.fi/foi/3D-DFT/BM3DDEN_article.pdf\\
     58͏    https://github.com/gfacciol/bm3d/blob/master/bm3d.cpp\\
     59͏    https://www.ipol.im/pub/art/2011/bcm_nlm/revisions/2011-09-13/bcm_nlm.htm#index1h2\\
     60͏    https://www.dirk-farin.net/projects/nlmeans/\\
     61͏    https://forum.handbrake.fr/viewtopic.php?t=30135#p139077\\
     62͏    https://github.com/HandBrake/HandBrake-docs/blob/master/source/docs/en/latest/technical/filters-summary.markdown#denoise
    2763
    28 Fourier vs. Wavelet Transform:
     64[ "bm3d"[=#bm3d]\\
     65͏    BM3D pre-filters via Block-Matching for similar blocks:\\
     66͏    Then applies tuned traditional denoise for each.\\
     67͏    .\\
     68͏    Thereby workaround the overdone of applying typical denoise vastly.
    2969
    30 - [https://builtin.com/data-science/wavelet-transform#main-content]
     70͏    Using denoised input for Block-Matching may somewhat aid similarity branching.\\
     71͏    But using complex algorithm (BM3D, NLM alike) for this phase mostly helps not, besides pointless computation. ]
    3172
    32 == Video[=#Video]
     73[ "nlmeans"[=#nlmeans]\\
     74͏    [ Quote <Non-local means denoising for preserving textures>:\\
     75https://scikit-image.org/docs/stable/auto_examples/filters/plot_nonlocal_means.html\\
     76͏    Non-Local Means replaces pixels' value by an average of selected pixels':\\
     77͏    Small patches centered around pixels are compared to the one of interest: with the average performed only when the patches share enough similarity.\\
     78͏    As result, the algorithm may restore well textures that would be otherwise blurred. ]
    3379
    34 FFmpeg supports 8 dedicated [1] video denoise filters:
     80͏    [ Quote <Comparison of CNN based and self-similarity based denoising methods> # Introduction:\\
     81https://stanford.edu/class/ee367/Winter2020/report/zhou_m_report.pdf\\
     82͏    NLM averages pixels with a similar neighborhood.\\
     83͏    Like other traditional methods, NLM can produce a high denoising quality.\\
     84͏    But has the drawback of low computational efficiency; and requires manual choice of some parameters:\\
     85͏    Such as the patch size, search window size, and cut-off distance. ]\\
     86<!^>͏    This is primarily for major NLM implementations seem to be false NLM:\\
     87͏    Not really "Non-Local" thus involve the patch size, search window etc. non-essential.\\
     88͏    [ Quote <Non-Local Means Denoising> # Introduction:\\
     89https://www.ipol.im/pub/art/2011/bcm_nlm/article.pdf\\
     90͏    Since the search for similar pixels will be made in a larger neighborhood, but still locally, the name "non-local" is somewhat misleading. ] ]
    3591
    36 - [https://ffmpeg.org/ffmpeg-filters.html#bm3d ͏"bm3d"] (BM3D: Block-Matching 3D)
    37 - [https://ffmpeg.org/ffmpeg-filters.html#nlmeans ͏"nlmeans"] (NLM: Non-Local Means)
    38 - [https://ffmpeg.org/ffmpeg-filters.html#fftdnoiz ͏"fftdnoiz"] (FFT then frequency clamp)
    39 - [https://ffmpeg.org/ffmpeg-filters.html#dctdnoiz ͏"dctdnoiz"] (DCT)
    40 - [https://ffmpeg.org/ffmpeg-filters.html#hqdn3d ͏"hqdn3d"]
    41 - [https://ffmpeg.org/ffmpeg-filters.html#vaguedenoiser ͏"vaguedenoiser"]
    42 - [https://ffmpeg.org/ffmpeg-filters.html#owdenoise ͏"owdenoise"] (Overcomplete Wavelet)
    43 - [https://ffmpeg.org/ffmpeg-filters.html#atadenoise ͏"atadenoise"] (Adaptive Temporal Averaging)
     92[ "favg"[=#favg]\\
     93͏    Hypothetical new filter derived from NLM:\\
     94͏    The NLM related papers didn't well explain why the patch similarity procedure was even necessary.\\
     95͏    Wouldn't just mere averaging all pixels within specific value threshold: repeat for each unprocessed pixel group; adequately work?\\
     96͏    (Full-Image Averaging) [ #11019 ] ]
    4497
    45 [1] Not counting [https://ffmpeg.org/ffmpeg-filters.html#pp ͏"pp"] (much defunct "libpostproc"), general manipulation [https://ffmpeg.org/ffmpeg-filters.html#fftfilt ͏"fftfilt"] alike.
     98͏    Caveat the factual validity of some linked.\\
     99\\
     100\\
     101͏== Audio ==[=#Audio]
    46102
    47 More info:
     103͏    FFmpeg supports ? dedicated audio denoise filters:\\
     104͏    ...\\
     105\\
     106\\
     107͏== See also ==[=#See-also]
    48108
    49 - [https://stackoverflow.com/questions/74831282#75348463]
    50 - [https://forum.shotcut.org/t/8631/12]
    51 - [https://old.reddit.com/r/ffmpeg/comments/a5ejgi?sort=old#ebyev3t]
    52 
    53 "bm3d" and "nlmeans" would be of most interest: for best quality.
    54 
    55 More details:
    56 
    57 - [https://stanford.edu/class/ee367/Winter2020/report/zhou_m_report.pdf]
    58 - [https://webpages.tuni.fi/foi/3D-DFT/BM3DDEN_article.pdf]
    59 - [https://github.com/gfacciol/bm3d/blob/master/bm3d.cpp]
    60 - [https://www.ipol.im/pub/art/2011/bcm_nlm/revisions/2011-09-13/bcm_nlm.htm#index1h2]
    61 - [https://www.dirk-farin.net/projects/nlmeans/]
    62 - [https://forum.handbrake.fr/viewtopic.php?t=30135#p139077]
    63 - [https://github.com/HandBrake/HandBrake-docs/blob/master/source/docs/en/latest/technical/filters-summary.markdown#denoise]
    64 
    65 ==== "bm3d"[=#bm3d]
    66 BM3D pre-filters via Block-Matching for similar blocks:
    67 Then applies tuned traditional denoise for each.
    68 
    69 Thereby workaround the overdone of applying typical denoise vastly.
    70 
    71 Using denoised input for Block-Matching may somewhat aid similarity branching.
    72 But using complex algorithm (BM3D, NLM alike) for this phase mostly helps not, besides pointless computation.
    73 
    74 ==== "nlmeans"[=#nlmeans]
    75     [https://scikit-image.org/docs/stable/auto_examples/filters/plot_nonlocal_means.html|Non-local means denoising for preserving textures]
    76     Non-Local Means replaces pixels' value by an average of selected pixels':
    77     Small patches centered around pixels are compared to the one of interest: with the average performed only when the patches share enough similarity.
    78     As result, the algorithm may restore well textures that would be otherwise blurred.
    79 
    80     [https://stanford.edu/class/ee367/Winter2020/report/zhou_m_report.pdf|Comparison of CNN based and self-similarity based denoising methods]
    81     NLM averages pixels with a similar neighborhood.
    82     Like other traditional methods, NLM can produce a high denoising quality.
    83     But has the drawback of low computational efficiency; and requires manual choice of some parameters:
    84     Such as the patch size, search window size, and cut-off distance.
    85 
    86     This is primarily for major NLM implementations seem to be false NLM:
    87     Not really "Non-Local" thus involve the patch size, search window etc. non-essential.
    88 
    89     [https://www.ipol.im/pub/art/2011/bcm_nlm/article.pdf|Non-Local Means Denoising]
    90     Since the search for similar pixels will be made in a larger neighborhood, but still locally, the name "non-local" is somewhat misleading.
    91 
    92 ==== "favg"[=#favg]
    93 Hypothetical new filter derived from NLM:
    94 The NLM related papers didn't well explain why the patch similarity procedure was even necessary.
    95 Wouldn't just mere averaging all pixels within specific value threshold: repeat for each unprocessed pixel group; adequately work?
    96 (Full-Image Averaging) [ #11019 ]
    97 
    98 Caveat: the factual validity of some linked.
    99 
    100 == See also[=#See-also]
    101 
    102 - [https://github.com/FFmpeg/FFmpeg/blob/master/libavfilter/]
    103 - [https://github.com/FFmpeg/FFmpeg/blob/master/libavfilter/avfilter.h]
    104 - [https://github.com/FFmpeg/FFmpeg/blob/master/libavfilter/vf_nlmeans.c]
    105  
     109͏    [https://github.com/FFmpeg/FFmpeg/blob/master/libavfilter/ https://github.com/FFmpeg/FFmpeg/blob/master/libavfilter/][av]f_${Name}.[ch]\\
     110͏    E.g. https://github.com/FFmpeg/FFmpeg/blob/master/libavfilter/vf_nlmeans.c