VideoHelp Forum




+ Reply to Thread
Results 1 to 13 of 13
  1. I've been using Avisynth's DeHalo alpha filter to clean up some Canon Legria HFG25 cam footage, but I've noticed that it tends to soften details. Has anyone found a way to restore the lost detail after applying dehalo? Is this worth the effort? Thanks in advance.
    Quote Quote  
  2. Originally Posted by taigi View Post
    I've been using Avisynth's DeHalo alpha filter to clean up some Canon Legria HFG25 cam footage, but I've noticed that it tends to soften details. Has anyone found a way to restore the lost detail after applying dehalo? Is this worth the effort? Thanks in advance.
    Are you sure Dehalo is the correct filter ? What does "clean up" mean - is it specifically for oversharpened halos ?

    But every dehalo filter will soften detail, in every software . It's impossible not to lose some detail, or else the filter isn't working

    You can adjust the settings, or use another filter, or try to composite with masks to reduce the detail loss
    Quote Quote  
  3. A sample of the video you are trying to fix would be helpful.

    But yes, dehalo filters will remove some detail. You may want to limit the dehalo filter to the worst halos, via Overlay and a mask.
    Quote Quote  
  4. Originally Posted by jagabo View Post
    A sample of the video you are trying to fix would be helpful.
    OK, uploading test videos for your review.
    Original "00012.MTS" and processed "00012.MTS.QTGMC,dehalo,8bit14CRF".
    Please ignore the content of the video. It's a short clip that I used as an example to illustrate the issue.
    I'm primarily interested in your feedback on use of the DeHalo alpha filter and maybe QTGMC encoding. 14CRF.
    Thank you.

    AVS used:

    SetFilterMTMode("QTGMC", 2)
    LwLibavVideoSource("00012.MTS")
    AssumeTFF()
    QTGMC(preset="Placebo", EZKeepGrain=2, EdiThreads=2)
    dehalo_alpha(rx=2.5, ry=2.5, darkstr=1.0, brightstr=1.0, lowsens=50, highsens=50, ss=1.5)
    Prefetch(2)
    Last edited by taigi; 3rd Dec 2024 at 07:17. Reason: added names of files
    Quote Quote  
  5. After dehalo_alpha() try this:

    Code:
    edges = mt_edge(mode="hprewitt", thy1=120, thy2=120).Blur(1.0) # locate edges, adjust thresholds as desired
    Overlay(last, Sharpen(0.5), mask=edges) # sharpen only around edges
    Quote Quote  
  6. preset="Placebo" <- why ?
    Why the large radi in DeHalo? (only halo I saw at a first glance and zooming were removed with brightstr=1)
    Why darkstr=1 and not 0 (didn't spot any dark halos)?
    -> all these settings seem total overkill,....
    https://imgsli.com/MzIwOTI2
    Last edited by Selur; 23rd Nov 2024 at 13:00.
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  7. Originally Posted by Selur View Post
    preset="Placebo" <- why ?
    A relic of the past. I'm realizing that the Placebo preset isn't very effective. VerySlow seems to be more useful.

    Originally Posted by Selur View Post
    Why the large radi in DeHalo?
    I was aiming for a universal DeHalo Alpha setting that could be applied to all footage from this camera. While I understand the ideal approach is to fine-tune settings for each specific take, time constraints prevent me from doing so. I'm seeking a versatile DeHalo setting that offers acceptable results across various scenarios, even if it might not be perfect in every instance. I've uploaded additional stills from various projects captured using this camera. I'm curious to know your thoughts. Presence of black halos too. I believe I may have noticed some. No green screen was used in any part of the footage.
    Last edited by taigi; 3rd Dec 2024 at 07:17.
    Quote Quote  
  8. I think your dehalo settings are fine. There are both dark and light halos. You might consider limiting the dehalo settings to the worst ones using and edge mask, similar to the way I limited the extra sharpening in my example.

    But keep in mind that eliminating the halos will make the picture look less sharp at first glance, especially from a distance (that's why the camera manufacturer adds the sharpening). But if you look closely at the edges they are actually sharper after the dehalo filter.
    Last edited by jagabo; 24th Nov 2024 at 12:20.
    Quote Quote  
  9. Originally Posted by taigi View Post
    I've been using Avisynth's DeHalo alpha filter to clean up some Canon Legria HFG25 cam footage, but I've noticed that it tends to soften details. Has anyone found a way to restore the lost detail after applying dehalo? Is this worth the effort? Thanks in advance.
    This will help reverse the softening. Use your choice of settings or try settings similar to this suggestion.

    The higher you set the RX and RY, the softer and more detail removal effect you will see. I would not go over 1.5 if you can help it. If you find it's not strong enough, using the same thing a second time right after tends to be better than raising the rx and ry over 1.5 for what you were asking about.
    Lowing the lowsens and raising the highsense can also help with this. Lower the highsense to about 70 if you need more white halo removal. It will get softer as you lower it though. I would not go below 50.
    Setting the darkstr to 0 tends to leave dark lines alone more, and preserves them better.

    Code:
    before = last
    dehalo_alpha(rx=1.1, ry=1.1, darkstr=0, lowsens=0, highsens=100, ss=1.0)
    MergeChroma(last, before)

    The before line and the merging the chroma will very much reduce the blurring/softening effect you didn't want. It will take the unfiltered chroma from before the dehalo filter was used, and replace the softened chroma from after the filter was used.
    Just adding that to however you were already using dehalo alpha should help some, but those other options will help even further if needed.
    Last edited by killerteengohan; 7th Dec 2024 at 20:08.
    Quote Quote  
  10. Code:
    edges = mt_edge(mode="hprewitt", thy1=120, thy2=120).Blur(1.0) # locate edges, adjust thresholds as desired
    Overlay(last, Sharpen(0.5), mask=edges) # sharpen only around edges
    [/QUOTE]

    @jagabo, I really enjoyed your script. Could you share some experiences with applying it to other videos? I'd like to use them on my older videos too lot rn.
    Quote Quote  
  11. Originally Posted by taigi View Post
    Code:
    edges = mt_edge(mode="hprewitt", thy1=120, thy2=120).Blur(1.0) # locate edges, adjust thresholds as desired
    Overlay(last, Sharpen(0.5), mask=edges) # sharpen only around edges
    @jagabo, I really enjoyed your script. Could you share some experiences with applying it to other videos? I'd like to use them on my older videos too lot rn.
    Are you asking for an explanation of how the script works? One think to keep in mind is that you can view the mask as a video with return(edges). So you can see what edges mt_edge() found. Do you understand the usage of Overlay() with an alpha mask?
    Quote Quote  
  12. @jagabo, thank you for an input.
    I'm interested in how this script performs on DV and VHS footage, also when dealing with HQ blurry video.
    Could you detail on the nuances involved in applying this script in these cases?
    Last edited by taigi; 11th Dec 2024 at 15:35.
    Quote Quote  
  13. Originally Posted by taigi View Post
    I'm interested in how this script performs on DV and VHS footage, also when dealing with HQ blurry video.
    Could you detail on the nuances involved in applying this script in these cases?
    Fist let me state what the sequence actually does:

    Code:
    edges = mt_edge(mode="hprewitt", thy1=120, thy2=120).Blur(1.0) # locate edges, adjust thresholds as desired
    Overlay(last, Sharpen(0.5), mask=edges) # sharpen only around edges
    The first line uses mt_edge() to builds map of edges within the image. So a frame that looks like this:

    Image
    [Attachment 84112 - Click to enlarge]


    gives an edge map that looks like this (note that the map is an image so it can be viewed):

    Image
    [Attachment 84113 - Click to enlarge]


    Then that map is used to overlay a sharpened version of the image (Sharpen(0.5)) over the image (last) only where that map (mask=edges) is non-black. Where the mask is full black the image is unchanged. Where mask is full white the sharpened image fully overlays the original pixels. In between values of the mask give a weighted blend of the two. The result here is that sharp edges in the video are made even sharper -- without sharpening or increasing noise in other parts of the picture. The mask was blurred a bit to spatially soften the transition between the two (sometimes the transition can create obvious discontinuities in moving video).

    Overlay() can be used like this to "mix" any two images. The trick is to create a mask that isolates the parts of the image you want to change.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!