gimp photocopy(影印) 算法

算法与gimp不尽相同,但是在一定照度和距离下也能得到干净的物体边缘的图像
gimp photocopy(影印) 算法 - truman_z - 0911
 
gimp photocopy(影印) 算法 - truman_z - 0911
 

origin website:http://www.imagemagick.org/discourse-server/viewtopic.php?f=1&t=14441&start=0

 

 

i checked the description from gimp photocopy.c

/*
* Photocopy algorithm
* -----------------
* Mask radius = radius of pixel neighborhood for intensity comparison
* Threshold = relative intensity difference which will result in darkening
* Ramp = amount of relative intensity difference before total black
* Blur radius = mask radius / 3.0
*
* Algorithm:
* For each pixel, calculate pixel intensity value to be: avg (blur radius)
* relative diff = pixel intensity / avg (mask radius)
* If relative diff < Threshold
* intensity mult = (Ramp - MIN (Ramp, (Threshold - relative diff))) / Ramp
* pixel intensity *= intensity mult
* Else
* pixel intensity = white
*/

i don't really get what they are doing based on that though.

however, based on the picture from  http://docs.gimp.org/en/plug-in-photocopy.html  I would say something like:

convert taj_orig.jpg -colorspace gray -contrast-stretch 10%x0% ( +clone -blur 0x2 ) +swap -compose divide -composite test.png

Image  -->  Image

(adjust -contrast-stretch 10%x0% and -blur 0x2 accordingly. For larger pictures a larger blur is needed)


edit:
convert taj_orig.jpg -colorspace gray -contrast-stretch 4%x0% ( +clone -blur 0x3 ) +swap -compose divide -composite -blur 0x1 -unsharp 0x20 test.png
seems to be closer, althought I am not sure if the last blur is desirable:
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值