11-25-2018, 07:49 PM | #41 |
Administrator
Join Date: Jan 2005
Location: NYC
Posts: 15,721
|
wwwmaze, btw, there's a typo in your YV12 version, it needs to be _1=eval_w*.5-1, in order to reset every scanline
I've merged the updated Gaussian kernel into my newer blur, here it is: Code:
// Blur (Gaussian) //@param1:sigma_parm 'Sigma' 10 0.5 100 25 0.1 //@param2:weight_mod 'Y modifier' 1 .25 4 1.0 0.01 //@param4:want_l 'leftward' 1 0 1 0 1 //@param5:want_r 'rightward' 1 0 1 0 1 //@param6:want_u 'upward' 1 0 1 0 1 //@param7:want_d 'downward' 1 0 1 0 1 in=0; colorspace!='RGBA' ? colorspace='YV12'; input_info(in,project_w,project_h); w=project_w; h=project_h; function rot(new_ang, dest, blur) local(lw,lh,ang) ( gfx_dest=dest; ang = (new_ang+4-c_ang)&3; c_ang = new_ang&3; lw=(c_ang&1) ? h:w; lh=(c_ang&1) ? w:h; ang==0 ? gfx_blit(c_last,0, 0,0,lw,lh,0,0,lw,lh) : ang==1 ? gfx_deltablit(c_last, 0,0, lw,lh, 0, lw-1, 0, -1, 1, 0) : ang==2 ? gfx_deltablit(c_last, 0,0, lw,lh, lw-1,lh-1, -1, 0, 0, -1): ang==3 ? gfx_deltablit(c_last, 0,0, lw,lh, lh-1,0, 0, 1, -1, 0); blur ? ( sigma = sigma_parm * ((c_ang&1)?weight_mod:1/weight_mod); sigma > 0.5 ? ( q = sigma <=2.5 ? 3.97156-4.14554*sqrt(1-0.26891*sigma) : 0.98711*sigma-0.96330; b0 = 1.57825 + 2.44413*q + 1.4281*q^2 + 0.422205*q^3; b1 = 2.44413*q + 2.85619*q^2 + 1.26661*q^3; b2 = -1.4281*q^2 - 1.26661*q^3; b3 = 0.422205*q^3; BB = 1-(b1+b2+b3)/b0; b1b0=b1/b0; b2b0=b2/b0; b3b0=b3/b0; eval_w = lw; gfx_evalrect(0,0,lw,lh, colorspace=='RGBA' ? " (_1 -= 1) < 0 ? ( _1=eval_w-1; _31=_21=_11=r; _32=_22=_12=g; _33=_23=_13=b; ); r=BB*r + b1b0*_11 + b2b0*_21 +b3b0*_31; _31=_21; _21=_11; _11=r; g=BB*g + b1b0*_12 + b2b0*_22 +b3b0*_32; _32=_22; _22=_12; _12=g; b=BB*b + b1b0*_13 + b2b0*_23 +b3b0*_33; _33=_23; _23=_13; _13=b; " : " (_1 -= 1) < 0 ? ( _1=eval_w*.5-1; _31=_21=_11=y1; _32=_22=_12=y3; _33=_23=_13=u; _34=_24=_14=v; ); y1=BB*y1 + b1b0*_11 + b2b0*_21 +b3b0*_31; y2=BB*y2 + b1b0*y1 + b2b0*_11 +b3b0*_21; _31=_11; _21=y1; _11=y2; y3=BB*y3 + b1b0*_12 + b2b0*_22 +b3b0*_32; y4=BB*y4 + b1b0*y3 + b2b0*_12 +b3b0*_22; _32=_12; _22=y3; _12=y4; _90=BB*u + b1b0*_13 + b2b0*_23 +b3b0*_33; u=BB*u + b1b0*_90 + b2b0*_13 +b3b0*_23; _33=_13; _23=_90; _13=u; _91=BB*v + b1b0*_14 + b2b0*_24 +b3b0*_34; v=BB*v + b1b0*_91 + b2b0*_14 +b3b0*_24; _34=_14; _24=_91; _14=v; " ); ); ); c_last=dest; ); c_ang=0; c_last=in; max(sigma_parm/weight_mod,sigma_parm*weight_mod)>.5? ( want_l ? rot(2, -1, 1); want_d ? rot(3, img3 = gfx_img_resize(img3,h,w),1); want_u ? rot(1, img2 = gfx_img_resize(img2,h,w),1); want_r || c_last==-1 ? rot(0, c_last==-1 ? (img1 = gfx_img_resize(img1,w,h)) : -1,want_r); ); c_last != -1 ? rot(0, -1, 0); |
11-26-2018, 12:58 AM | #42 |
Human being with feelings
Join Date: Mar 2018
Location: Cologne
Posts: 1,362
|
Wow! This more and more looks like the battle of the titans. Like Muhammad Ali vs. George Foreman. Or maybe more like Magnus Carlsen and Fabiano Caruana?
Anyway. We are pretty happy about how this thread turned out. Many thanks. |
11-26-2018, 02:18 PM | #43 |
Administrator
Join Date: Jan 2005
Location: NYC
Posts: 15,721
|
Except we get to add on to eachother's work
|
11-26-2018, 06:16 PM | #44 | |||||
Human being with feelings
Join Date: Oct 2009
Posts: 99
|
Quote:
Quote:
Quote:
Quote:
Quote:
It's awesome to know that many filters are really feasible. |
|||||
11-29-2018, 07:16 PM | #45 |
Administrator
Join Date: Jan 2005
Location: NYC
Posts: 15,721
|
Some improvements coming in the latest pre-release -- gfx_evalrect() can take flags to process right to left, or vertically, avoiding all of the image shuffling. I've updated the built-in blur presets to take advantage of this, they should both be quite a bit faster.
|
11-30-2018, 08:23 AM | #46 | |
Human being with feelings
Join Date: Oct 2009
Posts: 99
|
Quote:
Just a heads up: If I set colorspace to 'RGB' in project settings and run this I420/YV12 video through any blur preset I'm getting reproducible crashes with dev1129. Not with the edge detection preset and not with dev1128. Just saw the mention in the preset Thank you I'm feeling very honored man (shhhh...originally not my work...got it from here: https://www.researchgate.net/publica...aussian_filter ) |
|
11-30-2018, 08:51 AM | #47 | |
Administrator
Join Date: Jan 2005
Location: NYC
Posts: 15,721
|
Quote:
|
|
12-06-2018, 03:51 AM | #48 |
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,875
|
I left in last Pre release thread about about RGB color shift with blur, the common approach and the better one :
https://forum.cockos.com/showpost.ph...61&postcount=5 Can interest some of you here :P
__________________
Free ReaScripts - Premium Scripts - Custom Scripts Dev - Learn ReaScript - XR Theme - Stash Files - ReaLinks - Website - ReaComics - Alien 2347 - Donation |
12-06-2018, 06:20 AM | #49 | |
Human being with feelings
Join Date: Mar 2018
Location: Cologne
Posts: 1,362
|
Quote:
Many thanks for the info. Btw: Why are you not coding in video processor? Is it not your programming language or is it just not your genre? I'm just curios as you are known for your lots of scripts in other areas. |
|
12-06-2018, 11:36 AM | #50 |
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,875
|
@Eliseat
I coded few things for video items but not actual new video processor preset indeed. Basically, it's just that I'm used to video editor softwares which offers the tools I need (mostly GUI acceleration and RGB curves and advanced text tools) for video editing. I do use Video features in REAPER, mostly when I need to make a sound for video. Though basic color correction are very welcome in this case. Also, it's pretty hard :P Justin code is very conzise, but there is more complexlity in it than all my scripts of the same size ^^ I keep an eye on new video features, native or user made.
__________________
Free ReaScripts - Premium Scripts - Custom Scripts Dev - Learn ReaScript - XR Theme - Stash Files - ReaLinks - Website - ReaComics - Alien 2347 - Donation |
12-21-2018, 10:30 AM | #51 | |
Human being with feelings
Join Date: Nov 2008
Location: London, UK
Posts: 2,581
|
Quote:
HAHAHAHAHHAHA. Solid gold.
__________________
Puzzle Factory Sound Studios, London [Website] [Instagram] [AMD 5800X, 32Gb RAM, Win10x64, NVidia GTX1080ti, UAD2-OCTO, FireFaceUCX, REAPER x64] [Feature request: More details in Undo History] |
|
12-21-2018, 10:32 AM | #52 | |
Human being with feelings
Join Date: Nov 2008
Location: London, UK
Posts: 2,581
|
Quote:
__________________
Puzzle Factory Sound Studios, London [Website] [Instagram] [AMD 5800X, 32Gb RAM, Win10x64, NVidia GTX1080ti, UAD2-OCTO, FireFaceUCX, REAPER x64] [Feature request: More details in Undo History] |
|
04-11-2023, 12:04 AM | #53 |
Human being with feelings
Join Date: Feb 2008
Location: Eesti
Posts: 2,716
|
I know I'm resurrecting an old thread, but I have a few questions about the blurs.
Which one of the above blur presets is best for faking or enhancing the depth of field blurriness? How is it done selectively, meaning farther areas get progressively more blurred, with a gradient mask with alpha channel?
__________________
projektorn |
04-11-2023, 05:38 AM | #54 | |
Human being with feelings
Join Date: Aug 2020
Location: Brasil
Posts: 679
|
Quote:
Last edited by papagirafe; 04-11-2023 at 05:49 AM. |
|
04-11-2023, 08:01 AM | #55 |
Human being with feelings
Join Date: May 2006
Location: NA - North Augusta South Carolina
Posts: 4,294
|
Please, when you're finished working out the various filter parameters, put them all in one plugin ui and refer to it by it's proper name:
|
04-11-2023, 03:30 PM | #56 |
Human being with feelings
Join Date: Dec 2012
Posts: 7,271
|
^^^That kind of thing is exceedingly complicated because distance from camera is not specifically encoded in the video file, so you either need a second video file in which that is encoded to act as a mask, or you need to somehow figure it out from the limited information available. I think the best algorithms are AI driven. We theoretically could do AI in VP, but it wouldn’t be a whole lot of fun.
If you have a static angle and a static background, you could might be able to use a static shot of the scene without your foreground subject to do some trickery to create a mask out of the difference between the actual scene and that background, but that requires forethought, and kind of only works to the extent that everything (lighting, exposure, focus, etc) is exactly the same except the moving foreground element. Honestly, it’s almost easier to just greenscreen it.
__________________
Lorenzo's Tractor is Everywhere --- Ash's Tube --- Join the Partnership for a Drum Free Amerika |
04-11-2023, 03:38 PM | #57 |
Human being with feelings
Join Date: Nov 2008
Location: London, UK
Posts: 2,581
|
Yeah, honestly, REAPER's video tools are not advanced enough to do this. Your best option would be to look to Davinci Resolve, but even that is not black magic ( See what I did there?)
You're asking software to generate a 3D map from 2D vision. It's easy for us to tell what is near and far in a shot, but that's because we have neural processing and a lot of historic data for what depth looks like.
__________________
Puzzle Factory Sound Studios, London [Website] [Instagram] [AMD 5800X, 32Gb RAM, Win10x64, NVidia GTX1080ti, UAD2-OCTO, FireFaceUCX, REAPER x64] [Feature request: More details in Undo History] |
04-11-2023, 03:44 PM | #58 |
Human being with feelings
Join Date: Nov 2008
Location: London, UK
Posts: 2,581
|
__________________
Puzzle Factory Sound Studios, London [Website] [Instagram] [AMD 5800X, 32Gb RAM, Win10x64, NVidia GTX1080ti, UAD2-OCTO, FireFaceUCX, REAPER x64] [Feature request: More details in Undo History] |
04-11-2023, 10:39 PM | #59 | |
Human being with feelings
Join Date: Feb 2008
Location: Eesti
Posts: 2,716
|
Quote:
So that would need the mask to be animated too. Because of that and the overall feel of the blur, I decided it isn't worth the hassle with this instance at least. The Toneh is funny though.
__________________
projektorn |
|
Thread Tools | |
Display Modes | |
|
|