Treść książki

Przejdź do opcji czytnikaPrzejdź do nawigacjiPrzejdź do informacjiPrzejdź do stopki
Red.S.Sędziwy,SchedaeInformaticae,Vol.17/18December2009
Kraków2009,ISSN0860-0295,©byUJ
12
Fig.2.Inputandoutputimages
thenetworktrainingprocess500photoshavebeenused.Outputimageshadbeen
createdforthembeforehand.Bothimageshavearesolutionof320x240pixels.
InputandoutputimagesarerepresentedaslistsofRGBvaluesofindividual
pixels.Itiscalculatedasfollows:
valueR+valueG+valueB
maxR+maxG+maxB
,
where(valueR+valueG+valueB)isthesumofR,GandBvaluesforthepixel
and(maxR+maxG+maxB)isthesumofmaximumR,GandBvalues.For
exampleiftheRGBvalueofaselectedpixelequals(120,90,200),itsvalueinthe
listequals(120+90+200)/(256+256+256)=0,56.Pixelsforalistarecollected
inaccordancewiththealgorithm1.
Algorithm1
for(y=0;y¡yMax;y+=10)do
for(x=0;x¡xMax;x+=5)do
list.Add(pixel(x,y));
endfor
endfor
wherexisahorizontalcoordinateandyisaverticalcoordinate.Point(0,0)isplaced
intheupperleftcornerasinFig.3.
Alistofoutputpointsiscreatedsimilarly,withtheonlydierencebeingthat
thepixelsaretakenfromblackandwhiteimages.Inthiswaytwolistsarecreated
inputpointsandoutputpoints.Valuesfromalistofentrypointsareintherange
(0,1).Valuesfromthelistofoutputpointsareintheset{0,1},where0isaroad
and1isafield,whichisnottheroad.Inthefirstsolutiononlyonenetworkis