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.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Development

Reply
 
Thread Tools Search this Thread Display Modes
Old 4th May 2005, 10:45   #1  |  Link
vcmohan
Registered User
 
Join Date: Jul 2003
Location: India
Posts: 890
Recoloring

There is a thread in this forum with subject as "Colorization code used as denoiser?". It is actually discussing how to color or recolor an image. In one post E_Male suggested renaming the thread to correctly convey the meaning of what is being discussed there, but probably no one seriously took notice of it.. So I deliberately opened another thread to reflect it. Hope I did not violate any rules of forum.

I also have been working on a (re)coloring process.
For this I have created a plugin 'coloreds' (will change to recolor or so) with functions named TemplateMaker, colorbrush, colorpencil. I am adding to these ColorFills and drawlines functions. I am very close(?) to finish, but can not say when as so far I tested with a simpler image. ColorPencil takes coordinates of a point in an area and its color as an array. ColorBrush takes coordinates of straight lines, and color as an array. The main work is in formulating a template to demarcate an area to be colored.

As with any recoloring attempt more time is taken to decide on various parameters and therefore the actual time taken becomes mostly irrevelant. However I timed my script and i get about 1.5 fps.Since I started with a colored image, this time includes conversion to Grey scale,converttoYUY2 also. I work in YUY2 only but will be able to do in RGB (I hope)

My script runs like this
Code:
loadPlugin ("E:\TransPlugins\bin\Coloreds\Release\coloreds.dll")
loadPlugin ("E:\TransPlugins\bin\Grid\Release\Grid.dll")

#----------------------------------------
DirectShowSource("F:\TransVideo.avi").trim(140,0)
#converttoRGB32()

#r24=converttoRGB24()
#r32=converttoRGB32()
YUY=converttoYUY2()
#YV=converttoYV12()
a=GreyScale(YUY)


# below good for stars, fireworks, wick, flame
t=TemplateMaker(last,1,100,"e3", 88, black=true)

# for stars
colorPencil(a,1,100,t,5,80,$3f9f,120,80,$5f0080,266,80,$3f00,410,80,$1f004f,

580,96,$ffff,715,62,$3f9f)

# for fireworks body
colorPencil(last,1,100,t,130,400,$7f5000, 80,420,$7f5000, 170,390,$7f5000)
# for wick
colorPencil(last,1,100,t,245,360,$2f7000,220,327,$2f7000)
# for flame center
colorPencil(last,1,100,t,320,370,$1f5f)
# for outer flame
#colorbrush(last,1,2,t,300,340,360,370,$FF3030,300,340,320,420,$FF3030)
# for wickets and all area
colorPencil(last,1,100,t,2,400,$1f5f00,40,340,$1f5f00, 

380,440,$1f5f00,500,420,$1f5f00,710,250,$1f5f00,225,400,$1f5f00)
colorPencil(last,1,100,t,430,115,$1f5f00,540,110,$1f5f00,660,100,$1f5f00,238

,360,$1f5f00)
To get at various coordinates I used my Grid Plugin extensively. The first results are as below.

Original:


GreyScale:


Recolored:


As can be seen there are some spots which are not colored. They can be filled easily with colorpencil function. But I am having this problem which in another thread traversing a closed area, I explained. The solution suggested I did not understand yet.
I will be greatful for any suggestions observations.
__________________
mohan
my plugins are now hosted here

Last edited by vcmohan; 4th May 2005 at 10:51.
vcmohan is offline   Reply With Quote
Old 6th May 2005, 22:59   #2  |  Link
E-Male
mad computer-scientist
 
Join Date: Mar 2002
Posts: 1,375
first of all: sorry for not having done the plug-in based on ming yang's colorizing code, yet
it's finished in my head, but time and energy are low

would be nice to have a look at your code
but if you wanna keep it to yourself until your happy with the result i'll understand that
btw, what algo do you use?
E-Male is offline   Reply With Quote
Old 7th May 2005, 03:44   #3  |  Link
vcmohan
Registered User
 
Join Date: Jul 2003
Location: India
Posts: 890
Quote:
Originally posted by E-Male

btw, what algo do you use?
The process I use is to either demarcate areas of different colors with lines and or create masks. If demarcated with line boundaries then,I propagate the color within that area (using colorpencil or colorbrush) or if mask fill(using colorfill). I also think that my scheme can be used even if there is not too much movement.

Not having an interactive environment slows things terribly to arrive at various parameters. However I am thinking of learning to make a plugin for virtualdub for getting at parameters.

My code is part finished and not in a condition to release. Just testing
to make it work for allmost all situations.
__________________
mohan
my plugins are now hosted here
vcmohan is offline   Reply With Quote
Old 9th May 2005, 14:49   #4  |  Link
vcmohan
Registered User
 
Join Date: Jul 2003
Location: India
Posts: 890
Further I have tested my plugin on a sunset
my script for processing is simple enough.

script and results:-


loadPlugin ("E:\TransPlugins\bin\Coloreds\Release\coloreds.dll")
#loadPlugin ("E:\TransPlugins\bin\Grid\Release\Grid.dll")

#----------------------------------------
DirectShowSource("F:\TransVideo.avi")

YUY=converttoYUY2()
a=GreyScale(yuy)
n=20
s=200
y=TemplateMaker(a,s,s+n-1,"c1",90,0,0,true,225,0,0)
#Grid(y,s,s+n-1)
# sun and surrounding red clouds, reflection
x=colorFills(a,s,s+n-1,"rect",0,0,a.width-1,a.height-1, false,$BA673d,"allxy", y,true)
# darker clouds
x=colorFills(x,s,s+n-1,"rect",0,0,a.width-1,320,false,$996834,"allxy",y,false)
# sea
x=colorFills(x,s,s+n-1,"rect",0,320,a.width-1,a.height-1-320,false,$3b5444,"allxy",y,false)
reduceby2(x)
# Grey scale Image


# Recolored image, not very pretty but not bad for first attempt.


# Original color Image



I have some problem in selecting appropriate colors. The HTML colors which Irfanview indicates does produce strange hues on my lcd screen. May be I need to use R, G, B colors as seperate parameters. There is a need to have a reference large pallette of colors.
__________________
mohan
my plugins are now hosted here
vcmohan is offline   Reply With Quote
Old 10th May 2005, 18:38   #5  |  Link
E-Male
mad computer-scientist
 
Join Date: Mar 2002
Posts: 1,375
got Ming Yangs code ported, working on the interfaces now
E-Male is offline   Reply With Quote
Old 15th June 2005, 04:13   #6  |  Link
vcmohan
Registered User
 
Join Date: Jul 2003
Location: India
Posts: 890
I have made a little more progress on my recoloring project. Here are my script and results. I would appreciate critical comments and suggestions. As mentioned in my earlier post my scheme depends upon mask creation to separate out objects. (it can be grey values, edges, or lines drawn or a combination of all. Linear variation with frame numbers of colordrops and other functions ease in scripting for moving objects. Below is script and results.

loadPlugin (".....\colorit.dll")
loadPlugin (".......\Grid.dll")
loadPlugin(".......\EffectsMany.dll")
#----------------------------------------
# original scene creation A beach still photo is read and looped 50 times.
#on this two balloons hop.

ImageReader ("....../Originalbeach.jpg"...)
loop(0,50)
#As Image reader in my version is buggy and I can not use trim for getting just the first frame and I already have output of this in another project, I used following statement
#AVISource("F:\TransVideo.avi").trim(0,50)

#EffectBalloon is a function in my EffectsMany plugin (warpenterprises page)
#first balloon makes 3 (parabolic) hops between frames 1 to 41

EffectBalloon(last,1,41, color=$ff7f,opacity=90,light="west",refl=5, nhops=3)

#Second balloon makes single hop appears frame 6 to 46

EffectBalloon(last,6,46, color=$7f7f00,opacity=80,light="nw",refl=2)

YUY=converttoYUY2()

# greyscale image is input to recolor process
a=GreyScale(yuy)

# colorit plugin has Gaussian blur, morpher,draw lines, mask maker, EdgeMarker,color shift, color stretch, color filling for areas, lines, and points using a mask reference, cross fill and inlay using a mask and drawn lines. Some of them have test facility for parameter value selection.
Grid plugin is used to read off coordinates for input.
# following script is for recoloring. While fore some parts I used very near to original colors, I deliberately deviated from them in several other cases including balloons. About 32 lines of script was required.

g=GaussBlur(a,false,1)
b=blankclip(a,color=0)

# colors used for some

bal1=$7f7f
bal2=$4f5fdf
sand=$dbcba0
starfish=$966d50

# curved lines and straight lines
cl=drawlines(b,0,50,0,220,40,240,120,240,150,230,180,210,210,210,260,140,280,110,300,80,350,90,500,94,560,100,650,80,719,80,true,true)
sl=drawlines(b,0,50,700,200,400,278,curve=false,white=true)
sr=drawlines(sl,0,50,400,400,600,360,650,380,719,380,curve=false,white=true)

## use lines "above" for stones and "below" for sand and shells. use white
mm=maskmaker(a,0,50,"c1", thresh=1,ethresh=100)
#for stones within surf region
ii=inlay(a,mm,cl,0,50,"above", color=$1f3253)
#for surf
ii=inlay(ii,mm,cl,0,50,"above", color=$ffffff, mwhite=false)
#for sand
iii=inlay(ii,mm,cl,0,50,"below", color=sand, mwhite=false)
my=maskmaker(a,0,50,"c1", thresh=130,ethresh=220)
shl=drawlines(b,0,50,0,300,719,300,curve=false)
iii2=inlay(iii,my,shl,0,50,"below", color=starfish,mwhite=false)
#shells

iii3=inlay(iii2,mm,sr,0,50,"vint",mwhite=true)
ls1=drawlines(b,0,50,100,300,100,380,0,430,curve=false,white=true)
ls2=inlay(iii3,mm,ls1,0,50,"left",color=$d66d50,mwhite=true)
## for whitish shells
ms=maskmaker(a,0,50,"c1", thresh=200,ethresh=250)
shln=drawlines(b,0,50,0,300,719,400, curve=false)
ls3=inlay(ls2,ms,shln,0,50,"below",color=$fdf1ed,mwhite=true)

## for right side greenish shell

emp2=EMarker(g,0,50,"es",thresh=38)

# morpher for correcting mask. Default option "close" is used

mmp2=morpher(emp2,0,50)
cmp2=colordrops(ls3,emp2,0,50,630,350,$7f7f30)

#for right side lower blue spoted shell

bmm=maskmaker(g,0,50,"c1",thresh=148,ethresh=190)
bln=drawlines(b,0,50,515,422,555,422,curve=false)
bin=inlay(cmp2,bmm,bln,0,50,"below",color=$4545cc,mwhite=true)

#balloon1 and balloon 2 mask
mp1=EMarker(g,0,50,"es",6)

#balloon1 tracking and coloring

cd=colordrops(bin,mp1,1,8,60,370,bal1,160,10,bal1,vary=true)
cd1=colordrops(cd,mp1,9,15,180,20,bal1,260,400,bal1,vary=true)
cd1=colordrops(cd1,mp1,16,21,280,250,bal1,350,25,bal1,vary=true)
cd1=colordrops(cd1,mp1,22,28,370,20,bal1,460,350,bal1,vary=true)
cd1=colordrops(cd1,mp1,29,35,470,300,bal1,550,10,bal1,vary=true)
cd1=colordrops(cd1,mp1,36,41,570,10,bal1,650,300,bal1,vary=true)

#balloon2 tracking and coloring

cd2=colordrops(cd1,mp1,6,26,60,400,bal2,360,10,bal2,vary=true)
cd2=colordrops(cd2,mp1,27,46,370,10,bal2,650,340,bal2,vary=true)

# display for this post

selectEven(cd2)
selectodd()
reduceby2()

# the Grid function is a great help for specifying coordinates.

#Grid(cd2,0,50, color=$888888)

Displays:
Original Beach image


Greyscale image of beach


Recolored beach


Thumbnails of recolored images of balloons hopping
1

2

3

4

5

6

7

8

9

10

11



my next attempt will be to recolor scene with people faces, dress and background.
__________________
mohan
my plugins are now hosted here
vcmohan is offline   Reply With Quote
Old 15th June 2005, 04:45   #7  |  Link
insanedesio
Registered User
 
Join Date: May 2003
Posts: 27
Wow. Looking much better than where my attempt got before I stopped it.
insanedesio is offline   Reply With Quote
Old 5th July 2005, 03:24   #8  |  Link
vcmohan
Registered User
 
Join Date: Jul 2003
Location: India
Posts: 890
I have attempted to color a greyscale image derived from an color photo of a birthday party held in a open lawn. There are a number of children and adults, balloons cake etc along with other items.
As can be seen I have been to a large extent successful. I find that a lot of patience and time is needed. May be a number of persons working parallel on different scenes can create a colored movie out of a black and white original.
I use grey scale values and edge detection schemes to demarcate areas. I found that both sobel, prewit even with laplace combination do not give usable demarcations for this purpose. This may be due to almost insignificant level changes at certain places. This forces manual intervention by way of extending demarcation lines.
I have also some difficulty in treating the edge itself. It remains and sometimes seen. Grey scale value itself is a better demarcator than edge detection in my experience.
Below are the images.
Grey Scale

colored

original



Code:
loadPlugin ("E:\TransPlugins\bin\Colorit\Release\colorit.dll")
loadPlugin ("E:\TransPlugins\bin\Grid\Release\Grid.dll")

#----------------------------------------

imagereader("E:\TransPlugins\ch6.jpg",0,1,25,false)
reduceby2().crop(0,0,720,480)

YUY=converttoYUY2()
loop(yuy,100,0,0)
tr=trim(0,99)

blonde=$6d401d
face1=$e79c81
syrup=$f08080
hair=$f0507
#balloons
red=$9f2222
blue=$22339f
green=$229f22
yellow=$9f9f22
purple=$9f119f

a=GreyScale(tr)
g=GaussBlur(a,false,1)
b=blankclip(a,color=0)



#for lawn and plants
lawn=$a6b95e
plant=$9fb94e
mlawn=maskmaker(g,0,50,type="c1",gyt=118,et=183,rx=50,by=190,xcol=false)
cdlawn=colordrops(a,mlawn,0,50,10,100,lawn)
mlawn=maskmaker(g,0,50,type="c1",gyt=118,et=183,lx=200,rx=330,by=50,xcol=false)
mlawn=drawlines(mlawn,0,50,210,0,210,50)
cdlawn=colordrops(cdlawn,mlawn,0,50,205,40,lawn,250,30,lawn,315,30,lawn)
mlawn=maskmaker(g,0,50,type="c1",gyt=118,et=183,lx=500,by=150,xcol=false)
cdlawn=colordrops(cdlawn,mlawn,0,50,650,50,lawn,580,50,lawn)
elawn=EMarker(g,1,50,"es",gyt=43,lx=496,ty=70,by=180,xcol=false)
emlawn=drawlines(elawn,0,50,510,100,560,150)
cdlawn2=colordrops(cdlawn,emlawn,1,50,540,110,lawn,700,150,lawn)
#return(grid(cdlawn2,0,50,color=$7f3f00))
#black hair
mmhair1=maskmaker(g,2,50,"c1",gyt=21, et=45,rx=50,ty=350,xcol=false)
cdhair1=colordrops(cdlawn2,mmhair1,2,50,10,400,hair)
mmhair2=maskmaker(cdlawn2,2,50,"c1",gyt=21, et=45,lx=270,rx=600,by=350)
cdhair=colordrops(cdhair1,mmhair2,2,50,300,35,hair,550,250,hair,400,200,hair,455,10,hair,350,100,hair,240,2,hair)
mmtunic=maskmaker(cdhair,2,50,"c1",gyt=15, et=45,lx=205,rx=275,ty=35,by=260)
cdtunic=colordrops(cdhair,mmtunic,2,50,250,200,blue,265,80,blue,250,90,blue,215,45,blue)
#return(grid(cdtunic,0,50,color=$7f3f00))
#blonde
mmblnd=maskmaker(g,3,50,"c1",gyt=45,et=90,lx=600,ty=200,xcol=false)

lblnd=drawlines(mmblnd,3,50,630,250,610,260,610,280)
cdblnde=colordrops(cdhair,lblnd,3,50,660,250,blonde)
mgirl=maskmaker(cdblnde,3,50,"c1", gyt=95,et=195,lx=610,ty=250)
cdgirl=colordrops(cdblnde,mgirl,3,50,620,400,$f000a)

mgirl2=maskmaker(cdgirl,3,50,"c1",gyt=135,et=185,lx=610,ty=250)
cdgirl2=colordrops(cdgirl,mgirl2,3,50,640,430,blue)
mgirl3=maskmaker(cdgirl2,3,50,"c1", gyt=95,et=195,lx=610,ty=250)
dgirl3=drawlines(mgirl3,3,50,627,470,632,437)
cdblnd=colordrops(cdgirl2,dgirl3,3,50,700,400,face1,710,450,blue,715,450,blue,710,430,face1,690,300,blonde)
# maya?
#mm=maskmaker(cdhair1,3,50,"c1", gyt=20,et=50,test=true,ft=120,fet=150,rx=50,ty=350)
emaya=emarker(cdhair1,3,50,"e2",gyt=30,lt=2,rx=60,ty=350)
dmaya=drawlines(emaya,3,50,43,390,50,410,50,440,22,452,20,470,10,475)
cdmaya=colordrops(cdblnd,dmaya,3,50,40,420,face1)
#return(showpixelvalues(cdhair,500,100,bright=2,dim=0,threshold=1,showArea=true))
#return(grid(cdmaya,0,50,color=$7f3f00))

#syrup bowl and cake top
mm=maskmaker(g,4,50,"c1", gyt=180,et=235,test=true,ft=230,fet=235,lx=140,rx=310,ty=260,by=370,xcol=false)
mmcake=maskmaker(g,4,50,"c1",gyt=75,et=120,lx=140,rx=310,ty=260,by=370,xcol=false)
drcake=drawlines(b,4,50,260,300,220,265,145,275,185,315,260,300)
cdsyrp=colordrops(cdmaya,mmcake,4,50,280,320,syrup,155,320,purple)
incake=inlay(cdsyrp,mmcake,drcake,4,50,"hint",purple)
mcake=maskmaker(g,4,50,"c1", gyt=180,et=235,lx=140,rx=270,ty=280,by=350,xcol=false)
cdcake=colordrops(incake,mcake,4,50,200,320,$1f0405,st=-130)
mmsyrp2=maskmaker(g,4,50,"c1",gyt=45,et=90,lx=220,rx=310,ty=300,by=370,xcol=false)
cdsyrp2=colordrops(cdcake,mmsyrp2,4,50,260,360,syrup)

#wall
mmwall=maskmaker(g,4,50,"c1",gyt=150,et=195,lx=520,rx=580,by=40,xcol=false)
cdwall=colordrops(cdsyrp2,mmwall,4,50,560,10,$770000)
#return(grid(cdwall,0,50,color=$7f3f00))

#mm=maskmaker(cdsyrp2,5,50,"c1", gyt=50,et=150,test=true,ft=150,fet=250,lx=610,ty=250)


# girl red top
emredtop=EMarker(g,4,50,"es", gyt=19,lx=400,rx=480,ty=20,by=65,xcol=false)
cdredtop=colordrops(cdwall,emredtop,4,50,450,50,$9f4433)
#return(grid(mm,0,50,color=$7f3f00))
#plant and kshirt
mks=maskmaker(cdhair,5,50,"c1",gyt=121,et=161,lx=348,ty=60,by=230,rx=580)
cream=$dac07f
blue=$55668f
mks1=drawlines(b,5,50,450,60,570,150,580,210)
mks2=drawlines(mks1,5,50,350,60,350,210,440,210)
kps=inlay(cdredtop,mks,mks2,5,50,"hint",color=blue)
#embal=emarker(cdlawn,5,50,"ep",gyt=1,lt=1,test=true,ft=50,fl=1,lx=14,rx=235,by=272)
embal=emarker(cdhair,5,50,"ep",gyt=22,lx=14,rx=235,by=272)
drbal=drawlines(embal,5,50,230,95,215,115,236,135)
cdbal=colordrops(kps,drbal,5,50,50,100,red,45,150,green,30,30,purple)
#stackhorizontal(embal,g)
#return(pallet(b,10,30))
#mm=maskmaker(cdbal,5,50,"c1", gyt=50,et=150,test=true,ft=150,fet=250,lx=410,ty=250)
#return(grid(mm,0,50,color=$7f3f00))

# other faces, left over etc
mtlady=maskmaker(g,6,50,"c1",gyt=78,et=150,lx=210,rx=246,by=62)
cdtlady=colordrops(cdbal,mtlady,6,50,220,30,face1)
mtbikin=maskmaker(cdhair,6,50,"c1", gyt=52,et=150,lx=260,rx=310,ty=40,by=90)

cdbikin=colordrops(cdtlady,mtbikin,6,50,290,70,face1)
embik=emarker(cdhair,6,50,"esl",gyt=68,lt=1,lx=270,rx=330,ty=160,by=210)
drbik=drawlines(b,6,50,270,190,310,210,330,185)
rbik=inlay(cdbikin,embik,drbik,6,50,"above",color=blue,x=270,y=160,w=60,h=50)
gbik=inlay(rbik,embik,drbik,6,50,"above",color=blue,mwhite=false,x=270,y=160,w=60,h=50)

#metc=maskmaker(gbik,6,30,"c1", gyt=10,et=45,test=true,ft=130,fet=175,lx=155,rx=600,by=416)
metc=maskmaker(gbik,6,50,"c1", gyt=30,et=65,lx=210,rx=420,ty=36,by=260)
detc=drawlines(metc,6,50,330,190,330,210,330,220,355,210,265,160,270,162,290,140,300,142,260,90,270,100,265,130,280,130,330,210,370,210,line="diff")
cdetc=colordrops(gbik,detc,6,50,250,150,blue,250,200,blue,350,150,face1,335,157,face1,380,140,face1,260,140,face1,280,150,face1,280,110,blue,300,110,hair,300,230,face1,380,210,hair,400,230,hair,400,240,face1,280,220,face1)
#left over kshirt
mleft=maskmaker(cdetc,6,50,"c1", gyt=95,et=120,lx=350,rx=580,ty=60,by=230)
dleft=drawlines(b,6,50,350,80,440,60,580,175)
ileft=inlay(cdetc,mleft,dleft,6,50,"below",color=cream)
#chris body
#emetc=emarker(ileft,7,50,"epl", gyt=1,lt=2,test=true,ft=100,fl=2,lx=250,ty=200,rx=500,by=320)
emetc=emarker(ileft,7,50,"epl", gyt=52,lt=2,lx=250,ty=200,rx=500,by=320)
detc=drawlines(emetc,7,50,420,260,445,255,250,290,280,295,363,312,430,205,line="diff")
cdetc=colordrops(ileft,detc,7,50,400,300,face1,269,271,face1)

#stackvertical(emetc,ileft)
#return(grid(cdetc,0,50,color=$7f3f00))

#andrea
mand=maskmaker(cdetc,8,50,"c1", gyt=110,et=160,lx=470,ty=230,rx=582,by=440)
#mand=maskmaker(cdetc,8,50,"c1", gyt=50,et=100,test=true,ft=150,fet=200,lx=470,ty=230,rx=582,by=440)
drand=drawlines(mand,8,50,488,340,505,320,550,405,540,425,520,350,550,345,line = "diff")
cdand=colordrops(cdetc,drand,8,50,480,350,face1,515,350,face1,495,250,face1,500,280,face1,550,350,face1,530,340,face1,520,350,face1,500,370,purple)
mand2=maskmaker(cdand,8,50,"c1", gyt=150,et=170,lx=470,ty=230,rx=582,by=440)
#mand2=maskmaker(cdand,8,50,"c3", gyt=92,et=147,rt=128,ert=128,bt=128,ebt=128,lx=425,ty=210,rx=585,by=430)
drand2=drawlines(mand2,8,50,425,360,590,450,560,430,600,350)
cdand2=colordrops(cdand,drand2,8,50,570,380,face1,493,245,face1,505,270,face1,545,300,face1)

# couple and rest
#mcoup=maskmaker(cdand2,8,50,"c1", gyt=50,et=60,test=true,ft=100,fet=110,lx=320,rx=500,by=90)
#mcoup=emarker(cdand2,8,50,"epl",gyt=1, lt=2, test=true,ft=50,fl=2)
mcoup=emarker(cdand2,8,50,"epl",gyt=48, lt=2)
dcoup=drawlines(mcoup,8,50,398,32,405,28,420,355,430,320,388,50,388,70,360,15,375,35,408,15,418,28,407,0,407,10,line="diff")
cdcoup=colordrops(cdand2,dcoup,8,50,400,330,face1,350,50,blue,400,60,face1,480,50,face1,430,20,face1,370,10,face1,450,310,green)
drcoup=drawlines(b,8,50,0,250,120,300,180,370,300,270,320,330,400,330,620,479)
icoup=inlay(cdcoup,dcoup,drcoup,8,50,"below", color=red,w=620,y=250)

drcoup2=drawlines(b,8,50,25,0,30,40,10,70,10,100,50,130,50,180,20,230,50,270,200,40,200,0)
icoup2=inlay(icoup,dcoup,drcoup2,8,50,"hint",color=red,w=275,h=275)
icoup3=inlay(icoup2,dcoup,drcoup2,8,50,"hint",color=red,mwhite=false,w=275,h=275)
#maskmaker(icoup3,9,50,"c1", gyt=20,et=40,test=true,ft=120,fet=140,lx=500,rx=630,ty=350)
mchair=maskmaker(icoup3,9,50,"c1", gyt=54,et=74,lx=500,rx=630,ty=350)
dchair=drawlines(mchair,9,50,565,420,592,410,585,350)
cdchair=colordrops(icoup3,dchair,9,50,600,400,blue,600,440,blue,600,390,blue,590,420,face1,590,400,purple)
m=maskmaker(cdchair,10,50,"c1", gyt=1,et=80,lx=150,rx=450,ty=270)
l=drawlines(b,10,50,160,470,160,450,180,410,210,400,320,370,350,410,450,450,370,460,320,470,160,470)
i=inlay(cdchair,m,l,10,50,"vint",color=yellow,mwhite=false,x=160,w=315,y=320,h=159)
Trim(i,10,10) +trim(i,51,51) + trim(tr,0,1)
#return(grid(i,0,50,color=$7777))
#return(pallet(b,162,217))
I have tried to use colors mostly that look like those in original. But to demonstrate that they can be changed as one likes by showing the cake white icing as chocolate.
There are still some spots that are not colored or some areas that had color leaked from adjacent objects. These could be taken care of by manual intervention by drawing boundary lines.
It took about 170 lines of script to acheive this and two weeks of 6 hours a day work to get this. But by experience one can shorten this very much. I have also used part of time to fine tune my software.
The processing time is about 2 seconds per frame.
Last time I reported in haste a problem which I attributed to Avisynth and later found to be a bug in my plugin. But this time I ran into one which is strange. Before I attribute it to Avisynth I will describe it.
In the last fewlines I used a maskmaker function starting from frame 9 itself. Then I started to see some old frames as output, and no action occuring. If my plugin is at fault then I should get output of cdchair. But I get a frame about 50 statements back. This function stops at frame 49. If I go past 49 and reverse frame by frame in virtualdub I suddenly start seeing the correct frame processed properly. After changing start frame number to 10 I get a correct process.
This is strange as I use this very function over 20 times in my script without any problem. Ofcourse I will check again and again before blaming Avisynth.
__________________
mohan
my plugins are now hosted here
vcmohan is offline   Reply With Quote
Old 19th July 2005, 07:59   #9  |  Link
E-Male
mad computer-scientist
 
Join Date: Mar 2002
Posts: 1,375
how's your work going?
do you feel you could release the filter/source anytime soon?

i fixed 2 stupid bugs in MYcolorize (my fault) and i guess i'll soon have a releaseable version (doesn't mean it'll very usefull, but a good start)

i wonder if we could improve the results with combined effort
interested?
E-Male is offline   Reply With Quote
Old 20th July 2005, 04:06   #10  |  Link
vcmohan
Registered User
 
Join Date: Jul 2003
Location: India
Posts: 890
Quote:
Originally Posted by E-Male
how's your work going?
Well. I have added a few more functions and options to my plugin. Some may be useful and some I do not know. In the literature I read a number of references to a "watershed" algorithm and its use to properly segment an image. I implemented Vincent_Soille algorithm. I have processed the same Greyscale image shown in my recent post. The results at three successive stages are as follows. Watershed lines and basins are displayed.
progressive images at upper threshold at increasing grey value:
image for a low grey value as threshold:

image with an intermediate grey value as threshold:

image fully processed:

I am a bit (lots) disappointed at the results. The recognisable parts in the earlier stages are due to limiting to certain grey values and not due to segmentation by watershed function per se. Literature indicates that this "watershed" oversegments often. May be will be useful for recoloring cartoons rather than real images? I would very much appreciate comments or suggestions on this.

I have also added several other features like thinning, skeltonization, ridges and valleys to morpher function.
Quote:
do you feel you could release the filter/source anytime soon?
I think may be in two months time I may be ready as from now for a month I will be busy with my children and grand children visiting me. Then I will test most of the features and debug a little more.

Quote:
i wonder if we could improve the results with combined effort
interested?
Certainly I look forward for it. But the response to my recolor post was so little that I am somewhat disheartened .
__________________
mohan
my plugins are now hosted here
vcmohan is offline   Reply With Quote
Old 20th July 2005, 07:40   #11  |  Link
cweb
Registered User
 
cweb's Avatar
 
Join Date: Oct 2002
Location: The Pandorica
Posts: 527
This plugin looks amazing... I never thought this would be possible with avisynth...
__________________
PC specs for bug reports: Intel Core i7-4790K @4Ghz Win10(Linux VM) PCI express NVIDIA RTX 2060 SUPER graphics card
http://twitter.com/cwebdesign
cweb is offline   Reply With Quote
Old 20th July 2005, 18:07   #12  |  Link
E-Male
mad computer-scientist
 
Join Date: Mar 2002
Posts: 1,375
Quote:
Originally Posted by vcmohan
Certainly I look forward for it. But the response to my recolor post was so little that I am somewhat disheartened .
well, you gave them nothing to play with, yet, and also colorizing isn't an everyday job
but it's another very expensive thing made avaible for free and open-soruce, and i love it
i'd say we both finish our filters and their documentation (this time i'll write one, really, i think...) and then we see if we can combine features

Last edited by E-Male; 20th July 2005 at 18:23.
E-Male is offline   Reply With Quote
Old 20th July 2005, 22:48   #13  |  Link
Backwoods
ReMember
 
Backwoods's Avatar
 
Join Date: Nov 2003
Posts: 416
I agree, releasing something for us to test/play with will gain alot of attention towards the filter.
Backwoods is offline   Reply With Quote
Old 17th September 2005, 03:46   #14  |  Link
vcmohan
Registered User
 
Join Date: Jul 2003
Location: India
Posts: 890
Ihave posted the dlls along with usage documentation of ColorIt and Watershed.

The documentation I think definitely requires a work over. I will next change the Colorit documentation from MS Word format to HTML soon.

Meanwhile I invite comments, bugs report and suggestions
__________________
mohan
my plugins are now hosted here
vcmohan is offline   Reply With Quote
Old 18th September 2005, 22:02   #15  |  Link
morsa
the dumbest
 
Join Date: Oct 2002
Location: Malvinas
Posts: 494
I guess that your new filter is somewhat related to what Image Analogies project does.
If you are interested you can look at its source code.
morsa is offline   Reply With Quote
Old 19th September 2005, 00:53   #16  |  Link
mg262
Clouded
 
mg262's Avatar
 
Join Date: Jul 2003
Location: Cambridge, UK
Posts: 1,148
Image Analogies -- if that's the stuff I'm thinking of, it's incredibly effective but also incredibly slow?
mg262 is offline   Reply With Quote
Old 19th September 2005, 04:39   #17  |  Link
vcmohan
Registered User
 
Join Date: Jul 2003
Location: India
Posts: 890
Quote:
Originally Posted by morsa
I guess that your new filter is somewhat related to what Image Analogies project does.
ColorIt and Watershed plugins are not akin to Image Analogies. Possibly my NeuralNet plugin if modified for regression (which hopefully will be my next project) may come near to Image Analogies.
__________________
mohan
my plugins are now hosted here
vcmohan is offline   Reply With Quote
Old 22nd March 2006, 23:37   #18  |  Link
guillaja
Registered User
 
Join Date: Mar 2006
Posts: 1
Amazing, what a great job!!!

How is the work going?, Is it already finish?, I would like to test some images.

Thanks.
guillaja is offline   Reply With Quote
Old 23rd March 2006, 17:01   #19  |  Link
vcmohan
Registered User
 
Join Date: Jul 2003
Location: India
Posts: 890
Quote:
Originally Posted by guillaja

Is it already finish?, I would like to test some images.
At present I am not working on this plugin . This colorit and watershed plugins are complete and available for download
since long. Please use them and give me a feed back. Thanks for your nice words.
__________________
mohan
my plugins are now hosted here
vcmohan is offline   Reply With Quote
Old 5th January 2007, 10:13   #20  |  Link
jimlong
Registered User
 
Join Date: Dec 2006
Posts: 4
Quote:
Originally Posted by vcmohan View Post
At present I am not working on this plugin . This colorit and watershed plugins are complete and available for download
since long. Please use them and give me a feed back. Thanks for your nice words.
Mohan's work is really great! However, I would also like to see how e-male's work, too. Does anybody know where to find e-male's work?
jimlong is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 22:28.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.