home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 1 / crawlyvol1.bin / graphics / aim_3_1 / aimman.doc < prev    next >
Text File  |  1988-07-20  |  87KB  |  2,046 lines

  1. 06601030305800
  2. F0110030
  3. 9[...................................................]011
  4. Ç
  5. AIM:ANOTHERIMAGEMANAGER
  6.  
  7. TheimageprocessingprogramAIMwasoriginallydevelopedforthe
  8. ATARISTbyFransGroenandRobertdeVries.Sincethefirst
  9. versionofAIMtheextensionofthispublicdomainimage
  10. processingpackagehasbecomeajointeffortofanumberof
  11. peoplefromtheDelftUniversityofTechnologyandtheUniversity
  12. ofAmsterdam.EspeciallyPietVerbeeksuppliedmanylinearand
  13. non-linearfilteringroutines,LucasvanVlietandBenVerwer
  14. developedthefastmorphologicaloperations.AlsoGertvan
  15. Antwerpen,DamirSudarandIgorWebersuppliedanumberof
  16. routinestoAIM.
  17.  
  18. AIMrunsinhigh-resolutionandlow-resolutionmode.Themedium-
  19. resolutionmodeisnotsupported.AIMhasbeenwrittenintheC-
  20. languageusing.Thepurposeoftheprogramistoexperimentwith
  21. digitalimageprocessing.
  22.  
  23. Userinterface
  24.  
  25. TheuserinterfaceofAIMconsistsof:
  26.  
  27. -GEMinterface.Operationsandparameterscanbeselectedby
  28. meansofdialogboxesanddrop-downmenus.Achoicefromamenu
  29. resultsinacommandwhichispassedtothecommandinterpreter.
  30. Imagedisplayscanbemovedandsized.
  31.  
  32. -Commandinterpreter.Sequencesofcommandscanbeputtogether
  33. inacommandfile.Whentheloggingison,commandswhichare
  34. enteredarealsostoredinalogcommandfile.Acommandfilemay
  35. becalledwithinanothercommandfileupto16levelsdeep.
  36.  
  37. Thecommandinterpreterhasahistoryhandlerwithsomeediting
  38. facilities.
  39.  
  40. ImagesinAIM
  41.  
  42. FourimagememoriesareavailableinAIM.Theimagememoriesare
  43. 8bitwideandhaveamaximumsizeof65536pixels.Standardaim
  44. imageshaveathesizeof256x256pixels.Theseimagememories
  45. aredisplayedattheATARIscreen.Thewindowsaredesignated
  46. with'A','B','C'and'D'.Thepositionofthewindowsis
  47. obtainedfromasetupfile.Imagewindowscanbemovedandsized.
  48.  
  49. Acolourimageconsistsof4memorieswithamaximumof16384
  50. pixelsrespectivelyfortheintensity,red,greenandbluesub-
  51. images.Thismaximumsizeistheresultfromthecurrent1Mbyte
  52. memoryrestrictionoftheAtariST.Whenthememoryincreases,
  53. largercolourimagescouldbesupported.Standardaimcolour
  54. imageshaveasizeof4times128x128pixels.Theyoccupythe
  55. sameareaasangrey-valueimageofsize256x256.Mostofthe
  56. (colour)imageoperationsareappliedtoallsub-imagesofa
  57. Çcolourimage.Someimageoperations(gradx,grady,equal)are
  58. performedontheintensitysub-imageofacolourimage.After
  59. suchanoperationthered,greenandbluecolourvaluesare
  60. updatedaccordingtothenewintensityvalue.
  61.  
  62. The8bitplanesofthegrey-valueimagescanalsobeusedas8
  63. binaryimages.BinaryandCellularLogicoperationscanbe
  64. performedonthesebitplanes.Thebitplanesarenumberedfrom1
  65. to8.
  66.  
  67. Whenanimageisreadfromdiskall8bitplanesareread
  68. simultaneously.Thesameholdswhenanimageiswrittentodisk.
  69. Animageisdisplayedinthegrey-valuemodewhentheextension
  70. is.IMandincolormodewhentheextensionis.COL.Thedisplay
  71. ofcolorimagesisonlysupportedinthelow-resolutionmode.
  72.  
  73. AlsoDEGASandNeochromeimagescanbereadorwritten.Withthe
  74. readcommandthesepicturesareconvertedto320x200grey-value
  75. images.Withthecreadcommandtheyareconvertedtocolour
  76. imagesofsize160x100.Whentheextensionis.PI1or.PI3a
  77. DEGASfileisreadorwritten,whentheextensionis.NEOa
  78. neochromefileisreadorwritten.Examplesaregivenin@democ4.
  79.  
  80. Greatcareshouldbetakenbystoringimagesindegasor
  81. neochromeformat.Intheseformatsalimitednumberofgrey
  82. valuesorcoloursisused(palette),soadrasticreductionof
  83. informationtakesplace,whichlimitsthepossibilityoffurther
  84. imageprocessing.Imagesarestoredinfullgreyorcolour
  85. resolutionintheAIMformat.
  86.  
  87. Inthehighresolutionmodeastandardgrey-valueimageis
  88. representedby256x256blackandwhitedots.(thereareonly2
  89. greyvaluespossible:whiteandblack).Asigma-deltatechnique
  90. isusedtoobtainalocaldensityofthedotsrepresentingas
  91. goodaspossiblethegrey-valuesintheimage.Inabinary
  92. display0givesablackdotand1awhitedot.
  93.  
  94. Inthelowresolutionmodeastandardgrey-valueimageis
  95. representedby128x128pixelsin8grey-values.Againasigma-
  96. deltatechniqueisusedtorepresentasgoodaspossiblethe
  97. original256greyvalues.Asthestandardimageshaveasizeof
  98. 256x256pixels,inthelow-resolutionmodeonly1pixeloutof
  99. each2x2pixelneighbourhoodisdisplayed.Inthedefaultbinary
  100. low-resolutionmode(don1)ablackdotisdisplayedwhenall
  101. pixelsofa2x2neighbourhoodare'0'andawhitedotis
  102. displayedwhenallpixelsina2x2neighbourhoodare'1'.Inall
  103. othercasesagreydotisdisplayed.
  104.  
  105. Astandardcolorimageisdisplayedin128x128pixelswith16
  106. differentcolors.Anoptimumpaletteischosenforthecurrently
  107. displayedimage.Sothepalettesofotherimagesarenolonger
  108. correct.Thepaletteoftheimagewhichisontopisdisplayed.
  109. Clickingonanotherwindowbringsitontopwiththecorrect
  110. palette.
  111. Ç
  112. Standardgrey-valueimagesondisk(extension.IM)consistof256
  113. linesof256pixels(unsignedcharacters)of1byte.Soanimage
  114. consistsof65536bytesintotal.Thesequenceislinebyline
  115. fromtoplefttobottomright.
  116.  
  117. Standardcolorimagesondisk(extension.COL)consistofa
  118. sequenceof4sub-imagesof128linesof128pixels(unsigned
  119. characters)of1byte.Thesub-imagesareintensity,red,green
  120. andbluerespectively.
  121.  
  122. Whenanimagedoesnothaveastandardformataheaderisneeded
  123. (extension.HD),describingtheimagewidthandheight.The
  124. headerusedistheheaderoftheCentreforImageProcessing
  125. DelftandisgivenintheAppendix.Whenanimageiswrittenin
  126. theAIMformatalwaysaheaderiswritten.
  127.  
  128. Commandinterpreter
  129.  
  130. Itisnotnecessarytogivethecompletecommandname.The
  131. smallestnumberofletterswhichgivesnoambiguityissuffi⑨
  132. cient.
  133.  
  134. Itispossibletoedityourcommandsinasimpleway.Thedelete-
  135. orbackspace-keydeletethelastcharacter.CONTROL-Xdeletesthe
  136. wholeline.Asequenceofcommandswhichperformacertain
  137. operationmaybegroupedtoacommandfileandstoredondisk.
  138. Theextensionofcommandfilesis.AIM.Whentheloggingison
  139. alltheenteredcommandsarestored.Whentheloggingisswitched
  140. offalogcommandfileiswrittentodisc.
  141.  
  142.  
  143. Commandfilesareexecutedbytyping@name(withouttheexten⑨
  144. sion).Anewcommandfilecanbecalledfromacommandfileand
  145. maybenestedupto16levelsdeep.Sotyping@command-file-name
  146. insteadofacommandexecutesthecommand-file.ESCstopsthe
  147. executionofacommandfileandaskstheusertogoonornot.
  148. Defaultvaluesareusedwhenaparameterisnotgiven.Whenan
  149. erroneousvalueofaparameterisgiven,thecommandinterpreter
  150. asksforacorrectvalue.ESCstopsthisprocedureandreturnsto
  151. thecommandinterpreter(AIMprompt).Ifinthiscaseareturnis
  152. given,thedefaultvalueisused.Thisgivesthepossibilityto
  153. askforaparametervaluewhenacommand-fileisexecuted,
  154. insteadofusingafixedvalue.Inthecommandfileforinstancea
  155. questionmark(?)canbeusedinsteadoftheparametervalueto
  156. obtainthisfeature.
  157.  
  158. Aquestionmark(?)insteadofacommandgivesalistofall
  159. availablecommands.
  160.  
  161. Astar(*)indicatesthattheremainderofthecommandline
  162. consistsofcomments.
  163.  
  164. 9[....................................................]001
  165. History
  166. Ç
  167. ThehistorymechanisminAIMisintendedtoresembleasmuchas
  168. possibletheUNIXmechanism.Exceptforthe'history'commandmost
  169. importantfeatureshavebeenincluded.
  170. !!:repeatlastcommand.Itispossibletotypeextracharacters
  171. afterthe!!.Theseareappendedafterthepreviousline.
  172. !{chars}:repeatthecommandthatstartedwith{chars}.
  173. !<n>:repeatthen-thcommandwithnisaninteger.Incasethenumber
  174. isnegativethen-thpreviouscommandisrepeated.Ifsome
  175. charactersfollowtheintegernumber,theseareappended.
  176. ^<string1>^<string2>^<string3>:replace<string1>intheprevious
  177. commandwith<string2>,append<string3>andrepeatthechanged
  178. command.
  179.  
  180. Examples:
  181. Intheexamplestheprompthastheformof'aim'followedbyan
  182. integernumberfollowedby'>'.
  183. Thefirstcommandisasample.
  184. aim1>readftrui
  185. Nowlet'srepeatit.
  186. aim2>!!
  187. readftrui
  188. Anotherwaytorepeatit.
  189. aim3>!rea
  190. readftrui
  191. Youcanalsoappendtextafterthepreviouscommand.
  192. aim4>!!.im
  193. readftrui.im
  194. Repeatfirstcommand.
  195. aim5>!1
  196. readftrui
  197. Repeatthecommandofaim4>
  198. aim6>!-2
  199.    readftrui.im
  200. Changetruiintocermet.
  201. aim7>^trui^cermet
  202.    readfcermet.im
  203. ChangecermetintoketelandputimageinB.
  204.    aim8>^cermet^ketel^,B
  205.    readfketel.im,B
  206.  
  207. GEM-INTERFACE
  208.  
  209. Operationsmarkedwithastar(*)areonlyavailableinthe
  210. commandinterpreter.
  211.  
  212. Dialogboxes
  213.  
  214. Parametersareenteredinthedialogboxesbyfirstpushingthe
  215. ESCbuttontodeletethedefaultvalueandtogotothefirst
  216. position.Onlyatthefirstpositionminussignsareallowed.
  217. Therearetwospecialdialog-boxes.Oneisforthethreshold
  218. command.Thedefaultthresholdvalueiscomputedeachtimeanew
  219. input-imageisselected.
  220. ÇTheotherspecialboxisforthepalette.Ifacolorischosen
  221. thecolorcoefficientsareshownintheeditabletextline
  222. underneath.Ifthecoefficientsarechangedandanyothercolor-
  223. boxisclickedtheeffectofthechangesarevisible.Thethree
  224. coefficientsrepresentthered,greenandblue,andmayvaryfrom
  225. 0to7.Highervaluesarecastto7.
  226.  
  227. Printerdriver
  228.  
  229. Printeroutputcanonlybedoneinmonochromemode.Thisis
  230. becausetheactualscreenimageisprinted.Theprinterdriver
  231. supports8pinand24pingraphics.InthefileAIM.INFafter
  232. 'printer'theprinterdefinitionisplaced.Firstthenameofthe
  233. printerisgivenonasingleline.Afterthatthenumberofdots
  234. andfinallytheprintercodestoresettheprinter,tosetthe
  235. linedistanceandfinallytostartgraphicsprinting.
  236. Tomakeaprinterdriverforyourownprinteryouonlyneedatext
  237. editortocreateit.Thefirstlinecontainsthenameofyour
  238. printer.Thesecondlinegivesthenumberofverticaldotsper
  239. line.Itlookslike:
  240. dpl8
  241. "dpl"isakeywordfor"dotsperline"anditisseparatedbythe
  242. valuebyaspace.Theonlyvaluessupportedatthismomentare8
  243. and24.
  244. Thethirdlinegivestheresetcodeforyourprinter.Itlooks
  245. like:
  246. reset1B40
  247. "reset"isakeywordfortheresetcode.Thecharactersinthe
  248. resetcodearegiveninhexadecimalseperatedbyaspace.The
  249. maximumnumberofcharactersinthecontrolsequenceis20.
  250. Thefourthlinegivesthecontrolsequencetosetthelinedistance
  251. betweentwolinesofgraphicaloutput.Itlookslike:
  252. linedist1B4108
  253. "linedist"isthekeywordforthelinedistancecontrolsequence.
  254. Itcanbe20characterslong.
  255. Thelastlinegivesthecontrolsequencetostartgraphical
  256. output.Itlookslike:
  257. graphics1B4B
  258. "graphics"isagainakeyword.Thesequencetostartprinting
  259. graphicsisalwaysfollowedbythenumberofcolumnsofdotstobe
  260. printed.Inmostprintersthisisdonebysendingfirstthelow
  261. bytefollowedbythehighbyteofthewordthatcontainsthis
  262. number.OtherprinterssendthenumberinBCDformat.InAIMonly
  263. thefirstwayissupported.
  264.  
  265.  
  266. üOPERATIONSINAIMÇ
  267. FILEOPERATIONS
  268.  
  269.  
  270. readf[ile]:readsanimagefromdisk.
  271.  
  272. Thefirstcommandparameteristheimagename,thesecond
  273. optionalparameteristheimagememory(A,B,C,D).Defaultis
  274. ÇimagememoryA.Theextensionofangrey-valueimagefileis.IM.
  275. Availablestandardimagesare:TRUI.IM,CERMET.IM,TUD.IMand
  276. ASBEST.IM.Whennoextensionisgiven.IMisassumed.
  277. (Whentheextensionis.COLacolourimageisreadin).
  278.  
  279. Whennoheaderfileispresentastandardimagesizeisassumed,
  280. otherwisethedescriptionfromtheheaderfileisused.
  281. Whentheextensionis.PI1or.PI3aDEGASfileisconvertedtoa
  282. grey-valueimageof320x200pixels.Whentheextensionis.NEO
  283. aneochromefileisconvertedtoagrey-valueimageof320x200
  284. pixels.
  285.  
  286. command:readfimage-file,image
  287. default:readftrui,A
  288. range:-,<A-D>
  289.  
  290. creadf[ile]:readsacolourimagefromdisk.
  291.  
  292. Thefirstcommandparameteristheimagename,thesecond
  293. optionalparameteristheimagememory(A,B,C,D).Defaultis
  294. imagememoryA.
  295.  
  296. Theextensionofacolorimageis.COL.Availablecolorimages
  297. are:MANDRIL.COL,MAID.COL,GIRL.COLandARLES.COL.
  298. Whennoextensionisgiven.COLisassumed.
  299. (Whentheextensionis.IMagrey-valueimageisreadin).
  300.  
  301. Whennoheaderfileispresentastandardimagesizeisassumed.
  302. otherwisethedescriptionfromtheheaderfileisused.
  303.  
  304. Whentheextensionis.PI1aDEGASfileisconvertedtoacolour
  305. imageof160x100pixels.Whentheextensionis.NEOaneochrome
  306. fileisconvertedtoacolourimageof160x100pixels.
  307.  
  308. command:creadfimage-file,image
  309. default:creadfmandril,A
  310. range:-,<A-D>
  311.  
  312.  
  313. writf[ile]:writesanimagetodisk.
  314.  
  315. Thefirstcommandparameteristheimagememory(A,B,C,D).The
  316. secondparameteristhenameoftheimage-file.Whennoextension
  317. isgiven.IMisassumed.Besidestheimagefilealsoaheader
  318. fileiswritten(extension.HD).Theheaderstructureisgivenin
  319. theAppendix.
  320.  
  321. Whentheextensionis.PI1or.PI3aDEGASfileiswritten.When
  322. theextensionis.NEOaneochromefileiswritten.
  323.  
  324. command:writfimage,image-file
  325. default:writfA,dummy
  326. range:<A-D>,<anything>
  327.  
  328. Çloadsetup
  329.  
  330. Thiscommandloadsasetupfile.Thesetupfiledescribesthe
  331. pathoftheimagefiles(read/write),thecommandfiles,the
  332. helpfiles,theaspectandalign-flagsandthepositionofthe
  333. windows.
  334.  
  335. savesetup
  336.  
  337. Thiscommandsavesthecurrentsettings(pathsandwindow
  338. positions)inasetupfiles.
  339.  
  340. Macro:selectsandstartsacommandfile.
  341.  
  342. @filenameisacommandfile.An@startsthecommandfile.
  343. Commandfilesmaybenestedupto16levels.Anexampleisgiven
  344. in@demo.Theextensionofcommandfilesis.AIM.Theseexten⑨
  345. sionsareaddedtothecommandfilenamebyAIM.
  346.  
  347. Wheninfinite=-1thecommandfileisinfinitelyrepeated.
  348.  
  349. command:@name.AIM,infinite
  350. default:-,0
  351. range:-,<-1,0>
  352.  
  353. Logging
  354.  
  355. Whentheloggingisonallenteredcommandsarestored.Whenthe
  356. loggingisswitchedoff,thestoredcommandsarewritteninalog
  357. file.Inthiswayautomaticallycommandfilescanbecreated.
  358.  
  359. printpic:printsapicture.
  360.  
  361. Thiscommandprintsthecontentsofawindow.Itonlyworksin
  362. highres.Ifahistogramornumbersaredisplayedinawindowitis
  363. alsoprinted.Thesecondparameteristhemagnificationfactor.
  364. Whena24-dotmatrixprinterisinstalledtheresultlooksbetter
  365. withmagnificationfactor2.
  366.  
  367. command:printpicim,factor
  368. default:printpicA  ,1
  369. range:<A-D>,<1,5>
  370.  
  371. exit:endstheprogram.Thisactioncanalsobeobtainedby
  372. typingControl-Corbyclickingtheclose-boxofthecommand-
  373. window.
  374.  
  375. command:exit
  376.  
  377. TESTIMAGEGENERATION
  378. ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
  379. shad:shadingimagegenerator
  380.  
  381.  
  382. ÇShad generates a shadinglike grey image.Thegreyvalueisthe
  383. sumofthebilinearinterpolation of the corner points b a 
  384.                                                        c d 
  385. and the quadratic (e*x*(1-x) + f*y*(1-y))*N/128 
  386. ife+f>0,N = (255-(a+b+c+d)/4),  
  387. such that e=f=256 -> 255-(a+b+c+d)/4 as maximumoutput 
  388. ife+f<0,N = (    (a+b+c+d)/4), 
  389. such that e=f=-256 -> -(a+b+c+d)/4 as minimumoutput
  390.  
  391.  
  392. command:shadout_im,a,  b,c,d,e,f
  393. default:shad   B  ,255   0 ,  0 ,  0 ,  0, 0    
  394. range:<A-D>,<0,255>,<-255,255>
  395.  
  396.  
  397. GEOMETRICANDARITHMETICGREY-VALUEOPERATIONS
  398. ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
  399. GEOMETRICGREYVALUEOPERATIONS
  400.  
  401. copy:copiesorsamplesanimage.
  402.  
  403. Thefirstcommandparameteristheinputimage,thesecondis
  404. theoutputimage(A,B,C,D).Extraparametersallowsamplingthe
  405. inputimagewhichisvirtuallyrepeatedinalldirections
  406. (periodic).Thethirdandfourthparameterarethesampling
  407. startingpositionX,Yandallowwrapping(Xwith-signenforces
  408. theinverseoperation,Yalsowith-signenforceswritewithout
  409. clear(stamping));thefifthandsixgivethe2Dsamplingstep
  410. dx,dytakenintheinputimagewhenwritingalineintheoutput
  411. image;theseventhandeightharethe2DsamplingstepDX,DY
  412. takenwhenfeedingalineintheoutputimage.Inverse sampling
  413. (-X)at2**kstepsizemultiply overwritesallcopyingresultsbut
  414. thatofthe lower right block,whichisthusblowntodots.
  415. Differentparameterchoices:
  416.                  |
  417. typeofsampling |  X    Y    dx   dy   DX   DY
  418. copy               (1)  (1)   (1)  (0)  (0)  (1)(default)
  419. smearline31       1   31    1   0   0  0
  420. smearcolumn17    17   0    0   0   0   1
  421. wrap 17,31->1,1  17   31    (1)  (0)  (0)  (1)
  422. reduce 2x hor     1    1    2    0    0   1
  423. reduce 3x ver     1    1    1    0    0    3
  424. reduce 2xhor&ver   1    1     2    0    0    2
  425. skew up             1    1     1    1    0    1
  426. skew left           1    1     1    0    1    1
  427. skew right          1    1     1    0   -1    1
  428. reflect hor     256    1    -1    0    0    1
  429. reflect ver      1 256     1    0    0   -1
  430. upside down     256 256    -1    0    0   -1
  431. transpose           1    1     0    1    1    0
  432. symmetr. ri half 256    1    -1    0    0    1   out=in
  433. symmetr. lo half    1 256     1    0    0   -1   out=in
  434. pointsymlo half  256 256    -1    0    0   -1   out=in
  435. tilt atan 1 = 45  127 127    1    1   -1    1 
  436. Çtilt atan-1 =-45 127 127     1   -1    1    1
  437. tilt atan-2     127 127    1   -2    2    1
  438. tilt atan-1/2     127 127     2   -1    1    2
  439. inverse ofthis -127 127     2   -1    1    2
  440. blowtodots     -1    1     4    0    0    4
  441.  
  442. command:copyinput_image,out_im,X,  Y,dx,dy,DX,DY
  443. default:copy    A,   B  , 1    1    1    0    0   1    
  444. range:<A-D>,<A-D>,<-256,256>
  445.  
  446. ARITHMETICGREYVALUEOPERATIONS
  447.  
  448. Standardandsignedgreyvalues.
  449. Thestandardarithmeticgreyvalueoperationshavebeenbuiltfor
  450. greyvaluesintherangeof0to255.Someinterestingimage
  451. processingresultssuchasgradientsmaybenegative.InAIMsuch
  452. resultsarerepresentedbysilentlyadding127(integer255/2).
  453. Ineffectanewkindofgreyvalues,"signedgreyvalues",witha
  454. rangeof-127to128issodefined.Arithmeticwithsignedgrey
  455. valuesasksforaseparatesetofsignedarithmeticcommands.
  456. Theyaresimilartothenormalcommandsbutforaprefix"s"and
  457. willnotbeseparatelydescribed."sadd"doesnotexistasitis
  458. identicalto"add","sginva"isidenticalto"scmula-1".
  459.  
  460. MONADICGREYVALUEARITHMETIC
  461.  
  462. cadd:addsaconstanttoanimage.
  463.  
  464. Thefirstcommandparameteristheinputimage.Thesecond
  465. parameteristheconstantwhichisadded.Thethirdparameteris
  466. theoutputimage.Ifnooutputimageisspecifiedtheoutput
  467. overwritestheinput.
  468.  
  469. output_image=input_image+constant
  470.  
  471. command:caddinput_image,constant,output_image
  472. default:caddA,0  , input_image
  473. range:<A-D>,<-255,255>,<A-D>
  474.  
  475.  
  476. ginv:subtractstheimagefrom255
  477.  
  478. Thefirstcommandparameteristheinputimage.Thesecond
  479. parameteristheoutputimage.Ifnooutputimageisspecified
  480. theoutputoverwritestheinput.
  481.  
  482. output_image=255-input_image
  483.  
  484. command:ginvinput_image,output_image
  485. default:ginvA, input_image
  486. range:<A-D>,<A-D>
  487.  
  488.  
  489. cabs:determinesabsolutedifferencewithaconstant
  490. Ç
  491. Thefirstcommandparameteristheinputimage.Thesecond
  492. parameteristheconstant.Thethirdparameteristheoutput
  493. image.Theresultisclippedabove255.Ifnooutputimageis
  494. specifiedtheoutputoverwritestheinput.
  495.  
  496. output_image=|input_image-constant|
  497.  
  498. command:cabsinput_image,constant,output_image
  499. default:cabsA,0  , input_image
  500. range:<A-D>,<-255,255>,<A-D>
  501.  
  502.  
  503. cmul:multipliesanimagebyaconstant.
  504.  
  505. Thefirstcommandparameteristheinputimage.Thesecond
  506. parameteristhemultiplicationconstant.Thethirdparameteris
  507. theoutputimage.Ifnooutputimageisspecifiedtheoutput
  508. overwritestheinput.
  509.  
  510. output_image=input_image*constant
  511.  
  512. command:cmulinput_image,constant,output_image
  513. default:cmulA,1  , input_image
  514. range:<A-D>,<0,255>,<A-D>
  515.  
  516.  
  517. cdiv:dividesanimagebyaconstant.
  518.  
  519. Thefirstcommandparameteristheinputimage.Thesecond
  520. parameteristhedivisionconstant.Thethirdparameteristhe
  521. outputimage.Ifnooutputimageisspecifiedtheoutput
  522. overwritestheinput.
  523.  
  524. output_image=input_image/constant
  525.  
  526. command:cdivinput_image,constant,output_image
  527. default:cdivA,1  , input_image
  528. range:<A-D>,<1,255>,<A-D>
  529.  
  530.  
  531. (*)clear:clearsanimage.
  532.  
  533. Clearsetseachpixelvalueintheimageto0.
  534.  
  535. command:clearimagedefault:clearArange:
  536. <A-D>(*)assign:assignsaconstanttoeachpixelinanimage.
  537.  
  538. command:assignimage,constant
  539. default:assignA,0
  540. range:<A-D>,<0,255>
  541.  
  542.  
  543. DYADICGREYVALUEARITHMETIC
  544. Ç
  545. add:addstwoimages.
  546.  
  547. Thefirstcommandparameteristhefirstinputimage,thesecond
  548. parameteristhesecondinputimage,thethirdparameteristhe
  549. outputimage.Ifnooutputimageisspecifiedtheoutput
  550. overwritesthesecondinput.
  551.  
  552. output_image=(input1_image+input2_image)/2
  553.  
  554. command:addinput1_image,input2_image,output_image
  555. default:addA,B    , input2_image
  556. range:<A-D>,<A-D>,<A-D>
  557.  
  558.  
  559. sub:subtractstwoimages.
  560.  
  561. Thefirstparameteristhefirstinputimage,thesecond
  562. parameteristhesecondinputimage.Thethirdparameterisa
  563. constantwhichcanbeaddedtothedifference.Thefourth
  564. parameteristheoutputimage.Astheimagecannotbecome
  565. negative,theresultingvalueisclippedbelow0andabove255.
  566. Ifnooutputimageisspecifiedtheoutputoverwritesthesecond
  567. input.
  568.  
  569. output-image=(input1_image-input2_image)+constant
  570.  
  571. command:subinput1_image,input2_image,constant,output-image
  572. default:subA,B,0,input2_image
  573. range:<A-D>,<A-D>,<-255,255>,  <A-D>
  574.  
  575.  
  576. abs:givesabsolutedifferenceoftwoimages.
  577.  
  578. Thefirstparameteristhefirstinputimage,thesecond
  579. parameteristhesecondinputimage.Thethirdparameterisa
  580. constantwhichcanbeaddedtothedifference.Thefourth
  581. parameteristheoutputimage.Theresultingvalueisclipped
  582. above255.Ifnooutputimageisspecifiedtheoutputoverwrites
  583. thesecondinput.
  584.  
  585. output-image=|input1_image-input2_image+constant|
  586.  
  587. command:absinput1_image,input2_image,constant,output-image
  588. default:absA,B,0,input2_image
  589. range:<A-D>,<A-D>,<-255,255>,  <A-D>
  590.  
  591.  
  592. mul:multipliestwoimages.
  593.  
  594. Thefirstparameteristhefirstinputimage,thesecond
  595. parameteristhesecondinputimage.Thethirdparameterisa
  596. constantbywhichtheproductcanbedivided.Thefourth
  597. parameteristheoutputimage.Theresultingvalueisclipped
  598. Çabove255.Ifnooutputimageisspecifiedtheoutputoverwrites
  599. thesecondinput.
  600.  
  601. output-image=(input1_image*input2_image)/constant
  602.  
  603. command:mulinput1_image,input2_image,constant,output-image
  604. default:mulA,B,256,input2_image
  605. range:<A-D>,<A-D>,<1,32767>,  <A-D>
  606.  
  607.  
  608. div:dividestwoimages.
  609.  
  610. Thefirstparameteristhefirstinputimage,thesecond
  611. parameteristhesecondinputimage.Thethirdparameterisa
  612. constantbywhichthequotientcanmultiplied.Thefourth
  613. parameteristheoutputimage.Theresultingvalueisclipped
  614. above255.Ifnooutputimageisspecifiedtheoutputoverwrites
  615. thesecondinput.
  616.  
  617. output-image=(input1_image/input2_image)*constant
  618.  
  619. command:divinput1_image,input2_image,constant,output-image
  620. default:divA,B,1,input2_image
  621. range:<A-D>,<A-D>,<0,32767>,  <A-D>
  622.  
  623.  
  624. TRIADICGREYVALUEARITHMETIC
  625.  
  626. mud:multipliestwoimagesanddividesbyathirdimage.
  627.  
  628. Thefirstparameteristhefirstinputimage,thesecond
  629. parameteristhesecondinputimage.Thethirdparameteristhe
  630. thirdinputimagebywhichtheproductisdivided.Thefourth
  631. parameteristheoutputimage.Theresultingvalueisgiven
  632. modulo255.Ifnooutputimageisspecifiedtheoutputoverwrites
  633. thesecondinput.
  634.  
  635. output-image=(input1_image*input2_image)/input3_image
  636.  
  637. command:divinput1_image,input2_image,input3_image,output-image
  638. default:divA,B,C,input3_image
  639. range:<A-D>,<A-D>,<A-D>,<A-D>
  640.  
  641.  
  642. ♪①DYADICGREYVALUENON-ARITHMETIC
  643.  
  644.  
  645. (*)minimum:minimumoftwoimages.
  646.  
  647. Thefirstcommandparameteristhefirstinputimage,thesecond
  648. parameteristhesecondinputimage,thethirdparameteristhe
  649. outputimage.Ifnooutputimageisspecifiedtheoutput
  650. overwritesthesecondinput.
  651.  
  652. Çoutput_image=minimum(input1_image,input2_image)
  653.  
  654. command:minimuminput1_image,input2_image,output_image
  655. default:minimumA,B    , input2_image
  656. range:<A-D>,<A-D>,<A-D>
  657.  
  658.  
  659. (*)maximum:maximumoftwoimages.
  660.  
  661. Thefirstcommandparameteristhefirstinputimage,thesecond
  662. parameteristhesecondinputimage,thethirdparameteristhe
  663. outputimage.Ifnooutputimageisspecifiedtheoutput
  664. overwritesthesecondinput.
  665.  
  666. output_image=maximum(input1_image,input2_image)
  667.  
  668. command:maximuminput1_image,input2_image,output_image
  669. default:maximumA,B    , input2_image
  670. range:<A-D>,<A-D>,<A-D>
  671.  
  672.  
  673.  
  674. (*)sminimum:signedminimumoftwostandardimages.
  675.  
  676. Thisoperationisapplicabletostandard,nottosignedgrey
  677. values.Theoutputissigned.Thefirstcommandparameteristhe
  678. firstinputimage,thesecondparameteristhesecondinput
  679. image,thethirdparameteristheoutputimage.Theresulting
  680. valueisclippedbelow0andabove255.Ifnooutputimageis
  681. specifiedtheoutputoverwritesthesecondinput.
  682.  
  683. if(input1_image<input2_image)
  684. output_image=127+input1_image
  685. else
  686. output_image=127-input2_image
  687.  
  688. command:sminimuminput1_image,input2_image,output_image
  689. default:sminimumA,B   , input2_image
  690. range:<A-D>,<A-D>,<A-D>
  691.  
  692.  
  693. (*)ssminimum:signedminimumoftwoimages.
  694.  
  695. Thisoperationisapplicabletosigned,nottostandardgreyvalues.
  696. Theoutputissignedtoindicate.Thefirstcommandparameteristhefirst
  697. inputimage,thesecondparameteristhesecondinputimage,the
  698. thirdparameteristheoutputimage.Theresultingvalueis
  699. clippedbelow0andabove255.Ifnooutputimageisspecified
  700. theoutputoverwritesthesecondinput.
  701.  
  702. if(input1_image<input2_image)
  703. output_image=input1_image
  704. else
  705. output_image=254-input2_image
  706. Ç
  707.  
  708. command:ssmaximuminput1_image,input2_image,output_image
  709. default:ssmaximumA,B   , input2_image
  710. range:<A-D>,<A-D>,<A-D>
  711.  
  712.  
  713. TRIADICGREYVALUENON-ARITHMETIC
  714.  
  715. (*)mindev:takeinputvaluewithminimumdeviation.
  716.  
  717. Theoutputpixelvalueisthatvalueoftheinput1orinput2
  718. images,thatdifferstheleastfromtheinput3pixelvalue.Ifno
  719. outputimageisspecifiedtheoutputoverwritesinput3.
  720.  
  721. if|input3value-input1value|<|input3value-input2value|
  722. output=input1
  723. else
  724. output=input2
  725.  
  726.  
  727. command:mindevinput1_im,input2_im,input3_im,output-im
  728. default:mindevA,B,C,input3_im
  729. range:<A-D>,<A-D>,<A-D>,<A-D>
  730.  
  731.  
  732. GREY-VALUEFILTERS
  733. ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
  734. Apixelvalueintheoutputimageisdeterminedbythevalueof
  735. thepixelintheinputimagetogetherwiththepixelvaluesina
  736. localneighbourhoodaroundthepixel.Bothlinearandnon-linear
  737. operationscanbeappliedtosuchaneighbourhood.InAIMthe
  738. neighbourhoodsareeitherfixedsizeandfixedshape:3x3
  739. square,orvariablesizeandshape.
  740. Indicatinghorizontalby-,verticalby|andthediagonalsby/
  741. and\avariablefilterofsizescanhavedifferentshapes:
  742. size-x1|(shape=0or4),size/x1\(shape=1or5),size|x
  743. 1-(shape=2or6),size\x1/(shape=3or7),size-xsize|
  744. (square,shape=8),size/xsize\(diamond,shape=9),andin
  745. somecasesapproximatelyroundringswithdiameters(shapes10-
  746. 17).
  747.  
  748. APPLICATIONS
  749.  
  750. Differenttasksinimageprocessingcanbedefined.Eachtaskcan
  751. beperformedbydifferentfilters.Themaintasksare
  752. 1.maketheimagelesssharp("smoothing")
  753. 2.representslopestrength("gradient")
  754. 3.extractdetail("detail")
  755. 4.enhancedetail("crispening")
  756. 5.extractedgesorhighcontrastareas("edge")
  757. 6.findlocalextrema("min","max")
  758.  
  759. SURVEYGREYFILTERS
  760. ǯ¯¯¯¯¯¯¯|¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯|
  761. |non-adaptiveadaptive|
  762.         |      linear              non-linear               |
  763. size||
  764. &shape|fixedvariablefixedvariable|
  765. |-------------------------------------------------------|
  766. smooth|gaussuniformmediandyttet-kuwahara|
  767. |lgauss|
  768. |adne,adre|
  769. ||
  770. gradient|gradx,ylgradientxxxxkugradien*
  771. |ggradient|
  772. |sune,sure|
  773. ||
  774. detail|laplaceparabolapeakdygtegragvanefilte*
  775. |dogori-smoothori-smoothdystesras|
  776. ||
  777. crisp|filter(df)ori+detailhavedyftefrafori+detail
  778. |ori+detail|
  779. ||
  780. contrast|robertslgradient8-dyrterrar-|
  781. /edge|haradyltelral-|
  782. ||
  783. min|contrast-detail-lminlow-|
  784. max|contrast+detail-lmaxupp-|
  785. ||
  786. general-|filterseparablex---edgps|
  787. purpose|(+recurs)|
  788. ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
  789. *notyetimplemented;dfdefault;ximpossible;-absent.
  790.  
  791. IMPLEMENTATION
  792.  
  793. Separablefilters.Filtersthatcanbereplacedbyaone-
  794. dimensionalfilteringofeachimagelinefollowedbyaone-
  795. dimensionalfilteringofeach(resulting)columnarecalled
  796. separable.Theyworkonarectangularorsquareneighbourhood.
  797. Examplesarethelinear'uniform'filterandthenon-linear
  798. 'l(ocal)maximum'filter.InAIMthisseparationhasbeenexploi⑨
  799. tedtospeedupvariablesizefiltering.Theone-dimensional
  800. filtersusedcanalsobeappliedonebyonealonghorizontal,
  801. verticalandbothdiagonaldirections.Combiningdiagonaldirec⑨
  802. tionsyieldsadiamondneighbourhood.
  803. Sum-of-separablefilters.Thesumoftwoseparablefilters
  804. withoutacommonone-dimensionalcomponentbelongtoaspecial
  805. classofnon-separablefilters.InAIMtheirconstructionfrom
  806. one-dimensionalfiltersissometimesbutnotalwaysused.Exam⑨
  807. plesarethenon-linear'dyt'(dynamicthreshold)andthelinear
  808. 'laplace',respectively.InAIManot-separatedfilterisalways
  809. afixedsize3x3filteroritsrepeatedversion(e.g.'dog',
  810. differenceofgaussians).Inprincipleanylinearfilterisasum
  811. ofseparablefilters,tobefoundbysingularvaluedecomposi⑨
  812. tion.ThishasnotbeenimplementedinAIM.Alsootherfunctions
  813. oflinearfiltersmayoccur,likethemaximumofabsolutevalues
  814. Çinthe2-Dl(ocal)gradient(alaRoberts).Non-separable
  815. filters.Somenon-linearfiltersarenotknowntobereducibleto
  816. one-dimensionalfilters.Anexampleisthe'median'filter.
  817.  
  818. LINEAR,FIXEDSIZE&SHAPE
  819.  
  820. Alinearfiltercanberealizedbymultiplyingapixelandits
  821. neighbourhoodbycoefficients.Theresultisthesumofthese
  822. multiplica-tionsandiscalledaconvolution.Examplesoflinear
  823. filtersarethe'gauss','gradient'and'laplace'filters.
  824.  
  825. InAIMthesizeoflinearfiltersislimitedtoa3x3neighbour⑨
  826. hood.'Filter'isarotation-symmetrical3x3filterofwhichthe
  827. coefficientscanbespecifiedbytheuser.Inthe'gauss',
  828. 'gradient'and'laplace'filtersthecoefficientsarefixed.
  829.  
  830. Thecoefficientsare:
  831.  
  832. 121-10-1-1-2-10-10
  833. 242-20-2000-14-1
  834. 121-10-1-1-2-10-10
  835. gaussx-gradienty-gradientlaplace
  836. 
  837. cdchvcd0-10001010100100
  838. chvccchv-15-1000-1000000-10
  839. cdchvcd0-10-10000000-1000
  840. filter(default)grad/3grad/2grad\3grad\2
  841.                           ---------------roberts-----------------
  842.  
  843.    
  844. gauss:linearfilterforsmoothing.
  845.  
  846. Thefirstparameteristheinput-image(defaultA)andthe
  847. secondparameteristheoutput-image(defaultB).Thefiltering
  848. canberepeated(size-1)/2-1moretimesandthenemulatesasize
  849. xsizebinomialfilter,anapproximationoftheactualgauss
  850. filter.
  851. Thethirdparameteristhesize(2n+2=2n+1,default3).
  852.  
  853. output-image=gauss(gauss(gauss...(gauss(input-image))...))
  854. command:gaussinput-image,output-image,size
  855. default:gaussA,B,3
  856. range:<A-D>,<A-D>,<3-255>
  857.  
  858.  
  859. gradx:horizontal"Sobel"gradientfilter.
  860.  
  861. Thefirstparameteristheinput-image(defaultA)andthesecond
  862. parameteristheoutput-image(defaultB).Theoutput-imagemay
  863. bemultipliedbyafactor(multiply/1024)andaconstant(add)
  864. maybeaddedtotheresult.
  865. output-image=gradx(input-image)*(multiply/1024)+add
  866.  
  867. command:gradxinput-image,output-image,multiply,add
  868. Çdefault:gradxA,B,1024,128
  869. range:<A-D>,<A-D>,<1-10000>,<-255-255>
  870.  
  871.  
  872. grady:vertical"Sobel"gradientfilter.
  873.  
  874. Thefirstparameteristheinput-image(defaultA)andthesecond
  875. parameteristheoutput-image(defaultB).Theoutput-imagemay
  876. bemultipliedbyafactor(multiply/1024)andaconstant(add)
  877. maybeaddedtotheresult.
  878.  
  879. output-image=grady(input-image)*(multiply/1024)+add
  880.  
  881. command:gradyinput-image,output-image,multiply,add
  882. default:gradyA,B,1024,128
  883. range:<A-D>,<A-D>,<1-10000>,<-255-255>
  884.  
  885. enhance:linearfilterforimagedetailenhancement.
  886.  
  887. Thisisthepreviouslaplaceoperation.Thefirstcommand
  888. parameteristheinput-imageandthesecondparameteristhe
  889. output-image.Defaultsare:Afortheinput-imageandBforthe
  890. output-image.
  891.  
  892. command:enhanceinput-image,output-image
  893. default:enhanceA,B
  894. range:<A-D>,<A-D>
  895.  
  896. nlaplace:linearfilterforimagedetailextraction.
  897.  
  898. Thefirstcommandparameteristheinput-imageandthesecond
  899. parameteristheoutput-image.Defaultsare:Afortheinput-image
  900. andBfortheoutput-image.
  901.  
  902. command:nlaplaceinput-image,output-image
  903. default:nlaplaceA,B
  904. range:<A-D>,<A-D>
  905.  
  906. dog:differenceofgaussians,linearfilterforimagedetail
  907. extraction.
  908.  
  909. Thefirstcommandparameteristheinput-imageandthesecond
  910. parameteristheoutput-image.Defaultsare:Afortheinput-
  911. imageandBfortheoutput-image.Thethirdandfourthparameters
  912. thearesizesofthelargestandsmallestgauss(binomial)filter
  913. (2s+2=2s+1,defts.3,1).
  914.  
  915. output-image=gauss(input-image,s)-gauss(input-image,l)+127
  916. command:doginput-image,output-image,largel,smalls
  917. default:dogA,B,3,1(original)
  918. range:<A-D>,<A-D>,<3,255>,<1,sl-1>
  919.  
  920.  
  921. Çroberts:3x3or2x2Robertsgradientfilter.
  922.  
  923. Thefirstparameteristheinput-image(defaultA)andthesecond
  924. parameteristheoutput-image(defaultB).Thethirdparameter
  925. indicatessize3x3(3,default)or2x2(2).
  926.  
  927. output-image=pointmaximum(abs(grad/),abs(grad\))
  928. command:gradxinput-image,output-image,size
  929. default:gradxA,B,3
  930. range:<A-D>,<A-D>,<2-3>
  931.  
  932.  
  933. filter:generalpurpose3x3rotation-symmetricalfilter.
  934.  
  935. Thisfilterperformsageneral3x3rotation-symmetricalconvolu⑨
  936. tion.Parametersaretheinput-image,theoutput-imageandthe3
  937. differentcoefficientsina3x3neighbourhood.Thecoefficientof
  938. thecentralpixeliscc,thecoefficientsofthehorizontaland
  939. verticalneighboursarechvandthecoefficientsofthediagonal
  940. neighboursarecd.Thedefaults(5,-1,0)arechosensoasto
  941. givethecrispsum'original+laplace'.
  942. Theresultmaybemultipliedbyafactor(multiply/1024)anda
  943. constant(add)maybeaddedtotheresult.
  944.  
  945. output-image=filter(input-image)*(multiply/1024)+add
  946.  
  947. command:filterinput-image,output-image,cd,chv,cc,multiply,add
  948. default:filterA,B,0,-1,5,2048,0
  949. range:<A-D>,<A-D>,<-/+1000>,<10000>,<-+255>
  950.  
  951.  
  952. LINEAR,VARIABLESIZE&SHAPE
  953.  
  954. Forevensizetheresultisshiftedover1/2pixelwithrespect
  955. tothefiltercenter.
  956.  
  957.  
  958. unif:linearfilterforsmoothing.
  959.  
  960. Thisfilterdeterminesforeachpixeltheaverageofalocal
  961. neighbour-hoodintheinput-image.Thisaveragebecomesthepixel
  962. valueintheoutput-image.
  963. Thefirstparameteristheinput-image,thesecondparameteris
  964. theoutput-image.Thethirdparameteristhesizeofthelocal
  965. neighbourhood.Thissizeisavaluebetween1and127.Thefourth
  966. parameteristheshape:0,4=-;1,5=/;2,6=|;3,7=\;8=+,9=X.
  967. Roundshapeshavenotyetbeenimplemented.
  968.  
  969.  
  970. command:unifinput-image,output-image,neighbourhoodsize,shape
  971. default:unifA,B,3,8
  972. range:<A-D>,<A-D>,<1,63>,<0,9>
  973.  
  974. lgau:linearfilterforsmoothing.
  975. Ç
  976. Thisfilterdeterminesforeachpixeltheweightedaverageofa
  977. localneighbourhoodintheinput-image.Thebinomialcoefficients
  978. areusedasweights.Thisaveragebecomesthepixelvalueinthe
  979. output-image.
  980. Thesquareversionisfarbetterisotropicthansquareunif.
  981. Thefirstparameteristheinput-image,thesecondparameteris
  982. theoutput-image.Thethirdparameteristhesizeofthelocal
  983. neighbour-hood.Thissizeisavaluebetween1and63.Thefourth
  984. parameteristheshape.Roundshapesarenotneededandhavenot
  985. beenimplemented.
  986.  
  987.  
  988. command:lgauinput-image,output-image,neighbourhoodsize,shape
  989. default:lgauA,B,3,8
  990. range:<A-D>,<A-D>,<1,63>,<0,9>
  991.  
  992.  
  993. adne:linearfilterforsmoothing.
  994.  
  995. Thisfilteraddstoeachpixelintheinput-imagethevalue(or
  996. halforaquarteretc.)ofitsleftneighbour(ifshape=0)inthe
  997. input-image.Thesum(orincaseofoverflowsum-256)becomesthe
  998. pixelvalueintheoutput-image.Thefirstpixelofeachline(if
  999. shape=0)iscopiedunprocessed.Thefirstparameteristheinput-
  1000. image,thesecondparameteristheoutput-image.Thethird
  1001. parameterindicateswhichpartoftheneighbourisadded:0->
  1002. full,1->half,2->quarter,k->1/(2**k),7->1/128.Thefourth
  1003. parameteristheshapeandalsotheFreemandirection.0->E(ast),
  1004. 1->NE,2->N,3->NW,4->W,5->SW,6->S,7->SE.
  1005. 2-Dfiltersarecombinedfromthese:8->0,2,4,6;9->1,3,5,7.
  1006. Noroundshapes."adne"istheexactinverseof"sure".
  1007.  
  1008.  
  1009. command:adneinput-image,output-image,neighbourpart,shape
  1010. default:adneA,B,0,0
  1011. range:<A-D>,<A-D>,<0,7>,<0,9>
  1012.  
  1013. adre:recursivelinearfilterforsmoothing.
  1014.  
  1015. Thisfilteraddstoeachpixelintheinput-imagethevalue(or
  1016. halforaquarteretc.)ofitsleftneighbour(ifshape=0)inthe
  1017. output-image.Thesum(orincaseofoverflowsum-256)becomes
  1018. thepixelvalueintheoutput-image.Thefirstpixelofeachline
  1019. (ifshape=0)iscopiedunprocessed.Thefirstparameteristhe
  1020. input-image,thesecondparameteristheoutput-image.Thethird
  1021. parameterindicateswhichpartoftheneighbourisadded:0->
  1022. full,1->half,2->quarter,k->1/(2**k),7->1/128.Thefourth
  1023. parameteristheshapeandalsotheFreemandirection.0->E(ast),
  1024. 1->NE,2->N,3->NW,4->W,5->SW,6->S,7->SE.2-Dfiltersare
  1025. combinedfromthese:8->6,4,2,0;9->7,5,3,1.Noroundshapes.
  1026. "adre"istheexactinverseof"sune".
  1027.  
  1028. command:adreinput-image,output-image,neighbourpart,shape
  1029. Çdefault:adreA,B,0,0
  1030. range:<A-D>,<A-D>,<0,7>,<0,9>
  1031.  
  1032. lgra:lineargradientfilter.
  1033.  
  1034. Thisfilterdeterminesforeachpixeltheslopeaofthebestfit
  1035. firstdegreepolynomial(ax+b)overalocalneighbourhoodinthe
  1036. input-image.Thisslopebecomesthepixelvalueintheoutput-
  1037. image;normallyitisscaledsothatthelargeststepup(0000
  1038. 255255255255)producesoutput127+127,thelargeststepdown
  1039. 127-127.Thefirstparameteristheinput-image,thesecond
  1040. parameteristheoutput-image.Thethirdparameteristhesizeof
  1041. thelocalneighbour-hood.Thissizeisavaluebetween1and127.
  1042. A-signenforcesexactslopescaling.Thefourthparameteristhe
  1043. shape.2-Dshapes(square8,diamond9)givemaximumofabsolute
  1044. slopesalaRoberts(8->0,2;9->1,3).Noroundshapes.
  1045.  
  1046. command:lgrainput-image,output-image,neighbourhoodsize,shape
  1047. default:lgraA,B,3,8
  1048. range:<A-D>,<A-D>,<1,127>,<0,9>
  1049.  
  1050. ggra:lineargradientfilter.
  1051.  
  1052. Thisfilterisequivalenttolgaufollowedbysune(full
  1053. subtraction).Thefirstparameteristheinput-image,thesecond
  1054. parameteristheoutput-image.Thethirdparameteristhesizeof
  1055. thelocalneighbour-hood.Thissizeisavaluebetween1and127.
  1056. Thefourthparameteristheshape.2-Dshapes(square8,diamond
  1057. 9)givemaximumofabsoluteslopesalaRoberts(8->0,2;9->1,3).
  1058. Noroundshapes.
  1059.  
  1060. command:ggrainput-image,output-image,neighbourhoodsize,shape
  1061. default:ggraA,B,3,8
  1062. range:<A-D>,<A-D>,<1,127>,<0,9>
  1063.  
  1064.  
  1065.  
  1066.  
  1067. sune:lineargradientfilter.
  1068.  
  1069. Thisfiltersubtractsfromeachpixelintheinput-imagethe
  1070. value(orhalforaquarteretc.)ofitsleftneighbour(if
  1071. shape=0)intheinput-image.Thesum(orincaseofunderflowsum
  1072. +256)becomesthepixelvalueintheoutput-image.Thefirst
  1073. pixelofeachline(ifshape=0)iscopiedunprocessed.Thefirst
  1074. parameteristheinput-image,thesecondparameteristheoutput-
  1075. image.Thethirdparameterindicateswhichpartoftheneighbour
  1076. issubtracted:0->full,1->half,2->quarter,k->1/(2**k),7->
  1077. 1/128.ThefourthparameteristheshapeandalsotheFreeman
  1078. direction.0->E(ast),1->NE,2->N,3->NW,4->W,5->SW,6->S,7-
  1079. >SE.2-Dfiltersarecombinedfromthese:8->0,2,4,6;9->1,3,5,7.
  1080. Noroundshapes."sune"istheexactinverseof"adre"andeven
  1081. compensatesitsoverfloweffects.
  1082.  
  1083. Çcommand:suneinput-image,output-image,neighbourpart,shape
  1084. default:suneA,B,0,0
  1085. range:<A-D>,<A-D>,<0,7>,<0,9>
  1086.  
  1087. sure:recursivelineargradientfilter.
  1088.  
  1089. Thisfiltersubtractsfromeachpixelintheinput-imagethe
  1090. value(orhalforaquarteretc.)ofitsleftneighbour(if
  1091. shape=0)intheoutput-image.Thesum(orincaseofunderflow
  1092. sum+256)becomesthepixelvalueintheoutput-image.Thefirst
  1093. pixelofeachline(ifshape=0)iscopiedunprocessed.Thefirst
  1094. parameteristheinput-image,thesecondparameteristheoutput-
  1095. image.Thethirdparameterindicateswhichpartoftheneighbour
  1096. issubtracted:0->full,1->half,2->quarter,k->1/(2**k),7->
  1097. 1/128.ThefourthparameteristheshapeandalsotheFreeman
  1098. direction.0->E(ast),1->NE,2->N,3->NW,4->W,5->SW,6->S,7-
  1099. >SE.2-Dfiltersarecombinedfromthese:8->6,4,2,0;9->7,5,3,1.
  1100. Noroundshapes."sure"istheexactinverseof"adne"andeven
  1101. compensatesitsoverfloweffects.
  1102.  
  1103. command:sureinput-image,output-image,neighbourpart,shape
  1104. default:sureA,B,0,0
  1105. range:<A-D>,<A-D>,<0,7>,<0,9>
  1106.  
  1107.  
  1108. para:lineardetailextractingfilter.
  1109.  
  1110. Thisfilterdeterminesforeachpixelthecoefficientaofthe
  1111. bestfitseconddegreepolynomial(ax2+b)overalocalneighbour⑨
  1112. hoodintheinput-image.Thiscoefficientbecomesthepixelvalue
  1113. intheoutput-image;normallyitisscaledsothatthelargest
  1114. trough(2552552550...0255255255255)producesoutput
  1115. 127+127,thelargestridge127-127.Thefirstparameteristhe
  1116. input-image,thesecondparameteristheoutput-image.Thethird
  1117. parameteristhesizeofthelocalneighbourhood.Thissizeisa
  1118. valuebetween1and127.A-signenforcesexactcoefficient
  1119. scaling.Thefourthparameteristheshape.2-Dshapes(square8,
  1120. diamond9)givemaximumofabsoluteslopesalaRoberts(8->0,2;
  1121. 9->1,3).Noroundshapes.
  1122.  
  1123. command:lgrainput-image,output-image,neighbourhoodsize,shape
  1124. default:lgraA,B,3,8
  1125. range:<A-D>,<A-D>,<1,127>,<0,9>
  1126.  
  1127. sepa:generalpurposelinearfilter
  1128.  
  1129. This routine performs a one-dimensional filtering; thefirst
  1130. parameter(filter)type can be min=0,max=1,unif=2,
  1131. lgau(=binom)=4,adne(=add neighb)=10,adre(=recursive adne)=12,
  1132. lgra(=linfit)=6,sune(=sub neighb)=11,sure(=recursive sune)=13,
  1133. para(=quadfit)=8,recu(=3point recursive filtering)=14,defined
  1134. as  out=b0*in+b1*in_1+b2*in_2-a1*out_1-a2*out_2-a3*out_3.
  1135. Thesecondandthirdparameterareinputandoutputimage.The
  1136. fourthparameteris f(ilter)size, even size gives 1/2 pixelwrap-
  1137. Çped outputin the f(ilter)dir(ection) indicated by thefifthpa-
  1138. rameter; fdir can be 0=E(astwd),1=NE,2=N,3=NW,4=W,5=SW,6=S,7=SE;
  1139. thesixththrougheleventhparametersareb0,b1,b2,a1,a2,a3.
  1140.  
  1141. diagonal scanning goes as follows:                 
  1142.              SE scan  xsize = 10, ysize = 8         
  1143.                               11   *      7 = 77    
  1144.                                                     
  1145.      1  8 15 22 29 36 43 50 57 64                   
  1146.     71  2                      58                  
  1147.     65 72  3                   52                   
  1148.     59    73  4                46                   
  1149.     53       74  5             40                   
  1150.     47          75  6       27 34                   
  1151.     41             76  7 14 21 28                   
  1152.     35 42 49 56 63 70 77 -  -  -                    
  1153.  
  1154.              SW scan  xsize = 10, ysize = 8         
  1155.                                9   *      9 = 81    
  1156.                                                     
  1157.    18  9 18 55 46 37 28 19 10  1                   
  1158.      -                       2 11                   
  1159.     66                    3    52                   
  1160.     58                 4       46                   
  1161.     50              5          40                   
  1162.     42           6          27 34                   
  1163.    34        7                                     
  1164.     26 17  8 17             -  -                    
  1165.  
  1166. command:sepatype,in-im,outim,fsize,fdir,a1,a2,a3,b0,b1,b2
  1167. default:sepa2,A,B,3,0,0,0,0,0,0,0
  1168. range:<0,14>,<A-D>,<A-D>,<-127,127>,<0,7>,<-127,127>
  1169.  
  1170.  
  1171.  
  1172.    out=b0*in+b1*in_1+b2*in_2-a1*out_1-a2*out_2-a3*out_3 
  1173.  
  1174.  
  1175.  
  1176. NON-LINEARFILTERS
  1177.  
  1178. Non-linearfiltersperformimageoperationswhichareimpossible
  1179. withlinearfilters.Noisecanbesuppressedwithanon-linear
  1180. filterwithoutdeterioratingedgesinanimage.Themedian
  1181. filter,Schlag'speakfilter,thelocalminimumandmaximum
  1182. filtersandtheirrelatives(themax/minfamilyincludingthe
  1183. PAPSdynamicthreshold"dyt"andtheLee-Haralickedgefilter
  1184. "dyl"and"hara")areimplementedinAIM.
  1185.  
  1186. NON-LINEARFIXEDSIZE&SHAPE
  1187.  
  1188. medi:medianfilter.
  1189.  
  1190. Themedianfilterdeterminesforeachpixelthemedian(the
  1191. Çmiddle)valueofalocal(3x3)neighbourhoodintheinput-image.
  1192. Thismedianvaluebecomesthepixelvalueintheoutput-image.
  1193. Thisfiltersuppressesnoise.
  1194.  
  1195. Thefirstparameteristheinput-image,thesecondparameteris
  1196. theoutput-image.
  1197.  
  1198. command:mediinput-image,output-image
  1199. default:mediA,B
  1200. range:<A-D>,<A-D>
  1201.  
  1202.  
  1203. peak:ridgefindingfilter.
  1204.  
  1205. Thepeakfilter(JohnSchlag)determinesforeachpixelifitis
  1206. a1-Dmaximumalongthe-,/,|and\direction.Ifthisistrue
  1207. for"num"ormoredirectionsandifthepixelvalueisabove
  1208. "thresh"theoutputpixelisgiventhevalue"val"else0.
  1209.  
  1210. Thefirstparameteristheinput-image,thesecondparameteris
  1211. theoutput-image,thethirdparameteristhenumberofdirections
  1212. inwhichthepixelmustbemaxinorderthatitmaybepeak,the
  1213. fourthparameteristhethresholdabovewhichthepixelcanbe
  1214. peak,thefifthparameteristhevaluewrittenatpeakpositions.
  1215.  
  1216. command:peakinput-image,output-image,number,thresh,value
  1217. default:peakA,B    ,2  ,0,255
  1218. range:<A-D>,<A-D>,<0,4>,<0,255>,<0,255>
  1219.  
  1220.  
  1221. (*)hara:non-linearedgefilter.
  1222.  
  1223. Thefilterharaperformsavariant(LucasvanVliet)ofthe3x3
  1224. Lee-Haralickedgefilter(Patt.Rec.Conf.,Paris'86).
  1225. Thisfilterisbasedupontheweighteddifferencebetweenthe
  1226. originalimageandthelocalminimumandlocalmaximumfiltered
  1227. images.
  1228.  
  1229. Thefirstcommandparameteristheinput-imageandthesecond
  1230. parameteristheoutput-image.Defaultsare:Afortheinput-
  1231. imageandBfortheoutput-image.
  1232.  
  1233. command:harainput-image,output-image
  1234. default:haraA,B
  1235. range:<A-D>,<A-D>
  1236.  
  1237. (*)have:non-linearlaplacelikefilter.
  1238.  
  1239. Thefilterhaveperformsanon-linearlaplacelike-likeoperation
  1240. inspiredbythe3x3Lee-Haralickedgefilter(Patt.Rec.Conf.,
  1241. Paris'86).
  1242. Addingthehaveresulttotheoriginalgivessharpeningasinthe
  1243. linearlaplacefilter.
  1244. Thisfilterisbasedupontheweighteddifferencebetweenthe
  1245. Çoriginalimageandthelocalminimumandlocalmaximumfiltered
  1246. images.
  1247.  
  1248. Thefirstcommandparameteristheinput-imageandthesecond
  1249. parameteristheoutput-image.Defaultsare:Afortheinput-
  1250. imageandBfortheoutput-image.
  1251.  
  1252. command:haveinput-image,output-image
  1253. default:haveA,B
  1254. range:<A-D>,<A-D>
  1255.  
  1256.  
  1257. NON-LINEAR,VARIABLESIZE&SHAPE
  1258.  
  1259. lmin:localminimumfilter.
  1260.  
  1261. Theminimumfilterdeterminesforeachpixeltheminimumofa
  1262. localneighbourhoodintheinput-image.Thisminimumbecomesthe
  1263. pixelvalueintheoutput-image.Thisoperationresultsinan
  1264. extensionofthedarkpartsinanimage.Thisoperationisalso
  1265. calledgrey-valueerosion.
  1266. Thefirstparameteristheinput-image,thesecondparameteris
  1267. theoutput-image.Thethirdparameteristhesizeofthelocal
  1268. neighbourhood.Thissizeisavaluebetween1and127.Thissize
  1269. isavaluebetween1and127.Thefourthparameteristheshape:
  1270. 0,4=-;1,5=/;2,6=|;3,7=\;8=+;9=X;10=sparsecircularcordon;
  1271. 11=10+centre;12=10stamping;13=11stamping;14=circularring;15=14+
  1272. centre;16=14stamping;17=15stamping.Theoperationisillustrated
  1273. in@demo5and@demo7.
  1274.  
  1275. command:lmininput-image,output-image,neighbsize,shape
  1276. default:lminA,B,3   ,8
  1277. range:<A-D>,<A-D>,<1,127>  , <0,17>
  1278.  
  1279. lmax:localmaximumfilter.
  1280.  
  1281. Themaximumfilterdeterminesforeachpixelthemaximumofa
  1282. localneighbourhoodintheinput-image.Thismaximumbecomesthe
  1283. pixelvalueintheoutput-image.Thisoperationresultsinan
  1284. extensionofthebrightpartsofanimage.Thisoperationisalso
  1285. calledgrey-valuedilation.
  1286. Thefirstparameteristheinput-image,thesecondparameteris
  1287. theoutput-image.Thethirdparameteristhesizeofthelocal
  1288. neighbourhood.Thissizeisavaluebetween1and127.Thefourth
  1289. parameteristheshape:0,4=-;1,5=/;2,6=|;3,7=\;8=+,9=X;
  1290. 10=sparsecircularcordon;11=10+centre;12=10stamping;13=11stamping;
  1291. 14=circularring;15=14+centre;16=14stamping;17=15stamping.
  1292.  
  1293. command:lmaxinput-image,output-image,neighbsize,shape
  1294. default:lmaxA,B,3   ,8
  1295. range:<A-D>,<A-D>,<1,127>  , <0,17>
  1296.  
  1297. MAX/MINFAMILY
  1298. Allfiltersinthemax/minfamilyarecombinationsoflmaxand
  1299. Çlminfilters,thesizeandshapeofwhichcanbespecified.The
  1300. inputimageisalwaysA,theoutput-imagealwaysB.
  1301. IntermediateresultsarestoredinC(mostcases)andinD(many
  1302. cases).Duetotheconcatenationoffilterstepstheeffective
  1303. sizeofthetotalfilterwillbecorrespondinglylarger.
  1304. low:lowerenvelopefilter
  1305.  
  1306. Thelowerenvelopefilterremovessmallpeaksandfollowssmooth
  1307. ramps.Itconsistsoflminfollowedbylmax:low=lmax(lmin).
  1308.  
  1309. command:lowinput-image,output-image,neighbsize,shape
  1310. default:lowA,B,3   ,8
  1311. range:<A>,<B>,<1,127>  , <0,17>
  1312.  
  1313. upp:upperenvelopefilter
  1314.  
  1315. Theupperenvelopefilterremovessmalldipsandfollowssmooth
  1316. ramps.Itconsistsoflmaxfollowedbylmin:upp=lmin(lmax).
  1317.  
  1318. command:uppinput-image,output-image,neighbsize,shape
  1319. default:uppA,B,3   ,8
  1320. range:<A>,<B>,<1,127>  , <0,17>
  1321.  
  1322. dyt:dynamicthresholdfilter
  1323.  
  1324. Thedynamicthresholdfilter(Bernsen,PhilipsPAPS)isanon-
  1325. linearsmoothingfilterthatprovidesalocalthresholdinshaded
  1326. images.Applyingitasathresholdbringsoutdetail.Itconsists
  1327. oftheaverageoflminandlmax:dyt=(lmin+lmax)/2.
  1328.  
  1329. command:dytinput-image,output-image,neighbsize,shape
  1330. default:dytA,B,3   ,8
  1331. range:<A>,<B>,<1,127>  , <0,17>
  1332.  
  1333. tet:texturethresholdfilter
  1334.  
  1335. Thetexturethresholdfilterisanon-linearsmoothingfilter
  1336. thatprovidesalocalthresholdinshadedimageswhilefollowing
  1337. ramps.Applyingitasathresholdbringsouttexturedetailbut
  1338. norampdetail.Thereisnolinearequivalentforthis.The
  1339. filterconsistsoftheaverageoflowandupp:
  1340. tet=(low+upp)/2.Noiseishandledastexture:reducedbytet.
  1341.  
  1342. command:tetinput-image,output-image,neighbsize,shape
  1343. default:tetA,B,3   ,8
  1344. range:<A>,<B>,<1,127>  , <0,17>
  1345.  
  1346. dyg:dynamicgistfilter
  1347.  
  1348. Thedynamicgist(=essence)filterisanon-lineardetail
  1349. extractingfilter.Itsubtractsthedynamicthresholdfromthe
  1350. original.WhilePAPSdynamicthresholdinggivesthesignofthe
  1351. differenceasabinaryoutput,dyggivesthedifferenceasgrey
  1352. Çvalueoutput:dyg=ori-dyt.
  1353.  
  1354. command:dyginput-image,output-image,neighbsize,shape
  1355. default:dygA,B,3   ,8
  1356. range:<A>,<B>,<1,127>  , <0,17>
  1357.  
  1358. teg:texturegistfilter
  1359.  
  1360. Thetexturegist(=essence)filterisanon-lineartexturedetail
  1361. extractingfilterthatignoresrampdetail.Thereisnolinear
  1362. equivalentforthis.Thefiltersubtractsthetexturethreshold
  1363. fromtheoriginal:teg=ori-tet.Noiseishandledastexture:
  1364. extractedbyteg.
  1365.  
  1366. command:teginput-image,output-image,neighbsize,shape
  1367. default:tegA,B,3   ,8
  1368. range:<A>,<B>,<1,127>  , <0,17>
  1369.  
  1370. rag:rampgistfilter
  1371.  
  1372. Therampgist(=essence)filterisanon-linearrampdetail
  1373. extractingfilterthatignorestexturedetail.Thereisnolinear
  1374. equivalentforthis.Thefiltersubtractsthetexturegistfrom
  1375. thetotaldynamicgist:rag=dyg-teg.Noiseishandledas
  1376. texture:reducedbyrag.Fornoisyimagesragisbetterthandyg.
  1377.  
  1378. command:raginput-image,output-image,neighbsize,shape
  1379. default:ragA,B,3   ,8
  1380. range:<A>,<B>,<1,127>  , <0,17>
  1381.  
  1382.  
  1383. dyl:dynamicLeeedgefilter
  1384.  
  1385. TheLee-Haralick-Shapirofilterisanon-linearedgefilter.It
  1386. givestheabsolutedifferenceoftheoriginalwiththelocal
  1387. minimumorthelocalmaximum,whicheverissmallest:
  1388. dyl=pmin(lmax-ori,ori-lmin).
  1389.  
  1390. command:dylinput-image,output-image,neighbsize,shape
  1391. default:dylA,B,3   ,8
  1392. range:<A>,<B>,<1,127>  , <0,17>
  1393.  
  1394. tel:textureLeeedgefilter
  1395.  
  1396. ThisvariantoftheLee-Haralick-Shapirofilterisanon-linear
  1397. textureedgefilter.Itgivestheabsolutedifferenceofthe
  1398. originalwiththelowerorupperenvelope,whicheverissmallest:
  1399. tel=pmin(upp-ori,ori-low).Atrampsthesedifferencesareboth
  1400. small.Noiseishandledliketexture:extractedbytel.
  1401.  
  1402. command:telinput-image,output-image,neighbsize,shape
  1403. default:telA,B,3   ,8
  1404. range:<A>,<B>,<1,127>  , <0,17>
  1405.  
  1406. Çral:rampLeeedgefilter
  1407.  
  1408. ThisvariantoftheLee-Haralick-Shapirofilterisanon-linear
  1409. rampedgefilter.Itgivestheabsolutedifferenceofthelocal
  1410. minimumwiththelowerenvelopeortheabsolutedifferenceofthe
  1411. localmaximumwiththeupperenvelope,whicheverissmallest:
  1412. ral=pmin(lmax-upp,low-lmin).Atrampsthesedifferencesare
  1413. bothsmall.Noiseishandledliketexture:reducedbyral.In
  1414. noisyimagesralisbetterthandyl.
  1415.  
  1416. command:ralinput-image,output-image,neighbsize,shape
  1417. default:ralA,B,3   ,8
  1418. range:<A>,<B>,<1,127>  , <0,17>
  1419.  
  1420. dys:dynamicsignedLeefilter
  1421. hisvariantoftheLee-Haralick-Shapirofilterisanon-linear
  1422. detailextractingfilter.Unlikedyg(andlinearlaplace)it
  1423. representsdetailbyverysharpextremes.Startingoutfromdyl
  1424. onegetsdysbyaddingthesign:+iforiginalnearertolocal
  1425. maximum,-ifnearertominimum:dys=smin(lmax-ori,ori-lmin).
  1426.  
  1427. command:dysinput-image,output-image,neighbsize,shape
  1428. default:dysA,B,3   ,8
  1429. range:<A>,<B>,<1,127>  , <0,17>
  1430.  
  1431. tes:texturesignedLeefilter
  1432.  
  1433. ThisvariantoftheLee-Haralick-Shapirofilterisanon-linear
  1434. texturedetailextractingfilter.Thereisnolinearequivalent
  1435. forthis.Unliketegitrepresentsdetailbyverysharpextremes.
  1436. Startingoutfromtelonegetstesbyaddingthesign:+if
  1437. originalnearertoupperenvelope,-ifnearertolowerenvelope:
  1438. tes=smin(upp-ori,ori-low).Atrampsthesedifferencesareboth
  1439. small.Noiseishandledliketexture:extractedbytes.
  1440.  
  1441. command:tesinput-image,output-image,neighbsize,shape
  1442. default:tesA,B,3   ,8
  1443. range:<A>,<B>,<1,127>  , <0,17>
  1444.  
  1445. ras:rampsignedLeefilter
  1446.  
  1447. ThisvariantoftheLee-Haralick-Shapirofilterisanon-linear
  1448. rampdetailextractingfilter.Thereisnolinearequivalentfor
  1449. this.Unlikeragitrepresentsdetailbyverysharpextremes.
  1450. Startingoutfromralonegetstesbyaddingthesign:+iflocal
  1451. maximumnearertoupperenvelope,-iflocalminimumnearerto
  1452. lowerenvelope:ras=smin(lmax-upp,low-lmin).Attexturethese
  1453. differencesarebothsmall.Noiseishandledliketexture:
  1454. reducedbyras.Innoisyimagesrasisbetterthandys.
  1455.  
  1456. command:rasinput-image,output-image,neighbsize,shape
  1457. default:rasA,B,3   ,8
  1458. range:<A>,<B>,<1,127>  , <0,17>
  1459.  
  1460. Çdyf:dynamicfrontLeefilter
  1461.  
  1462. ThisvariantoftheLee-Haralick-Shapirofilterisanon-linear
  1463. crispeningfilter.Edgesareshapedintosteps.Likeadding
  1464. linearlaplaceherenon-lineardysisaddedtotheoriginal:
  1465. dyf=ori+dys.
  1466.  
  1467. command:dyfinput-image,output-image,neighbsize,shape
  1468. default:dyfA,B,3   ,8
  1469. range:<A>,<B>,<1,127>  , <0,17>
  1470.  
  1471. tef:texturefrontLeefilter
  1472.  
  1473. ThisvariantoftheLee-Haralick-Shapirofilterisanon-linear
  1474. texturecrispeningfilter.Textureedgesareshapedintosteps.
  1475. Thereisnolinearequivalentforthis.Likeaddingdysheretes
  1476. isaddedtotheoriginal:
  1477. tef=ori+tes.Atrampstesissmall.Noiseishandledlike
  1478. texture:extractedbytef.
  1479.  
  1480. command:tefinput-image,output-image,neighbsize,shape
  1481. default:tefA,B,3   ,8
  1482. range:<A>,<B>,<1,127>  , <0,17>
  1483.  
  1484. raf:rampfrontLeefilter
  1485.  
  1486. ThisvariantoftheLee-Haralick-Shapirofilterisanon-linear
  1487. rampcrispeningfilter.Textureedgesareshapedintosteps.
  1488. Thereisnolinearequivalentforthis.Likeaddingdyshereras
  1489. isaddedtotheoriginal:
  1490. raf=ori+ras.Attexturerasissmall.Noiseishandledlike
  1491. texture:reducedbyraf.Innoisyimagesrafisbetterthandyf.
  1492.  
  1493. command:rafinput-image,output-image,neighbsize,shape
  1494. default:rafA,B,3   ,8
  1495. range:<A>,<B>,<1,127>  , <0,17>
  1496.  
  1497. ADAPTIVEFILTERS
  1498.  
  1499. Typically,adaptivefiltersarecompositesofsimplelinearor
  1500. non-linearfilters.Theireffectisusuallynon-linear.Asimple
  1501. examplewouldbeanX-rayenhancerthatappliescrispeningin
  1502. lightareasonly:onesmoothingfilter"tastes"thegreyvalueof
  1503. areas,theresultisusedtocontrolasteerablecrispening
  1504. filter.Moreingeneral,severaltastingfiltersmaycollect
  1505. informationtransformedbyacontrolruleintoacontrolsignal
  1506. vectorthatsteersasteerableactingfilter,(e.g.aweighted
  1507. filterbank).
  1508.  
  1509. edgps:flippingneighbourhoodmechanism
  1510.  
  1511. VanAntwerpenintroducedthismechanismaspivotalpartofhis
  1512. versionofKuwaharaedgepreservingsmoothing(kuwainAIM).It
  1513. canbeusedtogeneralizethekuwafilter.Thefirstparameteris
  1514. Çafilteredimage.Thesecondparameterisanimagethatcontains
  1515. thetastedinformation.Thethirdparameteristheoutputimage.
  1516. Foreachoutputpixelthemechanisminspectsthecornersofanxn
  1517. square(nisthefourthparameter,usuallyequaltothesizeof
  1518. thefiltersusedtoproducetheinputimages)aroundit(giving
  1519. thefifthparameter(c)anon-zerovalueenforcesadditional
  1520. inspectionofthecenterposition)andselectstheonewithleast
  1521. tastedvalue.Thevalueofthefilteredimageattheselected
  1522. positioniswrittenastheoutputresult.Themechanismmimicks
  1523. thechoicebetweentheresultsoffour(fiveifc!=0)acting
  1524. filters(withasneighbourhoodstheupperleft,upperright,
  1525. lowerleftandlowerrightquadrantwithrespecttotheoutput
  1526. pixel,andalsoacenteredsquareifc!=0).Thischoicemay
  1527. changefromonepositiontothenext:aflippingneighbourhood.
  1528. Forevenntheoutputpositionhasan1/2,1/2offsetthatwill
  1529. compensatetheoffsetsofthefiltersused,iftheyareSouthand
  1530. Eastoriented(asisdefaultinAIM).
  1531. command:edgpsfilt'd-im,tasted-im,output-im,size,center-on
  1532. default:edgpsA,B,filt'd-im,3  ,0
  1533. range:<A-D>,<A-D>,<A-D>,<2,255>,<-255,255>
  1534.  
  1535. kuwa:edgepreservingsmoothingfilter
  1536.  
  1537. Hachimura&Kuwaharaproposedtheflippingneighbourhoodin
  1538. combinationwithavariancefilterastastingfilterandwith
  1539. uniformsmoothingasactingfilter.Areasthatcontainanedge
  1540. havinglargervariancethanothersareavoidedinthesmoothing.
  1541. Henceedgesarepreserved.InAIM(accordingtoVanAntwerpen)
  1542. thedynamicrange(lmax-lmin)istastedratherthanvariance.
  1543. Thefirstparameteristheinputimage,thesecondisa
  1544. temporaryimageusedasscratch,thethirdistheoutputimage.
  1545. Thefourthparameteristhesizeofthesmoothingandtasting
  1546. filters(evensizesallowed).Thefifthparameterifnon-zero
  1547. extendsthefourquadrantschoicebyacentersquare(seeedgps).
  1548.  
  1549. command:kuwainput-im,temp-im,output-im,quadrantsize,center-on
  1550. default:kuwaA,B,C,3  ,0
  1551. range:<A-D>,<A-D>,<A-D>,<2,15>,<-255,255>
  1552.  
  1553.  
  1554.  
  1555. GREY-VALUEPOINTOPERATIONS
  1556.  
  1557. equal(ization):histogramequalization.
  1558.  
  1559. Thisoperationreassignsthegrey-valuesinanimageandresults
  1560. inan"optimum"useoftheavailablegrey-values.Thegrey-value
  1561. histogramoftheoutputimageisasflataspossible(giventhe
  1562. necessaryrequantization).Anexampleisgivenin@demo1.
  1563.  
  1564. command:equalinput-image,output-image
  1565. default:equalA,B
  1566. range:<A-D>,<A-D>
  1567. Ç
  1568. table:transformsagreyvalueimageusingalook-uptable.
  1569.  
  1570. Thegreyvaluegfromtheinputimage(firstparameter)isused
  1571. astableaddress,thecontentfoundtherebecomesthegreyvalue
  1572. hintheoutputimage(secondparameter).Severaltablescanbe
  1573. generated(thirdparameter,t;examplesaregivenin@demtable):
  1574. t=0:h=g**(j/k);t=2:h=(k/g)**j;
  1575. t=1:h=(j/k)**g;j=0->j/k=e;t=-1:h=log(g)/log(j/k);
  1576. t=3:h=atan(k*(g-gj));t=-3:h=tan(g-j)/k+gj;
  1577. t=4:g=(x+8)+16*(y+8)->h=phi*16/2pi+16*r;t=-4:inverseoft=4;
  1578. t=5:h=cos(g**j*k*2pi);t=-5:h=sin(g**j*k*2pi);
  1579. t=6:j=lower,k=higherthreshold;t=-6:8thresholdsj,j+1,,j+7;
  1580. t=7:h=log(g+1)-log(256-g);t=-7:h=-1+257/(1+exp(-g)); 
  1581. t=8:h=((j/k)**g+(j/k)**-g)/2 -1;|t=-8:h=(log(g+1+sqrt((g+1)**2-1)))
  1582.                  j=0 -> j/k=e  ;|    /log(j/k);   j=0 -> j/k=e.
  1583. t=-8: inverse cosh-1, sqrt at low g,h but log at high g,h:
  1584.       pseudo Weber-Fechner law of human visual sensitivity
  1585. Fourthpara.(r)reflectstable:r=1:normal;r=2:g->-g;r=3:h->
  1586. -h;r=4:g->-g,h->-h;r=5:g->|g|;r=6:g->|g|,h->|h|*sgn(g).
  1587.  
  1588. thresh[olding]:transformsagrey-valueimageinabinaryimage.
  1589.  
  1590. Thebinaryimageisobtainedbythresholdingtheinputimage.
  1591. Afterthresholdingbinaryimageoperationsmaybeapplied.Pixels
  1592. withagrey-valueabovethethresholdgetthebinaryvalue'1'
  1593. andthusbecomewhite.Pixelswithagrey-valuebelowthe
  1594. thresholdgetthebinaryvalue'0'andbecomeblack.Thedefault
  1595. valueofthethresholdisobtainedfromthegrey-valuehistogram
  1596. withthemethodofRidler&Calvert.
  1597.  
  1598. command:threshinput-image,output-image,bitplane,threshold
  1599. default:threshA,B,1,automatic
  1600. range:<A-D>,<A-D>,<1,8>,<0,255>
  1601.  
  1602. mcop:transformsabinaryimageintoagrey-valueimage.
  1603.  
  1604. mcopallowsabinaryimagewantedtotakepartingreyoperations
  1605. tobecopiedtoallbitplanesofagreyimage(1->255).Amask
  1606. wordmayrestrict"all"tosome:e.g.255->all,37->only1,3,6.
  1607. Notethattheremainingbitplaneswillnotbereset.
  1608.  
  1609. command:mcopinput-image,output-image,input-bitplane,mask
  1610. default:mcopA,B,1,255
  1611. range:<A-D>,<A-D>,<1,8>,<0,255>
  1612.  
  1613.  
  1614.  
  1615. CELLULARLOGIC(BINARY)OPERATIONS
  1616.  
  1617. Theseoperationscanbeappliedtothe8bitplanesofanimage.
  1618. Thebitplanesarenumberedfrom1to8.Ablackpixelhasthe
  1619. value'0',awhitepixelhasthevalue'1'.
  1620. Theedgevalueoftheimagecanbesetto'0'or'1'inall
  1621. Çoperations.Thedefaultvalueoftheimageedgeisblack(0).The
  1622. givennumberofiterationsisamaximum.Theiterationsstopwhen
  1623. nochangesinthepixelvaluesoccuranymore.
  1624. Thenumberofiterationsisshowninthatcase.
  1625.  
  1626. erosion:erodeswhiteobjects.
  1627.  
  1628. Onelayerofthewhiteobjectsispeeledoffineachiteration.
  1629. Whiteobjectswhicharesmallerthanthenumberofiterations*2
  1630. willdisappear.Theconnectivitydetermineswhichwhitepixels
  1631. belongtoalayertobepeeledoff.Whentheconnectivityis4
  1632. thislayerconsistsofthosewhitepixelsthathaveahorizontal
  1633. orverticalblackneighbour.Whentheconnectivityis8alayer
  1634. consistsofthosewhitepixelsthathaveahorizontal,vertical
  1635. ordiagonalblackneighbour.Whentheconnectivityis6forthe
  1636. odditerationsa4-connectivityisusedandfortheeven
  1637. iterationsan8-connectivityisused.Theerosionisillustrated
  1638. in@demo6.
  1639.  
  1640. command:erosion#iterations,bitplane,connectivity,edge,image
  1641. default:erosion1,1,6,0,B
  1642. range:<1,512>,<1,8>,<4,6,8>,<0,1>,<A-D>
  1643.  
  1644. dilation:extendswhiteobjects.
  1645.  
  1646. Onelayerisaddedtothewhiteobjectsineachiteration.Black
  1647. partssuchasholeswhicharesmallerthanthenumberof
  1648. iterations*2willdisappear.Theconnectivitydetermineswhich
  1649. blackpixelsbelongtoalayertobeadded.Whentheconnectivity
  1650. is4thislayerconsistsofthosewhitepixelsthathavea
  1651. horizontalorverticalwhiteneighbour.Whentheconnectivityis
  1652. 8alayerconsistsofthoseblackpixelsthathaveahorizontal,
  1653. verticalordiagonalwhiteneighbour.Whentheconnectivityis6
  1654. fortheodditerationsa4-connectivityisusedandfortheeven
  1655. iterationsan8-connectivityisused.
  1656.  
  1657. command:dilation#iterations,bitplane,connectivity,edge,image
  1658. default:dilation1,1,6,0,B
  1659. range:<1,512>,<1,8>,<4,6,8>,<0,1>,<A-D>
  1660.  
  1661. propag[ation]:dilatesabitplaneunderamask.
  1662.  
  1663. Thepropagationstronglyresemblesthedilation.However,the
  1664. blackpixelsareonlyaddedwhentheyarewhite(1)inthemask
  1665. bitplane.Thepropagationcanbeusedtofindtheoriginalshapes
  1666. ofobjectswhichremainedafteranumberoferosioniterations.
  1667. Thisapplicationisalsoshownin@demo6.
  1668. Thefirstparameteristhenumberofiterations.Thesecond
  1669. parameteristhebitplaneofwhichthedilationtakesplace(seed
  1670. bitplane).Thethirdparameteristhemaskbitplane.Theother
  1671. parametersareagaintheconnectivityandtheimageedgevalue.
  1672. Whentheedgevalueis0onlytheseedbitplaneispropagated.
  1673. Whentheedgevalueis1onlytheedgeispropagatedandwhenthe
  1674. edgevalueis2boththeedgeandtheseedbitplaneare
  1675. Çpropagated.
  1676.  
  1677. command:propag#iterations,bitplane,maskbitplane,connectiv,
  1678. edge,image
  1679. default:propag1,1,2,6,0
  1680. ,A
  1681. range:<1,512>,<1,8>,<1,8>,<4,6,8>
  1682. ,<0,2>,<A-D>
  1683.  
  1684. skelet:skeletonwithendpixels.
  1685.  
  1686. Theskeletonisan1pixelthicklineinthemiddleofwhite
  1687. objects.Theskeletonoperationresemblestheerosion,butin
  1688. thiscasepixelsofalayerareonlydeleted,whentheirdeletion
  1689. doesnotchangethetopologyoftheimage.(Theyarenotbreak
  1690. pixels).Anadditionalrestrictionisthatapixelmaynotbe
  1691. deletedattheendofaskeleton(line).Thenumberofiterations
  1692. mustbesufficientlylargetofindthecompleteskeleton(the
  1693. biggestdiameterofthewhiteobjectsdividedby2).
  1694. Theoperationstopswhenthenumberofiterationsisreachedor
  1695. whennopixelschangeanymore.Anexampleisgivenin@demo3.
  1696.  
  1697. command:skelet#iterations,bitplane,edgevalue,image
  1698. default:skelet100,1,0,B
  1699. range:<1,512>,<1,8>,<0,1>,<A-D>
  1700.  
  1701. -skelet:skeletonwithoutendpixels
  1702.  
  1703. Theskeletonwithoutendpixelsisthesameastheprevious
  1704. skeletonoperation,butendpixelsmaybedeletedinthiscase.
  1705. Solidobjectswillresultinsinglepixelsandholesinobjects
  1706. willresultinrings.Thisisillustratedbytheskeletonofthe
  1707. background(exo-skeleton)in@demo4.
  1708.  
  1709. command:-skelet#iterations,bitplane,edgevalue,image
  1710. default:-skelet100,1,0,B
  1711. range:<1,512>,<1,8>,<0,1>,<A-D>
  1712.  
  1713. contour:determinesthecontoursofobjects.
  1714.  
  1715. Theresultistheedgesofwhiteobjects.Thismeansallwhite
  1716. pixelswithoneormoreblackneighbours.
  1717.  
  1718. command:contourbitplane,edgevalue,image
  1719. default:contour1,0,B
  1720. range:<1,8>,<0,1>,<A-D>
  1721.  
  1722. majority:performsamajorityvoting.
  1723.  
  1724. Thecentralpixelofa3x3neighbourhoodbecomesblackorwhite
  1725. dependinguponthemajorityoftheneighbourhood.
  1726.  
  1727. command:majoritybitplane,edgevalue,image
  1728. default:majority1,0,B
  1729. Çrange:<1,8>,<0,1>,<A-D>
  1730.  
  1731. remove[noise]:removespepperandsaltnoise.
  1732.  
  1733. Awhitepixelinacompleteblack3x3neighbourhoodbecomes
  1734. black.Ablackpixelinacompletewhite3x3neighbourhood
  1735. becomeswhite.
  1736.  
  1737. command:removebitplane,edgevalue,image
  1738. default:remove1,0,B
  1739. range:<1,8>,<0,1>,<A-D>
  1740.  
  1741. life:gameoflife
  1742.  
  1743. Thewell-knowngameoflifeisalsoacellularlogicoperation!
  1744.  
  1745. command:life#iterations,bitplane,edgevalue,image
  1746. default:life1,1,0,B
  1747. range:<1,512>,<1,8>,<0,1>,<A-D>
  1748.  
  1749.  
  1750.  
  1751. SPECIALLINEFIGUREPIXELS
  1752.  
  1753. sinpix[els]:determinesisolatedwhitepixels
  1754.  
  1755. Thesewhitepixelshavenowhiteneighbourina3x3neighbour⑨
  1756. hood.
  1757.  
  1758. command:sinpixbitplane,edgevalue,image
  1759. default:sinpix1,0,B
  1760. range:<1,8>,<0,1>,<A-D>
  1761.  
  1762. endpix[els]:determinesendpixelsofalinefigure.
  1763.  
  1764. Thesewhitepixelshaveonlyonewhiteneighbourina3x3
  1765. neighbourhood.
  1766.  
  1767. command:endpixbitplane,edgevalue,image
  1768. default:endpix1,0,B
  1769. range:<1,8>,<0,1>,<A-D>
  1770.  
  1771. linkpix[els]:determineswhitepixelswithtwowhiteneighbours.
  1772.  
  1773. Thesewhitepixelshavetwowhiteneighboursina3x3neighbour⑨
  1774. hood.
  1775.  
  1776. command:linkpixbitplane,edgevalue,image
  1777. default:linkpix1,0,B
  1778. range:<1,8>,<0,1>,<A-D>
  1779.  
  1780. vertices:determinestheverticesinalinefigure.
  1781.  
  1782. Thesewhitepixelshavemorethantwowhiteneighboursina3x3
  1783. Çneighbourhood.
  1784.  
  1785. command:verticesbitplane,edgevalue,image
  1786. default:vertices1,0,B
  1787. range:<1,8>,<0,1>,<A-D>
  1788.  
  1789.  
  1790. BITOPERATIONS
  1791.  
  1792.  
  1793. bcopy:copiesabitplane.
  1794.  
  1795. Thecommandparametersaretheinput-bitplaneandtheoutput-
  1796. bitplane.
  1797.  
  1798. command:bcopybitplanein,bitplaneout,imagein,imageout
  1799. default:bcopy1,3,B,B
  1800. range:<1,8>,<1,8>,<A-D>,<A-D>
  1801.  
  1802. and:AND-functionoftwobitplanes.
  1803.  
  1804. Thecommandparametersaretheinput-bitplanesofwhichtheAND-
  1805. functionistakenandtheoutput-bitplane.
  1806.  
  1807. command:andbitplanein1,bitplanein2,bitplaneout,image
  1808. default:and1,2,2,B
  1809. range:<1,8>,<1,8>,<1,8>,<A-D>
  1810.  
  1811. or:OR-functionoftwobitplanes
  1812.  
  1813. Thecommandparametersaretheinput-bitplanesofwhichtheOR-
  1814. functionistakenandtheoutput-bitplane.
  1815.  
  1816. command:orbitplanein1,bitplanein2,bitplaneout,image
  1817. default:or1,2,2,B
  1818. range:<1,8>,<1,8>,<1,8>,<A-D>
  1819.  
  1820. exor:EXOR-functionoftwobitplanes
  1821.  
  1822. Thecommandparametersaretheinput-bitplanesofwhichtheEXOR-
  1823. functionistakenandtheoutput-bitplane.
  1824.  
  1825. command:exorbitplanein1,bitplanein2,bitplaneout,image
  1826. default:exor1,2,2,B
  1827. range:<1,8>,<1,8>,<1,8>,<A-D>
  1828.  
  1829. invert:invertsabitplane
  1830.  
  1831. Thefirstcommandparameteristhebitplane.Thesecondcommand
  1832. parameteristheimage.
  1833.  
  1834. command:invertbitplane,image
  1835. default:invert1,B
  1836. range:<1,8>,<A-D>
  1837. Ç
  1838. set:setsabitplane,somakesitwhite(1).
  1839.  
  1840. Thefirstcommandparameteristhebitplane.Thesecondcommand
  1841. parameteristheimage
  1842.  
  1843. command:setbitplane,image
  1844. default:set1,B
  1845. range:<1,8>,<A-D>
  1846.  
  1847. reset:resetsabitplane,somakesitblack(0).
  1848.  
  1849. Thefirstcommandparameteristhebitplane.Thesecondcommand
  1850. parameteristheimage.
  1851.  
  1852. command:resetbitplane,image
  1853. default:reset1,B
  1854. range:<1,8>,<A-D>
  1855.  
  1856.  
  1857. label:labelsconnectedcomponents.
  1858.  
  1859. Thiscommandlabelstheconnectedcomponentswithinabinary
  1860. image.Themaximumnumberoflabelsis255.(Inlowresolution
  1861. thebestdisplayisobtainedby:don,3followedbybdisp.)
  1862.  
  1863. command:input-image,output-image,inputbitplane,connectivity
  1864. default:B,A,1,8
  1865. range:<A-D>,<A-D>,<1-8>,<4,6,8>
  1866.  
  1867. UTILITIES
  1868.  
  1869. (*)don:Automaticdisplayon
  1870.  
  1871. Whentheautomaticdisplayison,aftereachoperationtheresult
  1872. isshown.
  1873. Anoptionalparametergivesthetypeofdisplayinthelow-
  1874. resolutionmode.Anexampleisgivenin@democ5.
  1875.  
  1876. 0:displayoff(sameasdoff)
  1877.  
  1878. 1:Whenallpixelsofa2x2neighbourhoodintheoriginal
  1879. bitplaneare'0'ablackdotisdisplayed.Whenallpixelsofa
  1880. 2x2neighbourhoodinthebitplaneare'1'awhitedotis
  1881. displayed.Inallothercasesagreydotisdisplayed.
  1882.  
  1883. 2:ThebitplaneissampleddependingupontheGEMwindowsize.
  1884. Whenthefirstpixelofasampleregionis'0'ablackdotis
  1885. displayed.Whenthefirstpixelis'1'awhitedotisdisplayed.
  1886.  
  1887. 3:Multiplebitplanedisplay.Bitplanesaresampleddepending
  1888. upontheGEMwindowsize.Bitplane1isdisplayedinred,bitplane
  1889. 2inblueandbitplane3ingreen.Whenallthreelowest
  1890. bitplanesare'0',the3highestbitplanesareshownasgrey-
  1891. Çvalue.
  1892.  
  1893. 4:Multiplebitplanedisplay.Bitplanesaresampleddepending
  1894. upontheGEMwindowsize.Bitplane8isdisplayedinred,bitplane
  1895. 7isdisplayedinblueandbitplane6isdisplayedingreen.
  1896.  
  1897. command:don,display_type
  1898. default:don,1
  1899. range:don,<0,4>
  1900.  
  1901. (*)doff:Automaticdisplayoff
  1902.  
  1903. Whentheautomaticdisplayisoff,onlyanimageisdisplayed
  1904. afteragdisporbdispcommand.
  1905.  
  1906. command:doff
  1907.  
  1908. (*)ton:Timeron
  1909.  
  1910. Theexecutiontimeofeachcommandisdisplayedwhenthetimeris
  1911. on.
  1912.  
  1913. command:ton
  1914.  
  1915. (*)toff:Timeroff
  1916.  
  1917. Setstimeroff.
  1918.  
  1919. command:toff
  1920.  
  1921. gdisp:Grey-value/colordisplayofanimage.
  1922.  
  1923. Thisroutinedisplaysagrey-valueimageas256x256blackor
  1924. whitedotsinhighresolution.Inlowresolution128x128pixels
  1925. of8grey-valuesaredisplayed.Imagesarealwaysdisplayedwith
  1926. maximumcontrast.Thecontrastiscomputedfromthe0.1*promille
  1927. percentileofthehistogram.
  1928. Whentheimageisacolorimageitisdisplayedincolorinthe
  1929. lowresolutionmode.Whenthecdisp_typeparameteris0anoptimal
  1930. paletteiscomputed.Whentheparameteris2asigma/delta
  1931. techniqueforredgreenandbluedotsisused.Whentheparameter
  1932. is1,redandbluearedisplayedwithdots,greenisdisplayedin
  1933. 4values.
  1934. Thefirstparameteristheimage(AtoD).
  1935.  
  1936. command:gdispimage,promille,cdisp_type
  1937. default:gdispA,previous,0
  1938. range:<A-D>,<0-100>,<0-2>
  1939.  
  1940. bdisp:Displaysoneofthe8bitplanesofanimage.
  1941.  
  1942. Firstcommandparameteristheimage(defaultA).Secondparame⑨
  1943. teristhebitplane(default1).Inhighresolutionblackor
  1944. whitepixelsaredisplayed.Thetypeofdisplayinlowresolution
  1945. Çisdeterminedbythe(optional)donparameter.
  1946.  
  1947. command:bdispimage,bitplane
  1948. default:bdispA,1
  1949. range:<A-D>,<1,8>
  1950.  
  1951. hist:calculatesthehistogramofanimage.
  1952.  
  1953. Thehistogramisdisplayedinoverlayintheappropriateimage
  1954. window(AtoD).Athresholdiscalculatedfromthehistogramto
  1955. segmenttheimage(forthethreshcommand).Thecommand
  1956. parameteristheimage(defaultA).
  1957.  
  1958. command:histimage
  1959. default:histA
  1960. range:<A-D>
  1961. Palette:Changethepaletteinteractively.
  1962.  
  1963. Thisoptionisonlysupportedinthelow-resolutionmode.
  1964.  
  1965. Preferences:Changepreferences.
  1966.  
  1967. Whentheimagewindowsaresized,theaspectsratiocanbe
  1968. preservedornot.
  1969. Theimagescanbealignedtobyteboundariesornot.
  1970.  
  1971. help:giveshelpinformation.
  1972.  
  1973. command:helpcommand
  1974.  
  1975. APPENDIX:Fileheaderstructure
  1976.  
  1977.  
  1978. /*calltheheaderfile*.hd,thisfilecontainsthestructure
  1979. withallparametersofthecorrespondingimagefile*.im.*/
  1980.  
  1981. typedefstruct
  1982. {
  1983. short*address;/*image_addressinmemory*/
  1984. charname[16];/*nameoftheimagefile*/
  1985. shortformat;/*format*/
  1986. shortsizex;/*dimension1*/
  1987. shortsizey;/*dimension2*/
  1988. shortsizez;/*dimension3*/
  1989. unsignedshortcommsz;/*sizeofcommentinbytes*/
  1990. shortdata[16];/*userimagedependentdata*/
  1991. }
  1992. HEADER;
  1993.  
  1994. #defineF_WORDS0/*formatwordsintheimage*/
  1995. #defineF_BYTES1/*formatbytesintheimage*/
  1996. #defineF_FOBIT2/*fourbitsimage,packedin4pix/word*/
  1997. #defineF_TWBIT3/*twobitsimage,packedin8pix/word*/
  1998. #defineF_SBITS4/*formatsinglebitsintheimage*/
  1999. Ç
  2000.  
  2001. ACKNOWLEDGEMENT
  2002.  
  2003. ThefollowingpeoplecontributedtoAIM:
  2004. FransGroen(UVA/VU):someimageprocessing.
  2005. RobertdeVries(TUD):GEMinterface.
  2006. IgorWeber(UniversityofZagreb,YU):low-resolutionandcolour
  2007.                                         display.
  2008. GertvanAntwerpen(CBD):lmin,lmax,unif,label
  2009. PietVerbeek(TUD):gaus,dog,robe,lgau,adne,adre,lgra,ggra,
  2010. sune,sure,para,sepa,peak,hara,have,low,upp,dyt,tet,dyg,teg,rag,
  2011. dyr,ter,rar,dyl,tel,ral,dys,tes,ras,dyf,tef,raf,kuwa,edgps,copy
  2012. LucasvanVlietand:erosion,dilation,propagation,
  2013. BenVerwer(TUD)skeleton
  2014. TomHoeksma(TUD):testsandevaluation.
  2015. AdHerweijer(TUD)
  2016.  
  2017. FransGroen
  2018. PietVerbeek
  2019. RobertdeVries
  2020.  
  2021. March1988
  2022.  
  2023.  
  2024. Pleasesendremarksandcommentsto:
  2025. FransGroen
  2026. FacultyofMathematicsandComputerScience
  2027. UniversityofAmsterdam
  2028. Kruislaan409
  2029. 1098SJAmsterdam
  2030. TheNetherlands
  2031. email:groen@uva.uucp(....!mcvax!uva!groen)
  2032.  
  2033. orto:
  2034. PietVerbeek
  2035. AppliedPhysicsDepartment
  2036. DelftUniversityofTechnology
  2037. Lorentzweg1
  2038. 2628CJDelft
  2039. TheNetherlands
  2040. tel(31)15-781416
  2041.  
  2042.