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. |
5th September 2021, 19:22 | #45 | Link | |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
|
Quote:
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
|
11th September 2021, 08:42 | #48 | Link |
Registered User
Join Date: Jul 2003
Location: India
Posts: 890
|
I have added two functions to this plugin. 1. CorrectLD and 2. Circles.
CorrectLD is short for correct Lens Distortion. This includes barrel, pincushion , different formula to the DeBarrel, and also fish eye. Fish eye correction can be done with 4 methods viz: Orthoganal, Linear, equisolid and panaromic. Normal images can also be convereted to fish eye images by this function. In test mode dots on original image show the area covered and curvatures. This function takes in 3 parameters diameter, fk and rix. Test mode may be useful to decide upon parameters to use. Circles just draws circles on image and may be useful to specify center of a circular curvature seen in fish eye images which have been edited. For the image from mars used in a post above the following code may be tried. Code:
##ret=core.imwri.Read ( r'C:\images\fisheye.jpg') ##ret = core.std.AddBorders(ret,270,270,670,0) ##ret = core.vcm.Circles(ret, dim = 0.5,dots = 1,xo = 870, yo = 1270, fdia = 2800, cint =50) ##ret = core.vcm.CorrectLD(ret, test = 0,dim = 0.5,dots = 2, method = 3,q = 4, fk = 2.804825, rix = 1.25,xo = 870, yo = 1270, fdia = 2800) ##ret = core.vcm.CorrectLD(ret, test = 0,dim = 0.5,dots = 2, method = 4,q = 4, fk = 2.804825, rix = 1.25,xo = 870, yo = 1270, fdia = 2500) ##ret = core.vcm.CorrectLD(ret, test = 0,dim = 0.5,dots = 2, method = 5,q = 4, fk = 2.804825, rix = 1.25,xo = 870, yo = 1270, fdia = 2500) ##ret = core.vcm.CorrectLD(ret, test = 0,dim = 0.5,dots = 2, method = 6,q = 4, fk = 3.04825, rix = 1.25,xo = 870, yo = 1270, fdia = 2500) @selur may look into. I have some reservation in why should a horizontal horizon be strived at? It should remain circular I think. |
17th September 2021, 14:07 | #50 | Link |
Registered User
Join Date: Jul 2003
Location: India
Posts: 890
|
If one sees all around the horizontal horizon should be all around so must be circular. From a paper from Pune University I read a scheme to make the circle fit into a rectangle. Possibly it has made the change in deFish fitxy. I will try a different procedure and check. Will take some time.
|
18th September 2021, 00:07 | #51 | Link | |
Registered User
Join Date: Mar 2018
Posts: 447
|
Quote:
Also a small documentation error, minimum allowed span seems to be 3 and not 5. |
|
20th September 2021, 14:09 | #52 | Link | ||
Registered User
Join Date: Jul 2003
Location: India
Posts: 890
|
Quote:
Quote:
|
||
25th September 2021, 18:30 | #53 | Link |
Registered User
Join Date: Mar 2018
Posts: 447
|
Thanks, is there a way to only show the test display (test=1) without any processing? That would be needed to show before and after differences of F1QLimit. Argument filter is compulsory and cannot be an empty array, also I wasn't able to find a combination of filter settings which don't do any changes.
|
27th September 2021, 13:50 | #54 | Link |
Registered User
Join Date: Jul 2003
Location: India
Posts: 890
|
I probably did not understand clearly. One can compare the unprocessed input and processed output by using StackHorizontal(input, output) If I remember correct in F1Quiver test in test mode custom filter 0,100,512,100 should not do any filtering.
|
27th September 2021, 22:36 | #55 | Link | |
Registered User
Join Date: Mar 2018
Posts: 447
|
Quote:
By the way I'm testing if there are any changes with Code:
video2 = core.vcm.F1Quiver(video, filter=[0,100,512,1], test=0) diff = core.std.MakeDiff(video, video2, planes=0) diff = core.std.Expr(clips=[diff], expr=f"x 128 = 0 255 ?") diff.set_output() |
|
29th September 2021, 13:56 | #56 | Link |
Registered User
Join Date: Jul 2003
Location: India
Posts: 890
|
try with
video2 = core.vcm.F1Quiver(video, filter=[10,100,50,100], test=0, custom = 1) It will propagate values back and forward. Essentially there should be no filtering. However as all values are converted into floating point and back there can be round off errors and should be minor. |
2nd October 2021, 22:29 | #57 | Link | |
Registered User
Join Date: Mar 2018
Posts: 447
|
Quote:
So I made a comparison of F1QLimit versions, the settings used were Code:
core.vcm.F1QLimit(video, limit=80, span=7, freqs=[29]) Last edited by zorr; 3rd October 2021 at 00:39. Reason: Wrong function name |
|
3rd October 2021, 01:04 | #58 | Link |
Soul Architect
Join Date: Apr 2014
Posts: 2,559
|
Just ran some benchmark on my script.
Code:
Script evaluation done in 10.57 seconds Output 30 frames in 29.24 seconds (1.03 fps) Filtername Filter mode Time (%) Time (s) Median parallel 504.36 147.47 Analyse parallel 48.44 14.16 Analyse parallel 47.72 13.95 Analyse parallel 47.69 13.94 Analyse parallel 47.49 13.88 Analyse parallel 46.58 13.62 Analyse parallel 45.95 13.44 KNLMeansCL parreq 43.67 12.77 Edit: this actually gives me better results than Median Code:
std.Convolution(matrix=[1, 2, 1, 2, 4, 2, 1, 2, 1])
__________________
FrameRateConverter | AvisynthShader | AvsFilterNet | Natural Grounding Player with Yin Media Encoder, 432hz Player, Powerliminals Player and Audio Video Muxer Last edited by MysteryX; 3rd October 2021 at 01:13. |
4th October 2021, 13:47 | #59 | Link | |
Registered User
Join Date: Jul 2003
Location: India
Posts: 890
|
Quote:
starting value of grid is 3 i.e. 3x3 pixels. Compute max, min and median of the grid 1. if median is more than minimum and less than maximium:- if the grid center value is greater than minimum and less than maximum,the value is not changed Otherwise center value of grid is replaced by median. 2 else:- if grid size is less than maxgrid, it is increased to next step and process repeated. Otherwise center value is unchanged. As per theory Quote "Ordinary median filters perform well as long as the spatial density of impulsive noise is small. Adaptive Median filter can handle impulsive noise having larger probability. An additional benefit is this seeks to preserve detail while smoothing non impulse noise something that the traditional median filter does not do. The algorithm described has three purposes. 1.To remove salt and pepper (impulse) noise. 2.To smooth other noise which may not be impulsive 3.To reduce distortion such as excessive thinning or thickening of object boundaries. " unquote It will be slow depending on the type and intensity of noise present. I will look into the code again and see if I can improve speed. |
|
4th October 2021, 16:31 | #60 | Link |
Soul Architect
Join Date: Apr 2014
Posts: 2,559
|
Thanks, it helps to know what it's supposed to do to put it at the right place.
With 4K/5K videos, I actually have that problem where the noise is only removed locally (stabilized) but larger visible grain patterns are very hard to address. You could test with this short 5K clip Here's another one with more severe noise With Median at the start of the denoising on the first clip, I'm seeing a slight improvement with Median(maxgrid=9)... but not really with maxgrid=5. Could be useful if it wasn't such a performance pit.
__________________
FrameRateConverter | AvisynthShader | AvsFilterNet | Natural Grounding Player with Yin Media Encoder, 432hz Player, Powerliminals Player and Audio Video Muxer Last edited by MysteryX; 4th October 2021 at 16:45. |
|
|