Log in

View Full Version : Blurred plate


fenomeno83
17th February 2011, 10:31
Hello,
I need some script to get from this blurred plate
http://img337.imageshack.us/img337/7723/250pxcalifornialicensep.png

an image similar to this
http://img689.imageshack.us/img689/8841/65762243.jpg


Here others 3 images (good, medium and bad) on which I want get a good final result

http://img560.imageshack.us/img560/5980/demo14.jpg
http://img813.imageshack.us/img813/2871/demo15.jpg
http://img411.imageshack.us/img411/2689/demo16.jpg

How can I do?

THANKS

Didée
17th February 2011, 14:10
What's the deal, after all? Professional Industrial Espionage?

fenomeno83
17th February 2011, 15:05
What's the deal, after all? Professional Industrial Espionage?

????????????????????

Didée
17th February 2011, 15:22
As of late, you've come up with several tasks that involve photographs from supermarket products and product's price shields, and the questions always were about "enhancement" for better automated reckognition/evaluation.

Just thinking loud. :)

fenomeno83
17th February 2011, 17:18
As of late, you've come up with several tasks that involve photographs from supermarket products and product's price shields, and the questions always were about "enhancement" for better automated reckognition/evaluation.

Just thinking loud. :)

ahahaha...nono, it is for my university final project..
my algorithms works fine but need to have in input good quality images..so, better approach that I can use is preprocess them using avisynth, but I'm not very expert :)

jmac698
17th February 2011, 17:58
You can do fairly well with Blind Deconvolution
http://img46.imageshack.us/i/demo16deblur.jpg/
http://img585.imageshack.us/i/licensedeblur.jpg/
I wouldn't look for this in Avisynth though. Try ImageJ.

fenomeno83
17th February 2011, 18:18
You can do fairly well with Blind Deconvolution
http://img46.imageshack.us/i/demo16deblur.jpg/
http://img585.imageshack.us/i/licensedeblur.jpg/
I wouldn't look for this in Avisynth though. Try ImageJ.

thanks...I'd like if this is possibile using an avisynth e/o virtualdub plugin(that can be import in avisynth), because in this manner I can call avisynth functions from my code in preprocess step and preprocess images automatically

fenomeno83
19th February 2011, 09:35
no way to have blind deconvolution with avisynth? :)

jmac698
19th February 2011, 18:14
Yep you can use call.
http://forum.doom9.org/showthread.php?t=46506

LoadPlugin("Call.dll")
Call("e:\test\unshake.bat license.jpg license-deblur.jpg", "0,-1")
ImgSource("e:\test\license-deblur.jpg")

Didée
19th February 2011, 19:46
You can do fairly well with Blind Deconvolution
http://img46.imageshack.us/img46/6505/demo16deblur.jpg
What an extraordinarily spectacular result! Consider the base image:

http://img411.imageshack.us/img411/2689/demo16.jpg

I wouldn't look for this in Avisynth though. Try ImageJ.
Pffff.

imagesource("demo16.jpg")

# Image is very small. Some filters can not work with very small frames. Image is padded for processing.
xx=width yy=height oo=last
pointresize(320,240,-64,-64,320,240)
converttoyv12(matrix="PC.601")
o=last

# The processing: non-linear enhancer, like in SeeSaw, just with a more broad blurring filter
mt_lutxy(last,last.minblur(3).removegrain(20),"x x y - abs 9 / 1 2 / ^ 10 * 2 * x y - 2 ^ x y - 2 ^ 1 + / * x y - x y - abs 0.001 + / * +",U=2,V=2)
sharpen(0.4)

# Undo padding, undo colorspace conversion
converttoRGB24(matrix="PC.601")
crop(64,64,xx,yy)
return(last)

http://img842.imageshack.us/img842/6645/hohohoblinddeconvolutio.png (http://img842.imageshack.us/i/hohohoblinddeconvolutio.png/)

(The actual processing is a 1-line script. The other stuff is to play safe because of the small image resolution ... some SSE2/3 filters require a minimum width/height.)

Ho-ho-hoh! "Blind Deconvolution!" Ho-Ho-Hoh!

:rolleyes:

jmac698
19th February 2011, 23:29
Great idea. I hadn't experimented with SeeSaw or other sharpeners before. I tried this on some photos and it worked better for some, but not as well for a heavily blurred one. I'll have to experiment.
Could you translate that forumula into english? I don't feel like reading polish notation :) Vaguely it looks like subtracting the original from the blurred but in non-linear way.

Didée
19th February 2011, 23:56
Okay ... in english, that formula reads

"ex ex wy minus absolute nine by one two by exponent ten times two times ...." - wait, that's not what you wanted to hear, nay?


For the almost-same formula, I once wrote up the following:

Reverse Polish:
"x y == x x x y - abs 16 / 1 2 / ^ 16 * "+Str+" * x y - 2 ^ x y - 2 ^ "+Str+" 100 * 25 / + / * x y - x y - abs 0.001 + / * + ?"

in standard notation: (well, more or less standard)
( x == y ) ? x
: x + [ SQRT(abs(x-y)/16)*16 * str * (x-y)²/((x-y)²+str*100/25) * (x-y)/(0.001+abs(x-y)) ]
^ ^
b ____________________ s _________________________ _____________________
a modified "gamma" t damping for very small "SIGN" function (to revert
s curve r values the "abs" used earlier)
e e
value ngth multiplier