Log in

View Full Version : Remove Mosaic


App_rone
15th March 2018, 00:53
Something else I've been wanting to do. I have a video with lots of mosaic, and I was wondering if I could use Avisynth to remove it.

The image of the video is here.

https://i.imgur.com/SI38tA9.jpg

Does anyone have any suggestions?

lansing
15th March 2018, 05:13
Is this a joke?

tormento
15th March 2018, 07:10
Is this a joke?
Seems like a hentai anime mosaic removing request :D

Or. at least, is where "demosaicing" reached its highest point :rolleyes:

Look at this (http://www.extremetech.com/extreme/177435-depixelating-porn-is-it-really-possible-to-restore-8-bit-genitals-to-their-former-glory) snake oil.

Semi-serious mode: as in video mosaics there is always some moving or panning, probably at least a blurred image can be reconstructed. The point is if anybody has time (and material LOL) to get reasonable results.

ChaosKing
15th March 2018, 09:48
Easy, use BlankClip()

Pls provide a video sample.

tormento
15th March 2018, 12:50
Easy, use BlankClip()
:D
Pls provide a video sample.
Horny man ahahaha

MWilson
15th March 2018, 14:33
It looks to be 22x16.Resize down, resize back. That's all I got.

App_rone
15th March 2018, 22:06
Easy, use BlankClip()

Pls provide a video sample.

https://www.youtube.com/watch?v=EcgZYduaYD4

Here's the video I am trying to remove mosaic from.

StainlessS
15th March 2018, 22:45
1 step beyond MWilson's suggestion, but needs a little bit of tweaking for a perfect result.


function jm_fps(clip source, float "fps", int "BlkSize", int "Dct") {
/*
Motion Protected FPS converter script by johnmeyer from Doom9
Slightly modified interface by manolito
Requires MVTools V2 and RemoveGrain
Also needs fftw3.dll in the System32 or SysWOW64 folder for Dct values other than 0
https://forum.doom9.org/showthread.php?p=1800439#post1800439
*/
fps = default(fps, 25.000)
fps_num = int(fps * 1000)
fps_den = 1000
BlkSize = default(BlkSize, 16)
Dct = default(Dct, 0)
prefiltered = RemoveGrain(source, 22)
super = MSuper(source, hpad = 16, vpad = 16, levels = 1) # one level is enough for MRecalculate
superfilt = MSuper(prefiltered, hpad = 16, vpad = 16) # all levels for MAnalyse
backward = MAnalyse(superfilt, isb = true, blksize = BlkSize, overlap = 4, search = 3, dct = Dct)
forward = MAnalyse(superfilt, isb = false, blksize = BlkSize, overlap = 4, search = 3, dct = Dct)
forward_re = MRecalculate(super, forward, blksize = 8, overlap = 2, thSAD = 100)
backward_re = MRecalculate(super, backward, blksize = 8, overlap = 2, thSAD = 100)
out = MFlowFps(source, super, backward_re, forward_re, num = fps_num, den = fps_den, blend = false, ml = 200, mask = 2)
return out
}

AviSource(".\Mosaic.mp4.avi") # Converted to avi via ffmpeg (or eg VirtualDub2 previously VirtualDubFilterMod)
o=Last
W=o.Width # Or whatever W, H required
H=o.Height
P=PointResize(22,16)
G=P.BicubicResize(W,H,1,0) # Blurred
M=P.BicubicResize(W,H) # Medium
S=P.BiCubicResize(W,H,0,1) # Sharp
OO=P.PointResize(W,H)
##############
TOP=StackHorizontal(OO,G) # Original, Blurred
BOT=StackHorizontal(M,S) # Medium, Sharp
LFT=StackVertical(OO,M)
RGT=StackVertical(G,S)
ALL=StackVertical(TOP,BOT)

RET=7

Last = RET==0 ? OO [* 0 = Original Resized * to W,H *]
\ : RET==1 ? G [* 1 = Blurred *]
\ : RET==2 ? M [* 2 = Medium *]
\ : RET==3 ? S [* 3 = Sharp *]
\ : RET==4 ? TOP [* 4 = Orig + Blurred *]
\ : RET==5 ? BOT [* 5 = Med + Sharp *]
\ : RET==6 ? LFT [* 6 = Orig + Med *]
\ : RET==7 ? RGT [* 7 = Blur + Sharp *]
\ : ALL [* Else ALL *]

jm_fps(o.FrameRate*2.0) # DoubleRate
AutoLevels

EDIT: Moved AutoLevels to the end of script

Looks nuttin like a Nipponese prawn. :)

EDIT: Added jm_Fps() after seeing John viewing the thread he linked below
(Probably better result if following that below thread, this post script aint much better than the source).

EDIT:
this video is really awful.
Maybe so, but the tune is great.

One question. Could this be called Super Resolution :)

johnmeyer
15th March 2018, 23:06
This does appear to be a joke. However, if the OP is serious, I did have to do something similar several years ago when I wanted to restore a 1991-era digital video that was only 160x120 at 12 fps. Here's the thread where I provided the original and, after a lot of help from people in this forum, I posted the result:

Ideas for restoring early generation (really old) video (https://forum.doom9.org/showthread.php?t=163014)

Some of the ideas people gave me might be helpful here, although this video is really awful.

Mounir
16th March 2018, 01:38
Among others things, You'd need this filter (http://www.compression.ru/video/super_resolution/super_precision_en.html) but it's never been released publicly (shame on them ruskies)