Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
19th October 2014, 15:30 | #1 | Link |
Registered User
Join Date: Aug 2011
Posts: 103
|
Retinex
Source & Readme
r3 Binary: GitHub | NMM Retinex is a very powerful filter in dynamic range compression, contrast enhancement, color constancy, de-fog, etc. Filter examples Source retinex.MSRCP() retinex.MSRCR() Last edited by mawen1250; 8th November 2014 at 06:57. Reason: Update r3 and filter examples |
20th October 2014, 07:09 | #4 | Link |
Registered User
Join Date: Aug 2011
Posts: 103
|
Thanks for your report.
This is the correct result for MSRCP. It indicates that there's a bluish color cast in the original image, which is amplified after the Retinex with *chromaticity preservation*. Under this circumstance the color cast itself is unwanted chromatic information, so the plain MSRCP result is not suitable. possible solutions: 1. Use MSRCR(MSR with color restoration) instead, which will eliminate color cast. Currently it's not implemented yet. 2. Do some modification to the MSRCP algorithm, such as adding a threshold to attenuate chroma adjustment for very dark area. 3. For now, this may be a good solution: use std.Lut to build a mask guided by luma, and apply std.MaskedMerge to blend the value of source and retinex for chroma planes. Last edited by mawen1250; 20th October 2014 at 07:30. |
20th October 2014, 09:33 | #5 | Link |
Beyond Kawaii
Join Date: Feb 2008
Location: Russia
Posts: 724
|
I used ShufflePlanes to restore chroma the fastest way. Local contrast looks better in most of image, but worse at certain spots. Whole image looks desaturated. Experimented to see if it makes a good motion estimation clip for Analyse. Looks like it doesn't. Neighboring frames may differ in a way that actually messes up motion estimation.
__________________
...desu! Last edited by Mystery Keeper; 20th October 2014 at 09:41. |
21st October 2014, 15:08 | #6 | Link |
Registered User
Join Date: Aug 2011
Posts: 103
|
Update r2
MSRCP: Add option chroma_protect to attenuate chroma adjustment. MSRCP: Intensity channel is calculated from average of R, G, B value now, instead of weighted average. @Mystery Keeper Now you can try processing in RGB color space, and adjust chroma_protect when processing in YUV, to see if the result is better. |
21st October 2014, 17:38 | #7 | Link |
Beyond Kawaii
Join Date: Feb 2008
Location: Russia
Posts: 724
|
While the option decreases chroma corruption, it is still present. I'm still better off with ShufflePlanes. Still, your filter is great for local contrast enhancement. Thank you.
__________________
...desu! |
18th July 2017, 04:21 | #9 | Link |
Registered User
Join Date: Dec 2016
Posts: 71
|
Hi. I tried with updated r3 and getting Invalid Syntex error while using this.
video = core.retinex.MSRCR(video, sigma=[25,80,250], float lower_thr=0.001, float upper_thr=0.001, bool fulls=True, bool fulld=fulls, float restore=125) Pl. suggest the changes to be made. Thanks. |
18th July 2017, 07:18 | #10 | Link |
Registered User
Join Date: Jan 2016
Posts: 79
|
Remove all the data types from the call. Should look like this:
Code:
video = core.retinex.MSRCR(video, sigma=[25,80,250], lower_thr=0.001, upper_thr=0.001, fulls=True, fulld=True, restore=125) Last edited by blaze077; 18th July 2017 at 07:21. |
11th April 2018, 06:37 | #12 | Link |
Registered User
Join Date: Oct 2001
Location: Germany
Posts: 7,277
|
Is it intended that the image might get distorted depending on the source.
Using: Code:
# Imports import vapoursynth as vs core = vs.get_core() # Loading Plugins core.std.LoadPlugin(path="G:/Hybrid/64bit/vsfilters/ColorFilter/Retinex/Retinex.dll") core.std.LoadPlugin(path="G:/Hybrid/64bit/vsfilters/SourceFilter/LSmashSource/vslsmashsource.dll") # Loading F:\TestClips&Co\files\5000frames.mp4 using LWLibavSource clip = core.lsmas.LWLibavSource(source="F:/TESTCL~1/files/5000FR~1.MP4", format="YUV420P10", cache=0) # making sure input color matrix is set as 470bg clip = core.resize.Point(clip, matrix_in_s="470bg") # making sure frame rate is set to 25 clip = core.std.AssumeFPS(clip, fpsnum=25, fpsden=1) # Making sure input color range is set to TV (limited) range. clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=1) # adjusting color space from YUV420P10 to YUV444P16 clip = core.resize.Bicubic(clip=clip, format=vs.YUV444P16) # color adjustment using Retinex clip = core.retinex.MSRCP(input=clip, sigma=[25,80,250], fulls=True, fulld=True) # adjusting output color from: YUV444P16 to YUV420P8 for x264Model (i420) clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P8) # Output clip.set_output() The first 100 frames are totally broken. Cu Selur Ps.: there is also another user who has issues with Retinex, see: https://forum.selur.net/showthread.php?tid=345 Last edited by Selur; 11th April 2018 at 06:55. |
Thread Tools | Search this Thread |
Display Modes | |
|
|