Imgproc.h 448 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263
  1. //
  2. // This file is auto-generated. Please don't modify it!
  3. //
  4. #pragma once
  5. #ifdef __cplusplus
  6. //#import "opencv.hpp"
  7. #import "opencv2/imgproc.hpp"
  8. #import "imgproc/bindings.hpp"
  9. #else
  10. #define CV_EXPORTS
  11. #endif
  12. #import <Foundation/Foundation.h>
  13. #import "Core.h"
  14. @class CLAHE;
  15. @class FloatVector;
  16. @class GeneralizedHoughBallard;
  17. @class GeneralizedHoughGuil;
  18. @class Int4;
  19. @class IntVector;
  20. @class LineSegmentDetector;
  21. @class Mat;
  22. @class Moments;
  23. @class Point2d;
  24. @class Point2f;
  25. @class Point2i;
  26. @class Rect2i;
  27. @class RotatedRect;
  28. @class Scalar;
  29. @class Size2i;
  30. @class TermCriteria;
  31. // C++: enum AdaptiveThresholdTypes (cv.AdaptiveThresholdTypes)
  32. typedef NS_ENUM(int, AdaptiveThresholdTypes) {
  33. ADAPTIVE_THRESH_MEAN_C = 0,
  34. ADAPTIVE_THRESH_GAUSSIAN_C = 1
  35. };
  36. // C++: enum ColorConversionCodes (cv.ColorConversionCodes)
  37. typedef NS_ENUM(int, ColorConversionCodes) {
  38. COLOR_BGR2BGRA = 0,
  39. COLOR_RGB2RGBA = COLOR_BGR2BGRA,
  40. COLOR_BGRA2BGR = 1,
  41. COLOR_RGBA2RGB = COLOR_BGRA2BGR,
  42. COLOR_BGR2RGBA = 2,
  43. COLOR_RGB2BGRA = COLOR_BGR2RGBA,
  44. COLOR_RGBA2BGR = 3,
  45. COLOR_BGRA2RGB = COLOR_RGBA2BGR,
  46. COLOR_BGR2RGB = 4,
  47. COLOR_RGB2BGR = COLOR_BGR2RGB,
  48. COLOR_BGRA2RGBA = 5,
  49. COLOR_RGBA2BGRA = COLOR_BGRA2RGBA,
  50. COLOR_BGR2GRAY = 6,
  51. COLOR_RGB2GRAY = 7,
  52. COLOR_GRAY2BGR = 8,
  53. COLOR_GRAY2RGB = COLOR_GRAY2BGR,
  54. COLOR_GRAY2BGRA = 9,
  55. COLOR_GRAY2RGBA = COLOR_GRAY2BGRA,
  56. COLOR_BGRA2GRAY = 10,
  57. COLOR_RGBA2GRAY = 11,
  58. COLOR_BGR2BGR565 = 12,
  59. COLOR_RGB2BGR565 = 13,
  60. COLOR_BGR5652BGR = 14,
  61. COLOR_BGR5652RGB = 15,
  62. COLOR_BGRA2BGR565 = 16,
  63. COLOR_RGBA2BGR565 = 17,
  64. COLOR_BGR5652BGRA = 18,
  65. COLOR_BGR5652RGBA = 19,
  66. COLOR_GRAY2BGR565 = 20,
  67. COLOR_BGR5652GRAY = 21,
  68. COLOR_BGR2BGR555 = 22,
  69. COLOR_RGB2BGR555 = 23,
  70. COLOR_BGR5552BGR = 24,
  71. COLOR_BGR5552RGB = 25,
  72. COLOR_BGRA2BGR555 = 26,
  73. COLOR_RGBA2BGR555 = 27,
  74. COLOR_BGR5552BGRA = 28,
  75. COLOR_BGR5552RGBA = 29,
  76. COLOR_GRAY2BGR555 = 30,
  77. COLOR_BGR5552GRAY = 31,
  78. COLOR_BGR2XYZ = 32,
  79. COLOR_RGB2XYZ = 33,
  80. COLOR_XYZ2BGR = 34,
  81. COLOR_XYZ2RGB = 35,
  82. COLOR_BGR2YCrCb = 36,
  83. COLOR_RGB2YCrCb = 37,
  84. COLOR_YCrCb2BGR = 38,
  85. COLOR_YCrCb2RGB = 39,
  86. COLOR_BGR2HSV = 40,
  87. COLOR_RGB2HSV = 41,
  88. COLOR_BGR2Lab = 44,
  89. COLOR_RGB2Lab = 45,
  90. COLOR_BGR2Luv = 50,
  91. COLOR_RGB2Luv = 51,
  92. COLOR_BGR2HLS = 52,
  93. COLOR_RGB2HLS = 53,
  94. COLOR_HSV2BGR = 54,
  95. COLOR_HSV2RGB = 55,
  96. COLOR_Lab2BGR = 56,
  97. COLOR_Lab2RGB = 57,
  98. COLOR_Luv2BGR = 58,
  99. COLOR_Luv2RGB = 59,
  100. COLOR_HLS2BGR = 60,
  101. COLOR_HLS2RGB = 61,
  102. COLOR_BGR2HSV_FULL = 66,
  103. COLOR_RGB2HSV_FULL = 67,
  104. COLOR_BGR2HLS_FULL = 68,
  105. COLOR_RGB2HLS_FULL = 69,
  106. COLOR_HSV2BGR_FULL = 70,
  107. COLOR_HSV2RGB_FULL = 71,
  108. COLOR_HLS2BGR_FULL = 72,
  109. COLOR_HLS2RGB_FULL = 73,
  110. COLOR_LBGR2Lab = 74,
  111. COLOR_LRGB2Lab = 75,
  112. COLOR_LBGR2Luv = 76,
  113. COLOR_LRGB2Luv = 77,
  114. COLOR_Lab2LBGR = 78,
  115. COLOR_Lab2LRGB = 79,
  116. COLOR_Luv2LBGR = 80,
  117. COLOR_Luv2LRGB = 81,
  118. COLOR_BGR2YUV = 82,
  119. COLOR_RGB2YUV = 83,
  120. COLOR_YUV2BGR = 84,
  121. COLOR_YUV2RGB = 85,
  122. COLOR_YUV2RGB_NV12 = 90,
  123. COLOR_YUV2BGR_NV12 = 91,
  124. COLOR_YUV2RGB_NV21 = 92,
  125. COLOR_YUV2BGR_NV21 = 93,
  126. COLOR_YUV420sp2RGB = COLOR_YUV2RGB_NV21,
  127. COLOR_YUV420sp2BGR = COLOR_YUV2BGR_NV21,
  128. COLOR_YUV2RGBA_NV12 = 94,
  129. COLOR_YUV2BGRA_NV12 = 95,
  130. COLOR_YUV2RGBA_NV21 = 96,
  131. COLOR_YUV2BGRA_NV21 = 97,
  132. COLOR_YUV420sp2RGBA = COLOR_YUV2RGBA_NV21,
  133. COLOR_YUV420sp2BGRA = COLOR_YUV2BGRA_NV21,
  134. COLOR_YUV2RGB_YV12 = 98,
  135. COLOR_YUV2BGR_YV12 = 99,
  136. COLOR_YUV2RGB_IYUV = 100,
  137. COLOR_YUV2BGR_IYUV = 101,
  138. COLOR_YUV2RGB_I420 = COLOR_YUV2RGB_IYUV,
  139. COLOR_YUV2BGR_I420 = COLOR_YUV2BGR_IYUV,
  140. COLOR_YUV420p2RGB = COLOR_YUV2RGB_YV12,
  141. COLOR_YUV420p2BGR = COLOR_YUV2BGR_YV12,
  142. COLOR_YUV2RGBA_YV12 = 102,
  143. COLOR_YUV2BGRA_YV12 = 103,
  144. COLOR_YUV2RGBA_IYUV = 104,
  145. COLOR_YUV2BGRA_IYUV = 105,
  146. COLOR_YUV2RGBA_I420 = COLOR_YUV2RGBA_IYUV,
  147. COLOR_YUV2BGRA_I420 = COLOR_YUV2BGRA_IYUV,
  148. COLOR_YUV420p2RGBA = COLOR_YUV2RGBA_YV12,
  149. COLOR_YUV420p2BGRA = COLOR_YUV2BGRA_YV12,
  150. COLOR_YUV2GRAY_420 = 106,
  151. COLOR_YUV2GRAY_NV21 = COLOR_YUV2GRAY_420,
  152. COLOR_YUV2GRAY_NV12 = COLOR_YUV2GRAY_420,
  153. COLOR_YUV2GRAY_YV12 = COLOR_YUV2GRAY_420,
  154. COLOR_YUV2GRAY_IYUV = COLOR_YUV2GRAY_420,
  155. COLOR_YUV2GRAY_I420 = COLOR_YUV2GRAY_420,
  156. COLOR_YUV420sp2GRAY = COLOR_YUV2GRAY_420,
  157. COLOR_YUV420p2GRAY = COLOR_YUV2GRAY_420,
  158. COLOR_YUV2RGB_UYVY = 107,
  159. COLOR_YUV2BGR_UYVY = 108,
  160. COLOR_YUV2RGB_Y422 = COLOR_YUV2RGB_UYVY,
  161. COLOR_YUV2BGR_Y422 = COLOR_YUV2BGR_UYVY,
  162. COLOR_YUV2RGB_UYNV = COLOR_YUV2RGB_UYVY,
  163. COLOR_YUV2BGR_UYNV = COLOR_YUV2BGR_UYVY,
  164. COLOR_YUV2RGBA_UYVY = 111,
  165. COLOR_YUV2BGRA_UYVY = 112,
  166. COLOR_YUV2RGBA_Y422 = COLOR_YUV2RGBA_UYVY,
  167. COLOR_YUV2BGRA_Y422 = COLOR_YUV2BGRA_UYVY,
  168. COLOR_YUV2RGBA_UYNV = COLOR_YUV2RGBA_UYVY,
  169. COLOR_YUV2BGRA_UYNV = COLOR_YUV2BGRA_UYVY,
  170. COLOR_YUV2RGB_YUY2 = 115,
  171. COLOR_YUV2BGR_YUY2 = 116,
  172. COLOR_YUV2RGB_YVYU = 117,
  173. COLOR_YUV2BGR_YVYU = 118,
  174. COLOR_YUV2RGB_YUYV = COLOR_YUV2RGB_YUY2,
  175. COLOR_YUV2BGR_YUYV = COLOR_YUV2BGR_YUY2,
  176. COLOR_YUV2RGB_YUNV = COLOR_YUV2RGB_YUY2,
  177. COLOR_YUV2BGR_YUNV = COLOR_YUV2BGR_YUY2,
  178. COLOR_YUV2RGBA_YUY2 = 119,
  179. COLOR_YUV2BGRA_YUY2 = 120,
  180. COLOR_YUV2RGBA_YVYU = 121,
  181. COLOR_YUV2BGRA_YVYU = 122,
  182. COLOR_YUV2RGBA_YUYV = COLOR_YUV2RGBA_YUY2,
  183. COLOR_YUV2BGRA_YUYV = COLOR_YUV2BGRA_YUY2,
  184. COLOR_YUV2RGBA_YUNV = COLOR_YUV2RGBA_YUY2,
  185. COLOR_YUV2BGRA_YUNV = COLOR_YUV2BGRA_YUY2,
  186. COLOR_YUV2GRAY_UYVY = 123,
  187. COLOR_YUV2GRAY_YUY2 = 124,
  188. COLOR_YUV2GRAY_Y422 = COLOR_YUV2GRAY_UYVY,
  189. COLOR_YUV2GRAY_UYNV = COLOR_YUV2GRAY_UYVY,
  190. COLOR_YUV2GRAY_YVYU = COLOR_YUV2GRAY_YUY2,
  191. COLOR_YUV2GRAY_YUYV = COLOR_YUV2GRAY_YUY2,
  192. COLOR_YUV2GRAY_YUNV = COLOR_YUV2GRAY_YUY2,
  193. COLOR_RGBA2mRGBA = 125,
  194. COLOR_mRGBA2RGBA = 126,
  195. COLOR_RGB2YUV_I420 = 127,
  196. COLOR_BGR2YUV_I420 = 128,
  197. COLOR_RGB2YUV_IYUV = COLOR_RGB2YUV_I420,
  198. COLOR_BGR2YUV_IYUV = COLOR_BGR2YUV_I420,
  199. COLOR_RGBA2YUV_I420 = 129,
  200. COLOR_BGRA2YUV_I420 = 130,
  201. COLOR_RGBA2YUV_IYUV = COLOR_RGBA2YUV_I420,
  202. COLOR_BGRA2YUV_IYUV = COLOR_BGRA2YUV_I420,
  203. COLOR_RGB2YUV_YV12 = 131,
  204. COLOR_BGR2YUV_YV12 = 132,
  205. COLOR_RGBA2YUV_YV12 = 133,
  206. COLOR_BGRA2YUV_YV12 = 134,
  207. COLOR_BayerBG2BGR = 46,
  208. COLOR_BayerGB2BGR = 47,
  209. COLOR_BayerRG2BGR = 48,
  210. COLOR_BayerGR2BGR = 49,
  211. COLOR_BayerRGGB2BGR = COLOR_BayerBG2BGR,
  212. COLOR_BayerGRBG2BGR = COLOR_BayerGB2BGR,
  213. COLOR_BayerBGGR2BGR = COLOR_BayerRG2BGR,
  214. COLOR_BayerGBRG2BGR = COLOR_BayerGR2BGR,
  215. COLOR_BayerRGGB2RGB = COLOR_BayerBGGR2BGR,
  216. COLOR_BayerGRBG2RGB = COLOR_BayerGBRG2BGR,
  217. COLOR_BayerBGGR2RGB = COLOR_BayerRGGB2BGR,
  218. COLOR_BayerGBRG2RGB = COLOR_BayerGRBG2BGR,
  219. COLOR_BayerBG2RGB = COLOR_BayerRG2BGR,
  220. COLOR_BayerGB2RGB = COLOR_BayerGR2BGR,
  221. COLOR_BayerRG2RGB = COLOR_BayerBG2BGR,
  222. COLOR_BayerGR2RGB = COLOR_BayerGB2BGR,
  223. COLOR_BayerBG2GRAY = 86,
  224. COLOR_BayerGB2GRAY = 87,
  225. COLOR_BayerRG2GRAY = 88,
  226. COLOR_BayerGR2GRAY = 89,
  227. COLOR_BayerRGGB2GRAY = COLOR_BayerBG2GRAY,
  228. COLOR_BayerGRBG2GRAY = COLOR_BayerGB2GRAY,
  229. COLOR_BayerBGGR2GRAY = COLOR_BayerRG2GRAY,
  230. COLOR_BayerGBRG2GRAY = COLOR_BayerGR2GRAY,
  231. COLOR_BayerBG2BGR_VNG = 62,
  232. COLOR_BayerGB2BGR_VNG = 63,
  233. COLOR_BayerRG2BGR_VNG = 64,
  234. COLOR_BayerGR2BGR_VNG = 65,
  235. COLOR_BayerRGGB2BGR_VNG = COLOR_BayerBG2BGR_VNG,
  236. COLOR_BayerGRBG2BGR_VNG = COLOR_BayerGB2BGR_VNG,
  237. COLOR_BayerBGGR2BGR_VNG = COLOR_BayerRG2BGR_VNG,
  238. COLOR_BayerGBRG2BGR_VNG = COLOR_BayerGR2BGR_VNG,
  239. COLOR_BayerRGGB2RGB_VNG = COLOR_BayerBGGR2BGR_VNG,
  240. COLOR_BayerGRBG2RGB_VNG = COLOR_BayerGBRG2BGR_VNG,
  241. COLOR_BayerBGGR2RGB_VNG = COLOR_BayerRGGB2BGR_VNG,
  242. COLOR_BayerGBRG2RGB_VNG = COLOR_BayerGRBG2BGR_VNG,
  243. COLOR_BayerBG2RGB_VNG = COLOR_BayerRG2BGR_VNG,
  244. COLOR_BayerGB2RGB_VNG = COLOR_BayerGR2BGR_VNG,
  245. COLOR_BayerRG2RGB_VNG = COLOR_BayerBG2BGR_VNG,
  246. COLOR_BayerGR2RGB_VNG = COLOR_BayerGB2BGR_VNG,
  247. COLOR_BayerBG2BGR_EA = 135,
  248. COLOR_BayerGB2BGR_EA = 136,
  249. COLOR_BayerRG2BGR_EA = 137,
  250. COLOR_BayerGR2BGR_EA = 138,
  251. COLOR_BayerRGGB2BGR_EA = COLOR_BayerBG2BGR_EA,
  252. COLOR_BayerGRBG2BGR_EA = COLOR_BayerGB2BGR_EA,
  253. COLOR_BayerBGGR2BGR_EA = COLOR_BayerRG2BGR_EA,
  254. COLOR_BayerGBRG2BGR_EA = COLOR_BayerGR2BGR_EA,
  255. COLOR_BayerRGGB2RGB_EA = COLOR_BayerBGGR2BGR_EA,
  256. COLOR_BayerGRBG2RGB_EA = COLOR_BayerGBRG2BGR_EA,
  257. COLOR_BayerBGGR2RGB_EA = COLOR_BayerRGGB2BGR_EA,
  258. COLOR_BayerGBRG2RGB_EA = COLOR_BayerGRBG2BGR_EA,
  259. COLOR_BayerBG2RGB_EA = COLOR_BayerRG2BGR_EA,
  260. COLOR_BayerGB2RGB_EA = COLOR_BayerGR2BGR_EA,
  261. COLOR_BayerRG2RGB_EA = COLOR_BayerBG2BGR_EA,
  262. COLOR_BayerGR2RGB_EA = COLOR_BayerGB2BGR_EA,
  263. COLOR_BayerBG2BGRA = 139,
  264. COLOR_BayerGB2BGRA = 140,
  265. COLOR_BayerRG2BGRA = 141,
  266. COLOR_BayerGR2BGRA = 142,
  267. COLOR_BayerRGGB2BGRA = COLOR_BayerBG2BGRA,
  268. COLOR_BayerGRBG2BGRA = COLOR_BayerGB2BGRA,
  269. COLOR_BayerBGGR2BGRA = COLOR_BayerRG2BGRA,
  270. COLOR_BayerGBRG2BGRA = COLOR_BayerGR2BGRA,
  271. COLOR_BayerRGGB2RGBA = COLOR_BayerBGGR2BGRA,
  272. COLOR_BayerGRBG2RGBA = COLOR_BayerGBRG2BGRA,
  273. COLOR_BayerBGGR2RGBA = COLOR_BayerRGGB2BGRA,
  274. COLOR_BayerGBRG2RGBA = COLOR_BayerGRBG2BGRA,
  275. COLOR_BayerBG2RGBA = COLOR_BayerRG2BGRA,
  276. COLOR_BayerGB2RGBA = COLOR_BayerGR2BGRA,
  277. COLOR_BayerRG2RGBA = COLOR_BayerBG2BGRA,
  278. COLOR_BayerGR2RGBA = COLOR_BayerGB2BGRA,
  279. COLOR_COLORCVT_MAX = 143
  280. };
  281. // C++: enum ColormapTypes (cv.ColormapTypes)
  282. typedef NS_ENUM(int, ColormapTypes) {
  283. COLORMAP_AUTUMN = 0,
  284. COLORMAP_BONE = 1,
  285. COLORMAP_JET = 2,
  286. COLORMAP_WINTER = 3,
  287. COLORMAP_RAINBOW = 4,
  288. COLORMAP_OCEAN = 5,
  289. COLORMAP_SUMMER = 6,
  290. COLORMAP_SPRING = 7,
  291. COLORMAP_COOL = 8,
  292. COLORMAP_HSV = 9,
  293. COLORMAP_PINK = 10,
  294. COLORMAP_HOT = 11,
  295. COLORMAP_PARULA = 12,
  296. COLORMAP_MAGMA = 13,
  297. COLORMAP_INFERNO = 14,
  298. COLORMAP_PLASMA = 15,
  299. COLORMAP_VIRIDIS = 16,
  300. COLORMAP_CIVIDIS = 17,
  301. COLORMAP_TWILIGHT = 18,
  302. COLORMAP_TWILIGHT_SHIFTED = 19,
  303. COLORMAP_TURBO = 20,
  304. COLORMAP_DEEPGREEN = 21
  305. };
  306. // C++: enum ConnectedComponentsAlgorithmsTypes (cv.ConnectedComponentsAlgorithmsTypes)
  307. typedef NS_ENUM(int, ConnectedComponentsAlgorithmsTypes) {
  308. CCL_DEFAULT = -1,
  309. CCL_WU = 0,
  310. CCL_GRANA = 1,
  311. CCL_BOLELLI = 2,
  312. CCL_SAUF = 3,
  313. CCL_BBDT = 4,
  314. CCL_SPAGHETTI = 5
  315. };
  316. // C++: enum ConnectedComponentsTypes (cv.ConnectedComponentsTypes)
  317. typedef NS_ENUM(int, ConnectedComponentsTypes) {
  318. CC_STAT_LEFT = 0,
  319. CC_STAT_TOP = 1,
  320. CC_STAT_WIDTH = 2,
  321. CC_STAT_HEIGHT = 3,
  322. CC_STAT_AREA = 4,
  323. CC_STAT_MAX = 5
  324. };
  325. // C++: enum ContourApproximationModes (cv.ContourApproximationModes)
  326. typedef NS_ENUM(int, ContourApproximationModes) {
  327. CHAIN_APPROX_NONE = 1,
  328. CHAIN_APPROX_SIMPLE = 2,
  329. CHAIN_APPROX_TC89_L1 = 3,
  330. CHAIN_APPROX_TC89_KCOS = 4
  331. };
  332. // C++: enum DistanceTransformLabelTypes (cv.DistanceTransformLabelTypes)
  333. typedef NS_ENUM(int, DistanceTransformLabelTypes) {
  334. DIST_LABEL_CCOMP = 0,
  335. DIST_LABEL_PIXEL = 1
  336. };
  337. // C++: enum DistanceTransformMasks (cv.DistanceTransformMasks)
  338. typedef NS_ENUM(int, DistanceTransformMasks) {
  339. DIST_MASK_3 = 3,
  340. DIST_MASK_5 = 5,
  341. DIST_MASK_PRECISE = 0
  342. };
  343. // C++: enum DistanceTypes (cv.DistanceTypes)
  344. typedef NS_ENUM(int, DistanceTypes) {
  345. DIST_USER = -1,
  346. DIST_L1 = 1,
  347. DIST_L2 = 2,
  348. DIST_C = 3,
  349. DIST_L12 = 4,
  350. DIST_FAIR = 5,
  351. DIST_WELSCH = 6,
  352. DIST_HUBER = 7
  353. };
  354. // C++: enum FloodFillFlags (cv.FloodFillFlags)
  355. typedef NS_ENUM(int, FloodFillFlags) {
  356. FLOODFILL_FIXED_RANGE = 1 << 16,
  357. FLOODFILL_MASK_ONLY = 1 << 17
  358. };
  359. // C++: enum GrabCutClasses (cv.GrabCutClasses)
  360. typedef NS_ENUM(int, GrabCutClasses) {
  361. GC_BGD = 0,
  362. GC_FGD = 1,
  363. GC_PR_BGD = 2,
  364. GC_PR_FGD = 3
  365. };
  366. // C++: enum GrabCutModes (cv.GrabCutModes)
  367. typedef NS_ENUM(int, GrabCutModes) {
  368. GC_INIT_WITH_RECT = 0,
  369. GC_INIT_WITH_MASK = 1,
  370. GC_EVAL = 2,
  371. GC_EVAL_FREEZE_MODEL = 3
  372. };
  373. // C++: enum HersheyFonts (cv.HersheyFonts)
  374. typedef NS_ENUM(int, HersheyFonts) {
  375. FONT_HERSHEY_SIMPLEX = 0,
  376. FONT_HERSHEY_PLAIN = 1,
  377. FONT_HERSHEY_DUPLEX = 2,
  378. FONT_HERSHEY_COMPLEX = 3,
  379. FONT_HERSHEY_TRIPLEX = 4,
  380. FONT_HERSHEY_COMPLEX_SMALL = 5,
  381. FONT_HERSHEY_SCRIPT_SIMPLEX = 6,
  382. FONT_HERSHEY_SCRIPT_COMPLEX = 7,
  383. FONT_ITALIC = 16
  384. };
  385. // C++: enum HistCompMethods (cv.HistCompMethods)
  386. typedef NS_ENUM(int, HistCompMethods) {
  387. HISTCMP_CORREL = 0,
  388. HISTCMP_CHISQR = 1,
  389. HISTCMP_INTERSECT = 2,
  390. HISTCMP_BHATTACHARYYA = 3,
  391. HISTCMP_HELLINGER = HISTCMP_BHATTACHARYYA,
  392. HISTCMP_CHISQR_ALT = 4,
  393. HISTCMP_KL_DIV = 5
  394. };
  395. // C++: enum HoughModes (cv.HoughModes)
  396. typedef NS_ENUM(int, HoughModes) {
  397. HOUGH_STANDARD = 0,
  398. HOUGH_PROBABILISTIC = 1,
  399. HOUGH_MULTI_SCALE = 2,
  400. HOUGH_GRADIENT = 3,
  401. HOUGH_GRADIENT_ALT = 4
  402. };
  403. // C++: enum InterpolationFlags (cv.InterpolationFlags)
  404. typedef NS_ENUM(int, InterpolationFlags) {
  405. INTER_NEAREST = 0,
  406. INTER_LINEAR = 1,
  407. INTER_CUBIC = 2,
  408. INTER_AREA = 3,
  409. INTER_LANCZOS4 = 4,
  410. INTER_LINEAR_EXACT = 5,
  411. INTER_NEAREST_EXACT = 6,
  412. INTER_MAX = 7,
  413. WARP_FILL_OUTLIERS = 8,
  414. WARP_INVERSE_MAP = 16
  415. };
  416. // C++: enum InterpolationMasks (cv.InterpolationMasks)
  417. typedef NS_ENUM(int, InterpolationMasks) {
  418. INTER_BITS = 5,
  419. INTER_BITS2 = INTER_BITS * 2,
  420. INTER_TAB_SIZE = 1 << INTER_BITS,
  421. INTER_TAB_SIZE2 = INTER_TAB_SIZE * INTER_TAB_SIZE
  422. };
  423. // C++: enum LineSegmentDetectorModes (cv.LineSegmentDetectorModes)
  424. typedef NS_ENUM(int, LineSegmentDetectorModes) {
  425. LSD_REFINE_NONE = 0,
  426. LSD_REFINE_STD = 1,
  427. LSD_REFINE_ADV = 2
  428. };
  429. // C++: enum LineTypes (cv.LineTypes)
  430. typedef NS_ENUM(int, LineTypes) {
  431. FILLED = -1,
  432. LINE_4 = 4,
  433. LINE_8 = 8,
  434. LINE_AA = 16
  435. };
  436. // C++: enum MarkerTypes (cv.MarkerTypes)
  437. typedef NS_ENUM(int, MarkerTypes) {
  438. MARKER_CROSS = 0,
  439. MARKER_TILTED_CROSS = 1,
  440. MARKER_STAR = 2,
  441. MARKER_DIAMOND = 3,
  442. MARKER_SQUARE = 4,
  443. MARKER_TRIANGLE_UP = 5,
  444. MARKER_TRIANGLE_DOWN = 6
  445. };
  446. // C++: enum MorphShapes (cv.MorphShapes)
  447. typedef NS_ENUM(int, MorphShapes) {
  448. MORPH_RECT = 0,
  449. MORPH_CROSS = 1,
  450. MORPH_ELLIPSE = 2
  451. };
  452. // C++: enum MorphTypes (cv.MorphTypes)
  453. typedef NS_ENUM(int, MorphTypes) {
  454. MORPH_ERODE = 0,
  455. MORPH_DILATE = 1,
  456. MORPH_OPEN = 2,
  457. MORPH_CLOSE = 3,
  458. MORPH_GRADIENT = 4,
  459. MORPH_TOPHAT = 5,
  460. MORPH_BLACKHAT = 6,
  461. MORPH_HITMISS = 7
  462. };
  463. // C++: enum RectanglesIntersectTypes (cv.RectanglesIntersectTypes)
  464. typedef NS_ENUM(int, RectanglesIntersectTypes) {
  465. INTERSECT_NONE = 0,
  466. INTERSECT_PARTIAL = 1,
  467. INTERSECT_FULL = 2
  468. };
  469. // C++: enum RetrievalModes (cv.RetrievalModes)
  470. typedef NS_ENUM(int, RetrievalModes) {
  471. RETR_EXTERNAL = 0,
  472. RETR_LIST = 1,
  473. RETR_CCOMP = 2,
  474. RETR_TREE = 3,
  475. RETR_FLOODFILL = 4
  476. };
  477. // C++: enum ShapeMatchModes (cv.ShapeMatchModes)
  478. typedef NS_ENUM(int, ShapeMatchModes) {
  479. CONTOURS_MATCH_I1 = 1,
  480. CONTOURS_MATCH_I2 = 2,
  481. CONTOURS_MATCH_I3 = 3
  482. };
  483. // C++: enum SpecialFilter (cv.SpecialFilter)
  484. typedef NS_ENUM(int, SpecialFilter) {
  485. FILTER_SCHARR = -1
  486. };
  487. // C++: enum TemplateMatchModes (cv.TemplateMatchModes)
  488. typedef NS_ENUM(int, TemplateMatchModes) {
  489. TM_SQDIFF = 0,
  490. TM_SQDIFF_NORMED = 1,
  491. TM_CCORR = 2,
  492. TM_CCORR_NORMED = 3,
  493. TM_CCOEFF = 4,
  494. TM_CCOEFF_NORMED = 5
  495. };
  496. // C++: enum ThresholdTypes (cv.ThresholdTypes)
  497. typedef NS_ENUM(int, ThresholdTypes) {
  498. THRESH_BINARY = 0,
  499. THRESH_BINARY_INV = 1,
  500. THRESH_TRUNC = 2,
  501. THRESH_TOZERO = 3,
  502. THRESH_TOZERO_INV = 4,
  503. THRESH_MASK = 7,
  504. THRESH_OTSU = 8,
  505. THRESH_TRIANGLE = 16
  506. };
  507. // C++: enum WarpPolarMode (cv.WarpPolarMode)
  508. typedef NS_ENUM(int, WarpPolarMode) {
  509. WARP_POLAR_LINEAR = 0,
  510. WARP_POLAR_LOG = 256
  511. };
  512. NS_ASSUME_NONNULL_BEGIN
  513. // C++: class Imgproc
  514. /**
  515. * The Imgproc module
  516. *
  517. * Member classes: `GeneralizedHough`, `GeneralizedHoughBallard`, `GeneralizedHoughGuil`, `CLAHE`, `Subdiv2D`, `LineSegmentDetector`, `IntelligentScissorsMB`, `Moments`
  518. *
  519. * Member enums: `SpecialFilter`, `MorphTypes`, `MorphShapes`, `InterpolationFlags`, `WarpPolarMode`, `InterpolationMasks`, `DistanceTypes`, `DistanceTransformMasks`, `ThresholdTypes`, `AdaptiveThresholdTypes`, `GrabCutClasses`, `GrabCutModes`, `DistanceTransformLabelTypes`, `FloodFillFlags`, `ConnectedComponentsTypes`, `ConnectedComponentsAlgorithmsTypes`, `RetrievalModes`, `ContourApproximationModes`, `ShapeMatchModes`, `HoughModes`, `LineSegmentDetectorModes`, `HistCompMethods`, `ColorConversionCodes`, `RectanglesIntersectTypes`, `LineTypes`, `HersheyFonts`, `MarkerTypes`, `TemplateMatchModes`, `ColormapTypes`
  520. */
  521. CV_EXPORTS @interface Imgproc : NSObject
  522. #pragma mark - Class Constants
  523. @property (class, readonly) int CV_GAUSSIAN_5x5 NS_SWIFT_NAME(CV_GAUSSIAN_5x5);
  524. @property (class, readonly) int CV_SCHARR NS_SWIFT_NAME(CV_SCHARR);
  525. @property (class, readonly) int CV_MAX_SOBEL_KSIZE NS_SWIFT_NAME(CV_MAX_SOBEL_KSIZE);
  526. @property (class, readonly) int CV_RGBA2mRGBA NS_SWIFT_NAME(CV_RGBA2mRGBA);
  527. @property (class, readonly) int CV_mRGBA2RGBA NS_SWIFT_NAME(CV_mRGBA2RGBA);
  528. @property (class, readonly) int CV_WARP_FILL_OUTLIERS NS_SWIFT_NAME(CV_WARP_FILL_OUTLIERS);
  529. @property (class, readonly) int CV_WARP_INVERSE_MAP NS_SWIFT_NAME(CV_WARP_INVERSE_MAP);
  530. @property (class, readonly) int CV_CHAIN_CODE NS_SWIFT_NAME(CV_CHAIN_CODE);
  531. @property (class, readonly) int CV_LINK_RUNS NS_SWIFT_NAME(CV_LINK_RUNS);
  532. @property (class, readonly) int CV_POLY_APPROX_DP NS_SWIFT_NAME(CV_POLY_APPROX_DP);
  533. @property (class, readonly) int CV_CLOCKWISE NS_SWIFT_NAME(CV_CLOCKWISE);
  534. @property (class, readonly) int CV_COUNTER_CLOCKWISE NS_SWIFT_NAME(CV_COUNTER_CLOCKWISE);
  535. @property (class, readonly) int CV_CANNY_L2_GRADIENT NS_SWIFT_NAME(CV_CANNY_L2_GRADIENT);
  536. #pragma mark - Methods
  537. //
  538. // Ptr_LineSegmentDetector cv::createLineSegmentDetector(int refine = LSD_REFINE_STD, double scale = 0.8, double sigma_scale = 0.6, double quant = 2.0, double ang_th = 22.5, double log_eps = 0, double density_th = 0.7, int n_bins = 1024)
  539. //
  540. /**
  541. * Creates a smart pointer to a LineSegmentDetector object and initializes it.
  542. *
  543. * The LineSegmentDetector algorithm is defined using the standard values. Only advanced users may want
  544. * to edit those, as to tailor it for their own application.
  545. *
  546. * @param refine The way found lines will be refined, see #LineSegmentDetectorModes
  547. * @param scale The scale of the image that will be used to find the lines. Range (0..1].
  548. * @param sigma_scale Sigma for Gaussian filter. It is computed as sigma = sigma_scale/scale.
  549. * @param quant Bound to the quantization error on the gradient norm.
  550. * @param ang_th Gradient angle tolerance in degrees.
  551. * @param log_eps Detection threshold: -log10(NFA) \> log_eps. Used only when advance refinement is chosen.
  552. * @param density_th Minimal density of aligned region points in the enclosing rectangle.
  553. * @param n_bins Number of bins in pseudo-ordering of gradient modulus.
  554. */
  555. + (LineSegmentDetector*)createLineSegmentDetector:(int)refine scale:(double)scale sigma_scale:(double)sigma_scale quant:(double)quant ang_th:(double)ang_th log_eps:(double)log_eps density_th:(double)density_th n_bins:(int)n_bins NS_SWIFT_NAME(createLineSegmentDetector(refine:scale:sigma_scale:quant:ang_th:log_eps:density_th:n_bins:));
  556. /**
  557. * Creates a smart pointer to a LineSegmentDetector object and initializes it.
  558. *
  559. * The LineSegmentDetector algorithm is defined using the standard values. Only advanced users may want
  560. * to edit those, as to tailor it for their own application.
  561. *
  562. * @param refine The way found lines will be refined, see #LineSegmentDetectorModes
  563. * @param scale The scale of the image that will be used to find the lines. Range (0..1].
  564. * @param sigma_scale Sigma for Gaussian filter. It is computed as sigma = sigma_scale/scale.
  565. * @param quant Bound to the quantization error on the gradient norm.
  566. * @param ang_th Gradient angle tolerance in degrees.
  567. * @param log_eps Detection threshold: -log10(NFA) \> log_eps. Used only when advance refinement is chosen.
  568. * @param density_th Minimal density of aligned region points in the enclosing rectangle.
  569. */
  570. + (LineSegmentDetector*)createLineSegmentDetector:(int)refine scale:(double)scale sigma_scale:(double)sigma_scale quant:(double)quant ang_th:(double)ang_th log_eps:(double)log_eps density_th:(double)density_th NS_SWIFT_NAME(createLineSegmentDetector(refine:scale:sigma_scale:quant:ang_th:log_eps:density_th:));
  571. /**
  572. * Creates a smart pointer to a LineSegmentDetector object and initializes it.
  573. *
  574. * The LineSegmentDetector algorithm is defined using the standard values. Only advanced users may want
  575. * to edit those, as to tailor it for their own application.
  576. *
  577. * @param refine The way found lines will be refined, see #LineSegmentDetectorModes
  578. * @param scale The scale of the image that will be used to find the lines. Range (0..1].
  579. * @param sigma_scale Sigma for Gaussian filter. It is computed as sigma = sigma_scale/scale.
  580. * @param quant Bound to the quantization error on the gradient norm.
  581. * @param ang_th Gradient angle tolerance in degrees.
  582. * @param log_eps Detection threshold: -log10(NFA) \> log_eps. Used only when advance refinement is chosen.
  583. */
  584. + (LineSegmentDetector*)createLineSegmentDetector:(int)refine scale:(double)scale sigma_scale:(double)sigma_scale quant:(double)quant ang_th:(double)ang_th log_eps:(double)log_eps NS_SWIFT_NAME(createLineSegmentDetector(refine:scale:sigma_scale:quant:ang_th:log_eps:));
  585. /**
  586. * Creates a smart pointer to a LineSegmentDetector object and initializes it.
  587. *
  588. * The LineSegmentDetector algorithm is defined using the standard values. Only advanced users may want
  589. * to edit those, as to tailor it for their own application.
  590. *
  591. * @param refine The way found lines will be refined, see #LineSegmentDetectorModes
  592. * @param scale The scale of the image that will be used to find the lines. Range (0..1].
  593. * @param sigma_scale Sigma for Gaussian filter. It is computed as sigma = sigma_scale/scale.
  594. * @param quant Bound to the quantization error on the gradient norm.
  595. * @param ang_th Gradient angle tolerance in degrees.
  596. */
  597. + (LineSegmentDetector*)createLineSegmentDetector:(int)refine scale:(double)scale sigma_scale:(double)sigma_scale quant:(double)quant ang_th:(double)ang_th NS_SWIFT_NAME(createLineSegmentDetector(refine:scale:sigma_scale:quant:ang_th:));
  598. /**
  599. * Creates a smart pointer to a LineSegmentDetector object and initializes it.
  600. *
  601. * The LineSegmentDetector algorithm is defined using the standard values. Only advanced users may want
  602. * to edit those, as to tailor it for their own application.
  603. *
  604. * @param refine The way found lines will be refined, see #LineSegmentDetectorModes
  605. * @param scale The scale of the image that will be used to find the lines. Range (0..1].
  606. * @param sigma_scale Sigma for Gaussian filter. It is computed as sigma = sigma_scale/scale.
  607. * @param quant Bound to the quantization error on the gradient norm.
  608. */
  609. + (LineSegmentDetector*)createLineSegmentDetector:(int)refine scale:(double)scale sigma_scale:(double)sigma_scale quant:(double)quant NS_SWIFT_NAME(createLineSegmentDetector(refine:scale:sigma_scale:quant:));
  610. /**
  611. * Creates a smart pointer to a LineSegmentDetector object and initializes it.
  612. *
  613. * The LineSegmentDetector algorithm is defined using the standard values. Only advanced users may want
  614. * to edit those, as to tailor it for their own application.
  615. *
  616. * @param refine The way found lines will be refined, see #LineSegmentDetectorModes
  617. * @param scale The scale of the image that will be used to find the lines. Range (0..1].
  618. * @param sigma_scale Sigma for Gaussian filter. It is computed as sigma = sigma_scale/scale.
  619. */
  620. + (LineSegmentDetector*)createLineSegmentDetector:(int)refine scale:(double)scale sigma_scale:(double)sigma_scale NS_SWIFT_NAME(createLineSegmentDetector(refine:scale:sigma_scale:));
  621. /**
  622. * Creates a smart pointer to a LineSegmentDetector object and initializes it.
  623. *
  624. * The LineSegmentDetector algorithm is defined using the standard values. Only advanced users may want
  625. * to edit those, as to tailor it for their own application.
  626. *
  627. * @param refine The way found lines will be refined, see #LineSegmentDetectorModes
  628. * @param scale The scale of the image that will be used to find the lines. Range (0..1].
  629. */
  630. + (LineSegmentDetector*)createLineSegmentDetector:(int)refine scale:(double)scale NS_SWIFT_NAME(createLineSegmentDetector(refine:scale:));
  631. /**
  632. * Creates a smart pointer to a LineSegmentDetector object and initializes it.
  633. *
  634. * The LineSegmentDetector algorithm is defined using the standard values. Only advanced users may want
  635. * to edit those, as to tailor it for their own application.
  636. *
  637. * @param refine The way found lines will be refined, see #LineSegmentDetectorModes
  638. */
  639. + (LineSegmentDetector*)createLineSegmentDetector:(int)refine NS_SWIFT_NAME(createLineSegmentDetector(refine:));
  640. /**
  641. * Creates a smart pointer to a LineSegmentDetector object and initializes it.
  642. *
  643. * The LineSegmentDetector algorithm is defined using the standard values. Only advanced users may want
  644. * to edit those, as to tailor it for their own application.
  645. *
  646. */
  647. + (LineSegmentDetector*)createLineSegmentDetector NS_SWIFT_NAME(createLineSegmentDetector());
  648. //
  649. // Mat cv::getGaussianKernel(int ksize, double sigma, int ktype = CV_64F)
  650. //
  651. /**
  652. * Returns Gaussian filter coefficients.
  653. *
  654. * The function computes and returns the `$$\texttt{ksize} \times 1$$` matrix of Gaussian filter
  655. * coefficients:
  656. *
  657. * `$$G_i= \alpha *e^{-(i-( \texttt{ksize} -1)/2)^2/(2* \texttt{sigma}^2)},$$`
  658. *
  659. * where `$$i=0..\texttt{ksize}-1$$` and `$$\alpha$$` is the scale factor chosen so that `$$\sum_i G_i=1$$`.
  660. *
  661. * Two of such generated kernels can be passed to sepFilter2D. Those functions automatically recognize
  662. * smoothing kernels (a symmetrical kernel with sum of weights equal to 1) and handle them accordingly.
  663. * You may also use the higher-level GaussianBlur.
  664. * @param ksize Aperture size. It should be odd ( `$$\texttt{ksize} \mod 2 = 1$$` ) and positive.
  665. * @param sigma Gaussian standard deviation. If it is non-positive, it is computed from ksize as
  666. * `sigma = 0.3*((ksize-1)*0.5 - 1) + 0.8`.
  667. * @param ktype Type of filter coefficients. It can be CV_32F or CV_64F .
  668. * @see `+sepFilter2D:dst:ddepth:kernelX:kernelY:anchor:delta:borderType:`, `+getDerivKernels:ky:dx:dy:ksize:normalize:ktype:`, `+getStructuringElement:ksize:anchor:`, `+GaussianBlur:dst:ksize:sigmaX:sigmaY:borderType:`
  669. */
  670. + (Mat*)getGaussianKernel:(int)ksize sigma:(double)sigma ktype:(int)ktype NS_SWIFT_NAME(getGaussianKernel(ksize:sigma:ktype:));
  671. /**
  672. * Returns Gaussian filter coefficients.
  673. *
  674. * The function computes and returns the `$$\texttt{ksize} \times 1$$` matrix of Gaussian filter
  675. * coefficients:
  676. *
  677. * `$$G_i= \alpha *e^{-(i-( \texttt{ksize} -1)/2)^2/(2* \texttt{sigma}^2)},$$`
  678. *
  679. * where `$$i=0..\texttt{ksize}-1$$` and `$$\alpha$$` is the scale factor chosen so that `$$\sum_i G_i=1$$`.
  680. *
  681. * Two of such generated kernels can be passed to sepFilter2D. Those functions automatically recognize
  682. * smoothing kernels (a symmetrical kernel with sum of weights equal to 1) and handle them accordingly.
  683. * You may also use the higher-level GaussianBlur.
  684. * @param ksize Aperture size. It should be odd ( `$$\texttt{ksize} \mod 2 = 1$$` ) and positive.
  685. * @param sigma Gaussian standard deviation. If it is non-positive, it is computed from ksize as
  686. * `sigma = 0.3*((ksize-1)*0.5 - 1) + 0.8`.
  687. * @see `+sepFilter2D:dst:ddepth:kernelX:kernelY:anchor:delta:borderType:`, `+getDerivKernels:ky:dx:dy:ksize:normalize:ktype:`, `+getStructuringElement:ksize:anchor:`, `+GaussianBlur:dst:ksize:sigmaX:sigmaY:borderType:`
  688. */
  689. + (Mat*)getGaussianKernel:(int)ksize sigma:(double)sigma NS_SWIFT_NAME(getGaussianKernel(ksize:sigma:));
  690. //
  691. // void cv::getDerivKernels(Mat& kx, Mat& ky, int dx, int dy, int ksize, bool normalize = false, int ktype = CV_32F)
  692. //
  693. /**
  694. * Returns filter coefficients for computing spatial image derivatives.
  695. *
  696. * The function computes and returns the filter coefficients for spatial image derivatives. When
  697. * `ksize=FILTER_SCHARR`, the Scharr `$$3 \times 3$$` kernels are generated (see #Scharr). Otherwise, Sobel
  698. * kernels are generated (see #Sobel). The filters are normally passed to #sepFilter2D or to
  699. *
  700. * @param kx Output matrix of row filter coefficients. It has the type ktype .
  701. * @param ky Output matrix of column filter coefficients. It has the type ktype .
  702. * @param dx Derivative order in respect of x.
  703. * @param dy Derivative order in respect of y.
  704. * @param ksize Aperture size. It can be FILTER_SCHARR, 1, 3, 5, or 7.
  705. * @param normalize Flag indicating whether to normalize (scale down) the filter coefficients or not.
  706. * Theoretically, the coefficients should have the denominator `$$=2^{ksize*2-dx-dy-2}$$`. If you are
  707. * going to filter floating-point images, you are likely to use the normalized kernels. But if you
  708. * compute derivatives of an 8-bit image, store the results in a 16-bit image, and wish to preserve
  709. * all the fractional bits, you may want to set normalize=false .
  710. * @param ktype Type of filter coefficients. It can be CV_32f or CV_64F .
  711. */
  712. + (void)getDerivKernels:(Mat*)kx ky:(Mat*)ky dx:(int)dx dy:(int)dy ksize:(int)ksize normalize:(BOOL)normalize ktype:(int)ktype NS_SWIFT_NAME(getDerivKernels(kx:ky:dx:dy:ksize:normalize:ktype:));
  713. /**
  714. * Returns filter coefficients for computing spatial image derivatives.
  715. *
  716. * The function computes and returns the filter coefficients for spatial image derivatives. When
  717. * `ksize=FILTER_SCHARR`, the Scharr `$$3 \times 3$$` kernels are generated (see #Scharr). Otherwise, Sobel
  718. * kernels are generated (see #Sobel). The filters are normally passed to #sepFilter2D or to
  719. *
  720. * @param kx Output matrix of row filter coefficients. It has the type ktype .
  721. * @param ky Output matrix of column filter coefficients. It has the type ktype .
  722. * @param dx Derivative order in respect of x.
  723. * @param dy Derivative order in respect of y.
  724. * @param ksize Aperture size. It can be FILTER_SCHARR, 1, 3, 5, or 7.
  725. * @param normalize Flag indicating whether to normalize (scale down) the filter coefficients or not.
  726. * Theoretically, the coefficients should have the denominator `$$=2^{ksize*2-dx-dy-2}$$`. If you are
  727. * going to filter floating-point images, you are likely to use the normalized kernels. But if you
  728. * compute derivatives of an 8-bit image, store the results in a 16-bit image, and wish to preserve
  729. * all the fractional bits, you may want to set normalize=false .
  730. */
  731. + (void)getDerivKernels:(Mat*)kx ky:(Mat*)ky dx:(int)dx dy:(int)dy ksize:(int)ksize normalize:(BOOL)normalize NS_SWIFT_NAME(getDerivKernels(kx:ky:dx:dy:ksize:normalize:));
  732. /**
  733. * Returns filter coefficients for computing spatial image derivatives.
  734. *
  735. * The function computes and returns the filter coefficients for spatial image derivatives. When
  736. * `ksize=FILTER_SCHARR`, the Scharr `$$3 \times 3$$` kernels are generated (see #Scharr). Otherwise, Sobel
  737. * kernels are generated (see #Sobel). The filters are normally passed to #sepFilter2D or to
  738. *
  739. * @param kx Output matrix of row filter coefficients. It has the type ktype .
  740. * @param ky Output matrix of column filter coefficients. It has the type ktype .
  741. * @param dx Derivative order in respect of x.
  742. * @param dy Derivative order in respect of y.
  743. * @param ksize Aperture size. It can be FILTER_SCHARR, 1, 3, 5, or 7.
  744. * Theoretically, the coefficients should have the denominator `$$=2^{ksize*2-dx-dy-2}$$`. If you are
  745. * going to filter floating-point images, you are likely to use the normalized kernels. But if you
  746. * compute derivatives of an 8-bit image, store the results in a 16-bit image, and wish to preserve
  747. * all the fractional bits, you may want to set normalize=false .
  748. */
  749. + (void)getDerivKernels:(Mat*)kx ky:(Mat*)ky dx:(int)dx dy:(int)dy ksize:(int)ksize NS_SWIFT_NAME(getDerivKernels(kx:ky:dx:dy:ksize:));
  750. //
  751. // Mat cv::getGaborKernel(Size ksize, double sigma, double theta, double lambd, double gamma, double psi = CV_PI*0.5, int ktype = CV_64F)
  752. //
  753. /**
  754. * Returns Gabor filter coefficients.
  755. *
  756. * For more details about gabor filter equations and parameters, see: [Gabor
  757. * Filter](http://en.wikipedia.org/wiki/Gabor_filter).
  758. *
  759. * @param ksize Size of the filter returned.
  760. * @param sigma Standard deviation of the gaussian envelope.
  761. * @param theta Orientation of the normal to the parallel stripes of a Gabor function.
  762. * @param lambd Wavelength of the sinusoidal factor.
  763. * @param gamma Spatial aspect ratio.
  764. * @param psi Phase offset.
  765. * @param ktype Type of filter coefficients. It can be CV_32F or CV_64F .
  766. */
  767. + (Mat*)getGaborKernel:(Size2i*)ksize sigma:(double)sigma theta:(double)theta lambd:(double)lambd gamma:(double)gamma psi:(double)psi ktype:(int)ktype NS_SWIFT_NAME(getGaborKernel(ksize:sigma:theta:lambd:gamma:psi:ktype:));
  768. /**
  769. * Returns Gabor filter coefficients.
  770. *
  771. * For more details about gabor filter equations and parameters, see: [Gabor
  772. * Filter](http://en.wikipedia.org/wiki/Gabor_filter).
  773. *
  774. * @param ksize Size of the filter returned.
  775. * @param sigma Standard deviation of the gaussian envelope.
  776. * @param theta Orientation of the normal to the parallel stripes of a Gabor function.
  777. * @param lambd Wavelength of the sinusoidal factor.
  778. * @param gamma Spatial aspect ratio.
  779. * @param psi Phase offset.
  780. */
  781. + (Mat*)getGaborKernel:(Size2i*)ksize sigma:(double)sigma theta:(double)theta lambd:(double)lambd gamma:(double)gamma psi:(double)psi NS_SWIFT_NAME(getGaborKernel(ksize:sigma:theta:lambd:gamma:psi:));
  782. /**
  783. * Returns Gabor filter coefficients.
  784. *
  785. * For more details about gabor filter equations and parameters, see: [Gabor
  786. * Filter](http://en.wikipedia.org/wiki/Gabor_filter).
  787. *
  788. * @param ksize Size of the filter returned.
  789. * @param sigma Standard deviation of the gaussian envelope.
  790. * @param theta Orientation of the normal to the parallel stripes of a Gabor function.
  791. * @param lambd Wavelength of the sinusoidal factor.
  792. * @param gamma Spatial aspect ratio.
  793. */
  794. + (Mat*)getGaborKernel:(Size2i*)ksize sigma:(double)sigma theta:(double)theta lambd:(double)lambd gamma:(double)gamma NS_SWIFT_NAME(getGaborKernel(ksize:sigma:theta:lambd:gamma:));
  795. //
  796. // Mat cv::getStructuringElement(MorphShapes shape, Size ksize, Point anchor = Point(-1,-1))
  797. //
  798. /**
  799. * Returns a structuring element of the specified size and shape for morphological operations.
  800. *
  801. * The function constructs and returns the structuring element that can be further passed to #erode,
  802. * #dilate or #morphologyEx. But you can also construct an arbitrary binary mask yourself and use it as
  803. * the structuring element.
  804. *
  805. * @param shape Element shape that could be one of #MorphShapes
  806. * @param ksize Size of the structuring element.
  807. * @param anchor Anchor position within the element. The default value `$$(-1, -1)$$` means that the
  808. * anchor is at the center. Note that only the shape of a cross-shaped element depends on the anchor
  809. * position. In other cases the anchor just regulates how much the result of the morphological
  810. * operation is shifted.
  811. */
  812. + (Mat*)getStructuringElement:(MorphShapes)shape ksize:(Size2i*)ksize anchor:(Point2i*)anchor NS_SWIFT_NAME(getStructuringElement(shape:ksize:anchor:));
  813. /**
  814. * Returns a structuring element of the specified size and shape for morphological operations.
  815. *
  816. * The function constructs and returns the structuring element that can be further passed to #erode,
  817. * #dilate or #morphologyEx. But you can also construct an arbitrary binary mask yourself and use it as
  818. * the structuring element.
  819. *
  820. * @param shape Element shape that could be one of #MorphShapes
  821. * @param ksize Size of the structuring element.
  822. * anchor is at the center. Note that only the shape of a cross-shaped element depends on the anchor
  823. * position. In other cases the anchor just regulates how much the result of the morphological
  824. * operation is shifted.
  825. */
  826. + (Mat*)getStructuringElement:(MorphShapes)shape ksize:(Size2i*)ksize NS_SWIFT_NAME(getStructuringElement(shape:ksize:));
  827. //
  828. // void cv::medianBlur(Mat src, Mat& dst, int ksize)
  829. //
  830. /**
  831. * Blurs an image using the median filter.
  832. *
  833. * The function smoothes an image using the median filter with the `$$\texttt{ksize} \times
  834. * \texttt{ksize}$$` aperture. Each channel of a multi-channel image is processed independently.
  835. * In-place operation is supported.
  836. *
  837. * NOTE: The median filter uses #BORDER_REPLICATE internally to cope with border pixels, see #BorderTypes
  838. *
  839. * @param src input 1-, 3-, or 4-channel image; when ksize is 3 or 5, the image depth should be
  840. * CV_8U, CV_16U, or CV_32F, for larger aperture sizes, it can only be CV_8U.
  841. * @param dst destination array of the same size and type as src.
  842. * @param ksize aperture linear size; it must be odd and greater than 1, for example: 3, 5, 7 ...
  843. * @see `+bilateralFilter:dst:d:sigmaColor:sigmaSpace:borderType:`, `+blur:dst:ksize:anchor:borderType:`, `+boxFilter:dst:ddepth:ksize:anchor:normalize:borderType:`, `+GaussianBlur:dst:ksize:sigmaX:sigmaY:borderType:`
  844. */
  845. + (void)medianBlur:(Mat*)src dst:(Mat*)dst ksize:(int)ksize NS_SWIFT_NAME(medianBlur(src:dst:ksize:));
  846. //
  847. // void cv::GaussianBlur(Mat src, Mat& dst, Size ksize, double sigmaX, double sigmaY = 0, BorderTypes borderType = BORDER_DEFAULT)
  848. //
  849. /**
  850. * Blurs an image using a Gaussian filter.
  851. *
  852. * The function convolves the source image with the specified Gaussian kernel. In-place filtering is
  853. * supported.
  854. *
  855. * @param src input image; the image can have any number of channels, which are processed
  856. * independently, but the depth should be CV_8U, CV_16U, CV_16S, CV_32F or CV_64F.
  857. * @param dst output image of the same size and type as src.
  858. * @param ksize Gaussian kernel size. ksize.width and ksize.height can differ but they both must be
  859. * positive and odd. Or, they can be zero's and then they are computed from sigma.
  860. * @param sigmaX Gaussian kernel standard deviation in X direction.
  861. * @param sigmaY Gaussian kernel standard deviation in Y direction; if sigmaY is zero, it is set to be
  862. * equal to sigmaX, if both sigmas are zeros, they are computed from ksize.width and ksize.height,
  863. * respectively (see #getGaussianKernel for details); to fully control the result regardless of
  864. * possible future modifications of all this semantics, it is recommended to specify all of ksize,
  865. * sigmaX, and sigmaY.
  866. * @param borderType pixel extrapolation method, see #BorderTypes. #BORDER_WRAP is not supported.
  867. *
  868. * @see `+sepFilter2D:dst:ddepth:kernelX:kernelY:anchor:delta:borderType:`, `+filter2D:dst:ddepth:kernel:anchor:delta:borderType:`, `+blur:dst:ksize:anchor:borderType:`, `+boxFilter:dst:ddepth:ksize:anchor:normalize:borderType:`, `+bilateralFilter:dst:d:sigmaColor:sigmaSpace:borderType:`, `+medianBlur:dst:ksize:`
  869. */
  870. + (void)GaussianBlur:(Mat*)src dst:(Mat*)dst ksize:(Size2i*)ksize sigmaX:(double)sigmaX sigmaY:(double)sigmaY borderType:(BorderTypes)borderType NS_SWIFT_NAME(GaussianBlur(src:dst:ksize:sigmaX:sigmaY:borderType:));
  871. /**
  872. * Blurs an image using a Gaussian filter.
  873. *
  874. * The function convolves the source image with the specified Gaussian kernel. In-place filtering is
  875. * supported.
  876. *
  877. * @param src input image; the image can have any number of channels, which are processed
  878. * independently, but the depth should be CV_8U, CV_16U, CV_16S, CV_32F or CV_64F.
  879. * @param dst output image of the same size and type as src.
  880. * @param ksize Gaussian kernel size. ksize.width and ksize.height can differ but they both must be
  881. * positive and odd. Or, they can be zero's and then they are computed from sigma.
  882. * @param sigmaX Gaussian kernel standard deviation in X direction.
  883. * @param sigmaY Gaussian kernel standard deviation in Y direction; if sigmaY is zero, it is set to be
  884. * equal to sigmaX, if both sigmas are zeros, they are computed from ksize.width and ksize.height,
  885. * respectively (see #getGaussianKernel for details); to fully control the result regardless of
  886. * possible future modifications of all this semantics, it is recommended to specify all of ksize,
  887. * sigmaX, and sigmaY.
  888. *
  889. * @see `+sepFilter2D:dst:ddepth:kernelX:kernelY:anchor:delta:borderType:`, `+filter2D:dst:ddepth:kernel:anchor:delta:borderType:`, `+blur:dst:ksize:anchor:borderType:`, `+boxFilter:dst:ddepth:ksize:anchor:normalize:borderType:`, `+bilateralFilter:dst:d:sigmaColor:sigmaSpace:borderType:`, `+medianBlur:dst:ksize:`
  890. */
  891. + (void)GaussianBlur:(Mat*)src dst:(Mat*)dst ksize:(Size2i*)ksize sigmaX:(double)sigmaX sigmaY:(double)sigmaY NS_SWIFT_NAME(GaussianBlur(src:dst:ksize:sigmaX:sigmaY:));
  892. /**
  893. * Blurs an image using a Gaussian filter.
  894. *
  895. * The function convolves the source image with the specified Gaussian kernel. In-place filtering is
  896. * supported.
  897. *
  898. * @param src input image; the image can have any number of channels, which are processed
  899. * independently, but the depth should be CV_8U, CV_16U, CV_16S, CV_32F or CV_64F.
  900. * @param dst output image of the same size and type as src.
  901. * @param ksize Gaussian kernel size. ksize.width and ksize.height can differ but they both must be
  902. * positive and odd. Or, they can be zero's and then they are computed from sigma.
  903. * @param sigmaX Gaussian kernel standard deviation in X direction.
  904. * equal to sigmaX, if both sigmas are zeros, they are computed from ksize.width and ksize.height,
  905. * respectively (see #getGaussianKernel for details); to fully control the result regardless of
  906. * possible future modifications of all this semantics, it is recommended to specify all of ksize,
  907. * sigmaX, and sigmaY.
  908. *
  909. * @see `+sepFilter2D:dst:ddepth:kernelX:kernelY:anchor:delta:borderType:`, `+filter2D:dst:ddepth:kernel:anchor:delta:borderType:`, `+blur:dst:ksize:anchor:borderType:`, `+boxFilter:dst:ddepth:ksize:anchor:normalize:borderType:`, `+bilateralFilter:dst:d:sigmaColor:sigmaSpace:borderType:`, `+medianBlur:dst:ksize:`
  910. */
  911. + (void)GaussianBlur:(Mat*)src dst:(Mat*)dst ksize:(Size2i*)ksize sigmaX:(double)sigmaX NS_SWIFT_NAME(GaussianBlur(src:dst:ksize:sigmaX:));
  912. //
  913. // void cv::bilateralFilter(Mat src, Mat& dst, int d, double sigmaColor, double sigmaSpace, BorderTypes borderType = BORDER_DEFAULT)
  914. //
  915. /**
  916. * Applies the bilateral filter to an image.
  917. *
  918. * The function applies bilateral filtering to the input image, as described in
  919. * http://www.dai.ed.ac.uk/CVonline/LOCAL_COPIES/MANDUCHI1/Bilateral_Filtering.html
  920. * bilateralFilter can reduce unwanted noise very well while keeping edges fairly sharp. However, it is
  921. * very slow compared to most filters.
  922. *
  923. * _Sigma values_: For simplicity, you can set the 2 sigma values to be the same. If they are small (\<
  924. * 10), the filter will not have much effect, whereas if they are large (\> 150), they will have a very
  925. * strong effect, making the image look "cartoonish".
  926. *
  927. * _Filter size_: Large filters (d \> 5) are very slow, so it is recommended to use d=5 for real-time
  928. * applications, and perhaps d=9 for offline applications that need heavy noise filtering.
  929. *
  930. * This filter does not work inplace.
  931. * @param src Source 8-bit or floating-point, 1-channel or 3-channel image.
  932. * @param dst Destination image of the same size and type as src .
  933. * @param d Diameter of each pixel neighborhood that is used during filtering. If it is non-positive,
  934. * it is computed from sigmaSpace.
  935. * @param sigmaColor Filter sigma in the color space. A larger value of the parameter means that
  936. * farther colors within the pixel neighborhood (see sigmaSpace) will be mixed together, resulting
  937. * in larger areas of semi-equal color.
  938. * @param sigmaSpace Filter sigma in the coordinate space. A larger value of the parameter means that
  939. * farther pixels will influence each other as long as their colors are close enough (see sigmaColor
  940. * ). When d\>0, it specifies the neighborhood size regardless of sigmaSpace. Otherwise, d is
  941. * proportional to sigmaSpace.
  942. * @param borderType border mode used to extrapolate pixels outside of the image, see #BorderTypes
  943. */
  944. + (void)bilateralFilter:(Mat*)src dst:(Mat*)dst d:(int)d sigmaColor:(double)sigmaColor sigmaSpace:(double)sigmaSpace borderType:(BorderTypes)borderType NS_SWIFT_NAME(bilateralFilter(src:dst:d:sigmaColor:sigmaSpace:borderType:));
  945. /**
  946. * Applies the bilateral filter to an image.
  947. *
  948. * The function applies bilateral filtering to the input image, as described in
  949. * http://www.dai.ed.ac.uk/CVonline/LOCAL_COPIES/MANDUCHI1/Bilateral_Filtering.html
  950. * bilateralFilter can reduce unwanted noise very well while keeping edges fairly sharp. However, it is
  951. * very slow compared to most filters.
  952. *
  953. * _Sigma values_: For simplicity, you can set the 2 sigma values to be the same. If they are small (\<
  954. * 10), the filter will not have much effect, whereas if they are large (\> 150), they will have a very
  955. * strong effect, making the image look "cartoonish".
  956. *
  957. * _Filter size_: Large filters (d \> 5) are very slow, so it is recommended to use d=5 for real-time
  958. * applications, and perhaps d=9 for offline applications that need heavy noise filtering.
  959. *
  960. * This filter does not work inplace.
  961. * @param src Source 8-bit or floating-point, 1-channel or 3-channel image.
  962. * @param dst Destination image of the same size and type as src .
  963. * @param d Diameter of each pixel neighborhood that is used during filtering. If it is non-positive,
  964. * it is computed from sigmaSpace.
  965. * @param sigmaColor Filter sigma in the color space. A larger value of the parameter means that
  966. * farther colors within the pixel neighborhood (see sigmaSpace) will be mixed together, resulting
  967. * in larger areas of semi-equal color.
  968. * @param sigmaSpace Filter sigma in the coordinate space. A larger value of the parameter means that
  969. * farther pixels will influence each other as long as their colors are close enough (see sigmaColor
  970. * ). When d\>0, it specifies the neighborhood size regardless of sigmaSpace. Otherwise, d is
  971. * proportional to sigmaSpace.
  972. */
  973. + (void)bilateralFilter:(Mat*)src dst:(Mat*)dst d:(int)d sigmaColor:(double)sigmaColor sigmaSpace:(double)sigmaSpace NS_SWIFT_NAME(bilateralFilter(src:dst:d:sigmaColor:sigmaSpace:));
  974. //
  975. // void cv::boxFilter(Mat src, Mat& dst, int ddepth, Size ksize, Point anchor = Point(-1,-1), bool normalize = true, BorderTypes borderType = BORDER_DEFAULT)
  976. //
  977. /**
  978. * Blurs an image using the box filter.
  979. *
  980. * The function smooths an image using the kernel:
  981. *
  982. * `$$\texttt{K} = \alpha \begin{bmatrix} 1 & 1 & 1 & \cdots & 1 & 1 \\ 1 & 1 & 1 & \cdots & 1 & 1 \\ \hdotsfor{6} \\ 1 & 1 & 1 & \cdots & 1 & 1 \end{bmatrix}$$`
  983. *
  984. * where
  985. *
  986. * `$$\alpha = \begin{cases} \frac{1}{\texttt{ksize.width*ksize.height}} & \texttt{when } \texttt{normalize=true} \\1 & \texttt{otherwise}\end{cases}$$`
  987. *
  988. * Unnormalized box filter is useful for computing various integral characteristics over each pixel
  989. * neighborhood, such as covariance matrices of image derivatives (used in dense optical flow
  990. * algorithms, and so on). If you need to compute pixel sums over variable-size windows, use #integral.
  991. *
  992. * @param src input image.
  993. * @param dst output image of the same size and type as src.
  994. * @param ddepth the output image depth (-1 to use src.depth()).
  995. * @param ksize blurring kernel size.
  996. * @param anchor anchor point; default value Point(-1,-1) means that the anchor is at the kernel
  997. * center.
  998. * @param normalize flag, specifying whether the kernel is normalized by its area or not.
  999. * @param borderType border mode used to extrapolate pixels outside of the image, see #BorderTypes. #BORDER_WRAP is not supported.
  1000. * @see `+blur:dst:ksize:anchor:borderType:`, `+bilateralFilter:dst:d:sigmaColor:sigmaSpace:borderType:`, `+GaussianBlur:dst:ksize:sigmaX:sigmaY:borderType:`, `+medianBlur:dst:ksize:`, `+integral:sum:sdepth:`
  1001. */
  1002. + (void)boxFilter:(Mat*)src dst:(Mat*)dst ddepth:(int)ddepth ksize:(Size2i*)ksize anchor:(Point2i*)anchor normalize:(BOOL)normalize borderType:(BorderTypes)borderType NS_SWIFT_NAME(boxFilter(src:dst:ddepth:ksize:anchor:normalize:borderType:));
  1003. /**
  1004. * Blurs an image using the box filter.
  1005. *
  1006. * The function smooths an image using the kernel:
  1007. *
  1008. * `$$\texttt{K} = \alpha \begin{bmatrix} 1 & 1 & 1 & \cdots & 1 & 1 \\ 1 & 1 & 1 & \cdots & 1 & 1 \\ \hdotsfor{6} \\ 1 & 1 & 1 & \cdots & 1 & 1 \end{bmatrix}$$`
  1009. *
  1010. * where
  1011. *
  1012. * `$$\alpha = \begin{cases} \frac{1}{\texttt{ksize.width*ksize.height}} & \texttt{when } \texttt{normalize=true} \\1 & \texttt{otherwise}\end{cases}$$`
  1013. *
  1014. * Unnormalized box filter is useful for computing various integral characteristics over each pixel
  1015. * neighborhood, such as covariance matrices of image derivatives (used in dense optical flow
  1016. * algorithms, and so on). If you need to compute pixel sums over variable-size windows, use #integral.
  1017. *
  1018. * @param src input image.
  1019. * @param dst output image of the same size and type as src.
  1020. * @param ddepth the output image depth (-1 to use src.depth()).
  1021. * @param ksize blurring kernel size.
  1022. * @param anchor anchor point; default value Point(-1,-1) means that the anchor is at the kernel
  1023. * center.
  1024. * @param normalize flag, specifying whether the kernel is normalized by its area or not.
  1025. * @see `+blur:dst:ksize:anchor:borderType:`, `+bilateralFilter:dst:d:sigmaColor:sigmaSpace:borderType:`, `+GaussianBlur:dst:ksize:sigmaX:sigmaY:borderType:`, `+medianBlur:dst:ksize:`, `+integral:sum:sdepth:`
  1026. */
  1027. + (void)boxFilter:(Mat*)src dst:(Mat*)dst ddepth:(int)ddepth ksize:(Size2i*)ksize anchor:(Point2i*)anchor normalize:(BOOL)normalize NS_SWIFT_NAME(boxFilter(src:dst:ddepth:ksize:anchor:normalize:));
  1028. /**
  1029. * Blurs an image using the box filter.
  1030. *
  1031. * The function smooths an image using the kernel:
  1032. *
  1033. * `$$\texttt{K} = \alpha \begin{bmatrix} 1 & 1 & 1 & \cdots & 1 & 1 \\ 1 & 1 & 1 & \cdots & 1 & 1 \\ \hdotsfor{6} \\ 1 & 1 & 1 & \cdots & 1 & 1 \end{bmatrix}$$`
  1034. *
  1035. * where
  1036. *
  1037. * `$$\alpha = \begin{cases} \frac{1}{\texttt{ksize.width*ksize.height}} & \texttt{when } \texttt{normalize=true} \\1 & \texttt{otherwise}\end{cases}$$`
  1038. *
  1039. * Unnormalized box filter is useful for computing various integral characteristics over each pixel
  1040. * neighborhood, such as covariance matrices of image derivatives (used in dense optical flow
  1041. * algorithms, and so on). If you need to compute pixel sums over variable-size windows, use #integral.
  1042. *
  1043. * @param src input image.
  1044. * @param dst output image of the same size and type as src.
  1045. * @param ddepth the output image depth (-1 to use src.depth()).
  1046. * @param ksize blurring kernel size.
  1047. * @param anchor anchor point; default value Point(-1,-1) means that the anchor is at the kernel
  1048. * center.
  1049. * @see `+blur:dst:ksize:anchor:borderType:`, `+bilateralFilter:dst:d:sigmaColor:sigmaSpace:borderType:`, `+GaussianBlur:dst:ksize:sigmaX:sigmaY:borderType:`, `+medianBlur:dst:ksize:`, `+integral:sum:sdepth:`
  1050. */
  1051. + (void)boxFilter:(Mat*)src dst:(Mat*)dst ddepth:(int)ddepth ksize:(Size2i*)ksize anchor:(Point2i*)anchor NS_SWIFT_NAME(boxFilter(src:dst:ddepth:ksize:anchor:));
  1052. /**
  1053. * Blurs an image using the box filter.
  1054. *
  1055. * The function smooths an image using the kernel:
  1056. *
  1057. * `$$\texttt{K} = \alpha \begin{bmatrix} 1 & 1 & 1 & \cdots & 1 & 1 \\ 1 & 1 & 1 & \cdots & 1 & 1 \\ \hdotsfor{6} \\ 1 & 1 & 1 & \cdots & 1 & 1 \end{bmatrix}$$`
  1058. *
  1059. * where
  1060. *
  1061. * `$$\alpha = \begin{cases} \frac{1}{\texttt{ksize.width*ksize.height}} & \texttt{when } \texttt{normalize=true} \\1 & \texttt{otherwise}\end{cases}$$`
  1062. *
  1063. * Unnormalized box filter is useful for computing various integral characteristics over each pixel
  1064. * neighborhood, such as covariance matrices of image derivatives (used in dense optical flow
  1065. * algorithms, and so on). If you need to compute pixel sums over variable-size windows, use #integral.
  1066. *
  1067. * @param src input image.
  1068. * @param dst output image of the same size and type as src.
  1069. * @param ddepth the output image depth (-1 to use src.depth()).
  1070. * @param ksize blurring kernel size.
  1071. * center.
  1072. * @see `+blur:dst:ksize:anchor:borderType:`, `+bilateralFilter:dst:d:sigmaColor:sigmaSpace:borderType:`, `+GaussianBlur:dst:ksize:sigmaX:sigmaY:borderType:`, `+medianBlur:dst:ksize:`, `+integral:sum:sdepth:`
  1073. */
  1074. + (void)boxFilter:(Mat*)src dst:(Mat*)dst ddepth:(int)ddepth ksize:(Size2i*)ksize NS_SWIFT_NAME(boxFilter(src:dst:ddepth:ksize:));
  1075. //
  1076. // void cv::sqrBoxFilter(Mat src, Mat& dst, int ddepth, Size ksize, Point anchor = Point(-1, -1), bool normalize = true, BorderTypes borderType = BORDER_DEFAULT)
  1077. //
  1078. /**
  1079. * Calculates the normalized sum of squares of the pixel values overlapping the filter.
  1080. *
  1081. * For every pixel `$$ (x, y) $$` in the source image, the function calculates the sum of squares of those neighboring
  1082. * pixel values which overlap the filter placed over the pixel `$$ (x, y) $$`.
  1083. *
  1084. * The unnormalized square box filter can be useful in computing local image statistics such as the local
  1085. * variance and standard deviation around the neighborhood of a pixel.
  1086. *
  1087. * @param src input image
  1088. * @param dst output image of the same size and type as src
  1089. * @param ddepth the output image depth (-1 to use src.depth())
  1090. * @param ksize kernel size
  1091. * @param anchor kernel anchor point. The default value of Point(-1, -1) denotes that the anchor is at the kernel
  1092. * center.
  1093. * @param normalize flag, specifying whether the kernel is to be normalized by it's area or not.
  1094. * @param borderType border mode used to extrapolate pixels outside of the image, see #BorderTypes. #BORDER_WRAP is not supported.
  1095. * @see `+boxFilter:dst:ddepth:ksize:anchor:normalize:borderType:`
  1096. */
  1097. + (void)sqrBoxFilter:(Mat*)src dst:(Mat*)dst ddepth:(int)ddepth ksize:(Size2i*)ksize anchor:(Point2i*)anchor normalize:(BOOL)normalize borderType:(BorderTypes)borderType NS_SWIFT_NAME(sqrBoxFilter(src:dst:ddepth:ksize:anchor:normalize:borderType:));
  1098. /**
  1099. * Calculates the normalized sum of squares of the pixel values overlapping the filter.
  1100. *
  1101. * For every pixel `$$ (x, y) $$` in the source image, the function calculates the sum of squares of those neighboring
  1102. * pixel values which overlap the filter placed over the pixel `$$ (x, y) $$`.
  1103. *
  1104. * The unnormalized square box filter can be useful in computing local image statistics such as the local
  1105. * variance and standard deviation around the neighborhood of a pixel.
  1106. *
  1107. * @param src input image
  1108. * @param dst output image of the same size and type as src
  1109. * @param ddepth the output image depth (-1 to use src.depth())
  1110. * @param ksize kernel size
  1111. * @param anchor kernel anchor point. The default value of Point(-1, -1) denotes that the anchor is at the kernel
  1112. * center.
  1113. * @param normalize flag, specifying whether the kernel is to be normalized by it's area or not.
  1114. * @see `+boxFilter:dst:ddepth:ksize:anchor:normalize:borderType:`
  1115. */
  1116. + (void)sqrBoxFilter:(Mat*)src dst:(Mat*)dst ddepth:(int)ddepth ksize:(Size2i*)ksize anchor:(Point2i*)anchor normalize:(BOOL)normalize NS_SWIFT_NAME(sqrBoxFilter(src:dst:ddepth:ksize:anchor:normalize:));
  1117. /**
  1118. * Calculates the normalized sum of squares of the pixel values overlapping the filter.
  1119. *
  1120. * For every pixel `$$ (x, y) $$` in the source image, the function calculates the sum of squares of those neighboring
  1121. * pixel values which overlap the filter placed over the pixel `$$ (x, y) $$`.
  1122. *
  1123. * The unnormalized square box filter can be useful in computing local image statistics such as the local
  1124. * variance and standard deviation around the neighborhood of a pixel.
  1125. *
  1126. * @param src input image
  1127. * @param dst output image of the same size and type as src
  1128. * @param ddepth the output image depth (-1 to use src.depth())
  1129. * @param ksize kernel size
  1130. * @param anchor kernel anchor point. The default value of Point(-1, -1) denotes that the anchor is at the kernel
  1131. * center.
  1132. * @see `+boxFilter:dst:ddepth:ksize:anchor:normalize:borderType:`
  1133. */
  1134. + (void)sqrBoxFilter:(Mat*)src dst:(Mat*)dst ddepth:(int)ddepth ksize:(Size2i*)ksize anchor:(Point2i*)anchor NS_SWIFT_NAME(sqrBoxFilter(src:dst:ddepth:ksize:anchor:));
  1135. /**
  1136. * Calculates the normalized sum of squares of the pixel values overlapping the filter.
  1137. *
  1138. * For every pixel `$$ (x, y) $$` in the source image, the function calculates the sum of squares of those neighboring
  1139. * pixel values which overlap the filter placed over the pixel `$$ (x, y) $$`.
  1140. *
  1141. * The unnormalized square box filter can be useful in computing local image statistics such as the local
  1142. * variance and standard deviation around the neighborhood of a pixel.
  1143. *
  1144. * @param src input image
  1145. * @param dst output image of the same size and type as src
  1146. * @param ddepth the output image depth (-1 to use src.depth())
  1147. * @param ksize kernel size
  1148. * center.
  1149. * @see `+boxFilter:dst:ddepth:ksize:anchor:normalize:borderType:`
  1150. */
  1151. + (void)sqrBoxFilter:(Mat*)src dst:(Mat*)dst ddepth:(int)ddepth ksize:(Size2i*)ksize NS_SWIFT_NAME(sqrBoxFilter(src:dst:ddepth:ksize:));
  1152. //
  1153. // void cv::blur(Mat src, Mat& dst, Size ksize, Point anchor = Point(-1,-1), BorderTypes borderType = BORDER_DEFAULT)
  1154. //
  1155. /**
  1156. * Blurs an image using the normalized box filter.
  1157. *
  1158. * The function smooths an image using the kernel:
  1159. *
  1160. * `$$\texttt{K} = \frac{1}{\texttt{ksize.width*ksize.height}} \begin{bmatrix} 1 & 1 & 1 & \cdots & 1 & 1 \\ 1 & 1 & 1 & \cdots & 1 & 1 \\ \hdotsfor{6} \\ 1 & 1 & 1 & \cdots & 1 & 1 \\ \end{bmatrix}$$`
  1161. *
  1162. * The call `blur(src, dst, ksize, anchor, borderType)` is equivalent to `boxFilter(src, dst, src.type(), ksize,
  1163. * anchor, true, borderType)`.
  1164. *
  1165. * @param src input image; it can have any number of channels, which are processed independently, but
  1166. * the depth should be CV_8U, CV_16U, CV_16S, CV_32F or CV_64F.
  1167. * @param dst output image of the same size and type as src.
  1168. * @param ksize blurring kernel size.
  1169. * @param anchor anchor point; default value Point(-1,-1) means that the anchor is at the kernel
  1170. * center.
  1171. * @param borderType border mode used to extrapolate pixels outside of the image, see #BorderTypes. #BORDER_WRAP is not supported.
  1172. * @see `+boxFilter:dst:ddepth:ksize:anchor:normalize:borderType:`, `+bilateralFilter:dst:d:sigmaColor:sigmaSpace:borderType:`, `+GaussianBlur:dst:ksize:sigmaX:sigmaY:borderType:`, `+medianBlur:dst:ksize:`
  1173. */
  1174. + (void)blur:(Mat*)src dst:(Mat*)dst ksize:(Size2i*)ksize anchor:(Point2i*)anchor borderType:(BorderTypes)borderType NS_SWIFT_NAME(blur(src:dst:ksize:anchor:borderType:));
  1175. /**
  1176. * Blurs an image using the normalized box filter.
  1177. *
  1178. * The function smooths an image using the kernel:
  1179. *
  1180. * `$$\texttt{K} = \frac{1}{\texttt{ksize.width*ksize.height}} \begin{bmatrix} 1 & 1 & 1 & \cdots & 1 & 1 \\ 1 & 1 & 1 & \cdots & 1 & 1 \\ \hdotsfor{6} \\ 1 & 1 & 1 & \cdots & 1 & 1 \\ \end{bmatrix}$$`
  1181. *
  1182. * The call `blur(src, dst, ksize, anchor, borderType)` is equivalent to `boxFilter(src, dst, src.type(), ksize,
  1183. * anchor, true, borderType)`.
  1184. *
  1185. * @param src input image; it can have any number of channels, which are processed independently, but
  1186. * the depth should be CV_8U, CV_16U, CV_16S, CV_32F or CV_64F.
  1187. * @param dst output image of the same size and type as src.
  1188. * @param ksize blurring kernel size.
  1189. * @param anchor anchor point; default value Point(-1,-1) means that the anchor is at the kernel
  1190. * center.
  1191. * @see `+boxFilter:dst:ddepth:ksize:anchor:normalize:borderType:`, `+bilateralFilter:dst:d:sigmaColor:sigmaSpace:borderType:`, `+GaussianBlur:dst:ksize:sigmaX:sigmaY:borderType:`, `+medianBlur:dst:ksize:`
  1192. */
  1193. + (void)blur:(Mat*)src dst:(Mat*)dst ksize:(Size2i*)ksize anchor:(Point2i*)anchor NS_SWIFT_NAME(blur(src:dst:ksize:anchor:));
  1194. /**
  1195. * Blurs an image using the normalized box filter.
  1196. *
  1197. * The function smooths an image using the kernel:
  1198. *
  1199. * `$$\texttt{K} = \frac{1}{\texttt{ksize.width*ksize.height}} \begin{bmatrix} 1 & 1 & 1 & \cdots & 1 & 1 \\ 1 & 1 & 1 & \cdots & 1 & 1 \\ \hdotsfor{6} \\ 1 & 1 & 1 & \cdots & 1 & 1 \\ \end{bmatrix}$$`
  1200. *
  1201. * The call `blur(src, dst, ksize, anchor, borderType)` is equivalent to `boxFilter(src, dst, src.type(), ksize,
  1202. * anchor, true, borderType)`.
  1203. *
  1204. * @param src input image; it can have any number of channels, which are processed independently, but
  1205. * the depth should be CV_8U, CV_16U, CV_16S, CV_32F or CV_64F.
  1206. * @param dst output image of the same size and type as src.
  1207. * @param ksize blurring kernel size.
  1208. * center.
  1209. * @see `+boxFilter:dst:ddepth:ksize:anchor:normalize:borderType:`, `+bilateralFilter:dst:d:sigmaColor:sigmaSpace:borderType:`, `+GaussianBlur:dst:ksize:sigmaX:sigmaY:borderType:`, `+medianBlur:dst:ksize:`
  1210. */
  1211. + (void)blur:(Mat*)src dst:(Mat*)dst ksize:(Size2i*)ksize NS_SWIFT_NAME(blur(src:dst:ksize:));
  1212. //
  1213. // void cv::stackBlur(Mat src, Mat& dst, Size ksize)
  1214. //
  1215. /**
  1216. * Blurs an image using the stackBlur.
  1217. *
  1218. * The function applies and stackBlur to an image.
  1219. * stackBlur can generate similar results as Gaussian blur, and the time consumption does not increase with the increase of kernel size.
  1220. * It creates a kind of moving stack of colors whilst scanning through the image. Thereby it just has to add one new block of color to the right side
  1221. * of the stack and remove the leftmost color. The remaining colors on the topmost layer of the stack are either added on or reduced by one,
  1222. * depending on if they are on the right or on the left side of the stack. The only supported borderType is BORDER_REPLICATE.
  1223. * Original paper was proposed by Mario Klingemann, which can be found http://underdestruction.com/2004/02/25/stackblur-2004.
  1224. *
  1225. * @param src input image. The number of channels can be arbitrary, but the depth should be one of
  1226. * CV_8U, CV_16U, CV_16S or CV_32F.
  1227. * @param dst output image of the same size and type as src.
  1228. * @param ksize stack-blurring kernel size. The ksize.width and ksize.height can differ but they both must be
  1229. * positive and odd.
  1230. */
  1231. + (void)stackBlur:(Mat*)src dst:(Mat*)dst ksize:(Size2i*)ksize NS_SWIFT_NAME(stackBlur(src:dst:ksize:));
  1232. //
  1233. // void cv::filter2D(Mat src, Mat& dst, int ddepth, Mat kernel, Point anchor = Point(-1,-1), double delta = 0, BorderTypes borderType = BORDER_DEFAULT)
  1234. //
  1235. /**
  1236. * Convolves an image with the kernel.
  1237. *
  1238. * The function applies an arbitrary linear filter to an image. In-place operation is supported. When
  1239. * the aperture is partially outside the image, the function interpolates outlier pixel values
  1240. * according to the specified border mode.
  1241. *
  1242. * The function does actually compute correlation, not the convolution:
  1243. *
  1244. * `$$\texttt{dst} (x,y) = \sum _{ \substack{0\leq x' < \texttt{kernel.cols}\\{0\leq y' < \texttt{kernel.rows}}}} \texttt{kernel} (x',y')* \texttt{src} (x+x'- \texttt{anchor.x} ,y+y'- \texttt{anchor.y} )$$`
  1245. *
  1246. * That is, the kernel is not mirrored around the anchor point. If you need a real convolution, flip
  1247. * the kernel using #flip and set the new anchor to `(kernel.cols - anchor.x - 1, kernel.rows -
  1248. * anchor.y - 1)`.
  1249. *
  1250. * The function uses the DFT-based algorithm in case of sufficiently large kernels (~`11 x 11` or
  1251. * larger) and the direct algorithm for small kernels.
  1252. *
  1253. * @param src input image.
  1254. * @param dst output image of the same size and the same number of channels as src.
  1255. * @param ddepth desired depth of the destination image, see REF: filter_depths "combinations"
  1256. * @param kernel convolution kernel (or rather a correlation kernel), a single-channel floating point
  1257. * matrix; if you want to apply different kernels to different channels, split the image into
  1258. * separate color planes using split and process them individually.
  1259. * @param anchor anchor of the kernel that indicates the relative position of a filtered point within
  1260. * the kernel; the anchor should lie within the kernel; default value (-1,-1) means that the anchor
  1261. * is at the kernel center.
  1262. * @param delta optional value added to the filtered pixels before storing them in dst.
  1263. * @param borderType pixel extrapolation method, see #BorderTypes. #BORDER_WRAP is not supported.
  1264. * @see `+sepFilter2D:dst:ddepth:kernelX:kernelY:anchor:delta:borderType:`, `dft`, `+matchTemplate:templ:result:method:mask:`
  1265. */
  1266. + (void)filter2D:(Mat*)src dst:(Mat*)dst ddepth:(int)ddepth kernel:(Mat*)kernel anchor:(Point2i*)anchor delta:(double)delta borderType:(BorderTypes)borderType NS_SWIFT_NAME(filter2D(src:dst:ddepth:kernel:anchor:delta:borderType:));
  1267. /**
  1268. * Convolves an image with the kernel.
  1269. *
  1270. * The function applies an arbitrary linear filter to an image. In-place operation is supported. When
  1271. * the aperture is partially outside the image, the function interpolates outlier pixel values
  1272. * according to the specified border mode.
  1273. *
  1274. * The function does actually compute correlation, not the convolution:
  1275. *
  1276. * `$$\texttt{dst} (x,y) = \sum _{ \substack{0\leq x' < \texttt{kernel.cols}\\{0\leq y' < \texttt{kernel.rows}}}} \texttt{kernel} (x',y')* \texttt{src} (x+x'- \texttt{anchor.x} ,y+y'- \texttt{anchor.y} )$$`
  1277. *
  1278. * That is, the kernel is not mirrored around the anchor point. If you need a real convolution, flip
  1279. * the kernel using #flip and set the new anchor to `(kernel.cols - anchor.x - 1, kernel.rows -
  1280. * anchor.y - 1)`.
  1281. *
  1282. * The function uses the DFT-based algorithm in case of sufficiently large kernels (~`11 x 11` or
  1283. * larger) and the direct algorithm for small kernels.
  1284. *
  1285. * @param src input image.
  1286. * @param dst output image of the same size and the same number of channels as src.
  1287. * @param ddepth desired depth of the destination image, see REF: filter_depths "combinations"
  1288. * @param kernel convolution kernel (or rather a correlation kernel), a single-channel floating point
  1289. * matrix; if you want to apply different kernels to different channels, split the image into
  1290. * separate color planes using split and process them individually.
  1291. * @param anchor anchor of the kernel that indicates the relative position of a filtered point within
  1292. * the kernel; the anchor should lie within the kernel; default value (-1,-1) means that the anchor
  1293. * is at the kernel center.
  1294. * @param delta optional value added to the filtered pixels before storing them in dst.
  1295. * @see `+sepFilter2D:dst:ddepth:kernelX:kernelY:anchor:delta:borderType:`, `dft`, `+matchTemplate:templ:result:method:mask:`
  1296. */
  1297. + (void)filter2D:(Mat*)src dst:(Mat*)dst ddepth:(int)ddepth kernel:(Mat*)kernel anchor:(Point2i*)anchor delta:(double)delta NS_SWIFT_NAME(filter2D(src:dst:ddepth:kernel:anchor:delta:));
  1298. /**
  1299. * Convolves an image with the kernel.
  1300. *
  1301. * The function applies an arbitrary linear filter to an image. In-place operation is supported. When
  1302. * the aperture is partially outside the image, the function interpolates outlier pixel values
  1303. * according to the specified border mode.
  1304. *
  1305. * The function does actually compute correlation, not the convolution:
  1306. *
  1307. * `$$\texttt{dst} (x,y) = \sum _{ \substack{0\leq x' < \texttt{kernel.cols}\\{0\leq y' < \texttt{kernel.rows}}}} \texttt{kernel} (x',y')* \texttt{src} (x+x'- \texttt{anchor.x} ,y+y'- \texttt{anchor.y} )$$`
  1308. *
  1309. * That is, the kernel is not mirrored around the anchor point. If you need a real convolution, flip
  1310. * the kernel using #flip and set the new anchor to `(kernel.cols - anchor.x - 1, kernel.rows -
  1311. * anchor.y - 1)`.
  1312. *
  1313. * The function uses the DFT-based algorithm in case of sufficiently large kernels (~`11 x 11` or
  1314. * larger) and the direct algorithm for small kernels.
  1315. *
  1316. * @param src input image.
  1317. * @param dst output image of the same size and the same number of channels as src.
  1318. * @param ddepth desired depth of the destination image, see REF: filter_depths "combinations"
  1319. * @param kernel convolution kernel (or rather a correlation kernel), a single-channel floating point
  1320. * matrix; if you want to apply different kernels to different channels, split the image into
  1321. * separate color planes using split and process them individually.
  1322. * @param anchor anchor of the kernel that indicates the relative position of a filtered point within
  1323. * the kernel; the anchor should lie within the kernel; default value (-1,-1) means that the anchor
  1324. * is at the kernel center.
  1325. * @see `+sepFilter2D:dst:ddepth:kernelX:kernelY:anchor:delta:borderType:`, `dft`, `+matchTemplate:templ:result:method:mask:`
  1326. */
  1327. + (void)filter2D:(Mat*)src dst:(Mat*)dst ddepth:(int)ddepth kernel:(Mat*)kernel anchor:(Point2i*)anchor NS_SWIFT_NAME(filter2D(src:dst:ddepth:kernel:anchor:));
  1328. /**
  1329. * Convolves an image with the kernel.
  1330. *
  1331. * The function applies an arbitrary linear filter to an image. In-place operation is supported. When
  1332. * the aperture is partially outside the image, the function interpolates outlier pixel values
  1333. * according to the specified border mode.
  1334. *
  1335. * The function does actually compute correlation, not the convolution:
  1336. *
  1337. * `$$\texttt{dst} (x,y) = \sum _{ \substack{0\leq x' < \texttt{kernel.cols}\\{0\leq y' < \texttt{kernel.rows}}}} \texttt{kernel} (x',y')* \texttt{src} (x+x'- \texttt{anchor.x} ,y+y'- \texttt{anchor.y} )$$`
  1338. *
  1339. * That is, the kernel is not mirrored around the anchor point. If you need a real convolution, flip
  1340. * the kernel using #flip and set the new anchor to `(kernel.cols - anchor.x - 1, kernel.rows -
  1341. * anchor.y - 1)`.
  1342. *
  1343. * The function uses the DFT-based algorithm in case of sufficiently large kernels (~`11 x 11` or
  1344. * larger) and the direct algorithm for small kernels.
  1345. *
  1346. * @param src input image.
  1347. * @param dst output image of the same size and the same number of channels as src.
  1348. * @param ddepth desired depth of the destination image, see REF: filter_depths "combinations"
  1349. * @param kernel convolution kernel (or rather a correlation kernel), a single-channel floating point
  1350. * matrix; if you want to apply different kernels to different channels, split the image into
  1351. * separate color planes using split and process them individually.
  1352. * the kernel; the anchor should lie within the kernel; default value (-1,-1) means that the anchor
  1353. * is at the kernel center.
  1354. * @see `+sepFilter2D:dst:ddepth:kernelX:kernelY:anchor:delta:borderType:`, `dft`, `+matchTemplate:templ:result:method:mask:`
  1355. */
  1356. + (void)filter2D:(Mat*)src dst:(Mat*)dst ddepth:(int)ddepth kernel:(Mat*)kernel NS_SWIFT_NAME(filter2D(src:dst:ddepth:kernel:));
  1357. //
  1358. // void cv::sepFilter2D(Mat src, Mat& dst, int ddepth, Mat kernelX, Mat kernelY, Point anchor = Point(-1,-1), double delta = 0, BorderTypes borderType = BORDER_DEFAULT)
  1359. //
  1360. /**
  1361. * Applies a separable linear filter to an image.
  1362. *
  1363. * The function applies a separable linear filter to the image. That is, first, every row of src is
  1364. * filtered with the 1D kernel kernelX. Then, every column of the result is filtered with the 1D
  1365. * kernel kernelY. The final result shifted by delta is stored in dst .
  1366. *
  1367. * @param src Source image.
  1368. * @param dst Destination image of the same size and the same number of channels as src .
  1369. * @param ddepth Destination image depth, see REF: filter_depths "combinations"
  1370. * @param kernelX Coefficients for filtering each row.
  1371. * @param kernelY Coefficients for filtering each column.
  1372. * @param anchor Anchor position within the kernel. The default value `$$(-1,-1)$$` means that the anchor
  1373. * is at the kernel center.
  1374. * @param delta Value added to the filtered results before storing them.
  1375. * @param borderType Pixel extrapolation method, see #BorderTypes. #BORDER_WRAP is not supported.
  1376. * @see `+filter2D:dst:ddepth:kernel:anchor:delta:borderType:`, `+Sobel:dst:ddepth:dx:dy:ksize:scale:delta:borderType:`, `+GaussianBlur:dst:ksize:sigmaX:sigmaY:borderType:`, `+boxFilter:dst:ddepth:ksize:anchor:normalize:borderType:`, `+blur:dst:ksize:anchor:borderType:`
  1377. */
  1378. + (void)sepFilter2D:(Mat*)src dst:(Mat*)dst ddepth:(int)ddepth kernelX:(Mat*)kernelX kernelY:(Mat*)kernelY anchor:(Point2i*)anchor delta:(double)delta borderType:(BorderTypes)borderType NS_SWIFT_NAME(sepFilter2D(src:dst:ddepth:kernelX:kernelY:anchor:delta:borderType:));
  1379. /**
  1380. * Applies a separable linear filter to an image.
  1381. *
  1382. * The function applies a separable linear filter to the image. That is, first, every row of src is
  1383. * filtered with the 1D kernel kernelX. Then, every column of the result is filtered with the 1D
  1384. * kernel kernelY. The final result shifted by delta is stored in dst .
  1385. *
  1386. * @param src Source image.
  1387. * @param dst Destination image of the same size and the same number of channels as src .
  1388. * @param ddepth Destination image depth, see REF: filter_depths "combinations"
  1389. * @param kernelX Coefficients for filtering each row.
  1390. * @param kernelY Coefficients for filtering each column.
  1391. * @param anchor Anchor position within the kernel. The default value `$$(-1,-1)$$` means that the anchor
  1392. * is at the kernel center.
  1393. * @param delta Value added to the filtered results before storing them.
  1394. * @see `+filter2D:dst:ddepth:kernel:anchor:delta:borderType:`, `+Sobel:dst:ddepth:dx:dy:ksize:scale:delta:borderType:`, `+GaussianBlur:dst:ksize:sigmaX:sigmaY:borderType:`, `+boxFilter:dst:ddepth:ksize:anchor:normalize:borderType:`, `+blur:dst:ksize:anchor:borderType:`
  1395. */
  1396. + (void)sepFilter2D:(Mat*)src dst:(Mat*)dst ddepth:(int)ddepth kernelX:(Mat*)kernelX kernelY:(Mat*)kernelY anchor:(Point2i*)anchor delta:(double)delta NS_SWIFT_NAME(sepFilter2D(src:dst:ddepth:kernelX:kernelY:anchor:delta:));
  1397. /**
  1398. * Applies a separable linear filter to an image.
  1399. *
  1400. * The function applies a separable linear filter to the image. That is, first, every row of src is
  1401. * filtered with the 1D kernel kernelX. Then, every column of the result is filtered with the 1D
  1402. * kernel kernelY. The final result shifted by delta is stored in dst .
  1403. *
  1404. * @param src Source image.
  1405. * @param dst Destination image of the same size and the same number of channels as src .
  1406. * @param ddepth Destination image depth, see REF: filter_depths "combinations"
  1407. * @param kernelX Coefficients for filtering each row.
  1408. * @param kernelY Coefficients for filtering each column.
  1409. * @param anchor Anchor position within the kernel. The default value `$$(-1,-1)$$` means that the anchor
  1410. * is at the kernel center.
  1411. * @see `+filter2D:dst:ddepth:kernel:anchor:delta:borderType:`, `+Sobel:dst:ddepth:dx:dy:ksize:scale:delta:borderType:`, `+GaussianBlur:dst:ksize:sigmaX:sigmaY:borderType:`, `+boxFilter:dst:ddepth:ksize:anchor:normalize:borderType:`, `+blur:dst:ksize:anchor:borderType:`
  1412. */
  1413. + (void)sepFilter2D:(Mat*)src dst:(Mat*)dst ddepth:(int)ddepth kernelX:(Mat*)kernelX kernelY:(Mat*)kernelY anchor:(Point2i*)anchor NS_SWIFT_NAME(sepFilter2D(src:dst:ddepth:kernelX:kernelY:anchor:));
  1414. /**
  1415. * Applies a separable linear filter to an image.
  1416. *
  1417. * The function applies a separable linear filter to the image. That is, first, every row of src is
  1418. * filtered with the 1D kernel kernelX. Then, every column of the result is filtered with the 1D
  1419. * kernel kernelY. The final result shifted by delta is stored in dst .
  1420. *
  1421. * @param src Source image.
  1422. * @param dst Destination image of the same size and the same number of channels as src .
  1423. * @param ddepth Destination image depth, see REF: filter_depths "combinations"
  1424. * @param kernelX Coefficients for filtering each row.
  1425. * @param kernelY Coefficients for filtering each column.
  1426. * is at the kernel center.
  1427. * @see `+filter2D:dst:ddepth:kernel:anchor:delta:borderType:`, `+Sobel:dst:ddepth:dx:dy:ksize:scale:delta:borderType:`, `+GaussianBlur:dst:ksize:sigmaX:sigmaY:borderType:`, `+boxFilter:dst:ddepth:ksize:anchor:normalize:borderType:`, `+blur:dst:ksize:anchor:borderType:`
  1428. */
  1429. + (void)sepFilter2D:(Mat*)src dst:(Mat*)dst ddepth:(int)ddepth kernelX:(Mat*)kernelX kernelY:(Mat*)kernelY NS_SWIFT_NAME(sepFilter2D(src:dst:ddepth:kernelX:kernelY:));
  1430. //
  1431. // void cv::Sobel(Mat src, Mat& dst, int ddepth, int dx, int dy, int ksize = 3, double scale = 1, double delta = 0, BorderTypes borderType = BORDER_DEFAULT)
  1432. //
  1433. /**
  1434. * Calculates the first, second, third, or mixed image derivatives using an extended Sobel operator.
  1435. *
  1436. * In all cases except one, the `$$\texttt{ksize} \times \texttt{ksize}$$` separable kernel is used to
  1437. * calculate the derivative. When `$$\texttt{ksize = 1}$$`, the `$$3 \times 1$$` or `$$1 \times 3$$`
  1438. * kernel is used (that is, no Gaussian smoothing is done). `ksize = 1` can only be used for the first
  1439. * or the second x- or y- derivatives.
  1440. *
  1441. * There is also the special value `ksize = #FILTER_SCHARR (-1)` that corresponds to the `$$3\times3$$` Scharr
  1442. * filter that may give more accurate results than the `$$3\times3$$` Sobel. The Scharr aperture is
  1443. *
  1444. * `$$\newcommand{\vecthreethree}[9]{ \begin{bmatrix} #1 & #2 & #3\\\\ #4 & #5 & #6\\\\ #7 & #8 & #9 \end{bmatrix} } \vecthreethree{-3}{0}{3}{-10}{0}{10}{-3}{0}{3}$$`
  1445. *
  1446. * for the x-derivative, or transposed for the y-derivative.
  1447. *
  1448. * The function calculates an image derivative by convolving the image with the appropriate kernel:
  1449. *
  1450. * `$$\texttt{dst} = \frac{\partial^{xorder+yorder} \texttt{src}}{\partial x^{xorder} \partial y^{yorder}}$$`
  1451. *
  1452. * The Sobel operators combine Gaussian smoothing and differentiation, so the result is more or less
  1453. * resistant to the noise. Most often, the function is called with ( xorder = 1, yorder = 0, ksize = 3)
  1454. * or ( xorder = 0, yorder = 1, ksize = 3) to calculate the first x- or y- image derivative. The first
  1455. * case corresponds to a kernel of:
  1456. *
  1457. * `$$\newcommand{\vecthreethree}[9]{ \begin{bmatrix} #1 & #2 & #3\\\\ #4 & #5 & #6\\\\ #7 & #8 & #9 \end{bmatrix} } \vecthreethree{-1}{0}{1}{-2}{0}{2}{-1}{0}{1}$$`
  1458. *
  1459. * The second case corresponds to a kernel of:
  1460. *
  1461. * `$$\newcommand{\vecthreethree}[9]{ \begin{bmatrix} #1 & #2 & #3\\\\ #4 & #5 & #6\\\\ #7 & #8 & #9 \end{bmatrix} } \vecthreethree{-1}{-2}{-1}{0}{0}{0}{1}{2}{1}$$`
  1462. *
  1463. * @param src input image.
  1464. * @param dst output image of the same size and the same number of channels as src .
  1465. * @param ddepth output image depth, see REF: filter_depths "combinations"; in the case of
  1466. * 8-bit input images it will result in truncated derivatives.
  1467. * @param dx order of the derivative x.
  1468. * @param dy order of the derivative y.
  1469. * @param ksize size of the extended Sobel kernel; it must be 1, 3, 5, or 7.
  1470. * @param scale optional scale factor for the computed derivative values; by default, no scaling is
  1471. * applied (see #getDerivKernels for details).
  1472. * @param delta optional delta value that is added to the results prior to storing them in dst.
  1473. * @param borderType pixel extrapolation method, see #BorderTypes. #BORDER_WRAP is not supported.
  1474. * @see `+Scharr:dst:ddepth:dx:dy:scale:delta:borderType:`, `+Laplacian:dst:ddepth:ksize:scale:delta:borderType:`, `+sepFilter2D:dst:ddepth:kernelX:kernelY:anchor:delta:borderType:`, `+filter2D:dst:ddepth:kernel:anchor:delta:borderType:`, `+GaussianBlur:dst:ksize:sigmaX:sigmaY:borderType:`, `cartToPolar`
  1475. */
  1476. + (void)Sobel:(Mat*)src dst:(Mat*)dst ddepth:(int)ddepth dx:(int)dx dy:(int)dy ksize:(int)ksize scale:(double)scale delta:(double)delta borderType:(BorderTypes)borderType NS_SWIFT_NAME(Sobel(src:dst:ddepth:dx:dy:ksize:scale:delta:borderType:));
  1477. /**
  1478. * Calculates the first, second, third, or mixed image derivatives using an extended Sobel operator.
  1479. *
  1480. * In all cases except one, the `$$\texttt{ksize} \times \texttt{ksize}$$` separable kernel is used to
  1481. * calculate the derivative. When `$$\texttt{ksize = 1}$$`, the `$$3 \times 1$$` or `$$1 \times 3$$`
  1482. * kernel is used (that is, no Gaussian smoothing is done). `ksize = 1` can only be used for the first
  1483. * or the second x- or y- derivatives.
  1484. *
  1485. * There is also the special value `ksize = #FILTER_SCHARR (-1)` that corresponds to the `$$3\times3$$` Scharr
  1486. * filter that may give more accurate results than the `$$3\times3$$` Sobel. The Scharr aperture is
  1487. *
  1488. * `$$\newcommand{\vecthreethree}[9]{ \begin{bmatrix} #1 & #2 & #3\\\\ #4 & #5 & #6\\\\ #7 & #8 & #9 \end{bmatrix} } \vecthreethree{-3}{0}{3}{-10}{0}{10}{-3}{0}{3}$$`
  1489. *
  1490. * for the x-derivative, or transposed for the y-derivative.
  1491. *
  1492. * The function calculates an image derivative by convolving the image with the appropriate kernel:
  1493. *
  1494. * `$$\texttt{dst} = \frac{\partial^{xorder+yorder} \texttt{src}}{\partial x^{xorder} \partial y^{yorder}}$$`
  1495. *
  1496. * The Sobel operators combine Gaussian smoothing and differentiation, so the result is more or less
  1497. * resistant to the noise. Most often, the function is called with ( xorder = 1, yorder = 0, ksize = 3)
  1498. * or ( xorder = 0, yorder = 1, ksize = 3) to calculate the first x- or y- image derivative. The first
  1499. * case corresponds to a kernel of:
  1500. *
  1501. * `$$\newcommand{\vecthreethree}[9]{ \begin{bmatrix} #1 & #2 & #3\\\\ #4 & #5 & #6\\\\ #7 & #8 & #9 \end{bmatrix} } \vecthreethree{-1}{0}{1}{-2}{0}{2}{-1}{0}{1}$$`
  1502. *
  1503. * The second case corresponds to a kernel of:
  1504. *
  1505. * `$$\newcommand{\vecthreethree}[9]{ \begin{bmatrix} #1 & #2 & #3\\\\ #4 & #5 & #6\\\\ #7 & #8 & #9 \end{bmatrix} } \vecthreethree{-1}{-2}{-1}{0}{0}{0}{1}{2}{1}$$`
  1506. *
  1507. * @param src input image.
  1508. * @param dst output image of the same size and the same number of channels as src .
  1509. * @param ddepth output image depth, see REF: filter_depths "combinations"; in the case of
  1510. * 8-bit input images it will result in truncated derivatives.
  1511. * @param dx order of the derivative x.
  1512. * @param dy order of the derivative y.
  1513. * @param ksize size of the extended Sobel kernel; it must be 1, 3, 5, or 7.
  1514. * @param scale optional scale factor for the computed derivative values; by default, no scaling is
  1515. * applied (see #getDerivKernels for details).
  1516. * @param delta optional delta value that is added to the results prior to storing them in dst.
  1517. * @see `+Scharr:dst:ddepth:dx:dy:scale:delta:borderType:`, `+Laplacian:dst:ddepth:ksize:scale:delta:borderType:`, `+sepFilter2D:dst:ddepth:kernelX:kernelY:anchor:delta:borderType:`, `+filter2D:dst:ddepth:kernel:anchor:delta:borderType:`, `+GaussianBlur:dst:ksize:sigmaX:sigmaY:borderType:`, `cartToPolar`
  1518. */
  1519. + (void)Sobel:(Mat*)src dst:(Mat*)dst ddepth:(int)ddepth dx:(int)dx dy:(int)dy ksize:(int)ksize scale:(double)scale delta:(double)delta NS_SWIFT_NAME(Sobel(src:dst:ddepth:dx:dy:ksize:scale:delta:));
  1520. /**
  1521. * Calculates the first, second, third, or mixed image derivatives using an extended Sobel operator.
  1522. *
  1523. * In all cases except one, the `$$\texttt{ksize} \times \texttt{ksize}$$` separable kernel is used to
  1524. * calculate the derivative. When `$$\texttt{ksize = 1}$$`, the `$$3 \times 1$$` or `$$1 \times 3$$`
  1525. * kernel is used (that is, no Gaussian smoothing is done). `ksize = 1` can only be used for the first
  1526. * or the second x- or y- derivatives.
  1527. *
  1528. * There is also the special value `ksize = #FILTER_SCHARR (-1)` that corresponds to the `$$3\times3$$` Scharr
  1529. * filter that may give more accurate results than the `$$3\times3$$` Sobel. The Scharr aperture is
  1530. *
  1531. * `$$\newcommand{\vecthreethree}[9]{ \begin{bmatrix} #1 & #2 & #3\\\\ #4 & #5 & #6\\\\ #7 & #8 & #9 \end{bmatrix} } \vecthreethree{-3}{0}{3}{-10}{0}{10}{-3}{0}{3}$$`
  1532. *
  1533. * for the x-derivative, or transposed for the y-derivative.
  1534. *
  1535. * The function calculates an image derivative by convolving the image with the appropriate kernel:
  1536. *
  1537. * `$$\texttt{dst} = \frac{\partial^{xorder+yorder} \texttt{src}}{\partial x^{xorder} \partial y^{yorder}}$$`
  1538. *
  1539. * The Sobel operators combine Gaussian smoothing and differentiation, so the result is more or less
  1540. * resistant to the noise. Most often, the function is called with ( xorder = 1, yorder = 0, ksize = 3)
  1541. * or ( xorder = 0, yorder = 1, ksize = 3) to calculate the first x- or y- image derivative. The first
  1542. * case corresponds to a kernel of:
  1543. *
  1544. * `$$\newcommand{\vecthreethree}[9]{ \begin{bmatrix} #1 & #2 & #3\\\\ #4 & #5 & #6\\\\ #7 & #8 & #9 \end{bmatrix} } \vecthreethree{-1}{0}{1}{-2}{0}{2}{-1}{0}{1}$$`
  1545. *
  1546. * The second case corresponds to a kernel of:
  1547. *
  1548. * `$$\newcommand{\vecthreethree}[9]{ \begin{bmatrix} #1 & #2 & #3\\\\ #4 & #5 & #6\\\\ #7 & #8 & #9 \end{bmatrix} } \vecthreethree{-1}{-2}{-1}{0}{0}{0}{1}{2}{1}$$`
  1549. *
  1550. * @param src input image.
  1551. * @param dst output image of the same size and the same number of channels as src .
  1552. * @param ddepth output image depth, see REF: filter_depths "combinations"; in the case of
  1553. * 8-bit input images it will result in truncated derivatives.
  1554. * @param dx order of the derivative x.
  1555. * @param dy order of the derivative y.
  1556. * @param ksize size of the extended Sobel kernel; it must be 1, 3, 5, or 7.
  1557. * @param scale optional scale factor for the computed derivative values; by default, no scaling is
  1558. * applied (see #getDerivKernels for details).
  1559. * @see `+Scharr:dst:ddepth:dx:dy:scale:delta:borderType:`, `+Laplacian:dst:ddepth:ksize:scale:delta:borderType:`, `+sepFilter2D:dst:ddepth:kernelX:kernelY:anchor:delta:borderType:`, `+filter2D:dst:ddepth:kernel:anchor:delta:borderType:`, `+GaussianBlur:dst:ksize:sigmaX:sigmaY:borderType:`, `cartToPolar`
  1560. */
  1561. + (void)Sobel:(Mat*)src dst:(Mat*)dst ddepth:(int)ddepth dx:(int)dx dy:(int)dy ksize:(int)ksize scale:(double)scale NS_SWIFT_NAME(Sobel(src:dst:ddepth:dx:dy:ksize:scale:));
  1562. /**
  1563. * Calculates the first, second, third, or mixed image derivatives using an extended Sobel operator.
  1564. *
  1565. * In all cases except one, the `$$\texttt{ksize} \times \texttt{ksize}$$` separable kernel is used to
  1566. * calculate the derivative. When `$$\texttt{ksize = 1}$$`, the `$$3 \times 1$$` or `$$1 \times 3$$`
  1567. * kernel is used (that is, no Gaussian smoothing is done). `ksize = 1` can only be used for the first
  1568. * or the second x- or y- derivatives.
  1569. *
  1570. * There is also the special value `ksize = #FILTER_SCHARR (-1)` that corresponds to the `$$3\times3$$` Scharr
  1571. * filter that may give more accurate results than the `$$3\times3$$` Sobel. The Scharr aperture is
  1572. *
  1573. * `$$\newcommand{\vecthreethree}[9]{ \begin{bmatrix} #1 & #2 & #3\\\\ #4 & #5 & #6\\\\ #7 & #8 & #9 \end{bmatrix} } \vecthreethree{-3}{0}{3}{-10}{0}{10}{-3}{0}{3}$$`
  1574. *
  1575. * for the x-derivative, or transposed for the y-derivative.
  1576. *
  1577. * The function calculates an image derivative by convolving the image with the appropriate kernel:
  1578. *
  1579. * `$$\texttt{dst} = \frac{\partial^{xorder+yorder} \texttt{src}}{\partial x^{xorder} \partial y^{yorder}}$$`
  1580. *
  1581. * The Sobel operators combine Gaussian smoothing and differentiation, so the result is more or less
  1582. * resistant to the noise. Most often, the function is called with ( xorder = 1, yorder = 0, ksize = 3)
  1583. * or ( xorder = 0, yorder = 1, ksize = 3) to calculate the first x- or y- image derivative. The first
  1584. * case corresponds to a kernel of:
  1585. *
  1586. * `$$\newcommand{\vecthreethree}[9]{ \begin{bmatrix} #1 & #2 & #3\\\\ #4 & #5 & #6\\\\ #7 & #8 & #9 \end{bmatrix} } \vecthreethree{-1}{0}{1}{-2}{0}{2}{-1}{0}{1}$$`
  1587. *
  1588. * The second case corresponds to a kernel of:
  1589. *
  1590. * `$$\newcommand{\vecthreethree}[9]{ \begin{bmatrix} #1 & #2 & #3\\\\ #4 & #5 & #6\\\\ #7 & #8 & #9 \end{bmatrix} } \vecthreethree{-1}{-2}{-1}{0}{0}{0}{1}{2}{1}$$`
  1591. *
  1592. * @param src input image.
  1593. * @param dst output image of the same size and the same number of channels as src .
  1594. * @param ddepth output image depth, see REF: filter_depths "combinations"; in the case of
  1595. * 8-bit input images it will result in truncated derivatives.
  1596. * @param dx order of the derivative x.
  1597. * @param dy order of the derivative y.
  1598. * @param ksize size of the extended Sobel kernel; it must be 1, 3, 5, or 7.
  1599. * applied (see #getDerivKernels for details).
  1600. * @see `+Scharr:dst:ddepth:dx:dy:scale:delta:borderType:`, `+Laplacian:dst:ddepth:ksize:scale:delta:borderType:`, `+sepFilter2D:dst:ddepth:kernelX:kernelY:anchor:delta:borderType:`, `+filter2D:dst:ddepth:kernel:anchor:delta:borderType:`, `+GaussianBlur:dst:ksize:sigmaX:sigmaY:borderType:`, `cartToPolar`
  1601. */
  1602. + (void)Sobel:(Mat*)src dst:(Mat*)dst ddepth:(int)ddepth dx:(int)dx dy:(int)dy ksize:(int)ksize NS_SWIFT_NAME(Sobel(src:dst:ddepth:dx:dy:ksize:));
  1603. /**
  1604. * Calculates the first, second, third, or mixed image derivatives using an extended Sobel operator.
  1605. *
  1606. * In all cases except one, the `$$\texttt{ksize} \times \texttt{ksize}$$` separable kernel is used to
  1607. * calculate the derivative. When `$$\texttt{ksize = 1}$$`, the `$$3 \times 1$$` or `$$1 \times 3$$`
  1608. * kernel is used (that is, no Gaussian smoothing is done). `ksize = 1` can only be used for the first
  1609. * or the second x- or y- derivatives.
  1610. *
  1611. * There is also the special value `ksize = #FILTER_SCHARR (-1)` that corresponds to the `$$3\times3$$` Scharr
  1612. * filter that may give more accurate results than the `$$3\times3$$` Sobel. The Scharr aperture is
  1613. *
  1614. * `$$\newcommand{\vecthreethree}[9]{ \begin{bmatrix} #1 & #2 & #3\\\\ #4 & #5 & #6\\\\ #7 & #8 & #9 \end{bmatrix} } \vecthreethree{-3}{0}{3}{-10}{0}{10}{-3}{0}{3}$$`
  1615. *
  1616. * for the x-derivative, or transposed for the y-derivative.
  1617. *
  1618. * The function calculates an image derivative by convolving the image with the appropriate kernel:
  1619. *
  1620. * `$$\texttt{dst} = \frac{\partial^{xorder+yorder} \texttt{src}}{\partial x^{xorder} \partial y^{yorder}}$$`
  1621. *
  1622. * The Sobel operators combine Gaussian smoothing and differentiation, so the result is more or less
  1623. * resistant to the noise. Most often, the function is called with ( xorder = 1, yorder = 0, ksize = 3)
  1624. * or ( xorder = 0, yorder = 1, ksize = 3) to calculate the first x- or y- image derivative. The first
  1625. * case corresponds to a kernel of:
  1626. *
  1627. * `$$\newcommand{\vecthreethree}[9]{ \begin{bmatrix} #1 & #2 & #3\\\\ #4 & #5 & #6\\\\ #7 & #8 & #9 \end{bmatrix} } \vecthreethree{-1}{0}{1}{-2}{0}{2}{-1}{0}{1}$$`
  1628. *
  1629. * The second case corresponds to a kernel of:
  1630. *
  1631. * `$$\newcommand{\vecthreethree}[9]{ \begin{bmatrix} #1 & #2 & #3\\\\ #4 & #5 & #6\\\\ #7 & #8 & #9 \end{bmatrix} } \vecthreethree{-1}{-2}{-1}{0}{0}{0}{1}{2}{1}$$`
  1632. *
  1633. * @param src input image.
  1634. * @param dst output image of the same size and the same number of channels as src .
  1635. * @param ddepth output image depth, see REF: filter_depths "combinations"; in the case of
  1636. * 8-bit input images it will result in truncated derivatives.
  1637. * @param dx order of the derivative x.
  1638. * @param dy order of the derivative y.
  1639. * applied (see #getDerivKernels for details).
  1640. * @see `+Scharr:dst:ddepth:dx:dy:scale:delta:borderType:`, `+Laplacian:dst:ddepth:ksize:scale:delta:borderType:`, `+sepFilter2D:dst:ddepth:kernelX:kernelY:anchor:delta:borderType:`, `+filter2D:dst:ddepth:kernel:anchor:delta:borderType:`, `+GaussianBlur:dst:ksize:sigmaX:sigmaY:borderType:`, `cartToPolar`
  1641. */
  1642. + (void)Sobel:(Mat*)src dst:(Mat*)dst ddepth:(int)ddepth dx:(int)dx dy:(int)dy NS_SWIFT_NAME(Sobel(src:dst:ddepth:dx:dy:));
  1643. //
  1644. // void cv::spatialGradient(Mat src, Mat& dx, Mat& dy, int ksize = 3, BorderTypes borderType = BORDER_DEFAULT)
  1645. //
  1646. /**
  1647. * Calculates the first order image derivative in both x and y using a Sobel operator
  1648. *
  1649. * Equivalent to calling:
  1650. *
  1651. *
  1652. * Sobel( src, dx, CV_16SC1, 1, 0, 3 );
  1653. * Sobel( src, dy, CV_16SC1, 0, 1, 3 );
  1654. *
  1655. *
  1656. * @param src input image.
  1657. * @param dx output image with first-order derivative in x.
  1658. * @param dy output image with first-order derivative in y.
  1659. * @param ksize size of Sobel kernel. It must be 3.
  1660. * @param borderType pixel extrapolation method, see #BorderTypes.
  1661. * Only #BORDER_DEFAULT=#BORDER_REFLECT_101 and #BORDER_REPLICATE are supported.
  1662. *
  1663. * @see `+Sobel:dst:ddepth:dx:dy:ksize:scale:delta:borderType:`
  1664. */
  1665. + (void)spatialGradient:(Mat*)src dx:(Mat*)dx dy:(Mat*)dy ksize:(int)ksize borderType:(BorderTypes)borderType NS_SWIFT_NAME(spatialGradient(src:dx:dy:ksize:borderType:));
  1666. /**
  1667. * Calculates the first order image derivative in both x and y using a Sobel operator
  1668. *
  1669. * Equivalent to calling:
  1670. *
  1671. *
  1672. * Sobel( src, dx, CV_16SC1, 1, 0, 3 );
  1673. * Sobel( src, dy, CV_16SC1, 0, 1, 3 );
  1674. *
  1675. *
  1676. * @param src input image.
  1677. * @param dx output image with first-order derivative in x.
  1678. * @param dy output image with first-order derivative in y.
  1679. * @param ksize size of Sobel kernel. It must be 3.
  1680. * Only #BORDER_DEFAULT=#BORDER_REFLECT_101 and #BORDER_REPLICATE are supported.
  1681. *
  1682. * @see `+Sobel:dst:ddepth:dx:dy:ksize:scale:delta:borderType:`
  1683. */
  1684. + (void)spatialGradient:(Mat*)src dx:(Mat*)dx dy:(Mat*)dy ksize:(int)ksize NS_SWIFT_NAME(spatialGradient(src:dx:dy:ksize:));
  1685. /**
  1686. * Calculates the first order image derivative in both x and y using a Sobel operator
  1687. *
  1688. * Equivalent to calling:
  1689. *
  1690. *
  1691. * Sobel( src, dx, CV_16SC1, 1, 0, 3 );
  1692. * Sobel( src, dy, CV_16SC1, 0, 1, 3 );
  1693. *
  1694. *
  1695. * @param src input image.
  1696. * @param dx output image with first-order derivative in x.
  1697. * @param dy output image with first-order derivative in y.
  1698. * Only #BORDER_DEFAULT=#BORDER_REFLECT_101 and #BORDER_REPLICATE are supported.
  1699. *
  1700. * @see `+Sobel:dst:ddepth:dx:dy:ksize:scale:delta:borderType:`
  1701. */
  1702. + (void)spatialGradient:(Mat*)src dx:(Mat*)dx dy:(Mat*)dy NS_SWIFT_NAME(spatialGradient(src:dx:dy:));
  1703. //
  1704. // void cv::Scharr(Mat src, Mat& dst, int ddepth, int dx, int dy, double scale = 1, double delta = 0, BorderTypes borderType = BORDER_DEFAULT)
  1705. //
  1706. /**
  1707. * Calculates the first x- or y- image derivative using Scharr operator.
  1708. *
  1709. * The function computes the first x- or y- spatial image derivative using the Scharr operator. The
  1710. * call
  1711. *
  1712. * `$$\texttt{Scharr(src, dst, ddepth, dx, dy, scale, delta, borderType)}$$`
  1713. *
  1714. * is equivalent to
  1715. *
  1716. * `$$\texttt{Sobel(src, dst, ddepth, dx, dy, FILTER\_SCHARR, scale, delta, borderType)} .$$`
  1717. *
  1718. * @param src input image.
  1719. * @param dst output image of the same size and the same number of channels as src.
  1720. * @param ddepth output image depth, see REF: filter_depths "combinations"
  1721. * @param dx order of the derivative x.
  1722. * @param dy order of the derivative y.
  1723. * @param scale optional scale factor for the computed derivative values; by default, no scaling is
  1724. * applied (see #getDerivKernels for details).
  1725. * @param delta optional delta value that is added to the results prior to storing them in dst.
  1726. * @param borderType pixel extrapolation method, see #BorderTypes. #BORDER_WRAP is not supported.
  1727. * @see `cartToPolar`
  1728. */
  1729. + (void)Scharr:(Mat*)src dst:(Mat*)dst ddepth:(int)ddepth dx:(int)dx dy:(int)dy scale:(double)scale delta:(double)delta borderType:(BorderTypes)borderType NS_SWIFT_NAME(Scharr(src:dst:ddepth:dx:dy:scale:delta:borderType:));
  1730. /**
  1731. * Calculates the first x- or y- image derivative using Scharr operator.
  1732. *
  1733. * The function computes the first x- or y- spatial image derivative using the Scharr operator. The
  1734. * call
  1735. *
  1736. * `$$\texttt{Scharr(src, dst, ddepth, dx, dy, scale, delta, borderType)}$$`
  1737. *
  1738. * is equivalent to
  1739. *
  1740. * `$$\texttt{Sobel(src, dst, ddepth, dx, dy, FILTER\_SCHARR, scale, delta, borderType)} .$$`
  1741. *
  1742. * @param src input image.
  1743. * @param dst output image of the same size and the same number of channels as src.
  1744. * @param ddepth output image depth, see REF: filter_depths "combinations"
  1745. * @param dx order of the derivative x.
  1746. * @param dy order of the derivative y.
  1747. * @param scale optional scale factor for the computed derivative values; by default, no scaling is
  1748. * applied (see #getDerivKernels for details).
  1749. * @param delta optional delta value that is added to the results prior to storing them in dst.
  1750. * @see `cartToPolar`
  1751. */
  1752. + (void)Scharr:(Mat*)src dst:(Mat*)dst ddepth:(int)ddepth dx:(int)dx dy:(int)dy scale:(double)scale delta:(double)delta NS_SWIFT_NAME(Scharr(src:dst:ddepth:dx:dy:scale:delta:));
  1753. /**
  1754. * Calculates the first x- or y- image derivative using Scharr operator.
  1755. *
  1756. * The function computes the first x- or y- spatial image derivative using the Scharr operator. The
  1757. * call
  1758. *
  1759. * `$$\texttt{Scharr(src, dst, ddepth, dx, dy, scale, delta, borderType)}$$`
  1760. *
  1761. * is equivalent to
  1762. *
  1763. * `$$\texttt{Sobel(src, dst, ddepth, dx, dy, FILTER\_SCHARR, scale, delta, borderType)} .$$`
  1764. *
  1765. * @param src input image.
  1766. * @param dst output image of the same size and the same number of channels as src.
  1767. * @param ddepth output image depth, see REF: filter_depths "combinations"
  1768. * @param dx order of the derivative x.
  1769. * @param dy order of the derivative y.
  1770. * @param scale optional scale factor for the computed derivative values; by default, no scaling is
  1771. * applied (see #getDerivKernels for details).
  1772. * @see `cartToPolar`
  1773. */
  1774. + (void)Scharr:(Mat*)src dst:(Mat*)dst ddepth:(int)ddepth dx:(int)dx dy:(int)dy scale:(double)scale NS_SWIFT_NAME(Scharr(src:dst:ddepth:dx:dy:scale:));
  1775. /**
  1776. * Calculates the first x- or y- image derivative using Scharr operator.
  1777. *
  1778. * The function computes the first x- or y- spatial image derivative using the Scharr operator. The
  1779. * call
  1780. *
  1781. * `$$\texttt{Scharr(src, dst, ddepth, dx, dy, scale, delta, borderType)}$$`
  1782. *
  1783. * is equivalent to
  1784. *
  1785. * `$$\texttt{Sobel(src, dst, ddepth, dx, dy, FILTER\_SCHARR, scale, delta, borderType)} .$$`
  1786. *
  1787. * @param src input image.
  1788. * @param dst output image of the same size and the same number of channels as src.
  1789. * @param ddepth output image depth, see REF: filter_depths "combinations"
  1790. * @param dx order of the derivative x.
  1791. * @param dy order of the derivative y.
  1792. * applied (see #getDerivKernels for details).
  1793. * @see `cartToPolar`
  1794. */
  1795. + (void)Scharr:(Mat*)src dst:(Mat*)dst ddepth:(int)ddepth dx:(int)dx dy:(int)dy NS_SWIFT_NAME(Scharr(src:dst:ddepth:dx:dy:));
  1796. //
  1797. // void cv::Laplacian(Mat src, Mat& dst, int ddepth, int ksize = 1, double scale = 1, double delta = 0, BorderTypes borderType = BORDER_DEFAULT)
  1798. //
  1799. /**
  1800. * Calculates the Laplacian of an image.
  1801. *
  1802. * The function calculates the Laplacian of the source image by adding up the second x and y
  1803. * derivatives calculated using the Sobel operator:
  1804. *
  1805. * `$$\texttt{dst} = \Delta \texttt{src} = \frac{\partial^2 \texttt{src}}{\partial x^2} + \frac{\partial^2 \texttt{src}}{\partial y^2}$$`
  1806. *
  1807. * This is done when `ksize > 1`. When `ksize == 1`, the Laplacian is computed by filtering the image
  1808. * with the following `$$3 \times 3$$` aperture:
  1809. *
  1810. * `$$\newcommand{\vecthreethree}[9]{ \begin{bmatrix} #1 & #2 & #3\\\\ #4 & #5 & #6\\\\ #7 & #8 & #9 \end{bmatrix} } \vecthreethree {0}{1}{0}{1}{-4}{1}{0}{1}{0}$$`
  1811. *
  1812. * @param src Source image.
  1813. * @param dst Destination image of the same size and the same number of channels as src .
  1814. * @param ddepth Desired depth of the destination image, see REF: filter_depths "combinations".
  1815. * @param ksize Aperture size used to compute the second-derivative filters. See #getDerivKernels for
  1816. * details. The size must be positive and odd.
  1817. * @param scale Optional scale factor for the computed Laplacian values. By default, no scaling is
  1818. * applied. See #getDerivKernels for details.
  1819. * @param delta Optional delta value that is added to the results prior to storing them in dst .
  1820. * @param borderType Pixel extrapolation method, see #BorderTypes. #BORDER_WRAP is not supported.
  1821. * @see `+Sobel:dst:ddepth:dx:dy:ksize:scale:delta:borderType:`, `+Scharr:dst:ddepth:dx:dy:scale:delta:borderType:`
  1822. */
  1823. + (void)Laplacian:(Mat*)src dst:(Mat*)dst ddepth:(int)ddepth ksize:(int)ksize scale:(double)scale delta:(double)delta borderType:(BorderTypes)borderType NS_SWIFT_NAME(Laplacian(src:dst:ddepth:ksize:scale:delta:borderType:));
  1824. /**
  1825. * Calculates the Laplacian of an image.
  1826. *
  1827. * The function calculates the Laplacian of the source image by adding up the second x and y
  1828. * derivatives calculated using the Sobel operator:
  1829. *
  1830. * `$$\texttt{dst} = \Delta \texttt{src} = \frac{\partial^2 \texttt{src}}{\partial x^2} + \frac{\partial^2 \texttt{src}}{\partial y^2}$$`
  1831. *
  1832. * This is done when `ksize > 1`. When `ksize == 1`, the Laplacian is computed by filtering the image
  1833. * with the following `$$3 \times 3$$` aperture:
  1834. *
  1835. * `$$\newcommand{\vecthreethree}[9]{ \begin{bmatrix} #1 & #2 & #3\\\\ #4 & #5 & #6\\\\ #7 & #8 & #9 \end{bmatrix} } \vecthreethree {0}{1}{0}{1}{-4}{1}{0}{1}{0}$$`
  1836. *
  1837. * @param src Source image.
  1838. * @param dst Destination image of the same size and the same number of channels as src .
  1839. * @param ddepth Desired depth of the destination image, see REF: filter_depths "combinations".
  1840. * @param ksize Aperture size used to compute the second-derivative filters. See #getDerivKernels for
  1841. * details. The size must be positive and odd.
  1842. * @param scale Optional scale factor for the computed Laplacian values. By default, no scaling is
  1843. * applied. See #getDerivKernels for details.
  1844. * @param delta Optional delta value that is added to the results prior to storing them in dst .
  1845. * @see `+Sobel:dst:ddepth:dx:dy:ksize:scale:delta:borderType:`, `+Scharr:dst:ddepth:dx:dy:scale:delta:borderType:`
  1846. */
  1847. + (void)Laplacian:(Mat*)src dst:(Mat*)dst ddepth:(int)ddepth ksize:(int)ksize scale:(double)scale delta:(double)delta NS_SWIFT_NAME(Laplacian(src:dst:ddepth:ksize:scale:delta:));
  1848. /**
  1849. * Calculates the Laplacian of an image.
  1850. *
  1851. * The function calculates the Laplacian of the source image by adding up the second x and y
  1852. * derivatives calculated using the Sobel operator:
  1853. *
  1854. * `$$\texttt{dst} = \Delta \texttt{src} = \frac{\partial^2 \texttt{src}}{\partial x^2} + \frac{\partial^2 \texttt{src}}{\partial y^2}$$`
  1855. *
  1856. * This is done when `ksize > 1`. When `ksize == 1`, the Laplacian is computed by filtering the image
  1857. * with the following `$$3 \times 3$$` aperture:
  1858. *
  1859. * `$$\newcommand{\vecthreethree}[9]{ \begin{bmatrix} #1 & #2 & #3\\\\ #4 & #5 & #6\\\\ #7 & #8 & #9 \end{bmatrix} } \vecthreethree {0}{1}{0}{1}{-4}{1}{0}{1}{0}$$`
  1860. *
  1861. * @param src Source image.
  1862. * @param dst Destination image of the same size and the same number of channels as src .
  1863. * @param ddepth Desired depth of the destination image, see REF: filter_depths "combinations".
  1864. * @param ksize Aperture size used to compute the second-derivative filters. See #getDerivKernels for
  1865. * details. The size must be positive and odd.
  1866. * @param scale Optional scale factor for the computed Laplacian values. By default, no scaling is
  1867. * applied. See #getDerivKernels for details.
  1868. * @see `+Sobel:dst:ddepth:dx:dy:ksize:scale:delta:borderType:`, `+Scharr:dst:ddepth:dx:dy:scale:delta:borderType:`
  1869. */
  1870. + (void)Laplacian:(Mat*)src dst:(Mat*)dst ddepth:(int)ddepth ksize:(int)ksize scale:(double)scale NS_SWIFT_NAME(Laplacian(src:dst:ddepth:ksize:scale:));
  1871. /**
  1872. * Calculates the Laplacian of an image.
  1873. *
  1874. * The function calculates the Laplacian of the source image by adding up the second x and y
  1875. * derivatives calculated using the Sobel operator:
  1876. *
  1877. * `$$\texttt{dst} = \Delta \texttt{src} = \frac{\partial^2 \texttt{src}}{\partial x^2} + \frac{\partial^2 \texttt{src}}{\partial y^2}$$`
  1878. *
  1879. * This is done when `ksize > 1`. When `ksize == 1`, the Laplacian is computed by filtering the image
  1880. * with the following `$$3 \times 3$$` aperture:
  1881. *
  1882. * `$$\newcommand{\vecthreethree}[9]{ \begin{bmatrix} #1 & #2 & #3\\\\ #4 & #5 & #6\\\\ #7 & #8 & #9 \end{bmatrix} } \vecthreethree {0}{1}{0}{1}{-4}{1}{0}{1}{0}$$`
  1883. *
  1884. * @param src Source image.
  1885. * @param dst Destination image of the same size and the same number of channels as src .
  1886. * @param ddepth Desired depth of the destination image, see REF: filter_depths "combinations".
  1887. * @param ksize Aperture size used to compute the second-derivative filters. See #getDerivKernels for
  1888. * details. The size must be positive and odd.
  1889. * applied. See #getDerivKernels for details.
  1890. * @see `+Sobel:dst:ddepth:dx:dy:ksize:scale:delta:borderType:`, `+Scharr:dst:ddepth:dx:dy:scale:delta:borderType:`
  1891. */
  1892. + (void)Laplacian:(Mat*)src dst:(Mat*)dst ddepth:(int)ddepth ksize:(int)ksize NS_SWIFT_NAME(Laplacian(src:dst:ddepth:ksize:));
  1893. /**
  1894. * Calculates the Laplacian of an image.
  1895. *
  1896. * The function calculates the Laplacian of the source image by adding up the second x and y
  1897. * derivatives calculated using the Sobel operator:
  1898. *
  1899. * `$$\texttt{dst} = \Delta \texttt{src} = \frac{\partial^2 \texttt{src}}{\partial x^2} + \frac{\partial^2 \texttt{src}}{\partial y^2}$$`
  1900. *
  1901. * This is done when `ksize > 1`. When `ksize == 1`, the Laplacian is computed by filtering the image
  1902. * with the following `$$3 \times 3$$` aperture:
  1903. *
  1904. * `$$\newcommand{\vecthreethree}[9]{ \begin{bmatrix} #1 & #2 & #3\\\\ #4 & #5 & #6\\\\ #7 & #8 & #9 \end{bmatrix} } \vecthreethree {0}{1}{0}{1}{-4}{1}{0}{1}{0}$$`
  1905. *
  1906. * @param src Source image.
  1907. * @param dst Destination image of the same size and the same number of channels as src .
  1908. * @param ddepth Desired depth of the destination image, see REF: filter_depths "combinations".
  1909. * details. The size must be positive and odd.
  1910. * applied. See #getDerivKernels for details.
  1911. * @see `+Sobel:dst:ddepth:dx:dy:ksize:scale:delta:borderType:`, `+Scharr:dst:ddepth:dx:dy:scale:delta:borderType:`
  1912. */
  1913. + (void)Laplacian:(Mat*)src dst:(Mat*)dst ddepth:(int)ddepth NS_SWIFT_NAME(Laplacian(src:dst:ddepth:));
  1914. //
  1915. // void cv::Canny(Mat image, Mat& edges, double threshold1, double threshold2, int apertureSize = 3, bool L2gradient = false)
  1916. //
  1917. /**
  1918. * Finds edges in an image using the Canny algorithm CITE: Canny86 .
  1919. *
  1920. * The function finds edges in the input image and marks them in the output map edges using the
  1921. * Canny algorithm. The smallest value between threshold1 and threshold2 is used for edge linking. The
  1922. * largest value is used to find initial segments of strong edges. See
  1923. * <http://en.wikipedia.org/wiki/Canny_edge_detector>
  1924. *
  1925. * @param image 8-bit input image.
  1926. * @param edges output edge map; single channels 8-bit image, which has the same size as image .
  1927. * @param threshold1 first threshold for the hysteresis procedure.
  1928. * @param threshold2 second threshold for the hysteresis procedure.
  1929. * @param apertureSize aperture size for the Sobel operator.
  1930. * @param L2gradient a flag, indicating whether a more accurate `$$L_2$$` norm
  1931. * `$$=\sqrt{(dI/dx)^2 + (dI/dy)^2}$$` should be used to calculate the image gradient magnitude (
  1932. * L2gradient=true ), or whether the default `$$L_1$$` norm `$$=|dI/dx|+|dI/dy|$$` is enough (
  1933. * L2gradient=false ).
  1934. */
  1935. + (void)Canny:(Mat*)image edges:(Mat*)edges threshold1:(double)threshold1 threshold2:(double)threshold2 apertureSize:(int)apertureSize L2gradient:(BOOL)L2gradient NS_SWIFT_NAME(Canny(image:edges:threshold1:threshold2:apertureSize:L2gradient:));
  1936. /**
  1937. * Finds edges in an image using the Canny algorithm CITE: Canny86 .
  1938. *
  1939. * The function finds edges in the input image and marks them in the output map edges using the
  1940. * Canny algorithm. The smallest value between threshold1 and threshold2 is used for edge linking. The
  1941. * largest value is used to find initial segments of strong edges. See
  1942. * <http://en.wikipedia.org/wiki/Canny_edge_detector>
  1943. *
  1944. * @param image 8-bit input image.
  1945. * @param edges output edge map; single channels 8-bit image, which has the same size as image .
  1946. * @param threshold1 first threshold for the hysteresis procedure.
  1947. * @param threshold2 second threshold for the hysteresis procedure.
  1948. * @param apertureSize aperture size for the Sobel operator.
  1949. * `$$=\sqrt{(dI/dx)^2 + (dI/dy)^2}$$` should be used to calculate the image gradient magnitude (
  1950. * L2gradient=true ), or whether the default `$$L_1$$` norm `$$=|dI/dx|+|dI/dy|$$` is enough (
  1951. * L2gradient=false ).
  1952. */
  1953. + (void)Canny:(Mat*)image edges:(Mat*)edges threshold1:(double)threshold1 threshold2:(double)threshold2 apertureSize:(int)apertureSize NS_SWIFT_NAME(Canny(image:edges:threshold1:threshold2:apertureSize:));
  1954. /**
  1955. * Finds edges in an image using the Canny algorithm CITE: Canny86 .
  1956. *
  1957. * The function finds edges in the input image and marks them in the output map edges using the
  1958. * Canny algorithm. The smallest value between threshold1 and threshold2 is used for edge linking. The
  1959. * largest value is used to find initial segments of strong edges. See
  1960. * <http://en.wikipedia.org/wiki/Canny_edge_detector>
  1961. *
  1962. * @param image 8-bit input image.
  1963. * @param edges output edge map; single channels 8-bit image, which has the same size as image .
  1964. * @param threshold1 first threshold for the hysteresis procedure.
  1965. * @param threshold2 second threshold for the hysteresis procedure.
  1966. * `$$=\sqrt{(dI/dx)^2 + (dI/dy)^2}$$` should be used to calculate the image gradient magnitude (
  1967. * L2gradient=true ), or whether the default `$$L_1$$` norm `$$=|dI/dx|+|dI/dy|$$` is enough (
  1968. * L2gradient=false ).
  1969. */
  1970. + (void)Canny:(Mat*)image edges:(Mat*)edges threshold1:(double)threshold1 threshold2:(double)threshold2 NS_SWIFT_NAME(Canny(image:edges:threshold1:threshold2:));
  1971. //
  1972. // void cv::Canny(Mat dx, Mat dy, Mat& edges, double threshold1, double threshold2, bool L2gradient = false)
  1973. //
  1974. /**
  1975. * \overload
  1976. *
  1977. * Finds edges in an image using the Canny algorithm with custom image gradient.
  1978. *
  1979. * @param dx 16-bit x derivative of input image (CV_16SC1 or CV_16SC3).
  1980. * @param dy 16-bit y derivative of input image (same type as dx).
  1981. * @param edges output edge map; single channels 8-bit image, which has the same size as image .
  1982. * @param threshold1 first threshold for the hysteresis procedure.
  1983. * @param threshold2 second threshold for the hysteresis procedure.
  1984. * @param L2gradient a flag, indicating whether a more accurate `$$L_2$$` norm
  1985. * `$$=\sqrt{(dI/dx)^2 + (dI/dy)^2}$$` should be used to calculate the image gradient magnitude (
  1986. * L2gradient=true ), or whether the default `$$L_1$$` norm `$$=|dI/dx|+|dI/dy|$$` is enough (
  1987. * L2gradient=false ).
  1988. */
  1989. + (void)Canny:(Mat*)dx dy:(Mat*)dy edges:(Mat*)edges threshold1:(double)threshold1 threshold2:(double)threshold2 L2gradient:(BOOL)L2gradient NS_SWIFT_NAME(Canny(dx:dy:edges:threshold1:threshold2:L2gradient:));
  1990. /**
  1991. * \overload
  1992. *
  1993. * Finds edges in an image using the Canny algorithm with custom image gradient.
  1994. *
  1995. * @param dx 16-bit x derivative of input image (CV_16SC1 or CV_16SC3).
  1996. * @param dy 16-bit y derivative of input image (same type as dx).
  1997. * @param edges output edge map; single channels 8-bit image, which has the same size as image .
  1998. * @param threshold1 first threshold for the hysteresis procedure.
  1999. * @param threshold2 second threshold for the hysteresis procedure.
  2000. * `$$=\sqrt{(dI/dx)^2 + (dI/dy)^2}$$` should be used to calculate the image gradient magnitude (
  2001. * L2gradient=true ), or whether the default `$$L_1$$` norm `$$=|dI/dx|+|dI/dy|$$` is enough (
  2002. * L2gradient=false ).
  2003. */
  2004. + (void)Canny:(Mat*)dx dy:(Mat*)dy edges:(Mat*)edges threshold1:(double)threshold1 threshold2:(double)threshold2 NS_SWIFT_NAME(Canny(dx:dy:edges:threshold1:threshold2:));
  2005. //
  2006. // void cv::cornerMinEigenVal(Mat src, Mat& dst, int blockSize, int ksize = 3, BorderTypes borderType = BORDER_DEFAULT)
  2007. //
  2008. /**
  2009. * Calculates the minimal eigenvalue of gradient matrices for corner detection.
  2010. *
  2011. * The function is similar to cornerEigenValsAndVecs but it calculates and stores only the minimal
  2012. * eigenvalue of the covariance matrix of derivatives, that is, `$$\min(\lambda_1, \lambda_2)$$` in terms
  2013. * of the formulae in the cornerEigenValsAndVecs description.
  2014. *
  2015. * @param src Input single-channel 8-bit or floating-point image.
  2016. * @param dst Image to store the minimal eigenvalues. It has the type CV_32FC1 and the same size as
  2017. * src .
  2018. * @param blockSize Neighborhood size (see the details on #cornerEigenValsAndVecs ).
  2019. * @param ksize Aperture parameter for the Sobel operator.
  2020. * @param borderType Pixel extrapolation method. See #BorderTypes. #BORDER_WRAP is not supported.
  2021. */
  2022. + (void)cornerMinEigenVal:(Mat*)src dst:(Mat*)dst blockSize:(int)blockSize ksize:(int)ksize borderType:(BorderTypes)borderType NS_SWIFT_NAME(cornerMinEigenVal(src:dst:blockSize:ksize:borderType:));
  2023. /**
  2024. * Calculates the minimal eigenvalue of gradient matrices for corner detection.
  2025. *
  2026. * The function is similar to cornerEigenValsAndVecs but it calculates and stores only the minimal
  2027. * eigenvalue of the covariance matrix of derivatives, that is, `$$\min(\lambda_1, \lambda_2)$$` in terms
  2028. * of the formulae in the cornerEigenValsAndVecs description.
  2029. *
  2030. * @param src Input single-channel 8-bit or floating-point image.
  2031. * @param dst Image to store the minimal eigenvalues. It has the type CV_32FC1 and the same size as
  2032. * src .
  2033. * @param blockSize Neighborhood size (see the details on #cornerEigenValsAndVecs ).
  2034. * @param ksize Aperture parameter for the Sobel operator.
  2035. */
  2036. + (void)cornerMinEigenVal:(Mat*)src dst:(Mat*)dst blockSize:(int)blockSize ksize:(int)ksize NS_SWIFT_NAME(cornerMinEigenVal(src:dst:blockSize:ksize:));
  2037. /**
  2038. * Calculates the minimal eigenvalue of gradient matrices for corner detection.
  2039. *
  2040. * The function is similar to cornerEigenValsAndVecs but it calculates and stores only the minimal
  2041. * eigenvalue of the covariance matrix of derivatives, that is, `$$\min(\lambda_1, \lambda_2)$$` in terms
  2042. * of the formulae in the cornerEigenValsAndVecs description.
  2043. *
  2044. * @param src Input single-channel 8-bit or floating-point image.
  2045. * @param dst Image to store the minimal eigenvalues. It has the type CV_32FC1 and the same size as
  2046. * src .
  2047. * @param blockSize Neighborhood size (see the details on #cornerEigenValsAndVecs ).
  2048. */
  2049. + (void)cornerMinEigenVal:(Mat*)src dst:(Mat*)dst blockSize:(int)blockSize NS_SWIFT_NAME(cornerMinEigenVal(src:dst:blockSize:));
  2050. //
  2051. // void cv::cornerHarris(Mat src, Mat& dst, int blockSize, int ksize, double k, BorderTypes borderType = BORDER_DEFAULT)
  2052. //
  2053. /**
  2054. * Harris corner detector.
  2055. *
  2056. * The function runs the Harris corner detector on the image. Similarly to cornerMinEigenVal and
  2057. * cornerEigenValsAndVecs , for each pixel `$$(x, y)$$` it calculates a `$$2\times2$$` gradient covariance
  2058. * matrix `$$M^{(x,y)}$$` over a `$$\texttt{blockSize} \times \texttt{blockSize}$$` neighborhood. Then, it
  2059. * computes the following characteristic:
  2060. *
  2061. * `$$\texttt{dst} (x,y) = \mathrm{det} M^{(x,y)} - k \cdot \left ( \mathrm{tr} M^{(x,y)} \right )^2$$`
  2062. *
  2063. * Corners in the image can be found as the local maxima of this response map.
  2064. *
  2065. * @param src Input single-channel 8-bit or floating-point image.
  2066. * @param dst Image to store the Harris detector responses. It has the type CV_32FC1 and the same
  2067. * size as src .
  2068. * @param blockSize Neighborhood size (see the details on #cornerEigenValsAndVecs ).
  2069. * @param ksize Aperture parameter for the Sobel operator.
  2070. * @param k Harris detector free parameter. See the formula above.
  2071. * @param borderType Pixel extrapolation method. See #BorderTypes. #BORDER_WRAP is not supported.
  2072. */
  2073. + (void)cornerHarris:(Mat*)src dst:(Mat*)dst blockSize:(int)blockSize ksize:(int)ksize k:(double)k borderType:(BorderTypes)borderType NS_SWIFT_NAME(cornerHarris(src:dst:blockSize:ksize:k:borderType:));
  2074. /**
  2075. * Harris corner detector.
  2076. *
  2077. * The function runs the Harris corner detector on the image. Similarly to cornerMinEigenVal and
  2078. * cornerEigenValsAndVecs , for each pixel `$$(x, y)$$` it calculates a `$$2\times2$$` gradient covariance
  2079. * matrix `$$M^{(x,y)}$$` over a `$$\texttt{blockSize} \times \texttt{blockSize}$$` neighborhood. Then, it
  2080. * computes the following characteristic:
  2081. *
  2082. * `$$\texttt{dst} (x,y) = \mathrm{det} M^{(x,y)} - k \cdot \left ( \mathrm{tr} M^{(x,y)} \right )^2$$`
  2083. *
  2084. * Corners in the image can be found as the local maxima of this response map.
  2085. *
  2086. * @param src Input single-channel 8-bit or floating-point image.
  2087. * @param dst Image to store the Harris detector responses. It has the type CV_32FC1 and the same
  2088. * size as src .
  2089. * @param blockSize Neighborhood size (see the details on #cornerEigenValsAndVecs ).
  2090. * @param ksize Aperture parameter for the Sobel operator.
  2091. * @param k Harris detector free parameter. See the formula above.
  2092. */
  2093. + (void)cornerHarris:(Mat*)src dst:(Mat*)dst blockSize:(int)blockSize ksize:(int)ksize k:(double)k NS_SWIFT_NAME(cornerHarris(src:dst:blockSize:ksize:k:));
  2094. //
  2095. // void cv::cornerEigenValsAndVecs(Mat src, Mat& dst, int blockSize, int ksize, BorderTypes borderType = BORDER_DEFAULT)
  2096. //
  2097. /**
  2098. * Calculates eigenvalues and eigenvectors of image blocks for corner detection.
  2099. *
  2100. * For every pixel `$$p$$` , the function cornerEigenValsAndVecs considers a blockSize `$$\times$$` blockSize
  2101. * neighborhood `$$S(p)$$` . It calculates the covariation matrix of derivatives over the neighborhood as:
  2102. *
  2103. * `$$M = \begin{bmatrix} \sum _{S(p)}(dI/dx)^2 & \sum _{S(p)}dI/dx dI/dy \\ \sum _{S(p)}dI/dx dI/dy & \sum _{S(p)}(dI/dy)^2 \end{bmatrix}$$`
  2104. *
  2105. * where the derivatives are computed using the Sobel operator.
  2106. *
  2107. * After that, it finds eigenvectors and eigenvalues of `$$M$$` and stores them in the destination image as
  2108. * `$$(\lambda_1, \lambda_2, x_1, y_1, x_2, y_2)$$` where
  2109. *
  2110. * - `$$\lambda_1, \lambda_2$$` are the non-sorted eigenvalues of `$$M$$`
  2111. * - `$$x_1, y_1$$` are the eigenvectors corresponding to `$$\lambda_1$$`
  2112. * - `$$x_2, y_2$$` are the eigenvectors corresponding to `$$\lambda_2$$`
  2113. *
  2114. * The output of the function can be used for robust edge or corner detection.
  2115. *
  2116. * @param src Input single-channel 8-bit or floating-point image.
  2117. * @param dst Image to store the results. It has the same size as src and the type CV_32FC(6) .
  2118. * @param blockSize Neighborhood size (see details below).
  2119. * @param ksize Aperture parameter for the Sobel operator.
  2120. * @param borderType Pixel extrapolation method. See #BorderTypes. #BORDER_WRAP is not supported.
  2121. *
  2122. * @see `+cornerMinEigenVal:dst:blockSize:ksize:borderType:`, `+cornerHarris:dst:blockSize:ksize:k:borderType:`, `+preCornerDetect:dst:ksize:borderType:`
  2123. */
  2124. + (void)cornerEigenValsAndVecs:(Mat*)src dst:(Mat*)dst blockSize:(int)blockSize ksize:(int)ksize borderType:(BorderTypes)borderType NS_SWIFT_NAME(cornerEigenValsAndVecs(src:dst:blockSize:ksize:borderType:));
  2125. /**
  2126. * Calculates eigenvalues and eigenvectors of image blocks for corner detection.
  2127. *
  2128. * For every pixel `$$p$$` , the function cornerEigenValsAndVecs considers a blockSize `$$\times$$` blockSize
  2129. * neighborhood `$$S(p)$$` . It calculates the covariation matrix of derivatives over the neighborhood as:
  2130. *
  2131. * `$$M = \begin{bmatrix} \sum _{S(p)}(dI/dx)^2 & \sum _{S(p)}dI/dx dI/dy \\ \sum _{S(p)}dI/dx dI/dy & \sum _{S(p)}(dI/dy)^2 \end{bmatrix}$$`
  2132. *
  2133. * where the derivatives are computed using the Sobel operator.
  2134. *
  2135. * After that, it finds eigenvectors and eigenvalues of `$$M$$` and stores them in the destination image as
  2136. * `$$(\lambda_1, \lambda_2, x_1, y_1, x_2, y_2)$$` where
  2137. *
  2138. * - `$$\lambda_1, \lambda_2$$` are the non-sorted eigenvalues of `$$M$$`
  2139. * - `$$x_1, y_1$$` are the eigenvectors corresponding to `$$\lambda_1$$`
  2140. * - `$$x_2, y_2$$` are the eigenvectors corresponding to `$$\lambda_2$$`
  2141. *
  2142. * The output of the function can be used for robust edge or corner detection.
  2143. *
  2144. * @param src Input single-channel 8-bit or floating-point image.
  2145. * @param dst Image to store the results. It has the same size as src and the type CV_32FC(6) .
  2146. * @param blockSize Neighborhood size (see details below).
  2147. * @param ksize Aperture parameter for the Sobel operator.
  2148. *
  2149. * @see `+cornerMinEigenVal:dst:blockSize:ksize:borderType:`, `+cornerHarris:dst:blockSize:ksize:k:borderType:`, `+preCornerDetect:dst:ksize:borderType:`
  2150. */
  2151. + (void)cornerEigenValsAndVecs:(Mat*)src dst:(Mat*)dst blockSize:(int)blockSize ksize:(int)ksize NS_SWIFT_NAME(cornerEigenValsAndVecs(src:dst:blockSize:ksize:));
  2152. //
  2153. // void cv::preCornerDetect(Mat src, Mat& dst, int ksize, BorderTypes borderType = BORDER_DEFAULT)
  2154. //
  2155. /**
  2156. * Calculates a feature map for corner detection.
  2157. *
  2158. * The function calculates the complex spatial derivative-based function of the source image
  2159. *
  2160. * `$$\texttt{dst} = (D_x \texttt{src} )^2 \cdot D_{yy} \texttt{src} + (D_y \texttt{src} )^2 \cdot D_{xx} \texttt{src} - 2 D_x \texttt{src} \cdot D_y \texttt{src} \cdot D_{xy} \texttt{src}$$`
  2161. *
  2162. * where `$$D_x$$`,`$$D_y$$` are the first image derivatives, `$$D_{xx}$$`,`$$D_{yy}$$` are the second image
  2163. * derivatives, and `$$D_{xy}$$` is the mixed derivative.
  2164. *
  2165. * The corners can be found as local maximums of the functions, as shown below:
  2166. *
  2167. * Mat corners, dilated_corners;
  2168. * preCornerDetect(image, corners, 3);
  2169. * // dilation with 3x3 rectangular structuring element
  2170. * dilate(corners, dilated_corners, Mat(), 1);
  2171. * Mat corner_mask = corners == dilated_corners;
  2172. *
  2173. *
  2174. * @param src Source single-channel 8-bit of floating-point image.
  2175. * @param dst Output image that has the type CV_32F and the same size as src .
  2176. * @param ksize %Aperture size of the Sobel .
  2177. * @param borderType Pixel extrapolation method. See #BorderTypes. #BORDER_WRAP is not supported.
  2178. */
  2179. + (void)preCornerDetect:(Mat*)src dst:(Mat*)dst ksize:(int)ksize borderType:(BorderTypes)borderType NS_SWIFT_NAME(preCornerDetect(src:dst:ksize:borderType:));
  2180. /**
  2181. * Calculates a feature map for corner detection.
  2182. *
  2183. * The function calculates the complex spatial derivative-based function of the source image
  2184. *
  2185. * `$$\texttt{dst} = (D_x \texttt{src} )^2 \cdot D_{yy} \texttt{src} + (D_y \texttt{src} )^2 \cdot D_{xx} \texttt{src} - 2 D_x \texttt{src} \cdot D_y \texttt{src} \cdot D_{xy} \texttt{src}$$`
  2186. *
  2187. * where `$$D_x$$`,`$$D_y$$` are the first image derivatives, `$$D_{xx}$$`,`$$D_{yy}$$` are the second image
  2188. * derivatives, and `$$D_{xy}$$` is the mixed derivative.
  2189. *
  2190. * The corners can be found as local maximums of the functions, as shown below:
  2191. *
  2192. * Mat corners, dilated_corners;
  2193. * preCornerDetect(image, corners, 3);
  2194. * // dilation with 3x3 rectangular structuring element
  2195. * dilate(corners, dilated_corners, Mat(), 1);
  2196. * Mat corner_mask = corners == dilated_corners;
  2197. *
  2198. *
  2199. * @param src Source single-channel 8-bit of floating-point image.
  2200. * @param dst Output image that has the type CV_32F and the same size as src .
  2201. * @param ksize %Aperture size of the Sobel .
  2202. */
  2203. + (void)preCornerDetect:(Mat*)src dst:(Mat*)dst ksize:(int)ksize NS_SWIFT_NAME(preCornerDetect(src:dst:ksize:));
  2204. //
  2205. // void cv::cornerSubPix(Mat image, Mat& corners, Size winSize, Size zeroZone, TermCriteria criteria)
  2206. //
  2207. /**
  2208. * Refines the corner locations.
  2209. *
  2210. * The function iterates to find the sub-pixel accurate location of corners or radial saddle
  2211. * points as described in CITE: forstner1987fast, and as shown on the figure below.
  2212. *
  2213. * ![image](pics/cornersubpix.png)
  2214. *
  2215. * Sub-pixel accurate corner locator is based on the observation that every vector from the center `$$q$$`
  2216. * to a point `$$p$$` located within a neighborhood of `$$q$$` is orthogonal to the image gradient at `$$p$$`
  2217. * subject to image and measurement noise. Consider the expression:
  2218. *
  2219. * `$$\epsilon _i = {DI_{p_i}}^T \cdot (q - p_i)$$`
  2220. *
  2221. * where `$${DI_{p_i}}$$` is an image gradient at one of the points `$$p_i$$` in a neighborhood of `$$q$$` . The
  2222. * value of `$$q$$` is to be found so that `$$\epsilon_i$$` is minimized. A system of equations may be set up
  2223. * with `$$\epsilon_i$$` set to zero:
  2224. *
  2225. * `$$\sum _i(DI_{p_i} \cdot {DI_{p_i}}^T) \cdot q - \sum _i(DI_{p_i} \cdot {DI_{p_i}}^T \cdot p_i)$$`
  2226. *
  2227. * where the gradients are summed within a neighborhood ("search window") of `$$q$$` . Calling the first
  2228. * gradient term `$$G$$` and the second gradient term `$$b$$` gives:
  2229. *
  2230. * `$$q = G^{-1} \cdot b$$`
  2231. *
  2232. * The algorithm sets the center of the neighborhood window at this new center `$$q$$` and then iterates
  2233. * until the center stays within a set threshold.
  2234. *
  2235. * @param image Input single-channel, 8-bit or float image.
  2236. * @param corners Initial coordinates of the input corners and refined coordinates provided for
  2237. * output.
  2238. * @param winSize Half of the side length of the search window. For example, if winSize=Size(5,5) ,
  2239. * then a `$$(5*2+1) \times (5*2+1) = 11 \times 11$$` search window is used.
  2240. * @param zeroZone Half of the size of the dead region in the middle of the search zone over which
  2241. * the summation in the formula below is not done. It is used sometimes to avoid possible
  2242. * singularities of the autocorrelation matrix. The value of (-1,-1) indicates that there is no such
  2243. * a size.
  2244. * @param criteria Criteria for termination of the iterative process of corner refinement. That is,
  2245. * the process of corner position refinement stops either after criteria.maxCount iterations or when
  2246. * the corner position moves by less than criteria.epsilon on some iteration.
  2247. */
  2248. + (void)cornerSubPix:(Mat*)image corners:(Mat*)corners winSize:(Size2i*)winSize zeroZone:(Size2i*)zeroZone criteria:(TermCriteria*)criteria NS_SWIFT_NAME(cornerSubPix(image:corners:winSize:zeroZone:criteria:));
  2249. //
  2250. // void cv::goodFeaturesToTrack(Mat image, vector_Point& corners, int maxCorners, double qualityLevel, double minDistance, Mat mask = Mat(), int blockSize = 3, bool useHarrisDetector = false, double k = 0.04)
  2251. //
  2252. /**
  2253. * Determines strong corners on an image.
  2254. *
  2255. * The function finds the most prominent corners in the image or in the specified image region, as
  2256. * described in CITE: Shi94
  2257. *
  2258. * - Function calculates the corner quality measure at every source image pixel using the
  2259. * #cornerMinEigenVal or #cornerHarris .
  2260. * - Function performs a non-maximum suppression (the local maximums in *3 x 3* neighborhood are
  2261. * retained).
  2262. * - The corners with the minimal eigenvalue less than
  2263. * `$$\texttt{qualityLevel} \cdot \max_{x,y} qualityMeasureMap(x,y)$$` are rejected.
  2264. * - The remaining corners are sorted by the quality measure in the descending order.
  2265. * - Function throws away each corner for which there is a stronger corner at a distance less than
  2266. * maxDistance.
  2267. *
  2268. * The function can be used to initialize a point-based tracker of an object.
  2269. *
  2270. * NOTE: If the function is called with different values A and B of the parameter qualityLevel , and
  2271. * A \> B, the vector of returned corners with qualityLevel=A will be the prefix of the output vector
  2272. * with qualityLevel=B .
  2273. *
  2274. * @param image Input 8-bit or floating-point 32-bit, single-channel image.
  2275. * @param corners Output vector of detected corners.
  2276. * @param maxCorners Maximum number of corners to return. If there are more corners than are found,
  2277. * the strongest of them is returned. `maxCorners <= 0` implies that no limit on the maximum is set
  2278. * and all detected corners are returned.
  2279. * @param qualityLevel Parameter characterizing the minimal accepted quality of image corners. The
  2280. * parameter value is multiplied by the best corner quality measure, which is the minimal eigenvalue
  2281. * (see #cornerMinEigenVal ) or the Harris function response (see #cornerHarris ). The corners with the
  2282. * quality measure less than the product are rejected. For example, if the best corner has the
  2283. * quality measure = 1500, and the qualityLevel=0.01 , then all the corners with the quality measure
  2284. * less than 15 are rejected.
  2285. * @param minDistance Minimum possible Euclidean distance between the returned corners.
  2286. * @param mask Optional region of interest. If the image is not empty (it needs to have the type
  2287. * CV_8UC1 and the same size as image ), it specifies the region in which the corners are detected.
  2288. * @param blockSize Size of an average block for computing a derivative covariation matrix over each
  2289. * pixel neighborhood. See cornerEigenValsAndVecs .
  2290. * @param useHarrisDetector Parameter indicating whether to use a Harris detector (see #cornerHarris)
  2291. * or #cornerMinEigenVal.
  2292. * @param k Free parameter of the Harris detector.
  2293. *
  2294. * @see `+cornerMinEigenVal:dst:blockSize:ksize:borderType:`, `+cornerHarris:dst:blockSize:ksize:k:borderType:`, `calcOpticalFlowPyrLK`, `estimateRigidTransform`, ``
  2295. */
  2296. + (void)goodFeaturesToTrack:(Mat*)image corners:(NSMutableArray<Point2i*>*)corners maxCorners:(int)maxCorners qualityLevel:(double)qualityLevel minDistance:(double)minDistance mask:(Mat*)mask blockSize:(int)blockSize useHarrisDetector:(BOOL)useHarrisDetector k:(double)k NS_SWIFT_NAME(goodFeaturesToTrack(image:corners:maxCorners:qualityLevel:minDistance:mask:blockSize:useHarrisDetector:k:));
  2297. /**
  2298. * Determines strong corners on an image.
  2299. *
  2300. * The function finds the most prominent corners in the image or in the specified image region, as
  2301. * described in CITE: Shi94
  2302. *
  2303. * - Function calculates the corner quality measure at every source image pixel using the
  2304. * #cornerMinEigenVal or #cornerHarris .
  2305. * - Function performs a non-maximum suppression (the local maximums in *3 x 3* neighborhood are
  2306. * retained).
  2307. * - The corners with the minimal eigenvalue less than
  2308. * `$$\texttt{qualityLevel} \cdot \max_{x,y} qualityMeasureMap(x,y)$$` are rejected.
  2309. * - The remaining corners are sorted by the quality measure in the descending order.
  2310. * - Function throws away each corner for which there is a stronger corner at a distance less than
  2311. * maxDistance.
  2312. *
  2313. * The function can be used to initialize a point-based tracker of an object.
  2314. *
  2315. * NOTE: If the function is called with different values A and B of the parameter qualityLevel , and
  2316. * A \> B, the vector of returned corners with qualityLevel=A will be the prefix of the output vector
  2317. * with qualityLevel=B .
  2318. *
  2319. * @param image Input 8-bit or floating-point 32-bit, single-channel image.
  2320. * @param corners Output vector of detected corners.
  2321. * @param maxCorners Maximum number of corners to return. If there are more corners than are found,
  2322. * the strongest of them is returned. `maxCorners <= 0` implies that no limit on the maximum is set
  2323. * and all detected corners are returned.
  2324. * @param qualityLevel Parameter characterizing the minimal accepted quality of image corners. The
  2325. * parameter value is multiplied by the best corner quality measure, which is the minimal eigenvalue
  2326. * (see #cornerMinEigenVal ) or the Harris function response (see #cornerHarris ). The corners with the
  2327. * quality measure less than the product are rejected. For example, if the best corner has the
  2328. * quality measure = 1500, and the qualityLevel=0.01 , then all the corners with the quality measure
  2329. * less than 15 are rejected.
  2330. * @param minDistance Minimum possible Euclidean distance between the returned corners.
  2331. * @param mask Optional region of interest. If the image is not empty (it needs to have the type
  2332. * CV_8UC1 and the same size as image ), it specifies the region in which the corners are detected.
  2333. * @param blockSize Size of an average block for computing a derivative covariation matrix over each
  2334. * pixel neighborhood. See cornerEigenValsAndVecs .
  2335. * @param useHarrisDetector Parameter indicating whether to use a Harris detector (see #cornerHarris)
  2336. * or #cornerMinEigenVal.
  2337. *
  2338. * @see `+cornerMinEigenVal:dst:blockSize:ksize:borderType:`, `+cornerHarris:dst:blockSize:ksize:k:borderType:`, `calcOpticalFlowPyrLK`, `estimateRigidTransform`, ``
  2339. */
  2340. + (void)goodFeaturesToTrack:(Mat*)image corners:(NSMutableArray<Point2i*>*)corners maxCorners:(int)maxCorners qualityLevel:(double)qualityLevel minDistance:(double)minDistance mask:(Mat*)mask blockSize:(int)blockSize useHarrisDetector:(BOOL)useHarrisDetector NS_SWIFT_NAME(goodFeaturesToTrack(image:corners:maxCorners:qualityLevel:minDistance:mask:blockSize:useHarrisDetector:));
  2341. /**
  2342. * Determines strong corners on an image.
  2343. *
  2344. * The function finds the most prominent corners in the image or in the specified image region, as
  2345. * described in CITE: Shi94
  2346. *
  2347. * - Function calculates the corner quality measure at every source image pixel using the
  2348. * #cornerMinEigenVal or #cornerHarris .
  2349. * - Function performs a non-maximum suppression (the local maximums in *3 x 3* neighborhood are
  2350. * retained).
  2351. * - The corners with the minimal eigenvalue less than
  2352. * `$$\texttt{qualityLevel} \cdot \max_{x,y} qualityMeasureMap(x,y)$$` are rejected.
  2353. * - The remaining corners are sorted by the quality measure in the descending order.
  2354. * - Function throws away each corner for which there is a stronger corner at a distance less than
  2355. * maxDistance.
  2356. *
  2357. * The function can be used to initialize a point-based tracker of an object.
  2358. *
  2359. * NOTE: If the function is called with different values A and B of the parameter qualityLevel , and
  2360. * A \> B, the vector of returned corners with qualityLevel=A will be the prefix of the output vector
  2361. * with qualityLevel=B .
  2362. *
  2363. * @param image Input 8-bit or floating-point 32-bit, single-channel image.
  2364. * @param corners Output vector of detected corners.
  2365. * @param maxCorners Maximum number of corners to return. If there are more corners than are found,
  2366. * the strongest of them is returned. `maxCorners <= 0` implies that no limit on the maximum is set
  2367. * and all detected corners are returned.
  2368. * @param qualityLevel Parameter characterizing the minimal accepted quality of image corners. The
  2369. * parameter value is multiplied by the best corner quality measure, which is the minimal eigenvalue
  2370. * (see #cornerMinEigenVal ) or the Harris function response (see #cornerHarris ). The corners with the
  2371. * quality measure less than the product are rejected. For example, if the best corner has the
  2372. * quality measure = 1500, and the qualityLevel=0.01 , then all the corners with the quality measure
  2373. * less than 15 are rejected.
  2374. * @param minDistance Minimum possible Euclidean distance between the returned corners.
  2375. * @param mask Optional region of interest. If the image is not empty (it needs to have the type
  2376. * CV_8UC1 and the same size as image ), it specifies the region in which the corners are detected.
  2377. * @param blockSize Size of an average block for computing a derivative covariation matrix over each
  2378. * pixel neighborhood. See cornerEigenValsAndVecs .
  2379. * or #cornerMinEigenVal.
  2380. *
  2381. * @see `+cornerMinEigenVal:dst:blockSize:ksize:borderType:`, `+cornerHarris:dst:blockSize:ksize:k:borderType:`, `calcOpticalFlowPyrLK`, `estimateRigidTransform`, ``
  2382. */
  2383. + (void)goodFeaturesToTrack:(Mat*)image corners:(NSMutableArray<Point2i*>*)corners maxCorners:(int)maxCorners qualityLevel:(double)qualityLevel minDistance:(double)minDistance mask:(Mat*)mask blockSize:(int)blockSize NS_SWIFT_NAME(goodFeaturesToTrack(image:corners:maxCorners:qualityLevel:minDistance:mask:blockSize:));
  2384. /**
  2385. * Determines strong corners on an image.
  2386. *
  2387. * The function finds the most prominent corners in the image or in the specified image region, as
  2388. * described in CITE: Shi94
  2389. *
  2390. * - Function calculates the corner quality measure at every source image pixel using the
  2391. * #cornerMinEigenVal or #cornerHarris .
  2392. * - Function performs a non-maximum suppression (the local maximums in *3 x 3* neighborhood are
  2393. * retained).
  2394. * - The corners with the minimal eigenvalue less than
  2395. * `$$\texttt{qualityLevel} \cdot \max_{x,y} qualityMeasureMap(x,y)$$` are rejected.
  2396. * - The remaining corners are sorted by the quality measure in the descending order.
  2397. * - Function throws away each corner for which there is a stronger corner at a distance less than
  2398. * maxDistance.
  2399. *
  2400. * The function can be used to initialize a point-based tracker of an object.
  2401. *
  2402. * NOTE: If the function is called with different values A and B of the parameter qualityLevel , and
  2403. * A \> B, the vector of returned corners with qualityLevel=A will be the prefix of the output vector
  2404. * with qualityLevel=B .
  2405. *
  2406. * @param image Input 8-bit or floating-point 32-bit, single-channel image.
  2407. * @param corners Output vector of detected corners.
  2408. * @param maxCorners Maximum number of corners to return. If there are more corners than are found,
  2409. * the strongest of them is returned. `maxCorners <= 0` implies that no limit on the maximum is set
  2410. * and all detected corners are returned.
  2411. * @param qualityLevel Parameter characterizing the minimal accepted quality of image corners. The
  2412. * parameter value is multiplied by the best corner quality measure, which is the minimal eigenvalue
  2413. * (see #cornerMinEigenVal ) or the Harris function response (see #cornerHarris ). The corners with the
  2414. * quality measure less than the product are rejected. For example, if the best corner has the
  2415. * quality measure = 1500, and the qualityLevel=0.01 , then all the corners with the quality measure
  2416. * less than 15 are rejected.
  2417. * @param minDistance Minimum possible Euclidean distance between the returned corners.
  2418. * @param mask Optional region of interest. If the image is not empty (it needs to have the type
  2419. * CV_8UC1 and the same size as image ), it specifies the region in which the corners are detected.
  2420. * pixel neighborhood. See cornerEigenValsAndVecs .
  2421. * or #cornerMinEigenVal.
  2422. *
  2423. * @see `+cornerMinEigenVal:dst:blockSize:ksize:borderType:`, `+cornerHarris:dst:blockSize:ksize:k:borderType:`, `calcOpticalFlowPyrLK`, `estimateRigidTransform`, ``
  2424. */
  2425. + (void)goodFeaturesToTrack:(Mat*)image corners:(NSMutableArray<Point2i*>*)corners maxCorners:(int)maxCorners qualityLevel:(double)qualityLevel minDistance:(double)minDistance mask:(Mat*)mask NS_SWIFT_NAME(goodFeaturesToTrack(image:corners:maxCorners:qualityLevel:minDistance:mask:));
  2426. /**
  2427. * Determines strong corners on an image.
  2428. *
  2429. * The function finds the most prominent corners in the image or in the specified image region, as
  2430. * described in CITE: Shi94
  2431. *
  2432. * - Function calculates the corner quality measure at every source image pixel using the
  2433. * #cornerMinEigenVal or #cornerHarris .
  2434. * - Function performs a non-maximum suppression (the local maximums in *3 x 3* neighborhood are
  2435. * retained).
  2436. * - The corners with the minimal eigenvalue less than
  2437. * `$$\texttt{qualityLevel} \cdot \max_{x,y} qualityMeasureMap(x,y)$$` are rejected.
  2438. * - The remaining corners are sorted by the quality measure in the descending order.
  2439. * - Function throws away each corner for which there is a stronger corner at a distance less than
  2440. * maxDistance.
  2441. *
  2442. * The function can be used to initialize a point-based tracker of an object.
  2443. *
  2444. * NOTE: If the function is called with different values A and B of the parameter qualityLevel , and
  2445. * A \> B, the vector of returned corners with qualityLevel=A will be the prefix of the output vector
  2446. * with qualityLevel=B .
  2447. *
  2448. * @param image Input 8-bit or floating-point 32-bit, single-channel image.
  2449. * @param corners Output vector of detected corners.
  2450. * @param maxCorners Maximum number of corners to return. If there are more corners than are found,
  2451. * the strongest of them is returned. `maxCorners <= 0` implies that no limit on the maximum is set
  2452. * and all detected corners are returned.
  2453. * @param qualityLevel Parameter characterizing the minimal accepted quality of image corners. The
  2454. * parameter value is multiplied by the best corner quality measure, which is the minimal eigenvalue
  2455. * (see #cornerMinEigenVal ) or the Harris function response (see #cornerHarris ). The corners with the
  2456. * quality measure less than the product are rejected. For example, if the best corner has the
  2457. * quality measure = 1500, and the qualityLevel=0.01 , then all the corners with the quality measure
  2458. * less than 15 are rejected.
  2459. * @param minDistance Minimum possible Euclidean distance between the returned corners.
  2460. * CV_8UC1 and the same size as image ), it specifies the region in which the corners are detected.
  2461. * pixel neighborhood. See cornerEigenValsAndVecs .
  2462. * or #cornerMinEigenVal.
  2463. *
  2464. * @see `+cornerMinEigenVal:dst:blockSize:ksize:borderType:`, `+cornerHarris:dst:blockSize:ksize:k:borderType:`, `calcOpticalFlowPyrLK`, `estimateRigidTransform`, ``
  2465. */
  2466. + (void)goodFeaturesToTrack:(Mat*)image corners:(NSMutableArray<Point2i*>*)corners maxCorners:(int)maxCorners qualityLevel:(double)qualityLevel minDistance:(double)minDistance NS_SWIFT_NAME(goodFeaturesToTrack(image:corners:maxCorners:qualityLevel:minDistance:));
  2467. //
  2468. // void cv::goodFeaturesToTrack(Mat image, vector_Point& corners, int maxCorners, double qualityLevel, double minDistance, Mat mask, int blockSize, int gradientSize, bool useHarrisDetector = false, double k = 0.04)
  2469. //
  2470. + (void)goodFeaturesToTrack:(Mat*)image corners:(NSMutableArray<Point2i*>*)corners maxCorners:(int)maxCorners qualityLevel:(double)qualityLevel minDistance:(double)minDistance mask:(Mat*)mask blockSize:(int)blockSize gradientSize:(int)gradientSize useHarrisDetector:(BOOL)useHarrisDetector k:(double)k NS_SWIFT_NAME(goodFeaturesToTrack(image:corners:maxCorners:qualityLevel:minDistance:mask:blockSize:gradientSize:useHarrisDetector:k:));
  2471. + (void)goodFeaturesToTrack:(Mat*)image corners:(NSMutableArray<Point2i*>*)corners maxCorners:(int)maxCorners qualityLevel:(double)qualityLevel minDistance:(double)minDistance mask:(Mat*)mask blockSize:(int)blockSize gradientSize:(int)gradientSize useHarrisDetector:(BOOL)useHarrisDetector NS_SWIFT_NAME(goodFeaturesToTrack(image:corners:maxCorners:qualityLevel:minDistance:mask:blockSize:gradientSize:useHarrisDetector:));
  2472. + (void)goodFeaturesToTrack:(Mat*)image corners:(NSMutableArray<Point2i*>*)corners maxCorners:(int)maxCorners qualityLevel:(double)qualityLevel minDistance:(double)minDistance mask:(Mat*)mask blockSize:(int)blockSize gradientSize:(int)gradientSize NS_SWIFT_NAME(goodFeaturesToTrack(image:corners:maxCorners:qualityLevel:minDistance:mask:blockSize:gradientSize:));
  2473. //
  2474. // void cv::goodFeaturesToTrack(Mat image, Mat& corners, int maxCorners, double qualityLevel, double minDistance, Mat mask, Mat& cornersQuality, int blockSize = 3, int gradientSize = 3, bool useHarrisDetector = false, double k = 0.04)
  2475. //
  2476. /**
  2477. * Same as above, but returns also quality measure of the detected corners.
  2478. *
  2479. * @param image Input 8-bit or floating-point 32-bit, single-channel image.
  2480. * @param corners Output vector of detected corners.
  2481. * @param maxCorners Maximum number of corners to return. If there are more corners than are found,
  2482. * the strongest of them is returned. `maxCorners <= 0` implies that no limit on the maximum is set
  2483. * and all detected corners are returned.
  2484. * @param qualityLevel Parameter characterizing the minimal accepted quality of image corners. The
  2485. * parameter value is multiplied by the best corner quality measure, which is the minimal eigenvalue
  2486. * (see #cornerMinEigenVal ) or the Harris function response (see #cornerHarris ). The corners with the
  2487. * quality measure less than the product are rejected. For example, if the best corner has the
  2488. * quality measure = 1500, and the qualityLevel=0.01 , then all the corners with the quality measure
  2489. * less than 15 are rejected.
  2490. * @param minDistance Minimum possible Euclidean distance between the returned corners.
  2491. * @param mask Region of interest. If the image is not empty (it needs to have the type
  2492. * CV_8UC1 and the same size as image ), it specifies the region in which the corners are detected.
  2493. * @param cornersQuality Output vector of quality measure of the detected corners.
  2494. * @param blockSize Size of an average block for computing a derivative covariation matrix over each
  2495. * pixel neighborhood. See cornerEigenValsAndVecs .
  2496. * @param gradientSize Aperture parameter for the Sobel operator used for derivatives computation.
  2497. * See cornerEigenValsAndVecs .
  2498. * @param useHarrisDetector Parameter indicating whether to use a Harris detector (see #cornerHarris)
  2499. * or #cornerMinEigenVal.
  2500. * @param k Free parameter of the Harris detector.
  2501. */
  2502. + (void)goodFeaturesToTrackWithQuality:(Mat*)image corners:(Mat*)corners maxCorners:(int)maxCorners qualityLevel:(double)qualityLevel minDistance:(double)minDistance mask:(Mat*)mask cornersQuality:(Mat*)cornersQuality blockSize:(int)blockSize gradientSize:(int)gradientSize useHarrisDetector:(BOOL)useHarrisDetector k:(double)k NS_SWIFT_NAME(goodFeaturesToTrack(image:corners:maxCorners:qualityLevel:minDistance:mask:cornersQuality:blockSize:gradientSize:useHarrisDetector:k:));
  2503. /**
  2504. * Same as above, but returns also quality measure of the detected corners.
  2505. *
  2506. * @param image Input 8-bit or floating-point 32-bit, single-channel image.
  2507. * @param corners Output vector of detected corners.
  2508. * @param maxCorners Maximum number of corners to return. If there are more corners than are found,
  2509. * the strongest of them is returned. `maxCorners <= 0` implies that no limit on the maximum is set
  2510. * and all detected corners are returned.
  2511. * @param qualityLevel Parameter characterizing the minimal accepted quality of image corners. The
  2512. * parameter value is multiplied by the best corner quality measure, which is the minimal eigenvalue
  2513. * (see #cornerMinEigenVal ) or the Harris function response (see #cornerHarris ). The corners with the
  2514. * quality measure less than the product are rejected. For example, if the best corner has the
  2515. * quality measure = 1500, and the qualityLevel=0.01 , then all the corners with the quality measure
  2516. * less than 15 are rejected.
  2517. * @param minDistance Minimum possible Euclidean distance between the returned corners.
  2518. * @param mask Region of interest. If the image is not empty (it needs to have the type
  2519. * CV_8UC1 and the same size as image ), it specifies the region in which the corners are detected.
  2520. * @param cornersQuality Output vector of quality measure of the detected corners.
  2521. * @param blockSize Size of an average block for computing a derivative covariation matrix over each
  2522. * pixel neighborhood. See cornerEigenValsAndVecs .
  2523. * @param gradientSize Aperture parameter for the Sobel operator used for derivatives computation.
  2524. * See cornerEigenValsAndVecs .
  2525. * @param useHarrisDetector Parameter indicating whether to use a Harris detector (see #cornerHarris)
  2526. * or #cornerMinEigenVal.
  2527. */
  2528. + (void)goodFeaturesToTrackWithQuality:(Mat*)image corners:(Mat*)corners maxCorners:(int)maxCorners qualityLevel:(double)qualityLevel minDistance:(double)minDistance mask:(Mat*)mask cornersQuality:(Mat*)cornersQuality blockSize:(int)blockSize gradientSize:(int)gradientSize useHarrisDetector:(BOOL)useHarrisDetector NS_SWIFT_NAME(goodFeaturesToTrack(image:corners:maxCorners:qualityLevel:minDistance:mask:cornersQuality:blockSize:gradientSize:useHarrisDetector:));
  2529. /**
  2530. * Same as above, but returns also quality measure of the detected corners.
  2531. *
  2532. * @param image Input 8-bit or floating-point 32-bit, single-channel image.
  2533. * @param corners Output vector of detected corners.
  2534. * @param maxCorners Maximum number of corners to return. If there are more corners than are found,
  2535. * the strongest of them is returned. `maxCorners <= 0` implies that no limit on the maximum is set
  2536. * and all detected corners are returned.
  2537. * @param qualityLevel Parameter characterizing the minimal accepted quality of image corners. The
  2538. * parameter value is multiplied by the best corner quality measure, which is the minimal eigenvalue
  2539. * (see #cornerMinEigenVal ) or the Harris function response (see #cornerHarris ). The corners with the
  2540. * quality measure less than the product are rejected. For example, if the best corner has the
  2541. * quality measure = 1500, and the qualityLevel=0.01 , then all the corners with the quality measure
  2542. * less than 15 are rejected.
  2543. * @param minDistance Minimum possible Euclidean distance between the returned corners.
  2544. * @param mask Region of interest. If the image is not empty (it needs to have the type
  2545. * CV_8UC1 and the same size as image ), it specifies the region in which the corners are detected.
  2546. * @param cornersQuality Output vector of quality measure of the detected corners.
  2547. * @param blockSize Size of an average block for computing a derivative covariation matrix over each
  2548. * pixel neighborhood. See cornerEigenValsAndVecs .
  2549. * @param gradientSize Aperture parameter for the Sobel operator used for derivatives computation.
  2550. * See cornerEigenValsAndVecs .
  2551. * or #cornerMinEigenVal.
  2552. */
  2553. + (void)goodFeaturesToTrackWithQuality:(Mat*)image corners:(Mat*)corners maxCorners:(int)maxCorners qualityLevel:(double)qualityLevel minDistance:(double)minDistance mask:(Mat*)mask cornersQuality:(Mat*)cornersQuality blockSize:(int)blockSize gradientSize:(int)gradientSize NS_SWIFT_NAME(goodFeaturesToTrack(image:corners:maxCorners:qualityLevel:minDistance:mask:cornersQuality:blockSize:gradientSize:));
  2554. /**
  2555. * Same as above, but returns also quality measure of the detected corners.
  2556. *
  2557. * @param image Input 8-bit or floating-point 32-bit, single-channel image.
  2558. * @param corners Output vector of detected corners.
  2559. * @param maxCorners Maximum number of corners to return. If there are more corners than are found,
  2560. * the strongest of them is returned. `maxCorners <= 0` implies that no limit on the maximum is set
  2561. * and all detected corners are returned.
  2562. * @param qualityLevel Parameter characterizing the minimal accepted quality of image corners. The
  2563. * parameter value is multiplied by the best corner quality measure, which is the minimal eigenvalue
  2564. * (see #cornerMinEigenVal ) or the Harris function response (see #cornerHarris ). The corners with the
  2565. * quality measure less than the product are rejected. For example, if the best corner has the
  2566. * quality measure = 1500, and the qualityLevel=0.01 , then all the corners with the quality measure
  2567. * less than 15 are rejected.
  2568. * @param minDistance Minimum possible Euclidean distance between the returned corners.
  2569. * @param mask Region of interest. If the image is not empty (it needs to have the type
  2570. * CV_8UC1 and the same size as image ), it specifies the region in which the corners are detected.
  2571. * @param cornersQuality Output vector of quality measure of the detected corners.
  2572. * @param blockSize Size of an average block for computing a derivative covariation matrix over each
  2573. * pixel neighborhood. See cornerEigenValsAndVecs .
  2574. * See cornerEigenValsAndVecs .
  2575. * or #cornerMinEigenVal.
  2576. */
  2577. + (void)goodFeaturesToTrackWithQuality:(Mat*)image corners:(Mat*)corners maxCorners:(int)maxCorners qualityLevel:(double)qualityLevel minDistance:(double)minDistance mask:(Mat*)mask cornersQuality:(Mat*)cornersQuality blockSize:(int)blockSize NS_SWIFT_NAME(goodFeaturesToTrack(image:corners:maxCorners:qualityLevel:minDistance:mask:cornersQuality:blockSize:));
  2578. /**
  2579. * Same as above, but returns also quality measure of the detected corners.
  2580. *
  2581. * @param image Input 8-bit or floating-point 32-bit, single-channel image.
  2582. * @param corners Output vector of detected corners.
  2583. * @param maxCorners Maximum number of corners to return. If there are more corners than are found,
  2584. * the strongest of them is returned. `maxCorners <= 0` implies that no limit on the maximum is set
  2585. * and all detected corners are returned.
  2586. * @param qualityLevel Parameter characterizing the minimal accepted quality of image corners. The
  2587. * parameter value is multiplied by the best corner quality measure, which is the minimal eigenvalue
  2588. * (see #cornerMinEigenVal ) or the Harris function response (see #cornerHarris ). The corners with the
  2589. * quality measure less than the product are rejected. For example, if the best corner has the
  2590. * quality measure = 1500, and the qualityLevel=0.01 , then all the corners with the quality measure
  2591. * less than 15 are rejected.
  2592. * @param minDistance Minimum possible Euclidean distance between the returned corners.
  2593. * @param mask Region of interest. If the image is not empty (it needs to have the type
  2594. * CV_8UC1 and the same size as image ), it specifies the region in which the corners are detected.
  2595. * @param cornersQuality Output vector of quality measure of the detected corners.
  2596. * pixel neighborhood. See cornerEigenValsAndVecs .
  2597. * See cornerEigenValsAndVecs .
  2598. * or #cornerMinEigenVal.
  2599. */
  2600. + (void)goodFeaturesToTrackWithQuality:(Mat*)image corners:(Mat*)corners maxCorners:(int)maxCorners qualityLevel:(double)qualityLevel minDistance:(double)minDistance mask:(Mat*)mask cornersQuality:(Mat*)cornersQuality NS_SWIFT_NAME(goodFeaturesToTrack(image:corners:maxCorners:qualityLevel:minDistance:mask:cornersQuality:));
  2601. //
  2602. // void cv::HoughLines(Mat image, Mat& lines, double rho, double theta, int threshold, double srn = 0, double stn = 0, double min_theta = 0, double max_theta = CV_PI)
  2603. //
  2604. /**
  2605. * Finds lines in a binary image using the standard Hough transform.
  2606. *
  2607. * The function implements the standard or standard multi-scale Hough transform algorithm for line
  2608. * detection. See <http://homepages.inf.ed.ac.uk/rbf/HIPR2/hough.htm> for a good explanation of Hough
  2609. * transform.
  2610. *
  2611. * @param image 8-bit, single-channel binary source image. The image may be modified by the function.
  2612. * @param lines Output vector of lines. Each line is represented by a 2 or 3 element vector
  2613. * `$$(\rho, \theta)$$` or `$$(\rho, \theta, \textrm{votes})$$`, where `$$\rho$$` is the distance from
  2614. * the coordinate origin `$$(0,0)$$` (top-left corner of the image), `$$\theta$$` is the line rotation
  2615. * angle in radians ( `$$0 \sim \textrm{vertical line}, \pi/2 \sim \textrm{horizontal line}$$` ), and
  2616. * `$$\textrm{votes}$$` is the value of accumulator.
  2617. * @param rho Distance resolution of the accumulator in pixels.
  2618. * @param theta Angle resolution of the accumulator in radians.
  2619. * @param threshold %Accumulator threshold parameter. Only those lines are returned that get enough
  2620. * votes ( `$$>\texttt{threshold}$$` ).
  2621. * @param srn For the multi-scale Hough transform, it is a divisor for the distance resolution rho.
  2622. * The coarse accumulator distance resolution is rho and the accurate accumulator resolution is
  2623. * rho/srn. If both srn=0 and stn=0, the classical Hough transform is used. Otherwise, both these
  2624. * parameters should be positive.
  2625. * @param stn For the multi-scale Hough transform, it is a divisor for the distance resolution theta.
  2626. * @param min_theta For standard and multi-scale Hough transform, minimum angle to check for lines.
  2627. * Must fall between 0 and max_theta.
  2628. * @param max_theta For standard and multi-scale Hough transform, an upper bound for the angle.
  2629. * Must fall between min_theta and CV_PI. The actual maximum angle in the accumulator may be slightly
  2630. * less than max_theta, depending on the parameters min_theta and theta.
  2631. */
  2632. + (void)HoughLines:(Mat*)image lines:(Mat*)lines rho:(double)rho theta:(double)theta threshold:(int)threshold srn:(double)srn stn:(double)stn min_theta:(double)min_theta max_theta:(double)max_theta NS_SWIFT_NAME(HoughLines(image:lines:rho:theta:threshold:srn:stn:min_theta:max_theta:));
  2633. /**
  2634. * Finds lines in a binary image using the standard Hough transform.
  2635. *
  2636. * The function implements the standard or standard multi-scale Hough transform algorithm for line
  2637. * detection. See <http://homepages.inf.ed.ac.uk/rbf/HIPR2/hough.htm> for a good explanation of Hough
  2638. * transform.
  2639. *
  2640. * @param image 8-bit, single-channel binary source image. The image may be modified by the function.
  2641. * @param lines Output vector of lines. Each line is represented by a 2 or 3 element vector
  2642. * `$$(\rho, \theta)$$` or `$$(\rho, \theta, \textrm{votes})$$`, where `$$\rho$$` is the distance from
  2643. * the coordinate origin `$$(0,0)$$` (top-left corner of the image), `$$\theta$$` is the line rotation
  2644. * angle in radians ( `$$0 \sim \textrm{vertical line}, \pi/2 \sim \textrm{horizontal line}$$` ), and
  2645. * `$$\textrm{votes}$$` is the value of accumulator.
  2646. * @param rho Distance resolution of the accumulator in pixels.
  2647. * @param theta Angle resolution of the accumulator in radians.
  2648. * @param threshold %Accumulator threshold parameter. Only those lines are returned that get enough
  2649. * votes ( `$$>\texttt{threshold}$$` ).
  2650. * @param srn For the multi-scale Hough transform, it is a divisor for the distance resolution rho.
  2651. * The coarse accumulator distance resolution is rho and the accurate accumulator resolution is
  2652. * rho/srn. If both srn=0 and stn=0, the classical Hough transform is used. Otherwise, both these
  2653. * parameters should be positive.
  2654. * @param stn For the multi-scale Hough transform, it is a divisor for the distance resolution theta.
  2655. * @param min_theta For standard and multi-scale Hough transform, minimum angle to check for lines.
  2656. * Must fall between 0 and max_theta.
  2657. * Must fall between min_theta and CV_PI. The actual maximum angle in the accumulator may be slightly
  2658. * less than max_theta, depending on the parameters min_theta and theta.
  2659. */
  2660. + (void)HoughLines:(Mat*)image lines:(Mat*)lines rho:(double)rho theta:(double)theta threshold:(int)threshold srn:(double)srn stn:(double)stn min_theta:(double)min_theta NS_SWIFT_NAME(HoughLines(image:lines:rho:theta:threshold:srn:stn:min_theta:));
  2661. /**
  2662. * Finds lines in a binary image using the standard Hough transform.
  2663. *
  2664. * The function implements the standard or standard multi-scale Hough transform algorithm for line
  2665. * detection. See <http://homepages.inf.ed.ac.uk/rbf/HIPR2/hough.htm> for a good explanation of Hough
  2666. * transform.
  2667. *
  2668. * @param image 8-bit, single-channel binary source image. The image may be modified by the function.
  2669. * @param lines Output vector of lines. Each line is represented by a 2 or 3 element vector
  2670. * `$$(\rho, \theta)$$` or `$$(\rho, \theta, \textrm{votes})$$`, where `$$\rho$$` is the distance from
  2671. * the coordinate origin `$$(0,0)$$` (top-left corner of the image), `$$\theta$$` is the line rotation
  2672. * angle in radians ( `$$0 \sim \textrm{vertical line}, \pi/2 \sim \textrm{horizontal line}$$` ), and
  2673. * `$$\textrm{votes}$$` is the value of accumulator.
  2674. * @param rho Distance resolution of the accumulator in pixels.
  2675. * @param theta Angle resolution of the accumulator in radians.
  2676. * @param threshold %Accumulator threshold parameter. Only those lines are returned that get enough
  2677. * votes ( `$$>\texttt{threshold}$$` ).
  2678. * @param srn For the multi-scale Hough transform, it is a divisor for the distance resolution rho.
  2679. * The coarse accumulator distance resolution is rho and the accurate accumulator resolution is
  2680. * rho/srn. If both srn=0 and stn=0, the classical Hough transform is used. Otherwise, both these
  2681. * parameters should be positive.
  2682. * @param stn For the multi-scale Hough transform, it is a divisor for the distance resolution theta.
  2683. * Must fall between 0 and max_theta.
  2684. * Must fall between min_theta and CV_PI. The actual maximum angle in the accumulator may be slightly
  2685. * less than max_theta, depending on the parameters min_theta and theta.
  2686. */
  2687. + (void)HoughLines:(Mat*)image lines:(Mat*)lines rho:(double)rho theta:(double)theta threshold:(int)threshold srn:(double)srn stn:(double)stn NS_SWIFT_NAME(HoughLines(image:lines:rho:theta:threshold:srn:stn:));
  2688. /**
  2689. * Finds lines in a binary image using the standard Hough transform.
  2690. *
  2691. * The function implements the standard or standard multi-scale Hough transform algorithm for line
  2692. * detection. See <http://homepages.inf.ed.ac.uk/rbf/HIPR2/hough.htm> for a good explanation of Hough
  2693. * transform.
  2694. *
  2695. * @param image 8-bit, single-channel binary source image. The image may be modified by the function.
  2696. * @param lines Output vector of lines. Each line is represented by a 2 or 3 element vector
  2697. * `$$(\rho, \theta)$$` or `$$(\rho, \theta, \textrm{votes})$$`, where `$$\rho$$` is the distance from
  2698. * the coordinate origin `$$(0,0)$$` (top-left corner of the image), `$$\theta$$` is the line rotation
  2699. * angle in radians ( `$$0 \sim \textrm{vertical line}, \pi/2 \sim \textrm{horizontal line}$$` ), and
  2700. * `$$\textrm{votes}$$` is the value of accumulator.
  2701. * @param rho Distance resolution of the accumulator in pixels.
  2702. * @param theta Angle resolution of the accumulator in radians.
  2703. * @param threshold %Accumulator threshold parameter. Only those lines are returned that get enough
  2704. * votes ( `$$>\texttt{threshold}$$` ).
  2705. * @param srn For the multi-scale Hough transform, it is a divisor for the distance resolution rho.
  2706. * The coarse accumulator distance resolution is rho and the accurate accumulator resolution is
  2707. * rho/srn. If both srn=0 and stn=0, the classical Hough transform is used. Otherwise, both these
  2708. * parameters should be positive.
  2709. * Must fall between 0 and max_theta.
  2710. * Must fall between min_theta and CV_PI. The actual maximum angle in the accumulator may be slightly
  2711. * less than max_theta, depending on the parameters min_theta and theta.
  2712. */
  2713. + (void)HoughLines:(Mat*)image lines:(Mat*)lines rho:(double)rho theta:(double)theta threshold:(int)threshold srn:(double)srn NS_SWIFT_NAME(HoughLines(image:lines:rho:theta:threshold:srn:));
  2714. /**
  2715. * Finds lines in a binary image using the standard Hough transform.
  2716. *
  2717. * The function implements the standard or standard multi-scale Hough transform algorithm for line
  2718. * detection. See <http://homepages.inf.ed.ac.uk/rbf/HIPR2/hough.htm> for a good explanation of Hough
  2719. * transform.
  2720. *
  2721. * @param image 8-bit, single-channel binary source image. The image may be modified by the function.
  2722. * @param lines Output vector of lines. Each line is represented by a 2 or 3 element vector
  2723. * `$$(\rho, \theta)$$` or `$$(\rho, \theta, \textrm{votes})$$`, where `$$\rho$$` is the distance from
  2724. * the coordinate origin `$$(0,0)$$` (top-left corner of the image), `$$\theta$$` is the line rotation
  2725. * angle in radians ( `$$0 \sim \textrm{vertical line}, \pi/2 \sim \textrm{horizontal line}$$` ), and
  2726. * `$$\textrm{votes}$$` is the value of accumulator.
  2727. * @param rho Distance resolution of the accumulator in pixels.
  2728. * @param theta Angle resolution of the accumulator in radians.
  2729. * @param threshold %Accumulator threshold parameter. Only those lines are returned that get enough
  2730. * votes ( `$$>\texttt{threshold}$$` ).
  2731. * The coarse accumulator distance resolution is rho and the accurate accumulator resolution is
  2732. * rho/srn. If both srn=0 and stn=0, the classical Hough transform is used. Otherwise, both these
  2733. * parameters should be positive.
  2734. * Must fall between 0 and max_theta.
  2735. * Must fall between min_theta and CV_PI. The actual maximum angle in the accumulator may be slightly
  2736. * less than max_theta, depending on the parameters min_theta and theta.
  2737. */
  2738. + (void)HoughLines:(Mat*)image lines:(Mat*)lines rho:(double)rho theta:(double)theta threshold:(int)threshold NS_SWIFT_NAME(HoughLines(image:lines:rho:theta:threshold:));
  2739. //
  2740. // void cv::HoughLinesP(Mat image, Mat& lines, double rho, double theta, int threshold, double minLineLength = 0, double maxLineGap = 0)
  2741. //
  2742. /**
  2743. * Finds line segments in a binary image using the probabilistic Hough transform.
  2744. *
  2745. * The function implements the probabilistic Hough transform algorithm for line detection, described
  2746. * in CITE: Matas00
  2747. *
  2748. * See the line detection example below:
  2749. * INCLUDE: snippets/imgproc_HoughLinesP.cpp
  2750. * This is a sample picture the function parameters have been tuned for:
  2751. *
  2752. * ![image](pics/building.jpg)
  2753. *
  2754. * And this is the output of the above program in case of the probabilistic Hough transform:
  2755. *
  2756. * ![image](pics/houghp.png)
  2757. *
  2758. * @param image 8-bit, single-channel binary source image. The image may be modified by the function.
  2759. * @param lines Output vector of lines. Each line is represented by a 4-element vector
  2760. * `$$(x_1, y_1, x_2, y_2)$$` , where `$$(x_1,y_1)$$` and `$$(x_2, y_2)$$` are the ending points of each detected
  2761. * line segment.
  2762. * @param rho Distance resolution of the accumulator in pixels.
  2763. * @param theta Angle resolution of the accumulator in radians.
  2764. * @param threshold %Accumulator threshold parameter. Only those lines are returned that get enough
  2765. * votes ( `$$>\texttt{threshold}$$` ).
  2766. * @param minLineLength Minimum line length. Line segments shorter than that are rejected.
  2767. * @param maxLineGap Maximum allowed gap between points on the same line to link them.
  2768. *
  2769. * @see `LineSegmentDetector`
  2770. */
  2771. + (void)HoughLinesP:(Mat*)image lines:(Mat*)lines rho:(double)rho theta:(double)theta threshold:(int)threshold minLineLength:(double)minLineLength maxLineGap:(double)maxLineGap NS_SWIFT_NAME(HoughLinesP(image:lines:rho:theta:threshold:minLineLength:maxLineGap:));
  2772. /**
  2773. * Finds line segments in a binary image using the probabilistic Hough transform.
  2774. *
  2775. * The function implements the probabilistic Hough transform algorithm for line detection, described
  2776. * in CITE: Matas00
  2777. *
  2778. * See the line detection example below:
  2779. * INCLUDE: snippets/imgproc_HoughLinesP.cpp
  2780. * This is a sample picture the function parameters have been tuned for:
  2781. *
  2782. * ![image](pics/building.jpg)
  2783. *
  2784. * And this is the output of the above program in case of the probabilistic Hough transform:
  2785. *
  2786. * ![image](pics/houghp.png)
  2787. *
  2788. * @param image 8-bit, single-channel binary source image. The image may be modified by the function.
  2789. * @param lines Output vector of lines. Each line is represented by a 4-element vector
  2790. * `$$(x_1, y_1, x_2, y_2)$$` , where `$$(x_1,y_1)$$` and `$$(x_2, y_2)$$` are the ending points of each detected
  2791. * line segment.
  2792. * @param rho Distance resolution of the accumulator in pixels.
  2793. * @param theta Angle resolution of the accumulator in radians.
  2794. * @param threshold %Accumulator threshold parameter. Only those lines are returned that get enough
  2795. * votes ( `$$>\texttt{threshold}$$` ).
  2796. * @param minLineLength Minimum line length. Line segments shorter than that are rejected.
  2797. *
  2798. * @see `LineSegmentDetector`
  2799. */
  2800. + (void)HoughLinesP:(Mat*)image lines:(Mat*)lines rho:(double)rho theta:(double)theta threshold:(int)threshold minLineLength:(double)minLineLength NS_SWIFT_NAME(HoughLinesP(image:lines:rho:theta:threshold:minLineLength:));
  2801. /**
  2802. * Finds line segments in a binary image using the probabilistic Hough transform.
  2803. *
  2804. * The function implements the probabilistic Hough transform algorithm for line detection, described
  2805. * in CITE: Matas00
  2806. *
  2807. * See the line detection example below:
  2808. * INCLUDE: snippets/imgproc_HoughLinesP.cpp
  2809. * This is a sample picture the function parameters have been tuned for:
  2810. *
  2811. * ![image](pics/building.jpg)
  2812. *
  2813. * And this is the output of the above program in case of the probabilistic Hough transform:
  2814. *
  2815. * ![image](pics/houghp.png)
  2816. *
  2817. * @param image 8-bit, single-channel binary source image. The image may be modified by the function.
  2818. * @param lines Output vector of lines. Each line is represented by a 4-element vector
  2819. * `$$(x_1, y_1, x_2, y_2)$$` , where `$$(x_1,y_1)$$` and `$$(x_2, y_2)$$` are the ending points of each detected
  2820. * line segment.
  2821. * @param rho Distance resolution of the accumulator in pixels.
  2822. * @param theta Angle resolution of the accumulator in radians.
  2823. * @param threshold %Accumulator threshold parameter. Only those lines are returned that get enough
  2824. * votes ( `$$>\texttt{threshold}$$` ).
  2825. *
  2826. * @see `LineSegmentDetector`
  2827. */
  2828. + (void)HoughLinesP:(Mat*)image lines:(Mat*)lines rho:(double)rho theta:(double)theta threshold:(int)threshold NS_SWIFT_NAME(HoughLinesP(image:lines:rho:theta:threshold:));
  2829. //
  2830. // void cv::HoughLinesPointSet(Mat point, Mat& lines, int lines_max, int threshold, double min_rho, double max_rho, double rho_step, double min_theta, double max_theta, double theta_step)
  2831. //
  2832. /**
  2833. * Finds lines in a set of points using the standard Hough transform.
  2834. *
  2835. * The function finds lines in a set of points using a modification of the Hough transform.
  2836. * INCLUDE: snippets/imgproc_HoughLinesPointSet.cpp
  2837. * @param point Input vector of points. Each vector must be encoded as a Point vector `$$(x,y)$$`. Type must be CV_32FC2 or CV_32SC2.
  2838. * @param lines Output vector of found lines. Each vector is encoded as a vector<Vec3d> `$$(votes, rho, theta)$$`.
  2839. * The larger the value of 'votes', the higher the reliability of the Hough line.
  2840. * @param lines_max Max count of Hough lines.
  2841. * @param threshold %Accumulator threshold parameter. Only those lines are returned that get enough
  2842. * votes ( `$$>\texttt{threshold}$$` ).
  2843. * @param min_rho Minimum value for `$$\rho$$` for the accumulator (Note: `$$\rho$$` can be negative. The absolute value `$$|\rho|$$` is the distance of a line to the origin.).
  2844. * @param max_rho Maximum value for `$$\rho$$` for the accumulator.
  2845. * @param rho_step Distance resolution of the accumulator.
  2846. * @param min_theta Minimum angle value of the accumulator in radians.
  2847. * @param max_theta Upper bound for the angle value of the accumulator in radians. The actual maximum
  2848. * angle may be slightly less than max_theta, depending on the parameters min_theta and theta_step.
  2849. * @param theta_step Angle resolution of the accumulator in radians.
  2850. */
  2851. + (void)HoughLinesPointSet:(Mat*)point lines:(Mat*)lines lines_max:(int)lines_max threshold:(int)threshold min_rho:(double)min_rho max_rho:(double)max_rho rho_step:(double)rho_step min_theta:(double)min_theta max_theta:(double)max_theta theta_step:(double)theta_step NS_SWIFT_NAME(HoughLinesPointSet(point:lines:lines_max:threshold:min_rho:max_rho:rho_step:min_theta:max_theta:theta_step:));
  2852. //
  2853. // void cv::HoughCircles(Mat image, Mat& circles, HoughModes method, double dp, double minDist, double param1 = 100, double param2 = 100, int minRadius = 0, int maxRadius = 0)
  2854. //
  2855. /**
  2856. * Finds circles in a grayscale image using the Hough transform.
  2857. *
  2858. * The function finds circles in a grayscale image using a modification of the Hough transform.
  2859. *
  2860. * Example: :
  2861. * INCLUDE: snippets/imgproc_HoughLinesCircles.cpp
  2862. *
  2863. * NOTE: Usually the function detects the centers of circles well. However, it may fail to find correct
  2864. * radii. You can assist to the function by specifying the radius range ( minRadius and maxRadius ) if
  2865. * you know it. Or, in the case of #HOUGH_GRADIENT method you may set maxRadius to a negative number
  2866. * to return centers only without radius search, and find the correct radius using an additional procedure.
  2867. *
  2868. * It also helps to smooth image a bit unless it's already soft. For example,
  2869. * GaussianBlur() with 7x7 kernel and 1.5x1.5 sigma or similar blurring may help.
  2870. *
  2871. * @param image 8-bit, single-channel, grayscale input image.
  2872. * @param circles Output vector of found circles. Each vector is encoded as 3 or 4 element
  2873. * floating-point vector `$$(x, y, radius)$$` or `$$(x, y, radius, votes)$$` .
  2874. * @param method Detection method, see #HoughModes. The available methods are #HOUGH_GRADIENT and #HOUGH_GRADIENT_ALT.
  2875. * @param dp Inverse ratio of the accumulator resolution to the image resolution. For example, if
  2876. * dp=1 , the accumulator has the same resolution as the input image. If dp=2 , the accumulator has
  2877. * half as big width and height. For #HOUGH_GRADIENT_ALT the recommended value is dp=1.5,
  2878. * unless some small very circles need to be detected.
  2879. * @param minDist Minimum distance between the centers of the detected circles. If the parameter is
  2880. * too small, multiple neighbor circles may be falsely detected in addition to a true one. If it is
  2881. * too large, some circles may be missed.
  2882. * @param param1 First method-specific parameter. In case of #HOUGH_GRADIENT and #HOUGH_GRADIENT_ALT,
  2883. * it is the higher threshold of the two passed to the Canny edge detector (the lower one is twice smaller).
  2884. * Note that #HOUGH_GRADIENT_ALT uses #Scharr algorithm to compute image derivatives, so the threshold value
  2885. * shough normally be higher, such as 300 or normally exposed and contrasty images.
  2886. * @param param2 Second method-specific parameter. In case of #HOUGH_GRADIENT, it is the
  2887. * accumulator threshold for the circle centers at the detection stage. The smaller it is, the more
  2888. * false circles may be detected. Circles, corresponding to the larger accumulator values, will be
  2889. * returned first. In the case of #HOUGH_GRADIENT_ALT algorithm, this is the circle "perfectness" measure.
  2890. * The closer it to 1, the better shaped circles algorithm selects. In most cases 0.9 should be fine.
  2891. * If you want get better detection of small circles, you may decrease it to 0.85, 0.8 or even less.
  2892. * But then also try to limit the search range [minRadius, maxRadius] to avoid many false circles.
  2893. * @param minRadius Minimum circle radius.
  2894. * @param maxRadius Maximum circle radius. If <= 0, uses the maximum image dimension. If < 0, #HOUGH_GRADIENT returns
  2895. * centers without finding the radius. #HOUGH_GRADIENT_ALT always computes circle radiuses.
  2896. *
  2897. * @see `+fitEllipse:`, `+minEnclosingCircle:center:radius:`
  2898. */
  2899. + (void)HoughCircles:(Mat*)image circles:(Mat*)circles method:(HoughModes)method dp:(double)dp minDist:(double)minDist param1:(double)param1 param2:(double)param2 minRadius:(int)minRadius maxRadius:(int)maxRadius NS_SWIFT_NAME(HoughCircles(image:circles:method:dp:minDist:param1:param2:minRadius:maxRadius:));
  2900. /**
  2901. * Finds circles in a grayscale image using the Hough transform.
  2902. *
  2903. * The function finds circles in a grayscale image using a modification of the Hough transform.
  2904. *
  2905. * Example: :
  2906. * INCLUDE: snippets/imgproc_HoughLinesCircles.cpp
  2907. *
  2908. * NOTE: Usually the function detects the centers of circles well. However, it may fail to find correct
  2909. * radii. You can assist to the function by specifying the radius range ( minRadius and maxRadius ) if
  2910. * you know it. Or, in the case of #HOUGH_GRADIENT method you may set maxRadius to a negative number
  2911. * to return centers only without radius search, and find the correct radius using an additional procedure.
  2912. *
  2913. * It also helps to smooth image a bit unless it's already soft. For example,
  2914. * GaussianBlur() with 7x7 kernel and 1.5x1.5 sigma or similar blurring may help.
  2915. *
  2916. * @param image 8-bit, single-channel, grayscale input image.
  2917. * @param circles Output vector of found circles. Each vector is encoded as 3 or 4 element
  2918. * floating-point vector `$$(x, y, radius)$$` or `$$(x, y, radius, votes)$$` .
  2919. * @param method Detection method, see #HoughModes. The available methods are #HOUGH_GRADIENT and #HOUGH_GRADIENT_ALT.
  2920. * @param dp Inverse ratio of the accumulator resolution to the image resolution. For example, if
  2921. * dp=1 , the accumulator has the same resolution as the input image. If dp=2 , the accumulator has
  2922. * half as big width and height. For #HOUGH_GRADIENT_ALT the recommended value is dp=1.5,
  2923. * unless some small very circles need to be detected.
  2924. * @param minDist Minimum distance between the centers of the detected circles. If the parameter is
  2925. * too small, multiple neighbor circles may be falsely detected in addition to a true one. If it is
  2926. * too large, some circles may be missed.
  2927. * @param param1 First method-specific parameter. In case of #HOUGH_GRADIENT and #HOUGH_GRADIENT_ALT,
  2928. * it is the higher threshold of the two passed to the Canny edge detector (the lower one is twice smaller).
  2929. * Note that #HOUGH_GRADIENT_ALT uses #Scharr algorithm to compute image derivatives, so the threshold value
  2930. * shough normally be higher, such as 300 or normally exposed and contrasty images.
  2931. * @param param2 Second method-specific parameter. In case of #HOUGH_GRADIENT, it is the
  2932. * accumulator threshold for the circle centers at the detection stage. The smaller it is, the more
  2933. * false circles may be detected. Circles, corresponding to the larger accumulator values, will be
  2934. * returned first. In the case of #HOUGH_GRADIENT_ALT algorithm, this is the circle "perfectness" measure.
  2935. * The closer it to 1, the better shaped circles algorithm selects. In most cases 0.9 should be fine.
  2936. * If you want get better detection of small circles, you may decrease it to 0.85, 0.8 or even less.
  2937. * But then also try to limit the search range [minRadius, maxRadius] to avoid many false circles.
  2938. * @param minRadius Minimum circle radius.
  2939. * centers without finding the radius. #HOUGH_GRADIENT_ALT always computes circle radiuses.
  2940. *
  2941. * @see `+fitEllipse:`, `+minEnclosingCircle:center:radius:`
  2942. */
  2943. + (void)HoughCircles:(Mat*)image circles:(Mat*)circles method:(HoughModes)method dp:(double)dp minDist:(double)minDist param1:(double)param1 param2:(double)param2 minRadius:(int)minRadius NS_SWIFT_NAME(HoughCircles(image:circles:method:dp:minDist:param1:param2:minRadius:));
  2944. /**
  2945. * Finds circles in a grayscale image using the Hough transform.
  2946. *
  2947. * The function finds circles in a grayscale image using a modification of the Hough transform.
  2948. *
  2949. * Example: :
  2950. * INCLUDE: snippets/imgproc_HoughLinesCircles.cpp
  2951. *
  2952. * NOTE: Usually the function detects the centers of circles well. However, it may fail to find correct
  2953. * radii. You can assist to the function by specifying the radius range ( minRadius and maxRadius ) if
  2954. * you know it. Or, in the case of #HOUGH_GRADIENT method you may set maxRadius to a negative number
  2955. * to return centers only without radius search, and find the correct radius using an additional procedure.
  2956. *
  2957. * It also helps to smooth image a bit unless it's already soft. For example,
  2958. * GaussianBlur() with 7x7 kernel and 1.5x1.5 sigma or similar blurring may help.
  2959. *
  2960. * @param image 8-bit, single-channel, grayscale input image.
  2961. * @param circles Output vector of found circles. Each vector is encoded as 3 or 4 element
  2962. * floating-point vector `$$(x, y, radius)$$` or `$$(x, y, radius, votes)$$` .
  2963. * @param method Detection method, see #HoughModes. The available methods are #HOUGH_GRADIENT and #HOUGH_GRADIENT_ALT.
  2964. * @param dp Inverse ratio of the accumulator resolution to the image resolution. For example, if
  2965. * dp=1 , the accumulator has the same resolution as the input image. If dp=2 , the accumulator has
  2966. * half as big width and height. For #HOUGH_GRADIENT_ALT the recommended value is dp=1.5,
  2967. * unless some small very circles need to be detected.
  2968. * @param minDist Minimum distance between the centers of the detected circles. If the parameter is
  2969. * too small, multiple neighbor circles may be falsely detected in addition to a true one. If it is
  2970. * too large, some circles may be missed.
  2971. * @param param1 First method-specific parameter. In case of #HOUGH_GRADIENT and #HOUGH_GRADIENT_ALT,
  2972. * it is the higher threshold of the two passed to the Canny edge detector (the lower one is twice smaller).
  2973. * Note that #HOUGH_GRADIENT_ALT uses #Scharr algorithm to compute image derivatives, so the threshold value
  2974. * shough normally be higher, such as 300 or normally exposed and contrasty images.
  2975. * @param param2 Second method-specific parameter. In case of #HOUGH_GRADIENT, it is the
  2976. * accumulator threshold for the circle centers at the detection stage. The smaller it is, the more
  2977. * false circles may be detected. Circles, corresponding to the larger accumulator values, will be
  2978. * returned first. In the case of #HOUGH_GRADIENT_ALT algorithm, this is the circle "perfectness" measure.
  2979. * The closer it to 1, the better shaped circles algorithm selects. In most cases 0.9 should be fine.
  2980. * If you want get better detection of small circles, you may decrease it to 0.85, 0.8 or even less.
  2981. * But then also try to limit the search range [minRadius, maxRadius] to avoid many false circles.
  2982. * centers without finding the radius. #HOUGH_GRADIENT_ALT always computes circle radiuses.
  2983. *
  2984. * @see `+fitEllipse:`, `+minEnclosingCircle:center:radius:`
  2985. */
  2986. + (void)HoughCircles:(Mat*)image circles:(Mat*)circles method:(HoughModes)method dp:(double)dp minDist:(double)minDist param1:(double)param1 param2:(double)param2 NS_SWIFT_NAME(HoughCircles(image:circles:method:dp:minDist:param1:param2:));
  2987. /**
  2988. * Finds circles in a grayscale image using the Hough transform.
  2989. *
  2990. * The function finds circles in a grayscale image using a modification of the Hough transform.
  2991. *
  2992. * Example: :
  2993. * INCLUDE: snippets/imgproc_HoughLinesCircles.cpp
  2994. *
  2995. * NOTE: Usually the function detects the centers of circles well. However, it may fail to find correct
  2996. * radii. You can assist to the function by specifying the radius range ( minRadius and maxRadius ) if
  2997. * you know it. Or, in the case of #HOUGH_GRADIENT method you may set maxRadius to a negative number
  2998. * to return centers only without radius search, and find the correct radius using an additional procedure.
  2999. *
  3000. * It also helps to smooth image a bit unless it's already soft. For example,
  3001. * GaussianBlur() with 7x7 kernel and 1.5x1.5 sigma or similar blurring may help.
  3002. *
  3003. * @param image 8-bit, single-channel, grayscale input image.
  3004. * @param circles Output vector of found circles. Each vector is encoded as 3 or 4 element
  3005. * floating-point vector `$$(x, y, radius)$$` or `$$(x, y, radius, votes)$$` .
  3006. * @param method Detection method, see #HoughModes. The available methods are #HOUGH_GRADIENT and #HOUGH_GRADIENT_ALT.
  3007. * @param dp Inverse ratio of the accumulator resolution to the image resolution. For example, if
  3008. * dp=1 , the accumulator has the same resolution as the input image. If dp=2 , the accumulator has
  3009. * half as big width and height. For #HOUGH_GRADIENT_ALT the recommended value is dp=1.5,
  3010. * unless some small very circles need to be detected.
  3011. * @param minDist Minimum distance between the centers of the detected circles. If the parameter is
  3012. * too small, multiple neighbor circles may be falsely detected in addition to a true one. If it is
  3013. * too large, some circles may be missed.
  3014. * @param param1 First method-specific parameter. In case of #HOUGH_GRADIENT and #HOUGH_GRADIENT_ALT,
  3015. * it is the higher threshold of the two passed to the Canny edge detector (the lower one is twice smaller).
  3016. * Note that #HOUGH_GRADIENT_ALT uses #Scharr algorithm to compute image derivatives, so the threshold value
  3017. * shough normally be higher, such as 300 or normally exposed and contrasty images.
  3018. * accumulator threshold for the circle centers at the detection stage. The smaller it is, the more
  3019. * false circles may be detected. Circles, corresponding to the larger accumulator values, will be
  3020. * returned first. In the case of #HOUGH_GRADIENT_ALT algorithm, this is the circle "perfectness" measure.
  3021. * The closer it to 1, the better shaped circles algorithm selects. In most cases 0.9 should be fine.
  3022. * If you want get better detection of small circles, you may decrease it to 0.85, 0.8 or even less.
  3023. * But then also try to limit the search range [minRadius, maxRadius] to avoid many false circles.
  3024. * centers without finding the radius. #HOUGH_GRADIENT_ALT always computes circle radiuses.
  3025. *
  3026. * @see `+fitEllipse:`, `+minEnclosingCircle:center:radius:`
  3027. */
  3028. + (void)HoughCircles:(Mat*)image circles:(Mat*)circles method:(HoughModes)method dp:(double)dp minDist:(double)minDist param1:(double)param1 NS_SWIFT_NAME(HoughCircles(image:circles:method:dp:minDist:param1:));
  3029. /**
  3030. * Finds circles in a grayscale image using the Hough transform.
  3031. *
  3032. * The function finds circles in a grayscale image using a modification of the Hough transform.
  3033. *
  3034. * Example: :
  3035. * INCLUDE: snippets/imgproc_HoughLinesCircles.cpp
  3036. *
  3037. * NOTE: Usually the function detects the centers of circles well. However, it may fail to find correct
  3038. * radii. You can assist to the function by specifying the radius range ( minRadius and maxRadius ) if
  3039. * you know it. Or, in the case of #HOUGH_GRADIENT method you may set maxRadius to a negative number
  3040. * to return centers only without radius search, and find the correct radius using an additional procedure.
  3041. *
  3042. * It also helps to smooth image a bit unless it's already soft. For example,
  3043. * GaussianBlur() with 7x7 kernel and 1.5x1.5 sigma or similar blurring may help.
  3044. *
  3045. * @param image 8-bit, single-channel, grayscale input image.
  3046. * @param circles Output vector of found circles. Each vector is encoded as 3 or 4 element
  3047. * floating-point vector `$$(x, y, radius)$$` or `$$(x, y, radius, votes)$$` .
  3048. * @param method Detection method, see #HoughModes. The available methods are #HOUGH_GRADIENT and #HOUGH_GRADIENT_ALT.
  3049. * @param dp Inverse ratio of the accumulator resolution to the image resolution. For example, if
  3050. * dp=1 , the accumulator has the same resolution as the input image. If dp=2 , the accumulator has
  3051. * half as big width and height. For #HOUGH_GRADIENT_ALT the recommended value is dp=1.5,
  3052. * unless some small very circles need to be detected.
  3053. * @param minDist Minimum distance between the centers of the detected circles. If the parameter is
  3054. * too small, multiple neighbor circles may be falsely detected in addition to a true one. If it is
  3055. * too large, some circles may be missed.
  3056. * it is the higher threshold of the two passed to the Canny edge detector (the lower one is twice smaller).
  3057. * Note that #HOUGH_GRADIENT_ALT uses #Scharr algorithm to compute image derivatives, so the threshold value
  3058. * shough normally be higher, such as 300 or normally exposed and contrasty images.
  3059. * accumulator threshold for the circle centers at the detection stage. The smaller it is, the more
  3060. * false circles may be detected. Circles, corresponding to the larger accumulator values, will be
  3061. * returned first. In the case of #HOUGH_GRADIENT_ALT algorithm, this is the circle "perfectness" measure.
  3062. * The closer it to 1, the better shaped circles algorithm selects. In most cases 0.9 should be fine.
  3063. * If you want get better detection of small circles, you may decrease it to 0.85, 0.8 or even less.
  3064. * But then also try to limit the search range [minRadius, maxRadius] to avoid many false circles.
  3065. * centers without finding the radius. #HOUGH_GRADIENT_ALT always computes circle radiuses.
  3066. *
  3067. * @see `+fitEllipse:`, `+minEnclosingCircle:center:radius:`
  3068. */
  3069. + (void)HoughCircles:(Mat*)image circles:(Mat*)circles method:(HoughModes)method dp:(double)dp minDist:(double)minDist NS_SWIFT_NAME(HoughCircles(image:circles:method:dp:minDist:));
  3070. //
  3071. // void cv::erode(Mat src, Mat& dst, Mat kernel, Point anchor = Point(-1,-1), int iterations = 1, BorderTypes borderType = BORDER_CONSTANT, Scalar borderValue = morphologyDefaultBorderValue())
  3072. //
  3073. /**
  3074. * Erodes an image by using a specific structuring element.
  3075. *
  3076. * The function erodes the source image using the specified structuring element that determines the
  3077. * shape of a pixel neighborhood over which the minimum is taken:
  3078. *
  3079. * `$$\texttt{dst} (x,y) = \min _{(x',y'): \, \texttt{element} (x',y') \ne0 } \texttt{src} (x+x',y+y')$$`
  3080. *
  3081. * The function supports the in-place mode. Erosion can be applied several ( iterations ) times. In
  3082. * case of multi-channel images, each channel is processed independently.
  3083. *
  3084. * @param src input image; the number of channels can be arbitrary, but the depth should be one of
  3085. * CV_8U, CV_16U, CV_16S, CV_32F or CV_64F.
  3086. * @param dst output image of the same size and type as src.
  3087. * @param kernel structuring element used for erosion; if `element=Mat()`, a `3 x 3` rectangular
  3088. * structuring element is used. Kernel can be created using #getStructuringElement.
  3089. * @param anchor position of the anchor within the element; default value (-1, -1) means that the
  3090. * anchor is at the element center.
  3091. * @param iterations number of times erosion is applied.
  3092. * @param borderType pixel extrapolation method, see #BorderTypes. #BORDER_WRAP is not supported.
  3093. * @param borderValue border value in case of a constant border
  3094. * @see `+dilate:dst:kernel:anchor:iterations:borderType:borderValue:`, `+morphologyEx:dst:op:kernel:anchor:iterations:borderType:borderValue:`, `+getStructuringElement:ksize:anchor:`
  3095. */
  3096. + (void)erode:(Mat*)src dst:(Mat*)dst kernel:(Mat*)kernel anchor:(Point2i*)anchor iterations:(int)iterations borderType:(BorderTypes)borderType borderValue:(Scalar*)borderValue NS_SWIFT_NAME(erode(src:dst:kernel:anchor:iterations:borderType:borderValue:));
  3097. /**
  3098. * Erodes an image by using a specific structuring element.
  3099. *
  3100. * The function erodes the source image using the specified structuring element that determines the
  3101. * shape of a pixel neighborhood over which the minimum is taken:
  3102. *
  3103. * `$$\texttt{dst} (x,y) = \min _{(x',y'): \, \texttt{element} (x',y') \ne0 } \texttt{src} (x+x',y+y')$$`
  3104. *
  3105. * The function supports the in-place mode. Erosion can be applied several ( iterations ) times. In
  3106. * case of multi-channel images, each channel is processed independently.
  3107. *
  3108. * @param src input image; the number of channels can be arbitrary, but the depth should be one of
  3109. * CV_8U, CV_16U, CV_16S, CV_32F or CV_64F.
  3110. * @param dst output image of the same size and type as src.
  3111. * @param kernel structuring element used for erosion; if `element=Mat()`, a `3 x 3` rectangular
  3112. * structuring element is used. Kernel can be created using #getStructuringElement.
  3113. * @param anchor position of the anchor within the element; default value (-1, -1) means that the
  3114. * anchor is at the element center.
  3115. * @param iterations number of times erosion is applied.
  3116. * @param borderType pixel extrapolation method, see #BorderTypes. #BORDER_WRAP is not supported.
  3117. * @see `+dilate:dst:kernel:anchor:iterations:borderType:borderValue:`, `+morphologyEx:dst:op:kernel:anchor:iterations:borderType:borderValue:`, `+getStructuringElement:ksize:anchor:`
  3118. */
  3119. + (void)erode:(Mat*)src dst:(Mat*)dst kernel:(Mat*)kernel anchor:(Point2i*)anchor iterations:(int)iterations borderType:(BorderTypes)borderType NS_SWIFT_NAME(erode(src:dst:kernel:anchor:iterations:borderType:));
  3120. /**
  3121. * Erodes an image by using a specific structuring element.
  3122. *
  3123. * The function erodes the source image using the specified structuring element that determines the
  3124. * shape of a pixel neighborhood over which the minimum is taken:
  3125. *
  3126. * `$$\texttt{dst} (x,y) = \min _{(x',y'): \, \texttt{element} (x',y') \ne0 } \texttt{src} (x+x',y+y')$$`
  3127. *
  3128. * The function supports the in-place mode. Erosion can be applied several ( iterations ) times. In
  3129. * case of multi-channel images, each channel is processed independently.
  3130. *
  3131. * @param src input image; the number of channels can be arbitrary, but the depth should be one of
  3132. * CV_8U, CV_16U, CV_16S, CV_32F or CV_64F.
  3133. * @param dst output image of the same size and type as src.
  3134. * @param kernel structuring element used for erosion; if `element=Mat()`, a `3 x 3` rectangular
  3135. * structuring element is used. Kernel can be created using #getStructuringElement.
  3136. * @param anchor position of the anchor within the element; default value (-1, -1) means that the
  3137. * anchor is at the element center.
  3138. * @param iterations number of times erosion is applied.
  3139. * @see `+dilate:dst:kernel:anchor:iterations:borderType:borderValue:`, `+morphologyEx:dst:op:kernel:anchor:iterations:borderType:borderValue:`, `+getStructuringElement:ksize:anchor:`
  3140. */
  3141. + (void)erode:(Mat*)src dst:(Mat*)dst kernel:(Mat*)kernel anchor:(Point2i*)anchor iterations:(int)iterations NS_SWIFT_NAME(erode(src:dst:kernel:anchor:iterations:));
  3142. /**
  3143. * Erodes an image by using a specific structuring element.
  3144. *
  3145. * The function erodes the source image using the specified structuring element that determines the
  3146. * shape of a pixel neighborhood over which the minimum is taken:
  3147. *
  3148. * `$$\texttt{dst} (x,y) = \min _{(x',y'): \, \texttt{element} (x',y') \ne0 } \texttt{src} (x+x',y+y')$$`
  3149. *
  3150. * The function supports the in-place mode. Erosion can be applied several ( iterations ) times. In
  3151. * case of multi-channel images, each channel is processed independently.
  3152. *
  3153. * @param src input image; the number of channels can be arbitrary, but the depth should be one of
  3154. * CV_8U, CV_16U, CV_16S, CV_32F or CV_64F.
  3155. * @param dst output image of the same size and type as src.
  3156. * @param kernel structuring element used for erosion; if `element=Mat()`, a `3 x 3` rectangular
  3157. * structuring element is used. Kernel can be created using #getStructuringElement.
  3158. * @param anchor position of the anchor within the element; default value (-1, -1) means that the
  3159. * anchor is at the element center.
  3160. * @see `+dilate:dst:kernel:anchor:iterations:borderType:borderValue:`, `+morphologyEx:dst:op:kernel:anchor:iterations:borderType:borderValue:`, `+getStructuringElement:ksize:anchor:`
  3161. */
  3162. + (void)erode:(Mat*)src dst:(Mat*)dst kernel:(Mat*)kernel anchor:(Point2i*)anchor NS_SWIFT_NAME(erode(src:dst:kernel:anchor:));
  3163. /**
  3164. * Erodes an image by using a specific structuring element.
  3165. *
  3166. * The function erodes the source image using the specified structuring element that determines the
  3167. * shape of a pixel neighborhood over which the minimum is taken:
  3168. *
  3169. * `$$\texttt{dst} (x,y) = \min _{(x',y'): \, \texttt{element} (x',y') \ne0 } \texttt{src} (x+x',y+y')$$`
  3170. *
  3171. * The function supports the in-place mode. Erosion can be applied several ( iterations ) times. In
  3172. * case of multi-channel images, each channel is processed independently.
  3173. *
  3174. * @param src input image; the number of channels can be arbitrary, but the depth should be one of
  3175. * CV_8U, CV_16U, CV_16S, CV_32F or CV_64F.
  3176. * @param dst output image of the same size and type as src.
  3177. * @param kernel structuring element used for erosion; if `element=Mat()`, a `3 x 3` rectangular
  3178. * structuring element is used. Kernel can be created using #getStructuringElement.
  3179. * anchor is at the element center.
  3180. * @see `+dilate:dst:kernel:anchor:iterations:borderType:borderValue:`, `+morphologyEx:dst:op:kernel:anchor:iterations:borderType:borderValue:`, `+getStructuringElement:ksize:anchor:`
  3181. */
  3182. + (void)erode:(Mat*)src dst:(Mat*)dst kernel:(Mat*)kernel NS_SWIFT_NAME(erode(src:dst:kernel:));
  3183. //
  3184. // void cv::dilate(Mat src, Mat& dst, Mat kernel, Point anchor = Point(-1,-1), int iterations = 1, BorderTypes borderType = BORDER_CONSTANT, Scalar borderValue = morphologyDefaultBorderValue())
  3185. //
  3186. /**
  3187. * Dilates an image by using a specific structuring element.
  3188. *
  3189. * The function dilates the source image using the specified structuring element that determines the
  3190. * shape of a pixel neighborhood over which the maximum is taken:
  3191. * `$$\texttt{dst} (x,y) = \max _{(x',y'): \, \texttt{element} (x',y') \ne0 } \texttt{src} (x+x',y+y')$$`
  3192. *
  3193. * The function supports the in-place mode. Dilation can be applied several ( iterations ) times. In
  3194. * case of multi-channel images, each channel is processed independently.
  3195. *
  3196. * @param src input image; the number of channels can be arbitrary, but the depth should be one of
  3197. * CV_8U, CV_16U, CV_16S, CV_32F or CV_64F.
  3198. * @param dst output image of the same size and type as src.
  3199. * @param kernel structuring element used for dilation; if element=Mat(), a 3 x 3 rectangular
  3200. * structuring element is used. Kernel can be created using #getStructuringElement
  3201. * @param anchor position of the anchor within the element; default value (-1, -1) means that the
  3202. * anchor is at the element center.
  3203. * @param iterations number of times dilation is applied.
  3204. * @param borderType pixel extrapolation method, see #BorderTypes. #BORDER_WRAP is not suported.
  3205. * @param borderValue border value in case of a constant border
  3206. * @see `+erode:dst:kernel:anchor:iterations:borderType:borderValue:`, `+morphologyEx:dst:op:kernel:anchor:iterations:borderType:borderValue:`, `+getStructuringElement:ksize:anchor:`
  3207. */
  3208. + (void)dilate:(Mat*)src dst:(Mat*)dst kernel:(Mat*)kernel anchor:(Point2i*)anchor iterations:(int)iterations borderType:(BorderTypes)borderType borderValue:(Scalar*)borderValue NS_SWIFT_NAME(dilate(src:dst:kernel:anchor:iterations:borderType:borderValue:));
  3209. /**
  3210. * Dilates an image by using a specific structuring element.
  3211. *
  3212. * The function dilates the source image using the specified structuring element that determines the
  3213. * shape of a pixel neighborhood over which the maximum is taken:
  3214. * `$$\texttt{dst} (x,y) = \max _{(x',y'): \, \texttt{element} (x',y') \ne0 } \texttt{src} (x+x',y+y')$$`
  3215. *
  3216. * The function supports the in-place mode. Dilation can be applied several ( iterations ) times. In
  3217. * case of multi-channel images, each channel is processed independently.
  3218. *
  3219. * @param src input image; the number of channels can be arbitrary, but the depth should be one of
  3220. * CV_8U, CV_16U, CV_16S, CV_32F or CV_64F.
  3221. * @param dst output image of the same size and type as src.
  3222. * @param kernel structuring element used for dilation; if element=Mat(), a 3 x 3 rectangular
  3223. * structuring element is used. Kernel can be created using #getStructuringElement
  3224. * @param anchor position of the anchor within the element; default value (-1, -1) means that the
  3225. * anchor is at the element center.
  3226. * @param iterations number of times dilation is applied.
  3227. * @param borderType pixel extrapolation method, see #BorderTypes. #BORDER_WRAP is not suported.
  3228. * @see `+erode:dst:kernel:anchor:iterations:borderType:borderValue:`, `+morphologyEx:dst:op:kernel:anchor:iterations:borderType:borderValue:`, `+getStructuringElement:ksize:anchor:`
  3229. */
  3230. + (void)dilate:(Mat*)src dst:(Mat*)dst kernel:(Mat*)kernel anchor:(Point2i*)anchor iterations:(int)iterations borderType:(BorderTypes)borderType NS_SWIFT_NAME(dilate(src:dst:kernel:anchor:iterations:borderType:));
  3231. /**
  3232. * Dilates an image by using a specific structuring element.
  3233. *
  3234. * The function dilates the source image using the specified structuring element that determines the
  3235. * shape of a pixel neighborhood over which the maximum is taken:
  3236. * `$$\texttt{dst} (x,y) = \max _{(x',y'): \, \texttt{element} (x',y') \ne0 } \texttt{src} (x+x',y+y')$$`
  3237. *
  3238. * The function supports the in-place mode. Dilation can be applied several ( iterations ) times. In
  3239. * case of multi-channel images, each channel is processed independently.
  3240. *
  3241. * @param src input image; the number of channels can be arbitrary, but the depth should be one of
  3242. * CV_8U, CV_16U, CV_16S, CV_32F or CV_64F.
  3243. * @param dst output image of the same size and type as src.
  3244. * @param kernel structuring element used for dilation; if element=Mat(), a 3 x 3 rectangular
  3245. * structuring element is used. Kernel can be created using #getStructuringElement
  3246. * @param anchor position of the anchor within the element; default value (-1, -1) means that the
  3247. * anchor is at the element center.
  3248. * @param iterations number of times dilation is applied.
  3249. * @see `+erode:dst:kernel:anchor:iterations:borderType:borderValue:`, `+morphologyEx:dst:op:kernel:anchor:iterations:borderType:borderValue:`, `+getStructuringElement:ksize:anchor:`
  3250. */
  3251. + (void)dilate:(Mat*)src dst:(Mat*)dst kernel:(Mat*)kernel anchor:(Point2i*)anchor iterations:(int)iterations NS_SWIFT_NAME(dilate(src:dst:kernel:anchor:iterations:));
  3252. /**
  3253. * Dilates an image by using a specific structuring element.
  3254. *
  3255. * The function dilates the source image using the specified structuring element that determines the
  3256. * shape of a pixel neighborhood over which the maximum is taken:
  3257. * `$$\texttt{dst} (x,y) = \max _{(x',y'): \, \texttt{element} (x',y') \ne0 } \texttt{src} (x+x',y+y')$$`
  3258. *
  3259. * The function supports the in-place mode. Dilation can be applied several ( iterations ) times. In
  3260. * case of multi-channel images, each channel is processed independently.
  3261. *
  3262. * @param src input image; the number of channels can be arbitrary, but the depth should be one of
  3263. * CV_8U, CV_16U, CV_16S, CV_32F or CV_64F.
  3264. * @param dst output image of the same size and type as src.
  3265. * @param kernel structuring element used for dilation; if element=Mat(), a 3 x 3 rectangular
  3266. * structuring element is used. Kernel can be created using #getStructuringElement
  3267. * @param anchor position of the anchor within the element; default value (-1, -1) means that the
  3268. * anchor is at the element center.
  3269. * @see `+erode:dst:kernel:anchor:iterations:borderType:borderValue:`, `+morphologyEx:dst:op:kernel:anchor:iterations:borderType:borderValue:`, `+getStructuringElement:ksize:anchor:`
  3270. */
  3271. + (void)dilate:(Mat*)src dst:(Mat*)dst kernel:(Mat*)kernel anchor:(Point2i*)anchor NS_SWIFT_NAME(dilate(src:dst:kernel:anchor:));
  3272. /**
  3273. * Dilates an image by using a specific structuring element.
  3274. *
  3275. * The function dilates the source image using the specified structuring element that determines the
  3276. * shape of a pixel neighborhood over which the maximum is taken:
  3277. * `$$\texttt{dst} (x,y) = \max _{(x',y'): \, \texttt{element} (x',y') \ne0 } \texttt{src} (x+x',y+y')$$`
  3278. *
  3279. * The function supports the in-place mode. Dilation can be applied several ( iterations ) times. In
  3280. * case of multi-channel images, each channel is processed independently.
  3281. *
  3282. * @param src input image; the number of channels can be arbitrary, but the depth should be one of
  3283. * CV_8U, CV_16U, CV_16S, CV_32F or CV_64F.
  3284. * @param dst output image of the same size and type as src.
  3285. * @param kernel structuring element used for dilation; if element=Mat(), a 3 x 3 rectangular
  3286. * structuring element is used. Kernel can be created using #getStructuringElement
  3287. * anchor is at the element center.
  3288. * @see `+erode:dst:kernel:anchor:iterations:borderType:borderValue:`, `+morphologyEx:dst:op:kernel:anchor:iterations:borderType:borderValue:`, `+getStructuringElement:ksize:anchor:`
  3289. */
  3290. + (void)dilate:(Mat*)src dst:(Mat*)dst kernel:(Mat*)kernel NS_SWIFT_NAME(dilate(src:dst:kernel:));
  3291. //
  3292. // void cv::morphologyEx(Mat src, Mat& dst, MorphTypes op, Mat kernel, Point anchor = Point(-1,-1), int iterations = 1, BorderTypes borderType = BORDER_CONSTANT, Scalar borderValue = morphologyDefaultBorderValue())
  3293. //
  3294. /**
  3295. * Performs advanced morphological transformations.
  3296. *
  3297. * The function cv::morphologyEx can perform advanced morphological transformations using an erosion and dilation as
  3298. * basic operations.
  3299. *
  3300. * Any of the operations can be done in-place. In case of multi-channel images, each channel is
  3301. * processed independently.
  3302. *
  3303. * @param src Source image. The number of channels can be arbitrary. The depth should be one of
  3304. * CV_8U, CV_16U, CV_16S, CV_32F or CV_64F.
  3305. * @param dst Destination image of the same size and type as source image.
  3306. * @param op Type of a morphological operation, see #MorphTypes
  3307. * @param kernel Structuring element. It can be created using #getStructuringElement.
  3308. * @param anchor Anchor position with the kernel. Negative values mean that the anchor is at the
  3309. * kernel center.
  3310. * @param iterations Number of times erosion and dilation are applied.
  3311. * @param borderType Pixel extrapolation method, see #BorderTypes. #BORDER_WRAP is not supported.
  3312. * @param borderValue Border value in case of a constant border. The default value has a special
  3313. * meaning.
  3314. * @see `+dilate:dst:kernel:anchor:iterations:borderType:borderValue:`, `+erode:dst:kernel:anchor:iterations:borderType:borderValue:`, `+getStructuringElement:ksize:anchor:`
  3315. * NOTE: The number of iterations is the number of times erosion or dilatation operation will be applied.
  3316. * For instance, an opening operation (#MORPH_OPEN) with two iterations is equivalent to apply
  3317. * successively: erode -> erode -> dilate -> dilate (and not erode -> dilate -> erode -> dilate).
  3318. */
  3319. + (void)morphologyEx:(Mat*)src dst:(Mat*)dst op:(MorphTypes)op kernel:(Mat*)kernel anchor:(Point2i*)anchor iterations:(int)iterations borderType:(BorderTypes)borderType borderValue:(Scalar*)borderValue NS_SWIFT_NAME(morphologyEx(src:dst:op:kernel:anchor:iterations:borderType:borderValue:));
  3320. /**
  3321. * Performs advanced morphological transformations.
  3322. *
  3323. * The function cv::morphologyEx can perform advanced morphological transformations using an erosion and dilation as
  3324. * basic operations.
  3325. *
  3326. * Any of the operations can be done in-place. In case of multi-channel images, each channel is
  3327. * processed independently.
  3328. *
  3329. * @param src Source image. The number of channels can be arbitrary. The depth should be one of
  3330. * CV_8U, CV_16U, CV_16S, CV_32F or CV_64F.
  3331. * @param dst Destination image of the same size and type as source image.
  3332. * @param op Type of a morphological operation, see #MorphTypes
  3333. * @param kernel Structuring element. It can be created using #getStructuringElement.
  3334. * @param anchor Anchor position with the kernel. Negative values mean that the anchor is at the
  3335. * kernel center.
  3336. * @param iterations Number of times erosion and dilation are applied.
  3337. * @param borderType Pixel extrapolation method, see #BorderTypes. #BORDER_WRAP is not supported.
  3338. * meaning.
  3339. * @see `+dilate:dst:kernel:anchor:iterations:borderType:borderValue:`, `+erode:dst:kernel:anchor:iterations:borderType:borderValue:`, `+getStructuringElement:ksize:anchor:`
  3340. * NOTE: The number of iterations is the number of times erosion or dilatation operation will be applied.
  3341. * For instance, an opening operation (#MORPH_OPEN) with two iterations is equivalent to apply
  3342. * successively: erode -> erode -> dilate -> dilate (and not erode -> dilate -> erode -> dilate).
  3343. */
  3344. + (void)morphologyEx:(Mat*)src dst:(Mat*)dst op:(MorphTypes)op kernel:(Mat*)kernel anchor:(Point2i*)anchor iterations:(int)iterations borderType:(BorderTypes)borderType NS_SWIFT_NAME(morphologyEx(src:dst:op:kernel:anchor:iterations:borderType:));
  3345. /**
  3346. * Performs advanced morphological transformations.
  3347. *
  3348. * The function cv::morphologyEx can perform advanced morphological transformations using an erosion and dilation as
  3349. * basic operations.
  3350. *
  3351. * Any of the operations can be done in-place. In case of multi-channel images, each channel is
  3352. * processed independently.
  3353. *
  3354. * @param src Source image. The number of channels can be arbitrary. The depth should be one of
  3355. * CV_8U, CV_16U, CV_16S, CV_32F or CV_64F.
  3356. * @param dst Destination image of the same size and type as source image.
  3357. * @param op Type of a morphological operation, see #MorphTypes
  3358. * @param kernel Structuring element. It can be created using #getStructuringElement.
  3359. * @param anchor Anchor position with the kernel. Negative values mean that the anchor is at the
  3360. * kernel center.
  3361. * @param iterations Number of times erosion and dilation are applied.
  3362. * meaning.
  3363. * @see `+dilate:dst:kernel:anchor:iterations:borderType:borderValue:`, `+erode:dst:kernel:anchor:iterations:borderType:borderValue:`, `+getStructuringElement:ksize:anchor:`
  3364. * NOTE: The number of iterations is the number of times erosion or dilatation operation will be applied.
  3365. * For instance, an opening operation (#MORPH_OPEN) with two iterations is equivalent to apply
  3366. * successively: erode -> erode -> dilate -> dilate (and not erode -> dilate -> erode -> dilate).
  3367. */
  3368. + (void)morphologyEx:(Mat*)src dst:(Mat*)dst op:(MorphTypes)op kernel:(Mat*)kernel anchor:(Point2i*)anchor iterations:(int)iterations NS_SWIFT_NAME(morphologyEx(src:dst:op:kernel:anchor:iterations:));
  3369. /**
  3370. * Performs advanced morphological transformations.
  3371. *
  3372. * The function cv::morphologyEx can perform advanced morphological transformations using an erosion and dilation as
  3373. * basic operations.
  3374. *
  3375. * Any of the operations can be done in-place. In case of multi-channel images, each channel is
  3376. * processed independently.
  3377. *
  3378. * @param src Source image. The number of channels can be arbitrary. The depth should be one of
  3379. * CV_8U, CV_16U, CV_16S, CV_32F or CV_64F.
  3380. * @param dst Destination image of the same size and type as source image.
  3381. * @param op Type of a morphological operation, see #MorphTypes
  3382. * @param kernel Structuring element. It can be created using #getStructuringElement.
  3383. * @param anchor Anchor position with the kernel. Negative values mean that the anchor is at the
  3384. * kernel center.
  3385. * meaning.
  3386. * @see `+dilate:dst:kernel:anchor:iterations:borderType:borderValue:`, `+erode:dst:kernel:anchor:iterations:borderType:borderValue:`, `+getStructuringElement:ksize:anchor:`
  3387. * NOTE: The number of iterations is the number of times erosion or dilatation operation will be applied.
  3388. * For instance, an opening operation (#MORPH_OPEN) with two iterations is equivalent to apply
  3389. * successively: erode -> erode -> dilate -> dilate (and not erode -> dilate -> erode -> dilate).
  3390. */
  3391. + (void)morphologyEx:(Mat*)src dst:(Mat*)dst op:(MorphTypes)op kernel:(Mat*)kernel anchor:(Point2i*)anchor NS_SWIFT_NAME(morphologyEx(src:dst:op:kernel:anchor:));
  3392. /**
  3393. * Performs advanced morphological transformations.
  3394. *
  3395. * The function cv::morphologyEx can perform advanced morphological transformations using an erosion and dilation as
  3396. * basic operations.
  3397. *
  3398. * Any of the operations can be done in-place. In case of multi-channel images, each channel is
  3399. * processed independently.
  3400. *
  3401. * @param src Source image. The number of channels can be arbitrary. The depth should be one of
  3402. * CV_8U, CV_16U, CV_16S, CV_32F or CV_64F.
  3403. * @param dst Destination image of the same size and type as source image.
  3404. * @param op Type of a morphological operation, see #MorphTypes
  3405. * @param kernel Structuring element. It can be created using #getStructuringElement.
  3406. * kernel center.
  3407. * meaning.
  3408. * @see `+dilate:dst:kernel:anchor:iterations:borderType:borderValue:`, `+erode:dst:kernel:anchor:iterations:borderType:borderValue:`, `+getStructuringElement:ksize:anchor:`
  3409. * NOTE: The number of iterations is the number of times erosion or dilatation operation will be applied.
  3410. * For instance, an opening operation (#MORPH_OPEN) with two iterations is equivalent to apply
  3411. * successively: erode -> erode -> dilate -> dilate (and not erode -> dilate -> erode -> dilate).
  3412. */
  3413. + (void)morphologyEx:(Mat*)src dst:(Mat*)dst op:(MorphTypes)op kernel:(Mat*)kernel NS_SWIFT_NAME(morphologyEx(src:dst:op:kernel:));
  3414. //
  3415. // void cv::resize(Mat src, Mat& dst, Size dsize, double fx = 0, double fy = 0, int interpolation = INTER_LINEAR)
  3416. //
  3417. /**
  3418. * Resizes an image.
  3419. *
  3420. * The function resize resizes the image src down to or up to the specified size. Note that the
  3421. * initial dst type or size are not taken into account. Instead, the size and type are derived from
  3422. * the `src`,`dsize`,`fx`, and `fy`. If you want to resize src so that it fits the pre-created dst,
  3423. * you may call the function as follows:
  3424. *
  3425. * // explicitly specify dsize=dst.size(); fx and fy will be computed from that.
  3426. * resize(src, dst, dst.size(), 0, 0, interpolation);
  3427. *
  3428. * If you want to decimate the image by factor of 2 in each direction, you can call the function this
  3429. * way:
  3430. *
  3431. * // specify fx and fy and let the function compute the destination image size.
  3432. * resize(src, dst, Size(), 0.5, 0.5, interpolation);
  3433. *
  3434. * To shrink an image, it will generally look best with #INTER_AREA interpolation, whereas to
  3435. * enlarge an image, it will generally look best with #INTER_CUBIC (slow) or #INTER_LINEAR
  3436. * (faster but still looks OK).
  3437. *
  3438. * @param src input image.
  3439. * @param dst output image; it has the size dsize (when it is non-zero) or the size computed from
  3440. * src.size(), fx, and fy; the type of dst is the same as of src.
  3441. * @param dsize output image size; if it equals zero (`None` in Python), it is computed as:
  3442. * `$$\texttt{dsize = Size(round(fx*src.cols), round(fy*src.rows))}$$`
  3443. * Either dsize or both fx and fy must be non-zero.
  3444. * @param fx scale factor along the horizontal axis; when it equals 0, it is computed as
  3445. * `$$\texttt{(double)dsize.width/src.cols}$$`
  3446. * @param fy scale factor along the vertical axis; when it equals 0, it is computed as
  3447. * `$$\texttt{(double)dsize.height/src.rows}$$`
  3448. * @param interpolation interpolation method, see #InterpolationFlags
  3449. *
  3450. * @see `+warpAffine:dst:M:dsize:flags:borderMode:borderValue:`, `+warpPerspective:dst:M:dsize:flags:borderMode:borderValue:`, `+remap:dst:map1:map2:interpolation:borderMode:borderValue:`
  3451. */
  3452. + (void)resize:(Mat*)src dst:(Mat*)dst dsize:(Size2i*)dsize fx:(double)fx fy:(double)fy interpolation:(int)interpolation NS_SWIFT_NAME(resize(src:dst:dsize:fx:fy:interpolation:));
  3453. /**
  3454. * Resizes an image.
  3455. *
  3456. * The function resize resizes the image src down to or up to the specified size. Note that the
  3457. * initial dst type or size are not taken into account. Instead, the size and type are derived from
  3458. * the `src`,`dsize`,`fx`, and `fy`. If you want to resize src so that it fits the pre-created dst,
  3459. * you may call the function as follows:
  3460. *
  3461. * // explicitly specify dsize=dst.size(); fx and fy will be computed from that.
  3462. * resize(src, dst, dst.size(), 0, 0, interpolation);
  3463. *
  3464. * If you want to decimate the image by factor of 2 in each direction, you can call the function this
  3465. * way:
  3466. *
  3467. * // specify fx and fy and let the function compute the destination image size.
  3468. * resize(src, dst, Size(), 0.5, 0.5, interpolation);
  3469. *
  3470. * To shrink an image, it will generally look best with #INTER_AREA interpolation, whereas to
  3471. * enlarge an image, it will generally look best with #INTER_CUBIC (slow) or #INTER_LINEAR
  3472. * (faster but still looks OK).
  3473. *
  3474. * @param src input image.
  3475. * @param dst output image; it has the size dsize (when it is non-zero) or the size computed from
  3476. * src.size(), fx, and fy; the type of dst is the same as of src.
  3477. * @param dsize output image size; if it equals zero (`None` in Python), it is computed as:
  3478. * `$$\texttt{dsize = Size(round(fx*src.cols), round(fy*src.rows))}$$`
  3479. * Either dsize or both fx and fy must be non-zero.
  3480. * @param fx scale factor along the horizontal axis; when it equals 0, it is computed as
  3481. * `$$\texttt{(double)dsize.width/src.cols}$$`
  3482. * @param fy scale factor along the vertical axis; when it equals 0, it is computed as
  3483. * `$$\texttt{(double)dsize.height/src.rows}$$`
  3484. *
  3485. * @see `+warpAffine:dst:M:dsize:flags:borderMode:borderValue:`, `+warpPerspective:dst:M:dsize:flags:borderMode:borderValue:`, `+remap:dst:map1:map2:interpolation:borderMode:borderValue:`
  3486. */
  3487. + (void)resize:(Mat*)src dst:(Mat*)dst dsize:(Size2i*)dsize fx:(double)fx fy:(double)fy NS_SWIFT_NAME(resize(src:dst:dsize:fx:fy:));
  3488. /**
  3489. * Resizes an image.
  3490. *
  3491. * The function resize resizes the image src down to or up to the specified size. Note that the
  3492. * initial dst type or size are not taken into account. Instead, the size and type are derived from
  3493. * the `src`,`dsize`,`fx`, and `fy`. If you want to resize src so that it fits the pre-created dst,
  3494. * you may call the function as follows:
  3495. *
  3496. * // explicitly specify dsize=dst.size(); fx and fy will be computed from that.
  3497. * resize(src, dst, dst.size(), 0, 0, interpolation);
  3498. *
  3499. * If you want to decimate the image by factor of 2 in each direction, you can call the function this
  3500. * way:
  3501. *
  3502. * // specify fx and fy and let the function compute the destination image size.
  3503. * resize(src, dst, Size(), 0.5, 0.5, interpolation);
  3504. *
  3505. * To shrink an image, it will generally look best with #INTER_AREA interpolation, whereas to
  3506. * enlarge an image, it will generally look best with #INTER_CUBIC (slow) or #INTER_LINEAR
  3507. * (faster but still looks OK).
  3508. *
  3509. * @param src input image.
  3510. * @param dst output image; it has the size dsize (when it is non-zero) or the size computed from
  3511. * src.size(), fx, and fy; the type of dst is the same as of src.
  3512. * @param dsize output image size; if it equals zero (`None` in Python), it is computed as:
  3513. * `$$\texttt{dsize = Size(round(fx*src.cols), round(fy*src.rows))}$$`
  3514. * Either dsize or both fx and fy must be non-zero.
  3515. * @param fx scale factor along the horizontal axis; when it equals 0, it is computed as
  3516. * `$$\texttt{(double)dsize.width/src.cols}$$`
  3517. * `$$\texttt{(double)dsize.height/src.rows}$$`
  3518. *
  3519. * @see `+warpAffine:dst:M:dsize:flags:borderMode:borderValue:`, `+warpPerspective:dst:M:dsize:flags:borderMode:borderValue:`, `+remap:dst:map1:map2:interpolation:borderMode:borderValue:`
  3520. */
  3521. + (void)resize:(Mat*)src dst:(Mat*)dst dsize:(Size2i*)dsize fx:(double)fx NS_SWIFT_NAME(resize(src:dst:dsize:fx:));
  3522. /**
  3523. * Resizes an image.
  3524. *
  3525. * The function resize resizes the image src down to or up to the specified size. Note that the
  3526. * initial dst type or size are not taken into account. Instead, the size and type are derived from
  3527. * the `src`,`dsize`,`fx`, and `fy`. If you want to resize src so that it fits the pre-created dst,
  3528. * you may call the function as follows:
  3529. *
  3530. * // explicitly specify dsize=dst.size(); fx and fy will be computed from that.
  3531. * resize(src, dst, dst.size(), 0, 0, interpolation);
  3532. *
  3533. * If you want to decimate the image by factor of 2 in each direction, you can call the function this
  3534. * way:
  3535. *
  3536. * // specify fx and fy and let the function compute the destination image size.
  3537. * resize(src, dst, Size(), 0.5, 0.5, interpolation);
  3538. *
  3539. * To shrink an image, it will generally look best with #INTER_AREA interpolation, whereas to
  3540. * enlarge an image, it will generally look best with #INTER_CUBIC (slow) or #INTER_LINEAR
  3541. * (faster but still looks OK).
  3542. *
  3543. * @param src input image.
  3544. * @param dst output image; it has the size dsize (when it is non-zero) or the size computed from
  3545. * src.size(), fx, and fy; the type of dst is the same as of src.
  3546. * @param dsize output image size; if it equals zero (`None` in Python), it is computed as:
  3547. * `$$\texttt{dsize = Size(round(fx*src.cols), round(fy*src.rows))}$$`
  3548. * Either dsize or both fx and fy must be non-zero.
  3549. * `$$\texttt{(double)dsize.width/src.cols}$$`
  3550. * `$$\texttt{(double)dsize.height/src.rows}$$`
  3551. *
  3552. * @see `+warpAffine:dst:M:dsize:flags:borderMode:borderValue:`, `+warpPerspective:dst:M:dsize:flags:borderMode:borderValue:`, `+remap:dst:map1:map2:interpolation:borderMode:borderValue:`
  3553. */
  3554. + (void)resize:(Mat*)src dst:(Mat*)dst dsize:(Size2i*)dsize NS_SWIFT_NAME(resize(src:dst:dsize:));
  3555. //
  3556. // void cv::warpAffine(Mat src, Mat& dst, Mat M, Size dsize, int flags = INTER_LINEAR, BorderTypes borderMode = BORDER_CONSTANT, Scalar borderValue = Scalar())
  3557. //
  3558. /**
  3559. * Applies an affine transformation to an image.
  3560. *
  3561. * The function warpAffine transforms the source image using the specified matrix:
  3562. *
  3563. * `$$\texttt{dst} (x,y) = \texttt{src} ( \texttt{M} _{11} x + \texttt{M} _{12} y + \texttt{M} _{13}, \texttt{M} _{21} x + \texttt{M} _{22} y + \texttt{M} _{23})$$`
  3564. *
  3565. * when the flag #WARP_INVERSE_MAP is set. Otherwise, the transformation is first inverted
  3566. * with #invertAffineTransform and then put in the formula above instead of M. The function cannot
  3567. * operate in-place.
  3568. *
  3569. * @param src input image.
  3570. * @param dst output image that has the size dsize and the same type as src .
  3571. * @param M `$$2\times 3$$` transformation matrix.
  3572. * @param dsize size of the output image.
  3573. * @param flags combination of interpolation methods (see #InterpolationFlags) and the optional
  3574. * flag #WARP_INVERSE_MAP that means that M is the inverse transformation (
  3575. * `$$\texttt{dst}\rightarrow\texttt{src}$$` ).
  3576. * @param borderMode pixel extrapolation method (see #BorderTypes); when
  3577. * borderMode=#BORDER_TRANSPARENT, it means that the pixels in the destination image corresponding to
  3578. * the "outliers" in the source image are not modified by the function.
  3579. * @param borderValue value used in case of a constant border; by default, it is 0.
  3580. *
  3581. * @see `+warpPerspective:dst:M:dsize:flags:borderMode:borderValue:`, `+resize:dst:dsize:fx:fy:interpolation:`, `+remap:dst:map1:map2:interpolation:borderMode:borderValue:`, `+getRectSubPix:patchSize:center:patch:patchType:`, `transform`
  3582. */
  3583. + (void)warpAffine:(Mat*)src dst:(Mat*)dst M:(Mat*)M dsize:(Size2i*)dsize flags:(int)flags borderMode:(BorderTypes)borderMode borderValue:(Scalar*)borderValue NS_SWIFT_NAME(warpAffine(src:dst:M:dsize:flags:borderMode:borderValue:));
  3584. /**
  3585. * Applies an affine transformation to an image.
  3586. *
  3587. * The function warpAffine transforms the source image using the specified matrix:
  3588. *
  3589. * `$$\texttt{dst} (x,y) = \texttt{src} ( \texttt{M} _{11} x + \texttt{M} _{12} y + \texttt{M} _{13}, \texttt{M} _{21} x + \texttt{M} _{22} y + \texttt{M} _{23})$$`
  3590. *
  3591. * when the flag #WARP_INVERSE_MAP is set. Otherwise, the transformation is first inverted
  3592. * with #invertAffineTransform and then put in the formula above instead of M. The function cannot
  3593. * operate in-place.
  3594. *
  3595. * @param src input image.
  3596. * @param dst output image that has the size dsize and the same type as src .
  3597. * @param M `$$2\times 3$$` transformation matrix.
  3598. * @param dsize size of the output image.
  3599. * @param flags combination of interpolation methods (see #InterpolationFlags) and the optional
  3600. * flag #WARP_INVERSE_MAP that means that M is the inverse transformation (
  3601. * `$$\texttt{dst}\rightarrow\texttt{src}$$` ).
  3602. * @param borderMode pixel extrapolation method (see #BorderTypes); when
  3603. * borderMode=#BORDER_TRANSPARENT, it means that the pixels in the destination image corresponding to
  3604. * the "outliers" in the source image are not modified by the function.
  3605. *
  3606. * @see `+warpPerspective:dst:M:dsize:flags:borderMode:borderValue:`, `+resize:dst:dsize:fx:fy:interpolation:`, `+remap:dst:map1:map2:interpolation:borderMode:borderValue:`, `+getRectSubPix:patchSize:center:patch:patchType:`, `transform`
  3607. */
  3608. + (void)warpAffine:(Mat*)src dst:(Mat*)dst M:(Mat*)M dsize:(Size2i*)dsize flags:(int)flags borderMode:(BorderTypes)borderMode NS_SWIFT_NAME(warpAffine(src:dst:M:dsize:flags:borderMode:));
  3609. /**
  3610. * Applies an affine transformation to an image.
  3611. *
  3612. * The function warpAffine transforms the source image using the specified matrix:
  3613. *
  3614. * `$$\texttt{dst} (x,y) = \texttt{src} ( \texttt{M} _{11} x + \texttt{M} _{12} y + \texttt{M} _{13}, \texttt{M} _{21} x + \texttt{M} _{22} y + \texttt{M} _{23})$$`
  3615. *
  3616. * when the flag #WARP_INVERSE_MAP is set. Otherwise, the transformation is first inverted
  3617. * with #invertAffineTransform and then put in the formula above instead of M. The function cannot
  3618. * operate in-place.
  3619. *
  3620. * @param src input image.
  3621. * @param dst output image that has the size dsize and the same type as src .
  3622. * @param M `$$2\times 3$$` transformation matrix.
  3623. * @param dsize size of the output image.
  3624. * @param flags combination of interpolation methods (see #InterpolationFlags) and the optional
  3625. * flag #WARP_INVERSE_MAP that means that M is the inverse transformation (
  3626. * `$$\texttt{dst}\rightarrow\texttt{src}$$` ).
  3627. * borderMode=#BORDER_TRANSPARENT, it means that the pixels in the destination image corresponding to
  3628. * the "outliers" in the source image are not modified by the function.
  3629. *
  3630. * @see `+warpPerspective:dst:M:dsize:flags:borderMode:borderValue:`, `+resize:dst:dsize:fx:fy:interpolation:`, `+remap:dst:map1:map2:interpolation:borderMode:borderValue:`, `+getRectSubPix:patchSize:center:patch:patchType:`, `transform`
  3631. */
  3632. + (void)warpAffine:(Mat*)src dst:(Mat*)dst M:(Mat*)M dsize:(Size2i*)dsize flags:(int)flags NS_SWIFT_NAME(warpAffine(src:dst:M:dsize:flags:));
  3633. /**
  3634. * Applies an affine transformation to an image.
  3635. *
  3636. * The function warpAffine transforms the source image using the specified matrix:
  3637. *
  3638. * `$$\texttt{dst} (x,y) = \texttt{src} ( \texttt{M} _{11} x + \texttt{M} _{12} y + \texttt{M} _{13}, \texttt{M} _{21} x + \texttt{M} _{22} y + \texttt{M} _{23})$$`
  3639. *
  3640. * when the flag #WARP_INVERSE_MAP is set. Otherwise, the transformation is first inverted
  3641. * with #invertAffineTransform and then put in the formula above instead of M. The function cannot
  3642. * operate in-place.
  3643. *
  3644. * @param src input image.
  3645. * @param dst output image that has the size dsize and the same type as src .
  3646. * @param M `$$2\times 3$$` transformation matrix.
  3647. * @param dsize size of the output image.
  3648. * flag #WARP_INVERSE_MAP that means that M is the inverse transformation (
  3649. * `$$\texttt{dst}\rightarrow\texttt{src}$$` ).
  3650. * borderMode=#BORDER_TRANSPARENT, it means that the pixels in the destination image corresponding to
  3651. * the "outliers" in the source image are not modified by the function.
  3652. *
  3653. * @see `+warpPerspective:dst:M:dsize:flags:borderMode:borderValue:`, `+resize:dst:dsize:fx:fy:interpolation:`, `+remap:dst:map1:map2:interpolation:borderMode:borderValue:`, `+getRectSubPix:patchSize:center:patch:patchType:`, `transform`
  3654. */
  3655. + (void)warpAffine:(Mat*)src dst:(Mat*)dst M:(Mat*)M dsize:(Size2i*)dsize NS_SWIFT_NAME(warpAffine(src:dst:M:dsize:));
  3656. //
  3657. // void cv::warpPerspective(Mat src, Mat& dst, Mat M, Size dsize, int flags = INTER_LINEAR, BorderTypes borderMode = BORDER_CONSTANT, Scalar borderValue = Scalar())
  3658. //
  3659. /**
  3660. * Applies a perspective transformation to an image.
  3661. *
  3662. * The function warpPerspective transforms the source image using the specified matrix:
  3663. *
  3664. * `$$\texttt{dst} (x,y) = \texttt{src} \left ( \frac{M_{11} x + M_{12} y + M_{13}}{M_{31} x + M_{32} y + M_{33}} ,
  3665. * \frac{M_{21} x + M_{22} y + M_{23}}{M_{31} x + M_{32} y + M_{33}} \right )$$`
  3666. *
  3667. * when the flag #WARP_INVERSE_MAP is set. Otherwise, the transformation is first inverted with invert
  3668. * and then put in the formula above instead of M. The function cannot operate in-place.
  3669. *
  3670. * @param src input image.
  3671. * @param dst output image that has the size dsize and the same type as src .
  3672. * @param M `$$3\times 3$$` transformation matrix.
  3673. * @param dsize size of the output image.
  3674. * @param flags combination of interpolation methods (#INTER_LINEAR or #INTER_NEAREST) and the
  3675. * optional flag #WARP_INVERSE_MAP, that sets M as the inverse transformation (
  3676. * `$$\texttt{dst}\rightarrow\texttt{src}$$` ).
  3677. * @param borderMode pixel extrapolation method (#BORDER_CONSTANT or #BORDER_REPLICATE).
  3678. * @param borderValue value used in case of a constant border; by default, it equals 0.
  3679. *
  3680. * @see `+warpAffine:dst:M:dsize:flags:borderMode:borderValue:`, `+resize:dst:dsize:fx:fy:interpolation:`, `+remap:dst:map1:map2:interpolation:borderMode:borderValue:`, `+getRectSubPix:patchSize:center:patch:patchType:`, `perspectiveTransform`
  3681. */
  3682. + (void)warpPerspective:(Mat*)src dst:(Mat*)dst M:(Mat*)M dsize:(Size2i*)dsize flags:(int)flags borderMode:(BorderTypes)borderMode borderValue:(Scalar*)borderValue NS_SWIFT_NAME(warpPerspective(src:dst:M:dsize:flags:borderMode:borderValue:));
  3683. /**
  3684. * Applies a perspective transformation to an image.
  3685. *
  3686. * The function warpPerspective transforms the source image using the specified matrix:
  3687. *
  3688. * `$$\texttt{dst} (x,y) = \texttt{src} \left ( \frac{M_{11} x + M_{12} y + M_{13}}{M_{31} x + M_{32} y + M_{33}} ,
  3689. * \frac{M_{21} x + M_{22} y + M_{23}}{M_{31} x + M_{32} y + M_{33}} \right )$$`
  3690. *
  3691. * when the flag #WARP_INVERSE_MAP is set. Otherwise, the transformation is first inverted with invert
  3692. * and then put in the formula above instead of M. The function cannot operate in-place.
  3693. *
  3694. * @param src input image.
  3695. * @param dst output image that has the size dsize and the same type as src .
  3696. * @param M `$$3\times 3$$` transformation matrix.
  3697. * @param dsize size of the output image.
  3698. * @param flags combination of interpolation methods (#INTER_LINEAR or #INTER_NEAREST) and the
  3699. * optional flag #WARP_INVERSE_MAP, that sets M as the inverse transformation (
  3700. * `$$\texttt{dst}\rightarrow\texttt{src}$$` ).
  3701. * @param borderMode pixel extrapolation method (#BORDER_CONSTANT or #BORDER_REPLICATE).
  3702. *
  3703. * @see `+warpAffine:dst:M:dsize:flags:borderMode:borderValue:`, `+resize:dst:dsize:fx:fy:interpolation:`, `+remap:dst:map1:map2:interpolation:borderMode:borderValue:`, `+getRectSubPix:patchSize:center:patch:patchType:`, `perspectiveTransform`
  3704. */
  3705. + (void)warpPerspective:(Mat*)src dst:(Mat*)dst M:(Mat*)M dsize:(Size2i*)dsize flags:(int)flags borderMode:(BorderTypes)borderMode NS_SWIFT_NAME(warpPerspective(src:dst:M:dsize:flags:borderMode:));
  3706. /**
  3707. * Applies a perspective transformation to an image.
  3708. *
  3709. * The function warpPerspective transforms the source image using the specified matrix:
  3710. *
  3711. * `$$\texttt{dst} (x,y) = \texttt{src} \left ( \frac{M_{11} x + M_{12} y + M_{13}}{M_{31} x + M_{32} y + M_{33}} ,
  3712. * \frac{M_{21} x + M_{22} y + M_{23}}{M_{31} x + M_{32} y + M_{33}} \right )$$`
  3713. *
  3714. * when the flag #WARP_INVERSE_MAP is set. Otherwise, the transformation is first inverted with invert
  3715. * and then put in the formula above instead of M. The function cannot operate in-place.
  3716. *
  3717. * @param src input image.
  3718. * @param dst output image that has the size dsize and the same type as src .
  3719. * @param M `$$3\times 3$$` transformation matrix.
  3720. * @param dsize size of the output image.
  3721. * @param flags combination of interpolation methods (#INTER_LINEAR or #INTER_NEAREST) and the
  3722. * optional flag #WARP_INVERSE_MAP, that sets M as the inverse transformation (
  3723. * `$$\texttt{dst}\rightarrow\texttt{src}$$` ).
  3724. *
  3725. * @see `+warpAffine:dst:M:dsize:flags:borderMode:borderValue:`, `+resize:dst:dsize:fx:fy:interpolation:`, `+remap:dst:map1:map2:interpolation:borderMode:borderValue:`, `+getRectSubPix:patchSize:center:patch:patchType:`, `perspectiveTransform`
  3726. */
  3727. + (void)warpPerspective:(Mat*)src dst:(Mat*)dst M:(Mat*)M dsize:(Size2i*)dsize flags:(int)flags NS_SWIFT_NAME(warpPerspective(src:dst:M:dsize:flags:));
  3728. /**
  3729. * Applies a perspective transformation to an image.
  3730. *
  3731. * The function warpPerspective transforms the source image using the specified matrix:
  3732. *
  3733. * `$$\texttt{dst} (x,y) = \texttt{src} \left ( \frac{M_{11} x + M_{12} y + M_{13}}{M_{31} x + M_{32} y + M_{33}} ,
  3734. * \frac{M_{21} x + M_{22} y + M_{23}}{M_{31} x + M_{32} y + M_{33}} \right )$$`
  3735. *
  3736. * when the flag #WARP_INVERSE_MAP is set. Otherwise, the transformation is first inverted with invert
  3737. * and then put in the formula above instead of M. The function cannot operate in-place.
  3738. *
  3739. * @param src input image.
  3740. * @param dst output image that has the size dsize and the same type as src .
  3741. * @param M `$$3\times 3$$` transformation matrix.
  3742. * @param dsize size of the output image.
  3743. * optional flag #WARP_INVERSE_MAP, that sets M as the inverse transformation (
  3744. * `$$\texttt{dst}\rightarrow\texttt{src}$$` ).
  3745. *
  3746. * @see `+warpAffine:dst:M:dsize:flags:borderMode:borderValue:`, `+resize:dst:dsize:fx:fy:interpolation:`, `+remap:dst:map1:map2:interpolation:borderMode:borderValue:`, `+getRectSubPix:patchSize:center:patch:patchType:`, `perspectiveTransform`
  3747. */
  3748. + (void)warpPerspective:(Mat*)src dst:(Mat*)dst M:(Mat*)M dsize:(Size2i*)dsize NS_SWIFT_NAME(warpPerspective(src:dst:M:dsize:));
  3749. //
  3750. // void cv::remap(Mat src, Mat& dst, Mat map1, Mat map2, int interpolation, BorderTypes borderMode = BORDER_CONSTANT, Scalar borderValue = Scalar())
  3751. //
  3752. /**
  3753. * Applies a generic geometrical transformation to an image.
  3754. *
  3755. * The function remap transforms the source image using the specified map:
  3756. *
  3757. * `$$\texttt{dst} (x,y) = \texttt{src} (map_x(x,y),map_y(x,y))$$`
  3758. *
  3759. * where values of pixels with non-integer coordinates are computed using one of available
  3760. * interpolation methods. `$$map_x$$` and `$$map_y$$` can be encoded as separate floating-point maps
  3761. * in `$$map_1$$` and `$$map_2$$` respectively, or interleaved floating-point maps of `$$(x,y)$$` in
  3762. * `$$map_1$$`, or fixed-point maps created by using #convertMaps. The reason you might want to
  3763. * convert from floating to fixed-point representations of a map is that they can yield much faster
  3764. * (\~2x) remapping operations. In the converted case, `$$map_1$$` contains pairs (cvFloor(x),
  3765. * cvFloor(y)) and `$$map_2$$` contains indices in a table of interpolation coefficients.
  3766. *
  3767. * This function cannot operate in-place.
  3768. *
  3769. * @param src Source image.
  3770. * @param dst Destination image. It has the same size as map1 and the same type as src .
  3771. * @param map1 The first map of either (x,y) points or just x values having the type CV_16SC2 ,
  3772. * CV_32FC1, or CV_32FC2. See #convertMaps for details on converting a floating point
  3773. * representation to fixed-point for speed.
  3774. * @param map2 The second map of y values having the type CV_16UC1, CV_32FC1, or none (empty map
  3775. * if map1 is (x,y) points), respectively.
  3776. * @param interpolation Interpolation method (see #InterpolationFlags). The methods #INTER_AREA
  3777. * and #INTER_LINEAR_EXACT are not supported by this function.
  3778. * @param borderMode Pixel extrapolation method (see #BorderTypes). When
  3779. * borderMode=#BORDER_TRANSPARENT, it means that the pixels in the destination image that
  3780. * corresponds to the "outliers" in the source image are not modified by the function.
  3781. * @param borderValue Value used in case of a constant border. By default, it is 0.
  3782. * NOTE:
  3783. * Due to current implementation limitations the size of an input and output images should be less than 32767x32767.
  3784. */
  3785. + (void)remap:(Mat*)src dst:(Mat*)dst map1:(Mat*)map1 map2:(Mat*)map2 interpolation:(int)interpolation borderMode:(BorderTypes)borderMode borderValue:(Scalar*)borderValue NS_SWIFT_NAME(remap(src:dst:map1:map2:interpolation:borderMode:borderValue:));
  3786. /**
  3787. * Applies a generic geometrical transformation to an image.
  3788. *
  3789. * The function remap transforms the source image using the specified map:
  3790. *
  3791. * `$$\texttt{dst} (x,y) = \texttt{src} (map_x(x,y),map_y(x,y))$$`
  3792. *
  3793. * where values of pixels with non-integer coordinates are computed using one of available
  3794. * interpolation methods. `$$map_x$$` and `$$map_y$$` can be encoded as separate floating-point maps
  3795. * in `$$map_1$$` and `$$map_2$$` respectively, or interleaved floating-point maps of `$$(x,y)$$` in
  3796. * `$$map_1$$`, or fixed-point maps created by using #convertMaps. The reason you might want to
  3797. * convert from floating to fixed-point representations of a map is that they can yield much faster
  3798. * (\~2x) remapping operations. In the converted case, `$$map_1$$` contains pairs (cvFloor(x),
  3799. * cvFloor(y)) and `$$map_2$$` contains indices in a table of interpolation coefficients.
  3800. *
  3801. * This function cannot operate in-place.
  3802. *
  3803. * @param src Source image.
  3804. * @param dst Destination image. It has the same size as map1 and the same type as src .
  3805. * @param map1 The first map of either (x,y) points or just x values having the type CV_16SC2 ,
  3806. * CV_32FC1, or CV_32FC2. See #convertMaps for details on converting a floating point
  3807. * representation to fixed-point for speed.
  3808. * @param map2 The second map of y values having the type CV_16UC1, CV_32FC1, or none (empty map
  3809. * if map1 is (x,y) points), respectively.
  3810. * @param interpolation Interpolation method (see #InterpolationFlags). The methods #INTER_AREA
  3811. * and #INTER_LINEAR_EXACT are not supported by this function.
  3812. * @param borderMode Pixel extrapolation method (see #BorderTypes). When
  3813. * borderMode=#BORDER_TRANSPARENT, it means that the pixels in the destination image that
  3814. * corresponds to the "outliers" in the source image are not modified by the function.
  3815. * NOTE:
  3816. * Due to current implementation limitations the size of an input and output images should be less than 32767x32767.
  3817. */
  3818. + (void)remap:(Mat*)src dst:(Mat*)dst map1:(Mat*)map1 map2:(Mat*)map2 interpolation:(int)interpolation borderMode:(BorderTypes)borderMode NS_SWIFT_NAME(remap(src:dst:map1:map2:interpolation:borderMode:));
  3819. /**
  3820. * Applies a generic geometrical transformation to an image.
  3821. *
  3822. * The function remap transforms the source image using the specified map:
  3823. *
  3824. * `$$\texttt{dst} (x,y) = \texttt{src} (map_x(x,y),map_y(x,y))$$`
  3825. *
  3826. * where values of pixels with non-integer coordinates are computed using one of available
  3827. * interpolation methods. `$$map_x$$` and `$$map_y$$` can be encoded as separate floating-point maps
  3828. * in `$$map_1$$` and `$$map_2$$` respectively, or interleaved floating-point maps of `$$(x,y)$$` in
  3829. * `$$map_1$$`, or fixed-point maps created by using #convertMaps. The reason you might want to
  3830. * convert from floating to fixed-point representations of a map is that they can yield much faster
  3831. * (\~2x) remapping operations. In the converted case, `$$map_1$$` contains pairs (cvFloor(x),
  3832. * cvFloor(y)) and `$$map_2$$` contains indices in a table of interpolation coefficients.
  3833. *
  3834. * This function cannot operate in-place.
  3835. *
  3836. * @param src Source image.
  3837. * @param dst Destination image. It has the same size as map1 and the same type as src .
  3838. * @param map1 The first map of either (x,y) points or just x values having the type CV_16SC2 ,
  3839. * CV_32FC1, or CV_32FC2. See #convertMaps for details on converting a floating point
  3840. * representation to fixed-point for speed.
  3841. * @param map2 The second map of y values having the type CV_16UC1, CV_32FC1, or none (empty map
  3842. * if map1 is (x,y) points), respectively.
  3843. * @param interpolation Interpolation method (see #InterpolationFlags). The methods #INTER_AREA
  3844. * and #INTER_LINEAR_EXACT are not supported by this function.
  3845. * borderMode=#BORDER_TRANSPARENT, it means that the pixels in the destination image that
  3846. * corresponds to the "outliers" in the source image are not modified by the function.
  3847. * NOTE:
  3848. * Due to current implementation limitations the size of an input and output images should be less than 32767x32767.
  3849. */
  3850. + (void)remap:(Mat*)src dst:(Mat*)dst map1:(Mat*)map1 map2:(Mat*)map2 interpolation:(int)interpolation NS_SWIFT_NAME(remap(src:dst:map1:map2:interpolation:));
  3851. //
  3852. // void cv::convertMaps(Mat map1, Mat map2, Mat& dstmap1, Mat& dstmap2, int dstmap1type, bool nninterpolation = false)
  3853. //
  3854. /**
  3855. * Converts image transformation maps from one representation to another.
  3856. *
  3857. * The function converts a pair of maps for remap from one representation to another. The following
  3858. * options ( (map1.type(), map2.type()) `$$\rightarrow$$` (dstmap1.type(), dstmap2.type()) ) are
  3859. * supported:
  3860. *
  3861. * - `$$\texttt{(CV\_32FC1, CV\_32FC1)} \rightarrow \texttt{(CV\_16SC2, CV\_16UC1)}$$`. This is the
  3862. * most frequently used conversion operation, in which the original floating-point maps (see #remap)
  3863. * are converted to a more compact and much faster fixed-point representation. The first output array
  3864. * contains the rounded coordinates and the second array (created only when nninterpolation=false )
  3865. * contains indices in the interpolation tables.
  3866. *
  3867. * - `$$\texttt{(CV\_32FC2)} \rightarrow \texttt{(CV\_16SC2, CV\_16UC1)}$$`. The same as above but
  3868. * the original maps are stored in one 2-channel matrix.
  3869. *
  3870. * - Reverse conversion. Obviously, the reconstructed floating-point maps will not be exactly the same
  3871. * as the originals.
  3872. *
  3873. * @param map1 The first input map of type CV_16SC2, CV_32FC1, or CV_32FC2 .
  3874. * @param map2 The second input map of type CV_16UC1, CV_32FC1, or none (empty matrix),
  3875. * respectively.
  3876. * @param dstmap1 The first output map that has the type dstmap1type and the same size as src .
  3877. * @param dstmap2 The second output map.
  3878. * @param dstmap1type Type of the first output map that should be CV_16SC2, CV_32FC1, or
  3879. * CV_32FC2 .
  3880. * @param nninterpolation Flag indicating whether the fixed-point maps are used for the
  3881. * nearest-neighbor or for a more complex interpolation.
  3882. *
  3883. * @see `+remap:dst:map1:map2:interpolation:borderMode:borderValue:`, `undistort`, `initUndistortRectifyMap`
  3884. */
  3885. + (void)convertMaps:(Mat*)map1 map2:(Mat*)map2 dstmap1:(Mat*)dstmap1 dstmap2:(Mat*)dstmap2 dstmap1type:(int)dstmap1type nninterpolation:(BOOL)nninterpolation NS_SWIFT_NAME(convertMaps(map1:map2:dstmap1:dstmap2:dstmap1type:nninterpolation:));
  3886. /**
  3887. * Converts image transformation maps from one representation to another.
  3888. *
  3889. * The function converts a pair of maps for remap from one representation to another. The following
  3890. * options ( (map1.type(), map2.type()) `$$\rightarrow$$` (dstmap1.type(), dstmap2.type()) ) are
  3891. * supported:
  3892. *
  3893. * - `$$\texttt{(CV\_32FC1, CV\_32FC1)} \rightarrow \texttt{(CV\_16SC2, CV\_16UC1)}$$`. This is the
  3894. * most frequently used conversion operation, in which the original floating-point maps (see #remap)
  3895. * are converted to a more compact and much faster fixed-point representation. The first output array
  3896. * contains the rounded coordinates and the second array (created only when nninterpolation=false )
  3897. * contains indices in the interpolation tables.
  3898. *
  3899. * - `$$\texttt{(CV\_32FC2)} \rightarrow \texttt{(CV\_16SC2, CV\_16UC1)}$$`. The same as above but
  3900. * the original maps are stored in one 2-channel matrix.
  3901. *
  3902. * - Reverse conversion. Obviously, the reconstructed floating-point maps will not be exactly the same
  3903. * as the originals.
  3904. *
  3905. * @param map1 The first input map of type CV_16SC2, CV_32FC1, or CV_32FC2 .
  3906. * @param map2 The second input map of type CV_16UC1, CV_32FC1, or none (empty matrix),
  3907. * respectively.
  3908. * @param dstmap1 The first output map that has the type dstmap1type and the same size as src .
  3909. * @param dstmap2 The second output map.
  3910. * @param dstmap1type Type of the first output map that should be CV_16SC2, CV_32FC1, or
  3911. * CV_32FC2 .
  3912. * nearest-neighbor or for a more complex interpolation.
  3913. *
  3914. * @see `+remap:dst:map1:map2:interpolation:borderMode:borderValue:`, `undistort`, `initUndistortRectifyMap`
  3915. */
  3916. + (void)convertMaps:(Mat*)map1 map2:(Mat*)map2 dstmap1:(Mat*)dstmap1 dstmap2:(Mat*)dstmap2 dstmap1type:(int)dstmap1type NS_SWIFT_NAME(convertMaps(map1:map2:dstmap1:dstmap2:dstmap1type:));
  3917. //
  3918. // Mat cv::getRotationMatrix2D(Point2f center, double angle, double scale)
  3919. //
  3920. /**
  3921. * Calculates an affine matrix of 2D rotation.
  3922. *
  3923. * The function calculates the following matrix:
  3924. *
  3925. * `$$\begin{bmatrix} \alpha & \beta & (1- \alpha ) \cdot \texttt{center.x} - \beta \cdot \texttt{center.y} \\ - \beta & \alpha & \beta \cdot \texttt{center.x} + (1- \alpha ) \cdot \texttt{center.y} \end{bmatrix}$$`
  3926. *
  3927. * where
  3928. *
  3929. * `$$\begin{array}{l} \alpha = \texttt{scale} \cdot \cos \texttt{angle} , \\ \beta = \texttt{scale} \cdot \sin \texttt{angle} \end{array}$$`
  3930. *
  3931. * The transformation maps the rotation center to itself. If this is not the target, adjust the shift.
  3932. *
  3933. * @param center Center of the rotation in the source image.
  3934. * @param angle Rotation angle in degrees. Positive values mean counter-clockwise rotation (the
  3935. * coordinate origin is assumed to be the top-left corner).
  3936. * @param scale Isotropic scale factor.
  3937. *
  3938. * @see `+getAffineTransform:dst:`, `+warpAffine:dst:M:dsize:flags:borderMode:borderValue:`, `transform`
  3939. */
  3940. + (Mat*)getRotationMatrix2D:(Point2f*)center angle:(double)angle scale:(double)scale NS_SWIFT_NAME(getRotationMatrix2D(center:angle:scale:));
  3941. //
  3942. // void cv::invertAffineTransform(Mat M, Mat& iM)
  3943. //
  3944. /**
  3945. * Inverts an affine transformation.
  3946. *
  3947. * The function computes an inverse affine transformation represented by `$$2 \times 3$$` matrix M:
  3948. *
  3949. * `$$\begin{bmatrix} a_{11} & a_{12} & b_1 \\ a_{21} & a_{22} & b_2 \end{bmatrix}$$`
  3950. *
  3951. * The result is also a `$$2 \times 3$$` matrix of the same type as M.
  3952. *
  3953. * @param M Original affine transformation.
  3954. * @param iM Output reverse affine transformation.
  3955. */
  3956. + (void)invertAffineTransform:(Mat*)M iM:(Mat*)iM NS_SWIFT_NAME(invertAffineTransform(M:iM:));
  3957. //
  3958. // Mat cv::getPerspectiveTransform(Mat src, Mat dst, int solveMethod = DECOMP_LU)
  3959. //
  3960. /**
  3961. * Calculates a perspective transform from four pairs of the corresponding points.
  3962. *
  3963. * The function calculates the `$$3 \times 3$$` matrix of a perspective transform so that:
  3964. *
  3965. * `$$\begin{bmatrix} t_i x'_i \\ t_i y'_i \\ t_i \end{bmatrix} = \texttt{map\_matrix} \cdot \begin{bmatrix} x_i \\ y_i \\ 1 \end{bmatrix}$$`
  3966. *
  3967. * where
  3968. *
  3969. * `$$dst(i)=(x'_i,y'_i), src(i)=(x_i, y_i), i=0,1,2,3$$`
  3970. *
  3971. * @param src Coordinates of quadrangle vertices in the source image.
  3972. * @param dst Coordinates of the corresponding quadrangle vertices in the destination image.
  3973. * @param solveMethod method passed to cv::solve (#DecompTypes)
  3974. *
  3975. * @see `findHomography`, `+warpPerspective:dst:M:dsize:flags:borderMode:borderValue:`, `perspectiveTransform`
  3976. */
  3977. + (Mat*)getPerspectiveTransform:(Mat*)src dst:(Mat*)dst solveMethod:(int)solveMethod NS_SWIFT_NAME(getPerspectiveTransform(src:dst:solveMethod:));
  3978. /**
  3979. * Calculates a perspective transform from four pairs of the corresponding points.
  3980. *
  3981. * The function calculates the `$$3 \times 3$$` matrix of a perspective transform so that:
  3982. *
  3983. * `$$\begin{bmatrix} t_i x'_i \\ t_i y'_i \\ t_i \end{bmatrix} = \texttt{map\_matrix} \cdot \begin{bmatrix} x_i \\ y_i \\ 1 \end{bmatrix}$$`
  3984. *
  3985. * where
  3986. *
  3987. * `$$dst(i)=(x'_i,y'_i), src(i)=(x_i, y_i), i=0,1,2,3$$`
  3988. *
  3989. * @param src Coordinates of quadrangle vertices in the source image.
  3990. * @param dst Coordinates of the corresponding quadrangle vertices in the destination image.
  3991. *
  3992. * @see `findHomography`, `+warpPerspective:dst:M:dsize:flags:borderMode:borderValue:`, `perspectiveTransform`
  3993. */
  3994. + (Mat*)getPerspectiveTransform:(Mat*)src dst:(Mat*)dst NS_SWIFT_NAME(getPerspectiveTransform(src:dst:));
  3995. //
  3996. // Mat cv::getAffineTransform(vector_Point2f src, vector_Point2f dst)
  3997. //
  3998. + (Mat*)getAffineTransform:(NSArray<Point2f*>*)src dst:(NSArray<Point2f*>*)dst NS_SWIFT_NAME(getAffineTransform(src:dst:));
  3999. //
  4000. // void cv::getRectSubPix(Mat image, Size patchSize, Point2f center, Mat& patch, int patchType = -1)
  4001. //
  4002. /**
  4003. * Retrieves a pixel rectangle from an image with sub-pixel accuracy.
  4004. *
  4005. * The function getRectSubPix extracts pixels from src:
  4006. *
  4007. * `$$patch(x, y) = src(x + \texttt{center.x} - ( \texttt{dst.cols} -1)*0.5, y + \texttt{center.y} - ( \texttt{dst.rows} -1)*0.5)$$`
  4008. *
  4009. * where the values of the pixels at non-integer coordinates are retrieved using bilinear
  4010. * interpolation. Every channel of multi-channel images is processed independently. Also
  4011. * the image should be a single channel or three channel image. While the center of the
  4012. * rectangle must be inside the image, parts of the rectangle may be outside.
  4013. *
  4014. * @param image Source image.
  4015. * @param patchSize Size of the extracted patch.
  4016. * @param center Floating point coordinates of the center of the extracted rectangle within the
  4017. * source image. The center must be inside the image.
  4018. * @param patch Extracted patch that has the size patchSize and the same number of channels as src .
  4019. * @param patchType Depth of the extracted pixels. By default, they have the same depth as src .
  4020. *
  4021. * @see `+warpAffine:dst:M:dsize:flags:borderMode:borderValue:`, `+warpPerspective:dst:M:dsize:flags:borderMode:borderValue:`
  4022. */
  4023. + (void)getRectSubPix:(Mat*)image patchSize:(Size2i*)patchSize center:(Point2f*)center patch:(Mat*)patch patchType:(int)patchType NS_SWIFT_NAME(getRectSubPix(image:patchSize:center:patch:patchType:));
  4024. /**
  4025. * Retrieves a pixel rectangle from an image with sub-pixel accuracy.
  4026. *
  4027. * The function getRectSubPix extracts pixels from src:
  4028. *
  4029. * `$$patch(x, y) = src(x + \texttt{center.x} - ( \texttt{dst.cols} -1)*0.5, y + \texttt{center.y} - ( \texttt{dst.rows} -1)*0.5)$$`
  4030. *
  4031. * where the values of the pixels at non-integer coordinates are retrieved using bilinear
  4032. * interpolation. Every channel of multi-channel images is processed independently. Also
  4033. * the image should be a single channel or three channel image. While the center of the
  4034. * rectangle must be inside the image, parts of the rectangle may be outside.
  4035. *
  4036. * @param image Source image.
  4037. * @param patchSize Size of the extracted patch.
  4038. * @param center Floating point coordinates of the center of the extracted rectangle within the
  4039. * source image. The center must be inside the image.
  4040. * @param patch Extracted patch that has the size patchSize and the same number of channels as src .
  4041. *
  4042. * @see `+warpAffine:dst:M:dsize:flags:borderMode:borderValue:`, `+warpPerspective:dst:M:dsize:flags:borderMode:borderValue:`
  4043. */
  4044. + (void)getRectSubPix:(Mat*)image patchSize:(Size2i*)patchSize center:(Point2f*)center patch:(Mat*)patch NS_SWIFT_NAME(getRectSubPix(image:patchSize:center:patch:));
  4045. //
  4046. // void cv::logPolar(Mat src, Mat& dst, Point2f center, double M, int flags)
  4047. //
  4048. /**
  4049. * Remaps an image to semilog-polar coordinates space.
  4050. *
  4051. * @deprecated This function produces same result as cv::warpPolar(src, dst, src.size(), center, maxRadius, flags+WARP_POLAR_LOG);
  4052. *
  4053. *
  4054. * Transform the source image using the following transformation (See REF: polar_remaps_reference_image "Polar remaps reference image d)"):
  4055. * `$$\begin{array}{l}
  4056. * dst( \rho , \phi ) = src(x,y) \\
  4057. * dst.size() \leftarrow src.size()
  4058. * \end{array}$$`
  4059. *
  4060. * where
  4061. * `$$\begin{array}{l}
  4062. * I = (dx,dy) = (x - center.x,y - center.y) \\
  4063. * \rho = M \cdot log_e(\texttt{magnitude} (I)) ,\\
  4064. * \phi = Kangle \cdot \texttt{angle} (I) \\
  4065. * \end{array}$$`
  4066. *
  4067. * and
  4068. * `$$\begin{array}{l}
  4069. * M = src.cols / log_e(maxRadius) \\
  4070. * Kangle = src.rows / 2\Pi \\
  4071. * \end{array}$$`
  4072. *
  4073. * The function emulates the human "foveal" vision and can be used for fast scale and
  4074. * rotation-invariant template matching, for object tracking and so forth.
  4075. * @param src Source image
  4076. * @param dst Destination image. It will have same size and type as src.
  4077. * @param center The transformation center; where the output precision is maximal
  4078. * @param M Magnitude scale parameter. It determines the radius of the bounding circle to transform too.
  4079. * @param flags A combination of interpolation methods, see #InterpolationFlags
  4080. *
  4081. * NOTE:
  4082. * - The function can not operate in-place.
  4083. * - To calculate magnitude and angle in degrees #cartToPolar is used internally thus angles are measured from 0 to 360 with accuracy about 0.3 degrees.
  4084. *
  4085. * @see `cv::linearPolar`
  4086. */
  4087. + (void)logPolar:(Mat*)src dst:(Mat*)dst center:(Point2f*)center M:(double)M flags:(int)flags NS_SWIFT_NAME(logPolar(src:dst:center:M:flags:)) DEPRECATED_ATTRIBUTE;
  4088. //
  4089. // void cv::linearPolar(Mat src, Mat& dst, Point2f center, double maxRadius, int flags)
  4090. //
  4091. /**
  4092. * Remaps an image to polar coordinates space.
  4093. *
  4094. * @deprecated This function produces same result as cv::warpPolar(src, dst, src.size(), center, maxRadius, flags)
  4095. *
  4096. *
  4097. * Transform the source image using the following transformation (See REF: polar_remaps_reference_image "Polar remaps reference image c)"):
  4098. * `$$\begin{array}{l}
  4099. * dst( \rho , \phi ) = src(x,y) \\
  4100. * dst.size() \leftarrow src.size()
  4101. * \end{array}$$`
  4102. *
  4103. * where
  4104. * `$$\begin{array}{l}
  4105. * I = (dx,dy) = (x - center.x,y - center.y) \\
  4106. * \rho = Kmag \cdot \texttt{magnitude} (I) ,\\
  4107. * \phi = angle \cdot \texttt{angle} (I)
  4108. * \end{array}$$`
  4109. *
  4110. * and
  4111. * `$$\begin{array}{l}
  4112. * Kx = src.cols / maxRadius \\
  4113. * Ky = src.rows / 2\Pi
  4114. * \end{array}$$`
  4115. *
  4116. *
  4117. * @param src Source image
  4118. * @param dst Destination image. It will have same size and type as src.
  4119. * @param center The transformation center;
  4120. * @param maxRadius The radius of the bounding circle to transform. It determines the inverse magnitude scale parameter too.
  4121. * @param flags A combination of interpolation methods, see #InterpolationFlags
  4122. *
  4123. * NOTE:
  4124. * - The function can not operate in-place.
  4125. * - To calculate magnitude and angle in degrees #cartToPolar is used internally thus angles are measured from 0 to 360 with accuracy about 0.3 degrees.
  4126. *
  4127. * @see `cv::logPolar`
  4128. */
  4129. + (void)linearPolar:(Mat*)src dst:(Mat*)dst center:(Point2f*)center maxRadius:(double)maxRadius flags:(int)flags NS_SWIFT_NAME(linearPolar(src:dst:center:maxRadius:flags:)) DEPRECATED_ATTRIBUTE;
  4130. //
  4131. // void cv::warpPolar(Mat src, Mat& dst, Size dsize, Point2f center, double maxRadius, int flags)
  4132. //
  4133. /**
  4134. * Remaps an image to polar or semilog-polar coordinates space
  4135. *
  4136. * polar_remaps_reference_image
  4137. * ![Polar remaps reference](pics/polar_remap_doc.png)
  4138. *
  4139. * Transform the source image using the following transformation:
  4140. * `$$
  4141. * dst(\rho , \phi ) = src(x,y)
  4142. * $$`
  4143. *
  4144. * where
  4145. * `$$
  4146. * \begin{array}{l}
  4147. * \vec{I} = (x - center.x, \;y - center.y) \\
  4148. * \phi = Kangle \cdot \texttt{angle} (\vec{I}) \\
  4149. * \rho = \left\{\begin{matrix}
  4150. * Klin \cdot \texttt{magnitude} (\vec{I}) & default \\
  4151. * Klog \cdot log_e(\texttt{magnitude} (\vec{I})) & if \; semilog \\
  4152. * \end{matrix}\right.
  4153. * \end{array}
  4154. * $$`
  4155. *
  4156. * and
  4157. * `$$
  4158. * \begin{array}{l}
  4159. * Kangle = dsize.height / 2\Pi \\
  4160. * Klin = dsize.width / maxRadius \\
  4161. * Klog = dsize.width / log_e(maxRadius) \\
  4162. * \end{array}
  4163. * $$`
  4164. *
  4165. *
  4166. * \par Linear vs semilog mapping
  4167. *
  4168. * Polar mapping can be linear or semi-log. Add one of #WarpPolarMode to `flags` to specify the polar mapping mode.
  4169. *
  4170. * Linear is the default mode.
  4171. *
  4172. * The semilog mapping emulates the human "foveal" vision that permit very high acuity on the line of sight (central vision)
  4173. * in contrast to peripheral vision where acuity is minor.
  4174. *
  4175. * \par Option on `dsize`:
  4176. *
  4177. * - if both values in `dsize <=0 ` (default),
  4178. * the destination image will have (almost) same area of source bounding circle:
  4179. * `$$\begin{array}{l}
  4180. * dsize.area \leftarrow (maxRadius^2 \cdot \Pi) \\
  4181. * dsize.width = \texttt{cvRound}(maxRadius) \\
  4182. * dsize.height = \texttt{cvRound}(maxRadius \cdot \Pi) \\
  4183. * \end{array}$$`
  4184. *
  4185. *
  4186. * - if only `dsize.height <= 0`,
  4187. * the destination image area will be proportional to the bounding circle area but scaled by `Kx * Kx`:
  4188. * `$$\begin{array}{l}
  4189. * dsize.height = \texttt{cvRound}(dsize.width \cdot \Pi) \\
  4190. * \end{array}
  4191. * $$`
  4192. *
  4193. * - if both values in `dsize > 0 `,
  4194. * the destination image will have the given size therefore the area of the bounding circle will be scaled to `dsize`.
  4195. *
  4196. *
  4197. * \par Reverse mapping
  4198. *
  4199. * You can get reverse mapping adding #WARP_INVERSE_MAP to `flags`
  4200. * \snippet polar_transforms.cpp InverseMap
  4201. *
  4202. * In addiction, to calculate the original coordinate from a polar mapped coordinate `$$(rho, phi)->(x, y)$$`:
  4203. * \snippet polar_transforms.cpp InverseCoordinate
  4204. *
  4205. * @param src Source image.
  4206. * @param dst Destination image. It will have same type as src.
  4207. * @param dsize The destination image size (see description for valid options).
  4208. * @param center The transformation center.
  4209. * @param maxRadius The radius of the bounding circle to transform. It determines the inverse magnitude scale parameter too.
  4210. * @param flags A combination of interpolation methods, #InterpolationFlags + #WarpPolarMode.
  4211. * - Add #WARP_POLAR_LINEAR to select linear polar mapping (default)
  4212. * - Add #WARP_POLAR_LOG to select semilog polar mapping
  4213. * - Add #WARP_INVERSE_MAP for reverse mapping.
  4214. * NOTE:
  4215. * - The function can not operate in-place.
  4216. * - To calculate magnitude and angle in degrees #cartToPolar is used internally thus angles are measured from 0 to 360 with accuracy about 0.3 degrees.
  4217. * - This function uses #remap. Due to current implementation limitations the size of an input and output images should be less than 32767x32767.
  4218. *
  4219. * @see `cv::remap`
  4220. */
  4221. + (void)warpPolar:(Mat*)src dst:(Mat*)dst dsize:(Size2i*)dsize center:(Point2f*)center maxRadius:(double)maxRadius flags:(int)flags NS_SWIFT_NAME(warpPolar(src:dst:dsize:center:maxRadius:flags:));
  4222. //
  4223. // void cv::integral(Mat src, Mat& sum, Mat& sqsum, Mat& tilted, int sdepth = -1, int sqdepth = -1)
  4224. //
  4225. /**
  4226. * Calculates the integral of an image.
  4227. *
  4228. * The function calculates one or more integral images for the source image as follows:
  4229. *
  4230. * `$$\texttt{sum} (X,Y) = \sum _{x<X,y<Y} \texttt{image} (x,y)$$`
  4231. *
  4232. * `$$\texttt{sqsum} (X,Y) = \sum _{x<X,y<Y} \texttt{image} (x,y)^2$$`
  4233. *
  4234. * `$$\texttt{tilted} (X,Y) = \sum _{y<Y,abs(x-X+1) \leq Y-y-1} \texttt{image} (x,y)$$`
  4235. *
  4236. * Using these integral images, you can calculate sum, mean, and standard deviation over a specific
  4237. * up-right or rotated rectangular region of the image in a constant time, for example:
  4238. *
  4239. * `$$\sum _{x_1 \leq x < x_2, \, y_1 \leq y < y_2} \texttt{image} (x,y) = \texttt{sum} (x_2,y_2)- \texttt{sum} (x_1,y_2)- \texttt{sum} (x_2,y_1)+ \texttt{sum} (x_1,y_1)$$`
  4240. *
  4241. * It makes possible to do a fast blurring or fast block correlation with a variable window size, for
  4242. * example. In case of multi-channel images, sums for each channel are accumulated independently.
  4243. *
  4244. * As a practical example, the next figure shows the calculation of the integral of a straight
  4245. * rectangle Rect(4,4,3,2) and of a tilted rectangle Rect(5,1,2,3) . The selected pixels in the
  4246. * original image are shown, as well as the relative pixels in the integral images sum and tilted .
  4247. *
  4248. * ![integral calculation example](pics/integral.png)
  4249. *
  4250. * @param src input image as `$$W \times H$$`, 8-bit or floating-point (32f or 64f).
  4251. * @param sum integral image as `$$(W+1)\times (H+1)$$` , 32-bit integer or floating-point (32f or 64f).
  4252. * @param sqsum integral image for squared pixel values; it is `$$(W+1)\times (H+1)$$`, double-precision
  4253. * floating-point (64f) array.
  4254. * @param tilted integral for the image rotated by 45 degrees; it is `$$(W+1)\times (H+1)$$` array with
  4255. * the same data type as sum.
  4256. * @param sdepth desired depth of the integral and the tilted integral images, CV_32S, CV_32F, or
  4257. * CV_64F.
  4258. * @param sqdepth desired depth of the integral image of squared pixel values, CV_32F or CV_64F.
  4259. */
  4260. + (void)integral3:(Mat*)src sum:(Mat*)sum sqsum:(Mat*)sqsum tilted:(Mat*)tilted sdepth:(int)sdepth sqdepth:(int)sqdepth NS_SWIFT_NAME(integral(src:sum:sqsum:tilted:sdepth:sqdepth:));
  4261. /**
  4262. * Calculates the integral of an image.
  4263. *
  4264. * The function calculates one or more integral images for the source image as follows:
  4265. *
  4266. * `$$\texttt{sum} (X,Y) = \sum _{x<X,y<Y} \texttt{image} (x,y)$$`
  4267. *
  4268. * `$$\texttt{sqsum} (X,Y) = \sum _{x<X,y<Y} \texttt{image} (x,y)^2$$`
  4269. *
  4270. * `$$\texttt{tilted} (X,Y) = \sum _{y<Y,abs(x-X+1) \leq Y-y-1} \texttt{image} (x,y)$$`
  4271. *
  4272. * Using these integral images, you can calculate sum, mean, and standard deviation over a specific
  4273. * up-right or rotated rectangular region of the image in a constant time, for example:
  4274. *
  4275. * `$$\sum _{x_1 \leq x < x_2, \, y_1 \leq y < y_2} \texttt{image} (x,y) = \texttt{sum} (x_2,y_2)- \texttt{sum} (x_1,y_2)- \texttt{sum} (x_2,y_1)+ \texttt{sum} (x_1,y_1)$$`
  4276. *
  4277. * It makes possible to do a fast blurring or fast block correlation with a variable window size, for
  4278. * example. In case of multi-channel images, sums for each channel are accumulated independently.
  4279. *
  4280. * As a practical example, the next figure shows the calculation of the integral of a straight
  4281. * rectangle Rect(4,4,3,2) and of a tilted rectangle Rect(5,1,2,3) . The selected pixels in the
  4282. * original image are shown, as well as the relative pixels in the integral images sum and tilted .
  4283. *
  4284. * ![integral calculation example](pics/integral.png)
  4285. *
  4286. * @param src input image as `$$W \times H$$`, 8-bit or floating-point (32f or 64f).
  4287. * @param sum integral image as `$$(W+1)\times (H+1)$$` , 32-bit integer or floating-point (32f or 64f).
  4288. * @param sqsum integral image for squared pixel values; it is `$$(W+1)\times (H+1)$$`, double-precision
  4289. * floating-point (64f) array.
  4290. * @param tilted integral for the image rotated by 45 degrees; it is `$$(W+1)\times (H+1)$$` array with
  4291. * the same data type as sum.
  4292. * @param sdepth desired depth of the integral and the tilted integral images, CV_32S, CV_32F, or
  4293. * CV_64F.
  4294. */
  4295. + (void)integral3:(Mat*)src sum:(Mat*)sum sqsum:(Mat*)sqsum tilted:(Mat*)tilted sdepth:(int)sdepth NS_SWIFT_NAME(integral(src:sum:sqsum:tilted:sdepth:));
  4296. /**
  4297. * Calculates the integral of an image.
  4298. *
  4299. * The function calculates one or more integral images for the source image as follows:
  4300. *
  4301. * `$$\texttt{sum} (X,Y) = \sum _{x<X,y<Y} \texttt{image} (x,y)$$`
  4302. *
  4303. * `$$\texttt{sqsum} (X,Y) = \sum _{x<X,y<Y} \texttt{image} (x,y)^2$$`
  4304. *
  4305. * `$$\texttt{tilted} (X,Y) = \sum _{y<Y,abs(x-X+1) \leq Y-y-1} \texttt{image} (x,y)$$`
  4306. *
  4307. * Using these integral images, you can calculate sum, mean, and standard deviation over a specific
  4308. * up-right or rotated rectangular region of the image in a constant time, for example:
  4309. *
  4310. * `$$\sum _{x_1 \leq x < x_2, \, y_1 \leq y < y_2} \texttt{image} (x,y) = \texttt{sum} (x_2,y_2)- \texttt{sum} (x_1,y_2)- \texttt{sum} (x_2,y_1)+ \texttt{sum} (x_1,y_1)$$`
  4311. *
  4312. * It makes possible to do a fast blurring or fast block correlation with a variable window size, for
  4313. * example. In case of multi-channel images, sums for each channel are accumulated independently.
  4314. *
  4315. * As a practical example, the next figure shows the calculation of the integral of a straight
  4316. * rectangle Rect(4,4,3,2) and of a tilted rectangle Rect(5,1,2,3) . The selected pixels in the
  4317. * original image are shown, as well as the relative pixels in the integral images sum and tilted .
  4318. *
  4319. * ![integral calculation example](pics/integral.png)
  4320. *
  4321. * @param src input image as `$$W \times H$$`, 8-bit or floating-point (32f or 64f).
  4322. * @param sum integral image as `$$(W+1)\times (H+1)$$` , 32-bit integer or floating-point (32f or 64f).
  4323. * @param sqsum integral image for squared pixel values; it is `$$(W+1)\times (H+1)$$`, double-precision
  4324. * floating-point (64f) array.
  4325. * @param tilted integral for the image rotated by 45 degrees; it is `$$(W+1)\times (H+1)$$` array with
  4326. * the same data type as sum.
  4327. * CV_64F.
  4328. */
  4329. + (void)integral3:(Mat*)src sum:(Mat*)sum sqsum:(Mat*)sqsum tilted:(Mat*)tilted NS_SWIFT_NAME(integral(src:sum:sqsum:tilted:));
  4330. //
  4331. // void cv::integral(Mat src, Mat& sum, int sdepth = -1)
  4332. //
  4333. + (void)integral:(Mat*)src sum:(Mat*)sum sdepth:(int)sdepth NS_SWIFT_NAME(integral(src:sum:sdepth:));
  4334. + (void)integral:(Mat*)src sum:(Mat*)sum NS_SWIFT_NAME(integral(src:sum:));
  4335. //
  4336. // void cv::integral(Mat src, Mat& sum, Mat& sqsum, int sdepth = -1, int sqdepth = -1)
  4337. //
  4338. + (void)integral2:(Mat*)src sum:(Mat*)sum sqsum:(Mat*)sqsum sdepth:(int)sdepth sqdepth:(int)sqdepth NS_SWIFT_NAME(integral(src:sum:sqsum:sdepth:sqdepth:));
  4339. + (void)integral2:(Mat*)src sum:(Mat*)sum sqsum:(Mat*)sqsum sdepth:(int)sdepth NS_SWIFT_NAME(integral(src:sum:sqsum:sdepth:));
  4340. + (void)integral2:(Mat*)src sum:(Mat*)sum sqsum:(Mat*)sqsum NS_SWIFT_NAME(integral(src:sum:sqsum:));
  4341. //
  4342. // void cv::accumulate(Mat src, Mat& dst, Mat mask = Mat())
  4343. //
  4344. /**
  4345. * Adds an image to the accumulator image.
  4346. *
  4347. * The function adds src or some of its elements to dst :
  4348. *
  4349. * `$$\texttt{dst} (x,y) \leftarrow \texttt{dst} (x,y) + \texttt{src} (x,y) \quad \text{if} \quad \texttt{mask} (x,y) \ne 0$$`
  4350. *
  4351. * The function supports multi-channel images. Each channel is processed independently.
  4352. *
  4353. * The function cv::accumulate can be used, for example, to collect statistics of a scene background
  4354. * viewed by a still camera and for the further foreground-background segmentation.
  4355. *
  4356. * @param src Input image of type CV_8UC(n), CV_16UC(n), CV_32FC(n) or CV_64FC(n), where n is a positive integer.
  4357. * @param dst %Accumulator image with the same number of channels as input image, and a depth of CV_32F or CV_64F.
  4358. * @param mask Optional operation mask.
  4359. *
  4360. * @see `+accumulateSquare:dst:mask:`, `+accumulateProduct:src2:dst:mask:`, `+accumulateWeighted:dst:alpha:mask:`
  4361. */
  4362. + (void)accumulate:(Mat*)src dst:(Mat*)dst mask:(Mat*)mask NS_SWIFT_NAME(accumulate(src:dst:mask:));
  4363. /**
  4364. * Adds an image to the accumulator image.
  4365. *
  4366. * The function adds src or some of its elements to dst :
  4367. *
  4368. * `$$\texttt{dst} (x,y) \leftarrow \texttt{dst} (x,y) + \texttt{src} (x,y) \quad \text{if} \quad \texttt{mask} (x,y) \ne 0$$`
  4369. *
  4370. * The function supports multi-channel images. Each channel is processed independently.
  4371. *
  4372. * The function cv::accumulate can be used, for example, to collect statistics of a scene background
  4373. * viewed by a still camera and for the further foreground-background segmentation.
  4374. *
  4375. * @param src Input image of type CV_8UC(n), CV_16UC(n), CV_32FC(n) or CV_64FC(n), where n is a positive integer.
  4376. * @param dst %Accumulator image with the same number of channels as input image, and a depth of CV_32F or CV_64F.
  4377. *
  4378. * @see `+accumulateSquare:dst:mask:`, `+accumulateProduct:src2:dst:mask:`, `+accumulateWeighted:dst:alpha:mask:`
  4379. */
  4380. + (void)accumulate:(Mat*)src dst:(Mat*)dst NS_SWIFT_NAME(accumulate(src:dst:));
  4381. //
  4382. // void cv::accumulateSquare(Mat src, Mat& dst, Mat mask = Mat())
  4383. //
  4384. /**
  4385. * Adds the square of a source image to the accumulator image.
  4386. *
  4387. * The function adds the input image src or its selected region, raised to a power of 2, to the
  4388. * accumulator dst :
  4389. *
  4390. * `$$\texttt{dst} (x,y) \leftarrow \texttt{dst} (x,y) + \texttt{src} (x,y)^2 \quad \text{if} \quad \texttt{mask} (x,y) \ne 0$$`
  4391. *
  4392. * The function supports multi-channel images. Each channel is processed independently.
  4393. *
  4394. * @param src Input image as 1- or 3-channel, 8-bit or 32-bit floating point.
  4395. * @param dst %Accumulator image with the same number of channels as input image, 32-bit or 64-bit
  4396. * floating-point.
  4397. * @param mask Optional operation mask.
  4398. *
  4399. * @see `+accumulateSquare:dst:mask:`, `+accumulateProduct:src2:dst:mask:`, `+accumulateWeighted:dst:alpha:mask:`
  4400. */
  4401. + (void)accumulateSquare:(Mat*)src dst:(Mat*)dst mask:(Mat*)mask NS_SWIFT_NAME(accumulateSquare(src:dst:mask:));
  4402. /**
  4403. * Adds the square of a source image to the accumulator image.
  4404. *
  4405. * The function adds the input image src or its selected region, raised to a power of 2, to the
  4406. * accumulator dst :
  4407. *
  4408. * `$$\texttt{dst} (x,y) \leftarrow \texttt{dst} (x,y) + \texttt{src} (x,y)^2 \quad \text{if} \quad \texttt{mask} (x,y) \ne 0$$`
  4409. *
  4410. * The function supports multi-channel images. Each channel is processed independently.
  4411. *
  4412. * @param src Input image as 1- or 3-channel, 8-bit or 32-bit floating point.
  4413. * @param dst %Accumulator image with the same number of channels as input image, 32-bit or 64-bit
  4414. * floating-point.
  4415. *
  4416. * @see `+accumulateSquare:dst:mask:`, `+accumulateProduct:src2:dst:mask:`, `+accumulateWeighted:dst:alpha:mask:`
  4417. */
  4418. + (void)accumulateSquare:(Mat*)src dst:(Mat*)dst NS_SWIFT_NAME(accumulateSquare(src:dst:));
  4419. //
  4420. // void cv::accumulateProduct(Mat src1, Mat src2, Mat& dst, Mat mask = Mat())
  4421. //
  4422. /**
  4423. * Adds the per-element product of two input images to the accumulator image.
  4424. *
  4425. * The function adds the product of two images or their selected regions to the accumulator dst :
  4426. *
  4427. * `$$\texttt{dst} (x,y) \leftarrow \texttt{dst} (x,y) + \texttt{src1} (x,y) \cdot \texttt{src2} (x,y) \quad \text{if} \quad \texttt{mask} (x,y) \ne 0$$`
  4428. *
  4429. * The function supports multi-channel images. Each channel is processed independently.
  4430. *
  4431. * @param src1 First input image, 1- or 3-channel, 8-bit or 32-bit floating point.
  4432. * @param src2 Second input image of the same type and the same size as src1 .
  4433. * @param dst %Accumulator image with the same number of channels as input images, 32-bit or 64-bit
  4434. * floating-point.
  4435. * @param mask Optional operation mask.
  4436. *
  4437. * @see `+accumulate:dst:mask:`, `+accumulateSquare:dst:mask:`, `+accumulateWeighted:dst:alpha:mask:`
  4438. */
  4439. + (void)accumulateProduct:(Mat*)src1 src2:(Mat*)src2 dst:(Mat*)dst mask:(Mat*)mask NS_SWIFT_NAME(accumulateProduct(src1:src2:dst:mask:));
  4440. /**
  4441. * Adds the per-element product of two input images to the accumulator image.
  4442. *
  4443. * The function adds the product of two images or their selected regions to the accumulator dst :
  4444. *
  4445. * `$$\texttt{dst} (x,y) \leftarrow \texttt{dst} (x,y) + \texttt{src1} (x,y) \cdot \texttt{src2} (x,y) \quad \text{if} \quad \texttt{mask} (x,y) \ne 0$$`
  4446. *
  4447. * The function supports multi-channel images. Each channel is processed independently.
  4448. *
  4449. * @param src1 First input image, 1- or 3-channel, 8-bit or 32-bit floating point.
  4450. * @param src2 Second input image of the same type and the same size as src1 .
  4451. * @param dst %Accumulator image with the same number of channels as input images, 32-bit or 64-bit
  4452. * floating-point.
  4453. *
  4454. * @see `+accumulate:dst:mask:`, `+accumulateSquare:dst:mask:`, `+accumulateWeighted:dst:alpha:mask:`
  4455. */
  4456. + (void)accumulateProduct:(Mat*)src1 src2:(Mat*)src2 dst:(Mat*)dst NS_SWIFT_NAME(accumulateProduct(src1:src2:dst:));
  4457. //
  4458. // void cv::accumulateWeighted(Mat src, Mat& dst, double alpha, Mat mask = Mat())
  4459. //
  4460. /**
  4461. * Updates a running average.
  4462. *
  4463. * The function calculates the weighted sum of the input image src and the accumulator dst so that dst
  4464. * becomes a running average of a frame sequence:
  4465. *
  4466. * `$$\texttt{dst} (x,y) \leftarrow (1- \texttt{alpha} ) \cdot \texttt{dst} (x,y) + \texttt{alpha} \cdot \texttt{src} (x,y) \quad \text{if} \quad \texttt{mask} (x,y) \ne 0$$`
  4467. *
  4468. * That is, alpha regulates the update speed (how fast the accumulator "forgets" about earlier images).
  4469. * The function supports multi-channel images. Each channel is processed independently.
  4470. *
  4471. * @param src Input image as 1- or 3-channel, 8-bit or 32-bit floating point.
  4472. * @param dst %Accumulator image with the same number of channels as input image, 32-bit or 64-bit
  4473. * floating-point.
  4474. * @param alpha Weight of the input image.
  4475. * @param mask Optional operation mask.
  4476. *
  4477. * @see `+accumulate:dst:mask:`, `+accumulateSquare:dst:mask:`, `+accumulateProduct:src2:dst:mask:`
  4478. */
  4479. + (void)accumulateWeighted:(Mat*)src dst:(Mat*)dst alpha:(double)alpha mask:(Mat*)mask NS_SWIFT_NAME(accumulateWeighted(src:dst:alpha:mask:));
  4480. /**
  4481. * Updates a running average.
  4482. *
  4483. * The function calculates the weighted sum of the input image src and the accumulator dst so that dst
  4484. * becomes a running average of a frame sequence:
  4485. *
  4486. * `$$\texttt{dst} (x,y) \leftarrow (1- \texttt{alpha} ) \cdot \texttt{dst} (x,y) + \texttt{alpha} \cdot \texttt{src} (x,y) \quad \text{if} \quad \texttt{mask} (x,y) \ne 0$$`
  4487. *
  4488. * That is, alpha regulates the update speed (how fast the accumulator "forgets" about earlier images).
  4489. * The function supports multi-channel images. Each channel is processed independently.
  4490. *
  4491. * @param src Input image as 1- or 3-channel, 8-bit or 32-bit floating point.
  4492. * @param dst %Accumulator image with the same number of channels as input image, 32-bit or 64-bit
  4493. * floating-point.
  4494. * @param alpha Weight of the input image.
  4495. *
  4496. * @see `+accumulate:dst:mask:`, `+accumulateSquare:dst:mask:`, `+accumulateProduct:src2:dst:mask:`
  4497. */
  4498. + (void)accumulateWeighted:(Mat*)src dst:(Mat*)dst alpha:(double)alpha NS_SWIFT_NAME(accumulateWeighted(src:dst:alpha:));
  4499. //
  4500. // Point2d cv::phaseCorrelate(Mat src1, Mat src2, Mat window = Mat(), double* response = 0)
  4501. //
  4502. /**
  4503. * The function is used to detect translational shifts that occur between two images.
  4504. *
  4505. * The operation takes advantage of the Fourier shift theorem for detecting the translational shift in
  4506. * the frequency domain. It can be used for fast image registration as well as motion estimation. For
  4507. * more information please see <http://en.wikipedia.org/wiki/Phase_correlation>
  4508. *
  4509. * Calculates the cross-power spectrum of two supplied source arrays. The arrays are padded if needed
  4510. * with getOptimalDFTSize.
  4511. *
  4512. * The function performs the following equations:
  4513. * - First it applies a Hanning window (see <http://en.wikipedia.org/wiki/Hann_function>) to each
  4514. * image to remove possible edge effects. This window is cached until the array size changes to speed
  4515. * up processing time.
  4516. * - Next it computes the forward DFTs of each source array:
  4517. * `$$\mathbf{G}_a = \mathcal{F}\{src_1\}, \; \mathbf{G}_b = \mathcal{F}\{src_2\}$$`
  4518. * where `$$\mathcal{F}$$` is the forward DFT.
  4519. * - It then computes the cross-power spectrum of each frequency domain array:
  4520. * `$$R = \frac{ \mathbf{G}_a \mathbf{G}_b^*}{|\mathbf{G}_a \mathbf{G}_b^*|}$$`
  4521. * - Next the cross-correlation is converted back into the time domain via the inverse DFT:
  4522. * `$$r = \mathcal{F}^{-1}\{R\}$$`
  4523. * - Finally, it computes the peak location and computes a 5x5 weighted centroid around the peak to
  4524. * achieve sub-pixel accuracy.
  4525. * `$$(\Delta x, \Delta y) = \texttt{weightedCentroid} \{\arg \max_{(x, y)}\{r\}\}$$`
  4526. * - If non-zero, the response parameter is computed as the sum of the elements of r within the 5x5
  4527. * centroid around the peak location. It is normalized to a maximum of 1 (meaning there is a single
  4528. * peak) and will be smaller when there are multiple peaks.
  4529. *
  4530. * @param src1 Source floating point array (CV_32FC1 or CV_64FC1)
  4531. * @param src2 Source floating point array (CV_32FC1 or CV_64FC1)
  4532. * @param window Floating point array with windowing coefficients to reduce edge effects (optional).
  4533. * @param response Signal power within the 5x5 centroid around the peak, between 0 and 1 (optional).
  4534. * @return detected phase shift (sub-pixel) between the two arrays.
  4535. *
  4536. * @see `dft`, `getOptimalDFTSize`, `idft`, `mulSpectrums createHanningWindow`
  4537. */
  4538. + (Point2d*)phaseCorrelate:(Mat*)src1 src2:(Mat*)src2 window:(Mat*)window response:(double*)response NS_SWIFT_NAME(phaseCorrelate(src1:src2:window:response:));
  4539. /**
  4540. * The function is used to detect translational shifts that occur between two images.
  4541. *
  4542. * The operation takes advantage of the Fourier shift theorem for detecting the translational shift in
  4543. * the frequency domain. It can be used for fast image registration as well as motion estimation. For
  4544. * more information please see <http://en.wikipedia.org/wiki/Phase_correlation>
  4545. *
  4546. * Calculates the cross-power spectrum of two supplied source arrays. The arrays are padded if needed
  4547. * with getOptimalDFTSize.
  4548. *
  4549. * The function performs the following equations:
  4550. * - First it applies a Hanning window (see <http://en.wikipedia.org/wiki/Hann_function>) to each
  4551. * image to remove possible edge effects. This window is cached until the array size changes to speed
  4552. * up processing time.
  4553. * - Next it computes the forward DFTs of each source array:
  4554. * `$$\mathbf{G}_a = \mathcal{F}\{src_1\}, \; \mathbf{G}_b = \mathcal{F}\{src_2\}$$`
  4555. * where `$$\mathcal{F}$$` is the forward DFT.
  4556. * - It then computes the cross-power spectrum of each frequency domain array:
  4557. * `$$R = \frac{ \mathbf{G}_a \mathbf{G}_b^*}{|\mathbf{G}_a \mathbf{G}_b^*|}$$`
  4558. * - Next the cross-correlation is converted back into the time domain via the inverse DFT:
  4559. * `$$r = \mathcal{F}^{-1}\{R\}$$`
  4560. * - Finally, it computes the peak location and computes a 5x5 weighted centroid around the peak to
  4561. * achieve sub-pixel accuracy.
  4562. * `$$(\Delta x, \Delta y) = \texttt{weightedCentroid} \{\arg \max_{(x, y)}\{r\}\}$$`
  4563. * - If non-zero, the response parameter is computed as the sum of the elements of r within the 5x5
  4564. * centroid around the peak location. It is normalized to a maximum of 1 (meaning there is a single
  4565. * peak) and will be smaller when there are multiple peaks.
  4566. *
  4567. * @param src1 Source floating point array (CV_32FC1 or CV_64FC1)
  4568. * @param src2 Source floating point array (CV_32FC1 or CV_64FC1)
  4569. * @param window Floating point array with windowing coefficients to reduce edge effects (optional).
  4570. * @return detected phase shift (sub-pixel) between the two arrays.
  4571. *
  4572. * @see `dft`, `getOptimalDFTSize`, `idft`, `mulSpectrums createHanningWindow`
  4573. */
  4574. + (Point2d*)phaseCorrelate:(Mat*)src1 src2:(Mat*)src2 window:(Mat*)window NS_SWIFT_NAME(phaseCorrelate(src1:src2:window:));
  4575. /**
  4576. * The function is used to detect translational shifts that occur between two images.
  4577. *
  4578. * The operation takes advantage of the Fourier shift theorem for detecting the translational shift in
  4579. * the frequency domain. It can be used for fast image registration as well as motion estimation. For
  4580. * more information please see <http://en.wikipedia.org/wiki/Phase_correlation>
  4581. *
  4582. * Calculates the cross-power spectrum of two supplied source arrays. The arrays are padded if needed
  4583. * with getOptimalDFTSize.
  4584. *
  4585. * The function performs the following equations:
  4586. * - First it applies a Hanning window (see <http://en.wikipedia.org/wiki/Hann_function>) to each
  4587. * image to remove possible edge effects. This window is cached until the array size changes to speed
  4588. * up processing time.
  4589. * - Next it computes the forward DFTs of each source array:
  4590. * `$$\mathbf{G}_a = \mathcal{F}\{src_1\}, \; \mathbf{G}_b = \mathcal{F}\{src_2\}$$`
  4591. * where `$$\mathcal{F}$$` is the forward DFT.
  4592. * - It then computes the cross-power spectrum of each frequency domain array:
  4593. * `$$R = \frac{ \mathbf{G}_a \mathbf{G}_b^*}{|\mathbf{G}_a \mathbf{G}_b^*|}$$`
  4594. * - Next the cross-correlation is converted back into the time domain via the inverse DFT:
  4595. * `$$r = \mathcal{F}^{-1}\{R\}$$`
  4596. * - Finally, it computes the peak location and computes a 5x5 weighted centroid around the peak to
  4597. * achieve sub-pixel accuracy.
  4598. * `$$(\Delta x, \Delta y) = \texttt{weightedCentroid} \{\arg \max_{(x, y)}\{r\}\}$$`
  4599. * - If non-zero, the response parameter is computed as the sum of the elements of r within the 5x5
  4600. * centroid around the peak location. It is normalized to a maximum of 1 (meaning there is a single
  4601. * peak) and will be smaller when there are multiple peaks.
  4602. *
  4603. * @param src1 Source floating point array (CV_32FC1 or CV_64FC1)
  4604. * @param src2 Source floating point array (CV_32FC1 or CV_64FC1)
  4605. * @return detected phase shift (sub-pixel) between the two arrays.
  4606. *
  4607. * @see `dft`, `getOptimalDFTSize`, `idft`, `mulSpectrums createHanningWindow`
  4608. */
  4609. + (Point2d*)phaseCorrelate:(Mat*)src1 src2:(Mat*)src2 NS_SWIFT_NAME(phaseCorrelate(src1:src2:));
  4610. //
  4611. // void cv::createHanningWindow(Mat& dst, Size winSize, int type)
  4612. //
  4613. /**
  4614. * This function computes a Hanning window coefficients in two dimensions.
  4615. *
  4616. * See (http://en.wikipedia.org/wiki/Hann_function) and (http://en.wikipedia.org/wiki/Window_function)
  4617. * for more information.
  4618. *
  4619. * An example is shown below:
  4620. *
  4621. * // create hanning window of size 100x100 and type CV_32F
  4622. * Mat hann;
  4623. * createHanningWindow(hann, Size(100, 100), CV_32F);
  4624. *
  4625. * @param dst Destination array to place Hann coefficients in
  4626. * @param winSize The window size specifications (both width and height must be > 1)
  4627. * @param type Created array type
  4628. */
  4629. + (void)createHanningWindow:(Mat*)dst winSize:(Size2i*)winSize type:(int)type NS_SWIFT_NAME(createHanningWindow(dst:winSize:type:));
  4630. //
  4631. // void cv::divSpectrums(Mat a, Mat b, Mat& c, int flags, bool conjB = false)
  4632. //
  4633. /**
  4634. * Performs the per-element division of the first Fourier spectrum by the second Fourier spectrum.
  4635. *
  4636. * The function cv::divSpectrums performs the per-element division of the first array by the second array.
  4637. * The arrays are CCS-packed or complex matrices that are results of a real or complex Fourier transform.
  4638. *
  4639. * @param a first input array.
  4640. * @param b second input array of the same size and type as src1 .
  4641. * @param c output array of the same size and type as src1 .
  4642. * @param flags operation flags; currently, the only supported flag is cv::DFT_ROWS, which indicates that
  4643. * each row of src1 and src2 is an independent 1D Fourier spectrum. If you do not want to use this flag, then simply add a `0` as value.
  4644. * @param conjB optional flag that conjugates the second input array before the multiplication (true)
  4645. * or not (false).
  4646. */
  4647. + (void)divSpectrums:(Mat*)a b:(Mat*)b c:(Mat*)c flags:(int)flags conjB:(BOOL)conjB NS_SWIFT_NAME(divSpectrums(a:b:c:flags:conjB:));
  4648. /**
  4649. * Performs the per-element division of the first Fourier spectrum by the second Fourier spectrum.
  4650. *
  4651. * The function cv::divSpectrums performs the per-element division of the first array by the second array.
  4652. * The arrays are CCS-packed or complex matrices that are results of a real or complex Fourier transform.
  4653. *
  4654. * @param a first input array.
  4655. * @param b second input array of the same size and type as src1 .
  4656. * @param c output array of the same size and type as src1 .
  4657. * @param flags operation flags; currently, the only supported flag is cv::DFT_ROWS, which indicates that
  4658. * each row of src1 and src2 is an independent 1D Fourier spectrum. If you do not want to use this flag, then simply add a `0` as value.
  4659. * or not (false).
  4660. */
  4661. + (void)divSpectrums:(Mat*)a b:(Mat*)b c:(Mat*)c flags:(int)flags NS_SWIFT_NAME(divSpectrums(a:b:c:flags:));
  4662. //
  4663. // double cv::threshold(Mat src, Mat& dst, double thresh, double maxval, ThresholdTypes type)
  4664. //
  4665. /**
  4666. * Applies a fixed-level threshold to each array element.
  4667. *
  4668. * The function applies fixed-level thresholding to a multiple-channel array. The function is typically
  4669. * used to get a bi-level (binary) image out of a grayscale image ( #compare could be also used for
  4670. * this purpose) or for removing a noise, that is, filtering out pixels with too small or too large
  4671. * values. There are several types of thresholding supported by the function. They are determined by
  4672. * type parameter.
  4673. *
  4674. * Also, the special values #THRESH_OTSU or #THRESH_TRIANGLE may be combined with one of the
  4675. * above values. In these cases, the function determines the optimal threshold value using the Otsu's
  4676. * or Triangle algorithm and uses it instead of the specified thresh.
  4677. *
  4678. * NOTE: Currently, the Otsu's and Triangle methods are implemented only for 8-bit single-channel images.
  4679. *
  4680. * @param src input array (multiple-channel, 8-bit or 32-bit floating point).
  4681. * @param dst output array of the same size and type and the same number of channels as src.
  4682. * @param thresh threshold value.
  4683. * @param maxval maximum value to use with the #THRESH_BINARY and #THRESH_BINARY_INV thresholding
  4684. * types.
  4685. * @param type thresholding type (see #ThresholdTypes).
  4686. * @return the computed threshold value if Otsu's or Triangle methods used.
  4687. *
  4688. * @see `+adaptiveThreshold:dst:maxValue:adaptiveMethod:thresholdType:blockSize:C:`, `+findContours:contours:hierarchy:mode:method:offset:`, `compare`, `min`, `max`
  4689. */
  4690. + (double)threshold:(Mat*)src dst:(Mat*)dst thresh:(double)thresh maxval:(double)maxval type:(ThresholdTypes)type NS_SWIFT_NAME(threshold(src:dst:thresh:maxval:type:));
  4691. //
  4692. // void cv::adaptiveThreshold(Mat src, Mat& dst, double maxValue, AdaptiveThresholdTypes adaptiveMethod, ThresholdTypes thresholdType, int blockSize, double C)
  4693. //
  4694. /**
  4695. * Applies an adaptive threshold to an array.
  4696. *
  4697. * The function transforms a grayscale image to a binary image according to the formulae:
  4698. * - **THRESH_BINARY**
  4699. * `$$\newcommand{\fork}[4]{ \left\{ \begin{array}{l l} #1 & \text{#2}\\\\ #3 & \text{#4}\\\\ \end{array} \right.} dst(x,y) = \fork{\texttt{maxValue}}{if \(src(x,y) > T(x,y)\)}{0}{otherwise}$$`
  4700. * - **THRESH_BINARY_INV**
  4701. * `$$\newcommand{\fork}[4]{ \left\{ \begin{array}{l l} #1 & \text{#2}\\\\ #3 & \text{#4}\\\\ \end{array} \right.} dst(x,y) = \fork{0}{if \(src(x,y) > T(x,y)\)}{\texttt{maxValue}}{otherwise}$$`
  4702. * where `$$T(x,y)$$` is a threshold calculated individually for each pixel (see adaptiveMethod parameter).
  4703. *
  4704. * The function can process the image in-place.
  4705. *
  4706. * @param src Source 8-bit single-channel image.
  4707. * @param dst Destination image of the same size and the same type as src.
  4708. * @param maxValue Non-zero value assigned to the pixels for which the condition is satisfied
  4709. * @param adaptiveMethod Adaptive thresholding algorithm to use, see #AdaptiveThresholdTypes.
  4710. * The #BORDER_REPLICATE | #BORDER_ISOLATED is used to process boundaries.
  4711. * @param thresholdType Thresholding type that must be either #THRESH_BINARY or #THRESH_BINARY_INV,
  4712. * see #ThresholdTypes.
  4713. * @param blockSize Size of a pixel neighborhood that is used to calculate a threshold value for the
  4714. * pixel: 3, 5, 7, and so on.
  4715. * @param C Constant subtracted from the mean or weighted mean (see the details below). Normally, it
  4716. * is positive but may be zero or negative as well.
  4717. *
  4718. * @see `+threshold:dst:thresh:maxval:type:`, `+blur:dst:ksize:anchor:borderType:`, `+GaussianBlur:dst:ksize:sigmaX:sigmaY:borderType:`
  4719. */
  4720. + (void)adaptiveThreshold:(Mat*)src dst:(Mat*)dst maxValue:(double)maxValue adaptiveMethod:(AdaptiveThresholdTypes)adaptiveMethod thresholdType:(ThresholdTypes)thresholdType blockSize:(int)blockSize C:(double)C NS_SWIFT_NAME(adaptiveThreshold(src:dst:maxValue:adaptiveMethod:thresholdType:blockSize:C:));
  4721. //
  4722. // void cv::pyrDown(Mat src, Mat& dst, Size dstsize = Size(), BorderTypes borderType = BORDER_DEFAULT)
  4723. //
  4724. /**
  4725. * Blurs an image and downsamples it.
  4726. *
  4727. * By default, size of the output image is computed as `Size((src.cols+1)/2, (src.rows+1)/2)`, but in
  4728. * any case, the following conditions should be satisfied:
  4729. *
  4730. * `$$\begin{array}{l} | \texttt{dstsize.width} *2-src.cols| \leq 2 \\ | \texttt{dstsize.height} *2-src.rows| \leq 2 \end{array}$$`
  4731. *
  4732. * The function performs the downsampling step of the Gaussian pyramid construction. First, it
  4733. * convolves the source image with the kernel:
  4734. *
  4735. * `$$\frac{1}{256} \begin{bmatrix} 1 & 4 & 6 & 4 & 1 \\ 4 & 16 & 24 & 16 & 4 \\ 6 & 24 & 36 & 24 & 6 \\ 4 & 16 & 24 & 16 & 4 \\ 1 & 4 & 6 & 4 & 1 \end{bmatrix}$$`
  4736. *
  4737. * Then, it downsamples the image by rejecting even rows and columns.
  4738. *
  4739. * @param src input image.
  4740. * @param dst output image; it has the specified size and the same type as src.
  4741. * @param dstsize size of the output image.
  4742. * @param borderType Pixel extrapolation method, see #BorderTypes (#BORDER_CONSTANT isn't supported)
  4743. */
  4744. + (void)pyrDown:(Mat*)src dst:(Mat*)dst dstsize:(Size2i*)dstsize borderType:(BorderTypes)borderType NS_SWIFT_NAME(pyrDown(src:dst:dstsize:borderType:));
  4745. /**
  4746. * Blurs an image and downsamples it.
  4747. *
  4748. * By default, size of the output image is computed as `Size((src.cols+1)/2, (src.rows+1)/2)`, but in
  4749. * any case, the following conditions should be satisfied:
  4750. *
  4751. * `$$\begin{array}{l} | \texttt{dstsize.width} *2-src.cols| \leq 2 \\ | \texttt{dstsize.height} *2-src.rows| \leq 2 \end{array}$$`
  4752. *
  4753. * The function performs the downsampling step of the Gaussian pyramid construction. First, it
  4754. * convolves the source image with the kernel:
  4755. *
  4756. * `$$\frac{1}{256} \begin{bmatrix} 1 & 4 & 6 & 4 & 1 \\ 4 & 16 & 24 & 16 & 4 \\ 6 & 24 & 36 & 24 & 6 \\ 4 & 16 & 24 & 16 & 4 \\ 1 & 4 & 6 & 4 & 1 \end{bmatrix}$$`
  4757. *
  4758. * Then, it downsamples the image by rejecting even rows and columns.
  4759. *
  4760. * @param src input image.
  4761. * @param dst output image; it has the specified size and the same type as src.
  4762. * @param dstsize size of the output image.
  4763. */
  4764. + (void)pyrDown:(Mat*)src dst:(Mat*)dst dstsize:(Size2i*)dstsize NS_SWIFT_NAME(pyrDown(src:dst:dstsize:));
  4765. /**
  4766. * Blurs an image and downsamples it.
  4767. *
  4768. * By default, size of the output image is computed as `Size((src.cols+1)/2, (src.rows+1)/2)`, but in
  4769. * any case, the following conditions should be satisfied:
  4770. *
  4771. * `$$\begin{array}{l} | \texttt{dstsize.width} *2-src.cols| \leq 2 \\ | \texttt{dstsize.height} *2-src.rows| \leq 2 \end{array}$$`
  4772. *
  4773. * The function performs the downsampling step of the Gaussian pyramid construction. First, it
  4774. * convolves the source image with the kernel:
  4775. *
  4776. * `$$\frac{1}{256} \begin{bmatrix} 1 & 4 & 6 & 4 & 1 \\ 4 & 16 & 24 & 16 & 4 \\ 6 & 24 & 36 & 24 & 6 \\ 4 & 16 & 24 & 16 & 4 \\ 1 & 4 & 6 & 4 & 1 \end{bmatrix}$$`
  4777. *
  4778. * Then, it downsamples the image by rejecting even rows and columns.
  4779. *
  4780. * @param src input image.
  4781. * @param dst output image; it has the specified size and the same type as src.
  4782. */
  4783. + (void)pyrDown:(Mat*)src dst:(Mat*)dst NS_SWIFT_NAME(pyrDown(src:dst:));
  4784. //
  4785. // void cv::pyrUp(Mat src, Mat& dst, Size dstsize = Size(), BorderTypes borderType = BORDER_DEFAULT)
  4786. //
  4787. /**
  4788. * Upsamples an image and then blurs it.
  4789. *
  4790. * By default, size of the output image is computed as `Size(src.cols\*2, (src.rows\*2)`, but in any
  4791. * case, the following conditions should be satisfied:
  4792. *
  4793. * `$$\begin{array}{l} | \texttt{dstsize.width} -src.cols*2| \leq ( \texttt{dstsize.width} \mod 2) \\ | \texttt{dstsize.height} -src.rows*2| \leq ( \texttt{dstsize.height} \mod 2) \end{array}$$`
  4794. *
  4795. * The function performs the upsampling step of the Gaussian pyramid construction, though it can
  4796. * actually be used to construct the Laplacian pyramid. First, it upsamples the source image by
  4797. * injecting even zero rows and columns and then convolves the result with the same kernel as in
  4798. * pyrDown multiplied by 4.
  4799. *
  4800. * @param src input image.
  4801. * @param dst output image. It has the specified size and the same type as src .
  4802. * @param dstsize size of the output image.
  4803. * @param borderType Pixel extrapolation method, see #BorderTypes (only #BORDER_DEFAULT is supported)
  4804. */
  4805. + (void)pyrUp:(Mat*)src dst:(Mat*)dst dstsize:(Size2i*)dstsize borderType:(BorderTypes)borderType NS_SWIFT_NAME(pyrUp(src:dst:dstsize:borderType:));
  4806. /**
  4807. * Upsamples an image and then blurs it.
  4808. *
  4809. * By default, size of the output image is computed as `Size(src.cols\*2, (src.rows\*2)`, but in any
  4810. * case, the following conditions should be satisfied:
  4811. *
  4812. * `$$\begin{array}{l} | \texttt{dstsize.width} -src.cols*2| \leq ( \texttt{dstsize.width} \mod 2) \\ | \texttt{dstsize.height} -src.rows*2| \leq ( \texttt{dstsize.height} \mod 2) \end{array}$$`
  4813. *
  4814. * The function performs the upsampling step of the Gaussian pyramid construction, though it can
  4815. * actually be used to construct the Laplacian pyramid. First, it upsamples the source image by
  4816. * injecting even zero rows and columns and then convolves the result with the same kernel as in
  4817. * pyrDown multiplied by 4.
  4818. *
  4819. * @param src input image.
  4820. * @param dst output image. It has the specified size and the same type as src .
  4821. * @param dstsize size of the output image.
  4822. */
  4823. + (void)pyrUp:(Mat*)src dst:(Mat*)dst dstsize:(Size2i*)dstsize NS_SWIFT_NAME(pyrUp(src:dst:dstsize:));
  4824. /**
  4825. * Upsamples an image and then blurs it.
  4826. *
  4827. * By default, size of the output image is computed as `Size(src.cols\*2, (src.rows\*2)`, but in any
  4828. * case, the following conditions should be satisfied:
  4829. *
  4830. * `$$\begin{array}{l} | \texttt{dstsize.width} -src.cols*2| \leq ( \texttt{dstsize.width} \mod 2) \\ | \texttt{dstsize.height} -src.rows*2| \leq ( \texttt{dstsize.height} \mod 2) \end{array}$$`
  4831. *
  4832. * The function performs the upsampling step of the Gaussian pyramid construction, though it can
  4833. * actually be used to construct the Laplacian pyramid. First, it upsamples the source image by
  4834. * injecting even zero rows and columns and then convolves the result with the same kernel as in
  4835. * pyrDown multiplied by 4.
  4836. *
  4837. * @param src input image.
  4838. * @param dst output image. It has the specified size and the same type as src .
  4839. */
  4840. + (void)pyrUp:(Mat*)src dst:(Mat*)dst NS_SWIFT_NAME(pyrUp(src:dst:));
  4841. //
  4842. // void cv::calcHist(vector_Mat images, vector_int channels, Mat mask, Mat& hist, vector_int histSize, vector_float ranges, bool accumulate = false)
  4843. //
  4844. /**
  4845. *
  4846. *
  4847. * this variant supports only uniform histograms.
  4848. *
  4849. * ranges argument is either empty vector or a flattened vector of histSize.size()*2 elements
  4850. * (histSize.size() element pairs). The first and second elements of each pair specify the lower and
  4851. * upper boundaries.
  4852. */
  4853. + (void)calcHist:(NSArray<Mat*>*)images channels:(IntVector*)channels mask:(Mat*)mask hist:(Mat*)hist histSize:(IntVector*)histSize ranges:(FloatVector*)ranges accumulate:(BOOL)accumulate NS_SWIFT_NAME(calcHist(images:channels:mask:hist:histSize:ranges:accumulate:));
  4854. /**
  4855. *
  4856. *
  4857. * this variant supports only uniform histograms.
  4858. *
  4859. * ranges argument is either empty vector or a flattened vector of histSize.size()*2 elements
  4860. * (histSize.size() element pairs). The first and second elements of each pair specify the lower and
  4861. * upper boundaries.
  4862. */
  4863. + (void)calcHist:(NSArray<Mat*>*)images channels:(IntVector*)channels mask:(Mat*)mask hist:(Mat*)hist histSize:(IntVector*)histSize ranges:(FloatVector*)ranges NS_SWIFT_NAME(calcHist(images:channels:mask:hist:histSize:ranges:));
  4864. //
  4865. // void cv::calcBackProject(vector_Mat images, vector_int channels, Mat hist, Mat& dst, vector_float ranges, double scale)
  4866. //
  4867. + (void)calcBackProject:(NSArray<Mat*>*)images channels:(IntVector*)channels hist:(Mat*)hist dst:(Mat*)dst ranges:(FloatVector*)ranges scale:(double)scale NS_SWIFT_NAME(calcBackProject(images:channels:hist:dst:ranges:scale:));
  4868. //
  4869. // double cv::compareHist(Mat H1, Mat H2, HistCompMethods method)
  4870. //
  4871. /**
  4872. * Compares two histograms.
  4873. *
  4874. * The function cv::compareHist compares two dense or two sparse histograms using the specified method.
  4875. *
  4876. * The function returns `$$d(H_1, H_2)$$` .
  4877. *
  4878. * While the function works well with 1-, 2-, 3-dimensional dense histograms, it may not be suitable
  4879. * for high-dimensional sparse histograms. In such histograms, because of aliasing and sampling
  4880. * problems, the coordinates of non-zero histogram bins can slightly shift. To compare such histograms
  4881. * or more general sparse configurations of weighted points, consider using the #EMD function.
  4882. *
  4883. * @param H1 First compared histogram.
  4884. * @param H2 Second compared histogram of the same size as H1 .
  4885. * @param method Comparison method, see #HistCompMethods
  4886. */
  4887. + (double)compareHist:(Mat*)H1 H2:(Mat*)H2 method:(HistCompMethods)method NS_SWIFT_NAME(compareHist(H1:H2:method:));
  4888. //
  4889. // void cv::equalizeHist(Mat src, Mat& dst)
  4890. //
  4891. /**
  4892. * Equalizes the histogram of a grayscale image.
  4893. *
  4894. * The function equalizes the histogram of the input image using the following algorithm:
  4895. *
  4896. * - Calculate the histogram `$$H$$` for src .
  4897. * - Normalize the histogram so that the sum of histogram bins is 255.
  4898. * - Compute the integral of the histogram:
  4899. * `$$H'_i = \sum _{0 \le j < i} H(j)$$`
  4900. * - Transform the image using `$$H'$$` as a look-up table: `$$\texttt{dst}(x,y) = H'(\texttt{src}(x,y))$$`
  4901. *
  4902. * The algorithm normalizes the brightness and increases the contrast of the image.
  4903. *
  4904. * @param src Source 8-bit single channel image.
  4905. * @param dst Destination image of the same size and type as src .
  4906. */
  4907. + (void)equalizeHist:(Mat*)src dst:(Mat*)dst NS_SWIFT_NAME(equalizeHist(src:dst:));
  4908. //
  4909. // Ptr_CLAHE cv::createCLAHE(double clipLimit = 40.0, Size tileGridSize = Size(8, 8))
  4910. //
  4911. /**
  4912. * Creates a smart pointer to a cv::CLAHE class and initializes it.
  4913. *
  4914. * @param clipLimit Threshold for contrast limiting.
  4915. * @param tileGridSize Size of grid for histogram equalization. Input image will be divided into
  4916. * equally sized rectangular tiles. tileGridSize defines the number of tiles in row and column.
  4917. */
  4918. + (CLAHE*)createCLAHE:(double)clipLimit tileGridSize:(Size2i*)tileGridSize NS_SWIFT_NAME(createCLAHE(clipLimit:tileGridSize:));
  4919. /**
  4920. * Creates a smart pointer to a cv::CLAHE class and initializes it.
  4921. *
  4922. * @param clipLimit Threshold for contrast limiting.
  4923. * equally sized rectangular tiles. tileGridSize defines the number of tiles in row and column.
  4924. */
  4925. + (CLAHE*)createCLAHE:(double)clipLimit NS_SWIFT_NAME(createCLAHE(clipLimit:));
  4926. /**
  4927. * Creates a smart pointer to a cv::CLAHE class and initializes it.
  4928. *
  4929. * equally sized rectangular tiles. tileGridSize defines the number of tiles in row and column.
  4930. */
  4931. + (CLAHE*)createCLAHE NS_SWIFT_NAME(createCLAHE());
  4932. //
  4933. // float cv::wrapperEMD(Mat signature1, Mat signature2, DistanceTypes distType, Mat cost = Mat(), _hidden_ & lowerBound = cv::Ptr<float>(), Mat& flow = Mat())
  4934. //
  4935. /**
  4936. * Computes the "minimal work" distance between two weighted point configurations.
  4937. *
  4938. * The function computes the earth mover distance and/or a lower boundary of the distance between the
  4939. * two weighted point configurations. One of the applications described in CITE: RubnerSept98,
  4940. * CITE: Rubner2000 is multi-dimensional histogram comparison for image retrieval. EMD is a transportation
  4941. * problem that is solved using some modification of a simplex algorithm, thus the complexity is
  4942. * exponential in the worst case, though, on average it is much faster. In the case of a real metric
  4943. * the lower boundary can be calculated even faster (using linear-time algorithm) and it can be used
  4944. * to determine roughly whether the two signatures are far enough so that they cannot relate to the
  4945. * same object.
  4946. *
  4947. * @param signature1 First signature, a `$$\texttt{size1}\times \texttt{dims}+1$$` floating-point matrix.
  4948. * Each row stores the point weight followed by the point coordinates. The matrix is allowed to have
  4949. * a single column (weights only) if the user-defined cost matrix is used. The weights must be
  4950. * non-negative and have at least one non-zero value.
  4951. * @param signature2 Second signature of the same format as signature1 , though the number of rows
  4952. * may be different. The total weights may be different. In this case an extra "dummy" point is added
  4953. * to either signature1 or signature2. The weights must be non-negative and have at least one non-zero
  4954. * value.
  4955. * @param distType Used metric. See #DistanceTypes.
  4956. * @param cost User-defined `$$\texttt{size1}\times \texttt{size2}$$` cost matrix. Also, if a cost matrix
  4957. * is used, lower boundary lowerBound cannot be calculated because it needs a metric function.
  4958. * @param lowerBound Optional input/output parameter: lower boundary of a distance between the two
  4959. * signatures that is a distance between mass centers. The lower boundary may not be calculated if
  4960. * the user-defined cost matrix is used, the total weights of point configurations are not equal, or
  4961. * if the signatures consist of weights only (the signature matrices have a single column). You
  4962. * *must** initialize \*lowerBound . If the calculated distance between mass centers is greater or
  4963. * equal to \*lowerBound (it means that the signatures are far enough), the function does not
  4964. * calculate EMD. In any case \*lowerBound is set to the calculated distance between mass centers on
  4965. * return. Thus, if you want to calculate both distance between mass centers and EMD, \*lowerBound
  4966. * should be set to 0.
  4967. * @param flow Resultant `$$\texttt{size1} \times \texttt{size2}$$` flow matrix: `$$\texttt{flow}_{i,j}$$` is
  4968. * a flow from `$$i$$` -th point of signature1 to `$$j$$` -th point of signature2 .
  4969. */
  4970. + (float)EMD:(Mat*)signature1 signature2:(Mat*)signature2 distType:(DistanceTypes)distType cost:(Mat*)cost flow:(Mat*)flow NS_SWIFT_NAME(wrapperEMD(signature1:signature2:distType:cost:flow:));
  4971. /**
  4972. * Computes the "minimal work" distance between two weighted point configurations.
  4973. *
  4974. * The function computes the earth mover distance and/or a lower boundary of the distance between the
  4975. * two weighted point configurations. One of the applications described in CITE: RubnerSept98,
  4976. * CITE: Rubner2000 is multi-dimensional histogram comparison for image retrieval. EMD is a transportation
  4977. * problem that is solved using some modification of a simplex algorithm, thus the complexity is
  4978. * exponential in the worst case, though, on average it is much faster. In the case of a real metric
  4979. * the lower boundary can be calculated even faster (using linear-time algorithm) and it can be used
  4980. * to determine roughly whether the two signatures are far enough so that they cannot relate to the
  4981. * same object.
  4982. *
  4983. * @param signature1 First signature, a `$$\texttt{size1}\times \texttt{dims}+1$$` floating-point matrix.
  4984. * Each row stores the point weight followed by the point coordinates. The matrix is allowed to have
  4985. * a single column (weights only) if the user-defined cost matrix is used. The weights must be
  4986. * non-negative and have at least one non-zero value.
  4987. * @param signature2 Second signature of the same format as signature1 , though the number of rows
  4988. * may be different. The total weights may be different. In this case an extra "dummy" point is added
  4989. * to either signature1 or signature2. The weights must be non-negative and have at least one non-zero
  4990. * value.
  4991. * @param distType Used metric. See #DistanceTypes.
  4992. * @param cost User-defined `$$\texttt{size1}\times \texttt{size2}$$` cost matrix. Also, if a cost matrix
  4993. * is used, lower boundary lowerBound cannot be calculated because it needs a metric function.
  4994. * @param lowerBound Optional input/output parameter: lower boundary of a distance between the two
  4995. * signatures that is a distance between mass centers. The lower boundary may not be calculated if
  4996. * the user-defined cost matrix is used, the total weights of point configurations are not equal, or
  4997. * if the signatures consist of weights only (the signature matrices have a single column). You
  4998. * *must** initialize \*lowerBound . If the calculated distance between mass centers is greater or
  4999. * equal to \*lowerBound (it means that the signatures are far enough), the function does not
  5000. * calculate EMD. In any case \*lowerBound is set to the calculated distance between mass centers on
  5001. * return. Thus, if you want to calculate both distance between mass centers and EMD, \*lowerBound
  5002. * should be set to 0.
  5003. * a flow from `$$i$$` -th point of signature1 to `$$j$$` -th point of signature2 .
  5004. */
  5005. + (float)EMD:(Mat*)signature1 signature2:(Mat*)signature2 distType:(DistanceTypes)distType cost:(Mat*)cost NS_SWIFT_NAME(wrapperEMD(signature1:signature2:distType:cost:));
  5006. /**
  5007. * Computes the "minimal work" distance between two weighted point configurations.
  5008. *
  5009. * The function computes the earth mover distance and/or a lower boundary of the distance between the
  5010. * two weighted point configurations. One of the applications described in CITE: RubnerSept98,
  5011. * CITE: Rubner2000 is multi-dimensional histogram comparison for image retrieval. EMD is a transportation
  5012. * problem that is solved using some modification of a simplex algorithm, thus the complexity is
  5013. * exponential in the worst case, though, on average it is much faster. In the case of a real metric
  5014. * the lower boundary can be calculated even faster (using linear-time algorithm) and it can be used
  5015. * to determine roughly whether the two signatures are far enough so that they cannot relate to the
  5016. * same object.
  5017. *
  5018. * @param signature1 First signature, a `$$\texttt{size1}\times \texttt{dims}+1$$` floating-point matrix.
  5019. * Each row stores the point weight followed by the point coordinates. The matrix is allowed to have
  5020. * a single column (weights only) if the user-defined cost matrix is used. The weights must be
  5021. * non-negative and have at least one non-zero value.
  5022. * @param signature2 Second signature of the same format as signature1 , though the number of rows
  5023. * may be different. The total weights may be different. In this case an extra "dummy" point is added
  5024. * to either signature1 or signature2. The weights must be non-negative and have at least one non-zero
  5025. * value.
  5026. * @param distType Used metric. See #DistanceTypes.
  5027. * is used, lower boundary lowerBound cannot be calculated because it needs a metric function.
  5028. * signatures that is a distance between mass centers. The lower boundary may not be calculated if
  5029. * the user-defined cost matrix is used, the total weights of point configurations are not equal, or
  5030. * if the signatures consist of weights only (the signature matrices have a single column). You
  5031. * *must** initialize \*lowerBound . If the calculated distance between mass centers is greater or
  5032. * equal to \*lowerBound (it means that the signatures are far enough), the function does not
  5033. * calculate EMD. In any case \*lowerBound is set to the calculated distance between mass centers on
  5034. * return. Thus, if you want to calculate both distance between mass centers and EMD, \*lowerBound
  5035. * should be set to 0.
  5036. * a flow from `$$i$$` -th point of signature1 to `$$j$$` -th point of signature2 .
  5037. */
  5038. + (float)EMD:(Mat*)signature1 signature2:(Mat*)signature2 distType:(DistanceTypes)distType NS_SWIFT_NAME(wrapperEMD(signature1:signature2:distType:));
  5039. //
  5040. // void cv::watershed(Mat image, Mat& markers)
  5041. //
  5042. /**
  5043. * Performs a marker-based image segmentation using the watershed algorithm.
  5044. *
  5045. * The function implements one of the variants of watershed, non-parametric marker-based segmentation
  5046. * algorithm, described in CITE: Meyer92 .
  5047. *
  5048. * Before passing the image to the function, you have to roughly outline the desired regions in the
  5049. * image markers with positive (\>0) indices. So, every region is represented as one or more connected
  5050. * components with the pixel values 1, 2, 3, and so on. Such markers can be retrieved from a binary
  5051. * mask using #findContours and #drawContours (see the watershed.cpp demo). The markers are "seeds" of
  5052. * the future image regions. All the other pixels in markers , whose relation to the outlined regions
  5053. * is not known and should be defined by the algorithm, should be set to 0's. In the function output,
  5054. * each pixel in markers is set to a value of the "seed" components or to -1 at boundaries between the
  5055. * regions.
  5056. *
  5057. * NOTE: Any two neighbor connected components are not necessarily separated by a watershed boundary
  5058. * (-1's pixels); for example, they can touch each other in the initial marker image passed to the
  5059. * function.
  5060. *
  5061. * @param image Input 8-bit 3-channel image.
  5062. * @param markers Input/output 32-bit single-channel image (map) of markers. It should have the same
  5063. * size as image .
  5064. *
  5065. * @see `+findContours:contours:hierarchy:mode:method:offset:`
  5066. */
  5067. + (void)watershed:(Mat*)image markers:(Mat*)markers NS_SWIFT_NAME(watershed(image:markers:));
  5068. //
  5069. // void cv::pyrMeanShiftFiltering(Mat src, Mat& dst, double sp, double sr, int maxLevel = 1, TermCriteria termcrit = TermCriteria(TermCriteria::MAX_ITER+TermCriteria::EPS,5,1))
  5070. //
  5071. /**
  5072. * Performs initial step of meanshift segmentation of an image.
  5073. *
  5074. * The function implements the filtering stage of meanshift segmentation, that is, the output of the
  5075. * function is the filtered "posterized" image with color gradients and fine-grain texture flattened.
  5076. * At every pixel (X,Y) of the input image (or down-sized input image, see below) the function executes
  5077. * meanshift iterations, that is, the pixel (X,Y) neighborhood in the joint space-color hyperspace is
  5078. * considered:
  5079. *
  5080. * `$$(x,y): X- \texttt{sp} \le x \le X+ \texttt{sp} , Y- \texttt{sp} \le y \le Y+ \texttt{sp} , ||(R,G,B)-(r,g,b)|| \le \texttt{sr}$$`
  5081. *
  5082. * where (R,G,B) and (r,g,b) are the vectors of color components at (X,Y) and (x,y), respectively
  5083. * (though, the algorithm does not depend on the color space used, so any 3-component color space can
  5084. * be used instead). Over the neighborhood the average spatial value (X',Y') and average color vector
  5085. * (R',G',B') are found and they act as the neighborhood center on the next iteration:
  5086. *
  5087. * `$$(X,Y)~(X',Y'), (R,G,B)~(R',G',B').$$`
  5088. *
  5089. * After the iterations over, the color components of the initial pixel (that is, the pixel from where
  5090. * the iterations started) are set to the final value (average color at the last iteration):
  5091. *
  5092. * `$$I(X,Y) <- (R*,G*,B*)$$`
  5093. *
  5094. * When maxLevel \> 0, the gaussian pyramid of maxLevel+1 levels is built, and the above procedure is
  5095. * run on the smallest layer first. After that, the results are propagated to the larger layer and the
  5096. * iterations are run again only on those pixels where the layer colors differ by more than sr from the
  5097. * lower-resolution layer of the pyramid. That makes boundaries of color regions sharper. Note that the
  5098. * results will be actually different from the ones obtained by running the meanshift procedure on the
  5099. * whole original image (i.e. when maxLevel==0).
  5100. *
  5101. * @param src The source 8-bit, 3-channel image.
  5102. * @param dst The destination image of the same format and the same size as the source.
  5103. * @param sp The spatial window radius.
  5104. * @param sr The color window radius.
  5105. * @param maxLevel Maximum level of the pyramid for the segmentation.
  5106. * @param termcrit Termination criteria: when to stop meanshift iterations.
  5107. */
  5108. + (void)pyrMeanShiftFiltering:(Mat*)src dst:(Mat*)dst sp:(double)sp sr:(double)sr maxLevel:(int)maxLevel termcrit:(TermCriteria*)termcrit NS_SWIFT_NAME(pyrMeanShiftFiltering(src:dst:sp:sr:maxLevel:termcrit:));
  5109. /**
  5110. * Performs initial step of meanshift segmentation of an image.
  5111. *
  5112. * The function implements the filtering stage of meanshift segmentation, that is, the output of the
  5113. * function is the filtered "posterized" image with color gradients and fine-grain texture flattened.
  5114. * At every pixel (X,Y) of the input image (or down-sized input image, see below) the function executes
  5115. * meanshift iterations, that is, the pixel (X,Y) neighborhood in the joint space-color hyperspace is
  5116. * considered:
  5117. *
  5118. * `$$(x,y): X- \texttt{sp} \le x \le X+ \texttt{sp} , Y- \texttt{sp} \le y \le Y+ \texttt{sp} , ||(R,G,B)-(r,g,b)|| \le \texttt{sr}$$`
  5119. *
  5120. * where (R,G,B) and (r,g,b) are the vectors of color components at (X,Y) and (x,y), respectively
  5121. * (though, the algorithm does not depend on the color space used, so any 3-component color space can
  5122. * be used instead). Over the neighborhood the average spatial value (X',Y') and average color vector
  5123. * (R',G',B') are found and they act as the neighborhood center on the next iteration:
  5124. *
  5125. * `$$(X,Y)~(X',Y'), (R,G,B)~(R',G',B').$$`
  5126. *
  5127. * After the iterations over, the color components of the initial pixel (that is, the pixel from where
  5128. * the iterations started) are set to the final value (average color at the last iteration):
  5129. *
  5130. * `$$I(X,Y) <- (R*,G*,B*)$$`
  5131. *
  5132. * When maxLevel \> 0, the gaussian pyramid of maxLevel+1 levels is built, and the above procedure is
  5133. * run on the smallest layer first. After that, the results are propagated to the larger layer and the
  5134. * iterations are run again only on those pixels where the layer colors differ by more than sr from the
  5135. * lower-resolution layer of the pyramid. That makes boundaries of color regions sharper. Note that the
  5136. * results will be actually different from the ones obtained by running the meanshift procedure on the
  5137. * whole original image (i.e. when maxLevel==0).
  5138. *
  5139. * @param src The source 8-bit, 3-channel image.
  5140. * @param dst The destination image of the same format and the same size as the source.
  5141. * @param sp The spatial window radius.
  5142. * @param sr The color window radius.
  5143. * @param maxLevel Maximum level of the pyramid for the segmentation.
  5144. */
  5145. + (void)pyrMeanShiftFiltering:(Mat*)src dst:(Mat*)dst sp:(double)sp sr:(double)sr maxLevel:(int)maxLevel NS_SWIFT_NAME(pyrMeanShiftFiltering(src:dst:sp:sr:maxLevel:));
  5146. /**
  5147. * Performs initial step of meanshift segmentation of an image.
  5148. *
  5149. * The function implements the filtering stage of meanshift segmentation, that is, the output of the
  5150. * function is the filtered "posterized" image with color gradients and fine-grain texture flattened.
  5151. * At every pixel (X,Y) of the input image (or down-sized input image, see below) the function executes
  5152. * meanshift iterations, that is, the pixel (X,Y) neighborhood in the joint space-color hyperspace is
  5153. * considered:
  5154. *
  5155. * `$$(x,y): X- \texttt{sp} \le x \le X+ \texttt{sp} , Y- \texttt{sp} \le y \le Y+ \texttt{sp} , ||(R,G,B)-(r,g,b)|| \le \texttt{sr}$$`
  5156. *
  5157. * where (R,G,B) and (r,g,b) are the vectors of color components at (X,Y) and (x,y), respectively
  5158. * (though, the algorithm does not depend on the color space used, so any 3-component color space can
  5159. * be used instead). Over the neighborhood the average spatial value (X',Y') and average color vector
  5160. * (R',G',B') are found and they act as the neighborhood center on the next iteration:
  5161. *
  5162. * `$$(X,Y)~(X',Y'), (R,G,B)~(R',G',B').$$`
  5163. *
  5164. * After the iterations over, the color components of the initial pixel (that is, the pixel from where
  5165. * the iterations started) are set to the final value (average color at the last iteration):
  5166. *
  5167. * `$$I(X,Y) <- (R*,G*,B*)$$`
  5168. *
  5169. * When maxLevel \> 0, the gaussian pyramid of maxLevel+1 levels is built, and the above procedure is
  5170. * run on the smallest layer first. After that, the results are propagated to the larger layer and the
  5171. * iterations are run again only on those pixels where the layer colors differ by more than sr from the
  5172. * lower-resolution layer of the pyramid. That makes boundaries of color regions sharper. Note that the
  5173. * results will be actually different from the ones obtained by running the meanshift procedure on the
  5174. * whole original image (i.e. when maxLevel==0).
  5175. *
  5176. * @param src The source 8-bit, 3-channel image.
  5177. * @param dst The destination image of the same format and the same size as the source.
  5178. * @param sp The spatial window radius.
  5179. * @param sr The color window radius.
  5180. */
  5181. + (void)pyrMeanShiftFiltering:(Mat*)src dst:(Mat*)dst sp:(double)sp sr:(double)sr NS_SWIFT_NAME(pyrMeanShiftFiltering(src:dst:sp:sr:));
  5182. //
  5183. // void cv::grabCut(Mat img, Mat& mask, Rect rect, Mat& bgdModel, Mat& fgdModel, int iterCount, int mode = GC_EVAL)
  5184. //
  5185. /**
  5186. * Runs the GrabCut algorithm.
  5187. *
  5188. * The function implements the [GrabCut image segmentation algorithm](http://en.wikipedia.org/wiki/GrabCut).
  5189. *
  5190. * @param img Input 8-bit 3-channel image.
  5191. * @param mask Input/output 8-bit single-channel mask. The mask is initialized by the function when
  5192. * mode is set to #GC_INIT_WITH_RECT. Its elements may have one of the #GrabCutClasses.
  5193. * @param rect ROI containing a segmented object. The pixels outside of the ROI are marked as
  5194. * "obvious background". The parameter is only used when mode==#GC_INIT_WITH_RECT .
  5195. * @param bgdModel Temporary array for the background model. Do not modify it while you are
  5196. * processing the same image.
  5197. * @param fgdModel Temporary arrays for the foreground model. Do not modify it while you are
  5198. * processing the same image.
  5199. * @param iterCount Number of iterations the algorithm should make before returning the result. Note
  5200. * that the result can be refined with further calls with mode==#GC_INIT_WITH_MASK or
  5201. * mode==GC_EVAL .
  5202. * @param mode Operation mode that could be one of the #GrabCutModes
  5203. */
  5204. + (void)grabCut:(Mat*)img mask:(Mat*)mask rect:(Rect2i*)rect bgdModel:(Mat*)bgdModel fgdModel:(Mat*)fgdModel iterCount:(int)iterCount mode:(int)mode NS_SWIFT_NAME(grabCut(img:mask:rect:bgdModel:fgdModel:iterCount:mode:));
  5205. /**
  5206. * Runs the GrabCut algorithm.
  5207. *
  5208. * The function implements the [GrabCut image segmentation algorithm](http://en.wikipedia.org/wiki/GrabCut).
  5209. *
  5210. * @param img Input 8-bit 3-channel image.
  5211. * @param mask Input/output 8-bit single-channel mask. The mask is initialized by the function when
  5212. * mode is set to #GC_INIT_WITH_RECT. Its elements may have one of the #GrabCutClasses.
  5213. * @param rect ROI containing a segmented object. The pixels outside of the ROI are marked as
  5214. * "obvious background". The parameter is only used when mode==#GC_INIT_WITH_RECT .
  5215. * @param bgdModel Temporary array for the background model. Do not modify it while you are
  5216. * processing the same image.
  5217. * @param fgdModel Temporary arrays for the foreground model. Do not modify it while you are
  5218. * processing the same image.
  5219. * @param iterCount Number of iterations the algorithm should make before returning the result. Note
  5220. * that the result can be refined with further calls with mode==#GC_INIT_WITH_MASK or
  5221. * mode==GC_EVAL .
  5222. */
  5223. + (void)grabCut:(Mat*)img mask:(Mat*)mask rect:(Rect2i*)rect bgdModel:(Mat*)bgdModel fgdModel:(Mat*)fgdModel iterCount:(int)iterCount NS_SWIFT_NAME(grabCut(img:mask:rect:bgdModel:fgdModel:iterCount:));
  5224. //
  5225. // void cv::distanceTransform(Mat src, Mat& dst, Mat& labels, DistanceTypes distanceType, DistanceTransformMasks maskSize, DistanceTransformLabelTypes labelType = DIST_LABEL_CCOMP)
  5226. //
  5227. /**
  5228. * Calculates the distance to the closest zero pixel for each pixel of the source image.
  5229. *
  5230. * The function cv::distanceTransform calculates the approximate or precise distance from every binary
  5231. * image pixel to the nearest zero pixel. For zero image pixels, the distance will obviously be zero.
  5232. *
  5233. * When maskSize == #DIST_MASK_PRECISE and distanceType == #DIST_L2 , the function runs the
  5234. * algorithm described in CITE: Felzenszwalb04 . This algorithm is parallelized with the TBB library.
  5235. *
  5236. * In other cases, the algorithm CITE: Borgefors86 is used. This means that for a pixel the function
  5237. * finds the shortest path to the nearest zero pixel consisting of basic shifts: horizontal, vertical,
  5238. * diagonal, or knight's move (the latest is available for a `$$5\times 5$$` mask). The overall
  5239. * distance is calculated as a sum of these basic distances. Since the distance function should be
  5240. * symmetric, all of the horizontal and vertical shifts must have the same cost (denoted as a ), all
  5241. * the diagonal shifts must have the same cost (denoted as `b`), and all knight's moves must have the
  5242. * same cost (denoted as `c`). For the #DIST_C and #DIST_L1 types, the distance is calculated
  5243. * precisely, whereas for #DIST_L2 (Euclidean distance) the distance can be calculated only with a
  5244. * relative error (a `$$5\times 5$$` mask gives more accurate results). For `a`,`b`, and `c`, OpenCV
  5245. * uses the values suggested in the original paper:
  5246. * - DIST_L1: `a = 1, b = 2`
  5247. * - DIST_L2:
  5248. * - `3 x 3`: `a=0.955, b=1.3693`
  5249. * - `5 x 5`: `a=1, b=1.4, c=2.1969`
  5250. * - DIST_C: `a = 1, b = 1`
  5251. *
  5252. * Typically, for a fast, coarse distance estimation #DIST_L2, a `$$3\times 3$$` mask is used. For a
  5253. * more accurate distance estimation #DIST_L2, a `$$5\times 5$$` mask or the precise algorithm is used.
  5254. * Note that both the precise and the approximate algorithms are linear on the number of pixels.
  5255. *
  5256. * This variant of the function does not only compute the minimum distance for each pixel `$$(x, y)$$`
  5257. * but also identifies the nearest connected component consisting of zero pixels
  5258. * (labelType==#DIST_LABEL_CCOMP) or the nearest zero pixel (labelType==#DIST_LABEL_PIXEL). Index of the
  5259. * component/pixel is stored in `labels(x, y)`. When labelType==#DIST_LABEL_CCOMP, the function
  5260. * automatically finds connected components of zero pixels in the input image and marks them with
  5261. * distinct labels. When labelType==#DIST_LABEL_PIXEL, the function scans through the input image and
  5262. * marks all the zero pixels with distinct labels.
  5263. *
  5264. * In this mode, the complexity is still linear. That is, the function provides a very fast way to
  5265. * compute the Voronoi diagram for a binary image. Currently, the second variant can use only the
  5266. * approximate distance transform algorithm, i.e. maskSize=#DIST_MASK_PRECISE is not supported
  5267. * yet.
  5268. *
  5269. * @param src 8-bit, single-channel (binary) source image.
  5270. * @param dst Output image with calculated distances. It is a 8-bit or 32-bit floating-point,
  5271. * single-channel image of the same size as src.
  5272. * @param labels Output 2D array of labels (the discrete Voronoi diagram). It has the type
  5273. * CV_32SC1 and the same size as src.
  5274. * @param distanceType Type of distance, see #DistanceTypes
  5275. * @param maskSize Size of the distance transform mask, see #DistanceTransformMasks.
  5276. * #DIST_MASK_PRECISE is not supported by this variant. In case of the #DIST_L1 or #DIST_C distance type,
  5277. * the parameter is forced to 3 because a `$$3\times 3$$` mask gives the same result as `$$5\times
  5278. * 5$$` or any larger aperture.
  5279. * @param labelType Type of the label array to build, see #DistanceTransformLabelTypes.
  5280. */
  5281. + (void)distanceTransformWithLabels:(Mat*)src dst:(Mat*)dst labels:(Mat*)labels distanceType:(DistanceTypes)distanceType maskSize:(DistanceTransformMasks)maskSize labelType:(DistanceTransformLabelTypes)labelType NS_SWIFT_NAME(distanceTransform(src:dst:labels:distanceType:maskSize:labelType:));
  5282. /**
  5283. * Calculates the distance to the closest zero pixel for each pixel of the source image.
  5284. *
  5285. * The function cv::distanceTransform calculates the approximate or precise distance from every binary
  5286. * image pixel to the nearest zero pixel. For zero image pixels, the distance will obviously be zero.
  5287. *
  5288. * When maskSize == #DIST_MASK_PRECISE and distanceType == #DIST_L2 , the function runs the
  5289. * algorithm described in CITE: Felzenszwalb04 . This algorithm is parallelized with the TBB library.
  5290. *
  5291. * In other cases, the algorithm CITE: Borgefors86 is used. This means that for a pixel the function
  5292. * finds the shortest path to the nearest zero pixel consisting of basic shifts: horizontal, vertical,
  5293. * diagonal, or knight's move (the latest is available for a `$$5\times 5$$` mask). The overall
  5294. * distance is calculated as a sum of these basic distances. Since the distance function should be
  5295. * symmetric, all of the horizontal and vertical shifts must have the same cost (denoted as a ), all
  5296. * the diagonal shifts must have the same cost (denoted as `b`), and all knight's moves must have the
  5297. * same cost (denoted as `c`). For the #DIST_C and #DIST_L1 types, the distance is calculated
  5298. * precisely, whereas for #DIST_L2 (Euclidean distance) the distance can be calculated only with a
  5299. * relative error (a `$$5\times 5$$` mask gives more accurate results). For `a`,`b`, and `c`, OpenCV
  5300. * uses the values suggested in the original paper:
  5301. * - DIST_L1: `a = 1, b = 2`
  5302. * - DIST_L2:
  5303. * - `3 x 3`: `a=0.955, b=1.3693`
  5304. * - `5 x 5`: `a=1, b=1.4, c=2.1969`
  5305. * - DIST_C: `a = 1, b = 1`
  5306. *
  5307. * Typically, for a fast, coarse distance estimation #DIST_L2, a `$$3\times 3$$` mask is used. For a
  5308. * more accurate distance estimation #DIST_L2, a `$$5\times 5$$` mask or the precise algorithm is used.
  5309. * Note that both the precise and the approximate algorithms are linear on the number of pixels.
  5310. *
  5311. * This variant of the function does not only compute the minimum distance for each pixel `$$(x, y)$$`
  5312. * but also identifies the nearest connected component consisting of zero pixels
  5313. * (labelType==#DIST_LABEL_CCOMP) or the nearest zero pixel (labelType==#DIST_LABEL_PIXEL). Index of the
  5314. * component/pixel is stored in `labels(x, y)`. When labelType==#DIST_LABEL_CCOMP, the function
  5315. * automatically finds connected components of zero pixels in the input image and marks them with
  5316. * distinct labels. When labelType==#DIST_LABEL_PIXEL, the function scans through the input image and
  5317. * marks all the zero pixels with distinct labels.
  5318. *
  5319. * In this mode, the complexity is still linear. That is, the function provides a very fast way to
  5320. * compute the Voronoi diagram for a binary image. Currently, the second variant can use only the
  5321. * approximate distance transform algorithm, i.e. maskSize=#DIST_MASK_PRECISE is not supported
  5322. * yet.
  5323. *
  5324. * @param src 8-bit, single-channel (binary) source image.
  5325. * @param dst Output image with calculated distances. It is a 8-bit or 32-bit floating-point,
  5326. * single-channel image of the same size as src.
  5327. * @param labels Output 2D array of labels (the discrete Voronoi diagram). It has the type
  5328. * CV_32SC1 and the same size as src.
  5329. * @param distanceType Type of distance, see #DistanceTypes
  5330. * @param maskSize Size of the distance transform mask, see #DistanceTransformMasks.
  5331. * #DIST_MASK_PRECISE is not supported by this variant. In case of the #DIST_L1 or #DIST_C distance type,
  5332. * the parameter is forced to 3 because a `$$3\times 3$$` mask gives the same result as `$$5\times
  5333. * 5$$` or any larger aperture.
  5334. */
  5335. + (void)distanceTransformWithLabels:(Mat*)src dst:(Mat*)dst labels:(Mat*)labels distanceType:(DistanceTypes)distanceType maskSize:(DistanceTransformMasks)maskSize NS_SWIFT_NAME(distanceTransform(src:dst:labels:distanceType:maskSize:));
  5336. //
  5337. // void cv::distanceTransform(Mat src, Mat& dst, DistanceTypes distanceType, DistanceTransformMasks maskSize, int dstType = CV_32F)
  5338. //
  5339. /**
  5340. *
  5341. * @param src 8-bit, single-channel (binary) source image.
  5342. * @param dst Output image with calculated distances. It is a 8-bit or 32-bit floating-point,
  5343. * single-channel image of the same size as src .
  5344. * @param distanceType Type of distance, see #DistanceTypes
  5345. * @param maskSize Size of the distance transform mask, see #DistanceTransformMasks. In case of the
  5346. * #DIST_L1 or #DIST_C distance type, the parameter is forced to 3 because a `$$3\times 3$$` mask gives
  5347. * the same result as `$$5\times 5$$` or any larger aperture.
  5348. * @param dstType Type of output image. It can be CV_8U or CV_32F. Type CV_8U can be used only for
  5349. * the first variant of the function and distanceType == #DIST_L1.
  5350. */
  5351. + (void)distanceTransform:(Mat*)src dst:(Mat*)dst distanceType:(DistanceTypes)distanceType maskSize:(DistanceTransformMasks)maskSize dstType:(int)dstType NS_SWIFT_NAME(distanceTransform(src:dst:distanceType:maskSize:dstType:));
  5352. /**
  5353. *
  5354. * @param src 8-bit, single-channel (binary) source image.
  5355. * @param dst Output image with calculated distances. It is a 8-bit or 32-bit floating-point,
  5356. * single-channel image of the same size as src .
  5357. * @param distanceType Type of distance, see #DistanceTypes
  5358. * @param maskSize Size of the distance transform mask, see #DistanceTransformMasks. In case of the
  5359. * #DIST_L1 or #DIST_C distance type, the parameter is forced to 3 because a `$$3\times 3$$` mask gives
  5360. * the same result as `$$5\times 5$$` or any larger aperture.
  5361. * the first variant of the function and distanceType == #DIST_L1.
  5362. */
  5363. + (void)distanceTransform:(Mat*)src dst:(Mat*)dst distanceType:(DistanceTypes)distanceType maskSize:(DistanceTransformMasks)maskSize NS_SWIFT_NAME(distanceTransform(src:dst:distanceType:maskSize:));
  5364. //
  5365. // int cv::floodFill(Mat& image, Mat& mask, Point seedPoint, Scalar newVal, Rect* rect = 0, Scalar loDiff = Scalar(), Scalar upDiff = Scalar(), int flags = 4)
  5366. //
  5367. /**
  5368. * Fills a connected component with the given color.
  5369. *
  5370. * The function cv::floodFill fills a connected component starting from the seed point with the specified
  5371. * color. The connectivity is determined by the color/brightness closeness of the neighbor pixels. The
  5372. * pixel at `$$(x,y)$$` is considered to belong to the repainted domain if:
  5373. *
  5374. * - in case of a grayscale image and floating range
  5375. * `$$\texttt{src} (x',y')- \texttt{loDiff} \leq \texttt{src} (x,y) \leq \texttt{src} (x',y')+ \texttt{upDiff}$$`
  5376. *
  5377. *
  5378. * - in case of a grayscale image and fixed range
  5379. * `$$\texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)- \texttt{loDiff} \leq \texttt{src} (x,y) \leq \texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)+ \texttt{upDiff}$$`
  5380. *
  5381. *
  5382. * - in case of a color image and floating range
  5383. * `$$\texttt{src} (x',y')_r- \texttt{loDiff} _r \leq \texttt{src} (x,y)_r \leq \texttt{src} (x',y')_r+ \texttt{upDiff} _r,$$`
  5384. * `$$\texttt{src} (x',y')_g- \texttt{loDiff} _g \leq \texttt{src} (x,y)_g \leq \texttt{src} (x',y')_g+ \texttt{upDiff} _g$$`
  5385. * and
  5386. * `$$\texttt{src} (x',y')_b- \texttt{loDiff} _b \leq \texttt{src} (x,y)_b \leq \texttt{src} (x',y')_b+ \texttt{upDiff} _b$$`
  5387. *
  5388. *
  5389. * - in case of a color image and fixed range
  5390. * `$$\texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_r- \texttt{loDiff} _r \leq \texttt{src} (x,y)_r \leq \texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_r+ \texttt{upDiff} _r,$$`
  5391. * `$$\texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_g- \texttt{loDiff} _g \leq \texttt{src} (x,y)_g \leq \texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_g+ \texttt{upDiff} _g$$`
  5392. * and
  5393. * `$$\texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_b- \texttt{loDiff} _b \leq \texttt{src} (x,y)_b \leq \texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_b+ \texttt{upDiff} _b$$`
  5394. *
  5395. *
  5396. * where `$$src(x',y')$$` is the value of one of pixel neighbors that is already known to belong to the
  5397. * component. That is, to be added to the connected component, a color/brightness of the pixel should
  5398. * be close enough to:
  5399. * - Color/brightness of one of its neighbors that already belong to the connected component in case
  5400. * of a floating range.
  5401. * - Color/brightness of the seed point in case of a fixed range.
  5402. *
  5403. * Use these functions to either mark a connected component with the specified color in-place, or build
  5404. * a mask and then extract the contour, or copy the region to another image, and so on.
  5405. *
  5406. * @param image Input/output 1- or 3-channel, 8-bit, or floating-point image. It is modified by the
  5407. * function unless the #FLOODFILL_MASK_ONLY flag is set in the second variant of the function. See
  5408. * the details below.
  5409. * @param mask Operation mask that should be a single-channel 8-bit image, 2 pixels wider and 2 pixels
  5410. * taller than image. If an empty Mat is passed it will be created automatically. Since this is both an
  5411. * input and output parameter, you must take responsibility of initializing it.
  5412. * Flood-filling cannot go across non-zero pixels in the input mask. For example,
  5413. * an edge detector output can be used as a mask to stop filling at edges. On output, pixels in the
  5414. * mask corresponding to filled pixels in the image are set to 1 or to the specified value in flags
  5415. * as described below. Additionally, the function fills the border of the mask with ones to simplify
  5416. * internal processing. It is therefore possible to use the same mask in multiple calls to the function
  5417. * to make sure the filled areas do not overlap.
  5418. * @param seedPoint Starting point.
  5419. * @param newVal New value of the repainted domain pixels.
  5420. * @param loDiff Maximal lower brightness/color difference between the currently observed pixel and
  5421. * one of its neighbors belonging to the component, or a seed pixel being added to the component.
  5422. * @param upDiff Maximal upper brightness/color difference between the currently observed pixel and
  5423. * one of its neighbors belonging to the component, or a seed pixel being added to the component.
  5424. * @param rect Optional output parameter set by the function to the minimum bounding rectangle of the
  5425. * repainted domain.
  5426. * @param flags Operation flags. The first 8 bits contain a connectivity value. The default value of
  5427. * 4 means that only the four nearest neighbor pixels (those that share an edge) are considered. A
  5428. * connectivity value of 8 means that the eight nearest neighbor pixels (those that share a corner)
  5429. * will be considered. The next 8 bits (8-16) contain a value between 1 and 255 with which to fill
  5430. * the mask (the default value is 1). For example, 4 | ( 255 \<\< 8 ) will consider 4 nearest
  5431. * neighbours and fill the mask with a value of 255. The following additional options occupy higher
  5432. * bits and therefore may be further combined with the connectivity and mask fill values using
  5433. * bit-wise or (|), see #FloodFillFlags.
  5434. *
  5435. * NOTE: Since the mask is larger than the filled image, a pixel `$$(x, y)$$` in image corresponds to the
  5436. * pixel `$$(x+1, y+1)$$` in the mask .
  5437. *
  5438. * @see `+findContours:contours:hierarchy:mode:method:offset:`
  5439. */
  5440. + (int)floodFill:(Mat*)image mask:(Mat*)mask seedPoint:(Point2i*)seedPoint newVal:(Scalar*)newVal rect:(Rect2i*)rect loDiff:(Scalar*)loDiff upDiff:(Scalar*)upDiff flags:(int)flags NS_SWIFT_NAME(floodFill(image:mask:seedPoint:newVal:rect:loDiff:upDiff:flags:));
  5441. /**
  5442. * Fills a connected component with the given color.
  5443. *
  5444. * The function cv::floodFill fills a connected component starting from the seed point with the specified
  5445. * color. The connectivity is determined by the color/brightness closeness of the neighbor pixels. The
  5446. * pixel at `$$(x,y)$$` is considered to belong to the repainted domain if:
  5447. *
  5448. * - in case of a grayscale image and floating range
  5449. * `$$\texttt{src} (x',y')- \texttt{loDiff} \leq \texttt{src} (x,y) \leq \texttt{src} (x',y')+ \texttt{upDiff}$$`
  5450. *
  5451. *
  5452. * - in case of a grayscale image and fixed range
  5453. * `$$\texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)- \texttt{loDiff} \leq \texttt{src} (x,y) \leq \texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)+ \texttt{upDiff}$$`
  5454. *
  5455. *
  5456. * - in case of a color image and floating range
  5457. * `$$\texttt{src} (x',y')_r- \texttt{loDiff} _r \leq \texttt{src} (x,y)_r \leq \texttt{src} (x',y')_r+ \texttt{upDiff} _r,$$`
  5458. * `$$\texttt{src} (x',y')_g- \texttt{loDiff} _g \leq \texttt{src} (x,y)_g \leq \texttt{src} (x',y')_g+ \texttt{upDiff} _g$$`
  5459. * and
  5460. * `$$\texttt{src} (x',y')_b- \texttt{loDiff} _b \leq \texttt{src} (x,y)_b \leq \texttt{src} (x',y')_b+ \texttt{upDiff} _b$$`
  5461. *
  5462. *
  5463. * - in case of a color image and fixed range
  5464. * `$$\texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_r- \texttt{loDiff} _r \leq \texttt{src} (x,y)_r \leq \texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_r+ \texttt{upDiff} _r,$$`
  5465. * `$$\texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_g- \texttt{loDiff} _g \leq \texttt{src} (x,y)_g \leq \texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_g+ \texttt{upDiff} _g$$`
  5466. * and
  5467. * `$$\texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_b- \texttt{loDiff} _b \leq \texttt{src} (x,y)_b \leq \texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_b+ \texttt{upDiff} _b$$`
  5468. *
  5469. *
  5470. * where `$$src(x',y')$$` is the value of one of pixel neighbors that is already known to belong to the
  5471. * component. That is, to be added to the connected component, a color/brightness of the pixel should
  5472. * be close enough to:
  5473. * - Color/brightness of one of its neighbors that already belong to the connected component in case
  5474. * of a floating range.
  5475. * - Color/brightness of the seed point in case of a fixed range.
  5476. *
  5477. * Use these functions to either mark a connected component with the specified color in-place, or build
  5478. * a mask and then extract the contour, or copy the region to another image, and so on.
  5479. *
  5480. * @param image Input/output 1- or 3-channel, 8-bit, or floating-point image. It is modified by the
  5481. * function unless the #FLOODFILL_MASK_ONLY flag is set in the second variant of the function. See
  5482. * the details below.
  5483. * @param mask Operation mask that should be a single-channel 8-bit image, 2 pixels wider and 2 pixels
  5484. * taller than image. If an empty Mat is passed it will be created automatically. Since this is both an
  5485. * input and output parameter, you must take responsibility of initializing it.
  5486. * Flood-filling cannot go across non-zero pixels in the input mask. For example,
  5487. * an edge detector output can be used as a mask to stop filling at edges. On output, pixels in the
  5488. * mask corresponding to filled pixels in the image are set to 1 or to the specified value in flags
  5489. * as described below. Additionally, the function fills the border of the mask with ones to simplify
  5490. * internal processing. It is therefore possible to use the same mask in multiple calls to the function
  5491. * to make sure the filled areas do not overlap.
  5492. * @param seedPoint Starting point.
  5493. * @param newVal New value of the repainted domain pixels.
  5494. * @param loDiff Maximal lower brightness/color difference between the currently observed pixel and
  5495. * one of its neighbors belonging to the component, or a seed pixel being added to the component.
  5496. * @param upDiff Maximal upper brightness/color difference between the currently observed pixel and
  5497. * one of its neighbors belonging to the component, or a seed pixel being added to the component.
  5498. * @param rect Optional output parameter set by the function to the minimum bounding rectangle of the
  5499. * repainted domain.
  5500. * 4 means that only the four nearest neighbor pixels (those that share an edge) are considered. A
  5501. * connectivity value of 8 means that the eight nearest neighbor pixels (those that share a corner)
  5502. * will be considered. The next 8 bits (8-16) contain a value between 1 and 255 with which to fill
  5503. * the mask (the default value is 1). For example, 4 | ( 255 \<\< 8 ) will consider 4 nearest
  5504. * neighbours and fill the mask with a value of 255. The following additional options occupy higher
  5505. * bits and therefore may be further combined with the connectivity and mask fill values using
  5506. * bit-wise or (|), see #FloodFillFlags.
  5507. *
  5508. * NOTE: Since the mask is larger than the filled image, a pixel `$$(x, y)$$` in image corresponds to the
  5509. * pixel `$$(x+1, y+1)$$` in the mask .
  5510. *
  5511. * @see `+findContours:contours:hierarchy:mode:method:offset:`
  5512. */
  5513. + (int)floodFill:(Mat*)image mask:(Mat*)mask seedPoint:(Point2i*)seedPoint newVal:(Scalar*)newVal rect:(Rect2i*)rect loDiff:(Scalar*)loDiff upDiff:(Scalar*)upDiff NS_SWIFT_NAME(floodFill(image:mask:seedPoint:newVal:rect:loDiff:upDiff:));
  5514. /**
  5515. * Fills a connected component with the given color.
  5516. *
  5517. * The function cv::floodFill fills a connected component starting from the seed point with the specified
  5518. * color. The connectivity is determined by the color/brightness closeness of the neighbor pixels. The
  5519. * pixel at `$$(x,y)$$` is considered to belong to the repainted domain if:
  5520. *
  5521. * - in case of a grayscale image and floating range
  5522. * `$$\texttt{src} (x',y')- \texttt{loDiff} \leq \texttt{src} (x,y) \leq \texttt{src} (x',y')+ \texttt{upDiff}$$`
  5523. *
  5524. *
  5525. * - in case of a grayscale image and fixed range
  5526. * `$$\texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)- \texttt{loDiff} \leq \texttt{src} (x,y) \leq \texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)+ \texttt{upDiff}$$`
  5527. *
  5528. *
  5529. * - in case of a color image and floating range
  5530. * `$$\texttt{src} (x',y')_r- \texttt{loDiff} _r \leq \texttt{src} (x,y)_r \leq \texttt{src} (x',y')_r+ \texttt{upDiff} _r,$$`
  5531. * `$$\texttt{src} (x',y')_g- \texttt{loDiff} _g \leq \texttt{src} (x,y)_g \leq \texttt{src} (x',y')_g+ \texttt{upDiff} _g$$`
  5532. * and
  5533. * `$$\texttt{src} (x',y')_b- \texttt{loDiff} _b \leq \texttt{src} (x,y)_b \leq \texttt{src} (x',y')_b+ \texttt{upDiff} _b$$`
  5534. *
  5535. *
  5536. * - in case of a color image and fixed range
  5537. * `$$\texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_r- \texttt{loDiff} _r \leq \texttt{src} (x,y)_r \leq \texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_r+ \texttt{upDiff} _r,$$`
  5538. * `$$\texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_g- \texttt{loDiff} _g \leq \texttt{src} (x,y)_g \leq \texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_g+ \texttt{upDiff} _g$$`
  5539. * and
  5540. * `$$\texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_b- \texttt{loDiff} _b \leq \texttt{src} (x,y)_b \leq \texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_b+ \texttt{upDiff} _b$$`
  5541. *
  5542. *
  5543. * where `$$src(x',y')$$` is the value of one of pixel neighbors that is already known to belong to the
  5544. * component. That is, to be added to the connected component, a color/brightness of the pixel should
  5545. * be close enough to:
  5546. * - Color/brightness of one of its neighbors that already belong to the connected component in case
  5547. * of a floating range.
  5548. * - Color/brightness of the seed point in case of a fixed range.
  5549. *
  5550. * Use these functions to either mark a connected component with the specified color in-place, or build
  5551. * a mask and then extract the contour, or copy the region to another image, and so on.
  5552. *
  5553. * @param image Input/output 1- or 3-channel, 8-bit, or floating-point image. It is modified by the
  5554. * function unless the #FLOODFILL_MASK_ONLY flag is set in the second variant of the function. See
  5555. * the details below.
  5556. * @param mask Operation mask that should be a single-channel 8-bit image, 2 pixels wider and 2 pixels
  5557. * taller than image. If an empty Mat is passed it will be created automatically. Since this is both an
  5558. * input and output parameter, you must take responsibility of initializing it.
  5559. * Flood-filling cannot go across non-zero pixels in the input mask. For example,
  5560. * an edge detector output can be used as a mask to stop filling at edges. On output, pixels in the
  5561. * mask corresponding to filled pixels in the image are set to 1 or to the specified value in flags
  5562. * as described below. Additionally, the function fills the border of the mask with ones to simplify
  5563. * internal processing. It is therefore possible to use the same mask in multiple calls to the function
  5564. * to make sure the filled areas do not overlap.
  5565. * @param seedPoint Starting point.
  5566. * @param newVal New value of the repainted domain pixels.
  5567. * @param loDiff Maximal lower brightness/color difference between the currently observed pixel and
  5568. * one of its neighbors belonging to the component, or a seed pixel being added to the component.
  5569. * one of its neighbors belonging to the component, or a seed pixel being added to the component.
  5570. * @param rect Optional output parameter set by the function to the minimum bounding rectangle of the
  5571. * repainted domain.
  5572. * 4 means that only the four nearest neighbor pixels (those that share an edge) are considered. A
  5573. * connectivity value of 8 means that the eight nearest neighbor pixels (those that share a corner)
  5574. * will be considered. The next 8 bits (8-16) contain a value between 1 and 255 with which to fill
  5575. * the mask (the default value is 1). For example, 4 | ( 255 \<\< 8 ) will consider 4 nearest
  5576. * neighbours and fill the mask with a value of 255. The following additional options occupy higher
  5577. * bits and therefore may be further combined with the connectivity and mask fill values using
  5578. * bit-wise or (|), see #FloodFillFlags.
  5579. *
  5580. * NOTE: Since the mask is larger than the filled image, a pixel `$$(x, y)$$` in image corresponds to the
  5581. * pixel `$$(x+1, y+1)$$` in the mask .
  5582. *
  5583. * @see `+findContours:contours:hierarchy:mode:method:offset:`
  5584. */
  5585. + (int)floodFill:(Mat*)image mask:(Mat*)mask seedPoint:(Point2i*)seedPoint newVal:(Scalar*)newVal rect:(Rect2i*)rect loDiff:(Scalar*)loDiff NS_SWIFT_NAME(floodFill(image:mask:seedPoint:newVal:rect:loDiff:));
  5586. /**
  5587. * Fills a connected component with the given color.
  5588. *
  5589. * The function cv::floodFill fills a connected component starting from the seed point with the specified
  5590. * color. The connectivity is determined by the color/brightness closeness of the neighbor pixels. The
  5591. * pixel at `$$(x,y)$$` is considered to belong to the repainted domain if:
  5592. *
  5593. * - in case of a grayscale image and floating range
  5594. * `$$\texttt{src} (x',y')- \texttt{loDiff} \leq \texttt{src} (x,y) \leq \texttt{src} (x',y')+ \texttt{upDiff}$$`
  5595. *
  5596. *
  5597. * - in case of a grayscale image and fixed range
  5598. * `$$\texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)- \texttt{loDiff} \leq \texttt{src} (x,y) \leq \texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)+ \texttt{upDiff}$$`
  5599. *
  5600. *
  5601. * - in case of a color image and floating range
  5602. * `$$\texttt{src} (x',y')_r- \texttt{loDiff} _r \leq \texttt{src} (x,y)_r \leq \texttt{src} (x',y')_r+ \texttt{upDiff} _r,$$`
  5603. * `$$\texttt{src} (x',y')_g- \texttt{loDiff} _g \leq \texttt{src} (x,y)_g \leq \texttt{src} (x',y')_g+ \texttt{upDiff} _g$$`
  5604. * and
  5605. * `$$\texttt{src} (x',y')_b- \texttt{loDiff} _b \leq \texttt{src} (x,y)_b \leq \texttt{src} (x',y')_b+ \texttt{upDiff} _b$$`
  5606. *
  5607. *
  5608. * - in case of a color image and fixed range
  5609. * `$$\texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_r- \texttt{loDiff} _r \leq \texttt{src} (x,y)_r \leq \texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_r+ \texttt{upDiff} _r,$$`
  5610. * `$$\texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_g- \texttt{loDiff} _g \leq \texttt{src} (x,y)_g \leq \texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_g+ \texttt{upDiff} _g$$`
  5611. * and
  5612. * `$$\texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_b- \texttt{loDiff} _b \leq \texttt{src} (x,y)_b \leq \texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_b+ \texttt{upDiff} _b$$`
  5613. *
  5614. *
  5615. * where `$$src(x',y')$$` is the value of one of pixel neighbors that is already known to belong to the
  5616. * component. That is, to be added to the connected component, a color/brightness of the pixel should
  5617. * be close enough to:
  5618. * - Color/brightness of one of its neighbors that already belong to the connected component in case
  5619. * of a floating range.
  5620. * - Color/brightness of the seed point in case of a fixed range.
  5621. *
  5622. * Use these functions to either mark a connected component with the specified color in-place, or build
  5623. * a mask and then extract the contour, or copy the region to another image, and so on.
  5624. *
  5625. * @param image Input/output 1- or 3-channel, 8-bit, or floating-point image. It is modified by the
  5626. * function unless the #FLOODFILL_MASK_ONLY flag is set in the second variant of the function. See
  5627. * the details below.
  5628. * @param mask Operation mask that should be a single-channel 8-bit image, 2 pixels wider and 2 pixels
  5629. * taller than image. If an empty Mat is passed it will be created automatically. Since this is both an
  5630. * input and output parameter, you must take responsibility of initializing it.
  5631. * Flood-filling cannot go across non-zero pixels in the input mask. For example,
  5632. * an edge detector output can be used as a mask to stop filling at edges. On output, pixels in the
  5633. * mask corresponding to filled pixels in the image are set to 1 or to the specified value in flags
  5634. * as described below. Additionally, the function fills the border of the mask with ones to simplify
  5635. * internal processing. It is therefore possible to use the same mask in multiple calls to the function
  5636. * to make sure the filled areas do not overlap.
  5637. * @param seedPoint Starting point.
  5638. * @param newVal New value of the repainted domain pixels.
  5639. * one of its neighbors belonging to the component, or a seed pixel being added to the component.
  5640. * one of its neighbors belonging to the component, or a seed pixel being added to the component.
  5641. * @param rect Optional output parameter set by the function to the minimum bounding rectangle of the
  5642. * repainted domain.
  5643. * 4 means that only the four nearest neighbor pixels (those that share an edge) are considered. A
  5644. * connectivity value of 8 means that the eight nearest neighbor pixels (those that share a corner)
  5645. * will be considered. The next 8 bits (8-16) contain a value between 1 and 255 with which to fill
  5646. * the mask (the default value is 1). For example, 4 | ( 255 \<\< 8 ) will consider 4 nearest
  5647. * neighbours and fill the mask with a value of 255. The following additional options occupy higher
  5648. * bits and therefore may be further combined with the connectivity and mask fill values using
  5649. * bit-wise or (|), see #FloodFillFlags.
  5650. *
  5651. * NOTE: Since the mask is larger than the filled image, a pixel `$$(x, y)$$` in image corresponds to the
  5652. * pixel `$$(x+1, y+1)$$` in the mask .
  5653. *
  5654. * @see `+findContours:contours:hierarchy:mode:method:offset:`
  5655. */
  5656. + (int)floodFill:(Mat*)image mask:(Mat*)mask seedPoint:(Point2i*)seedPoint newVal:(Scalar*)newVal rect:(Rect2i*)rect NS_SWIFT_NAME(floodFill(image:mask:seedPoint:newVal:rect:));
  5657. /**
  5658. * Fills a connected component with the given color.
  5659. *
  5660. * The function cv::floodFill fills a connected component starting from the seed point with the specified
  5661. * color. The connectivity is determined by the color/brightness closeness of the neighbor pixels. The
  5662. * pixel at `$$(x,y)$$` is considered to belong to the repainted domain if:
  5663. *
  5664. * - in case of a grayscale image and floating range
  5665. * `$$\texttt{src} (x',y')- \texttt{loDiff} \leq \texttt{src} (x,y) \leq \texttt{src} (x',y')+ \texttt{upDiff}$$`
  5666. *
  5667. *
  5668. * - in case of a grayscale image and fixed range
  5669. * `$$\texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)- \texttt{loDiff} \leq \texttt{src} (x,y) \leq \texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)+ \texttt{upDiff}$$`
  5670. *
  5671. *
  5672. * - in case of a color image and floating range
  5673. * `$$\texttt{src} (x',y')_r- \texttt{loDiff} _r \leq \texttt{src} (x,y)_r \leq \texttt{src} (x',y')_r+ \texttt{upDiff} _r,$$`
  5674. * `$$\texttt{src} (x',y')_g- \texttt{loDiff} _g \leq \texttt{src} (x,y)_g \leq \texttt{src} (x',y')_g+ \texttt{upDiff} _g$$`
  5675. * and
  5676. * `$$\texttt{src} (x',y')_b- \texttt{loDiff} _b \leq \texttt{src} (x,y)_b \leq \texttt{src} (x',y')_b+ \texttt{upDiff} _b$$`
  5677. *
  5678. *
  5679. * - in case of a color image and fixed range
  5680. * `$$\texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_r- \texttt{loDiff} _r \leq \texttt{src} (x,y)_r \leq \texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_r+ \texttt{upDiff} _r,$$`
  5681. * `$$\texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_g- \texttt{loDiff} _g \leq \texttt{src} (x,y)_g \leq \texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_g+ \texttt{upDiff} _g$$`
  5682. * and
  5683. * `$$\texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_b- \texttt{loDiff} _b \leq \texttt{src} (x,y)_b \leq \texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_b+ \texttt{upDiff} _b$$`
  5684. *
  5685. *
  5686. * where `$$src(x',y')$$` is the value of one of pixel neighbors that is already known to belong to the
  5687. * component. That is, to be added to the connected component, a color/brightness of the pixel should
  5688. * be close enough to:
  5689. * - Color/brightness of one of its neighbors that already belong to the connected component in case
  5690. * of a floating range.
  5691. * - Color/brightness of the seed point in case of a fixed range.
  5692. *
  5693. * Use these functions to either mark a connected component with the specified color in-place, or build
  5694. * a mask and then extract the contour, or copy the region to another image, and so on.
  5695. *
  5696. * @param image Input/output 1- or 3-channel, 8-bit, or floating-point image. It is modified by the
  5697. * function unless the #FLOODFILL_MASK_ONLY flag is set in the second variant of the function. See
  5698. * the details below.
  5699. * @param mask Operation mask that should be a single-channel 8-bit image, 2 pixels wider and 2 pixels
  5700. * taller than image. If an empty Mat is passed it will be created automatically. Since this is both an
  5701. * input and output parameter, you must take responsibility of initializing it.
  5702. * Flood-filling cannot go across non-zero pixels in the input mask. For example,
  5703. * an edge detector output can be used as a mask to stop filling at edges. On output, pixels in the
  5704. * mask corresponding to filled pixels in the image are set to 1 or to the specified value in flags
  5705. * as described below. Additionally, the function fills the border of the mask with ones to simplify
  5706. * internal processing. It is therefore possible to use the same mask in multiple calls to the function
  5707. * to make sure the filled areas do not overlap.
  5708. * @param seedPoint Starting point.
  5709. * @param newVal New value of the repainted domain pixels.
  5710. * one of its neighbors belonging to the component, or a seed pixel being added to the component.
  5711. * one of its neighbors belonging to the component, or a seed pixel being added to the component.
  5712. * repainted domain.
  5713. * 4 means that only the four nearest neighbor pixels (those that share an edge) are considered. A
  5714. * connectivity value of 8 means that the eight nearest neighbor pixels (those that share a corner)
  5715. * will be considered. The next 8 bits (8-16) contain a value between 1 and 255 with which to fill
  5716. * the mask (the default value is 1). For example, 4 | ( 255 \<\< 8 ) will consider 4 nearest
  5717. * neighbours and fill the mask with a value of 255. The following additional options occupy higher
  5718. * bits and therefore may be further combined with the connectivity and mask fill values using
  5719. * bit-wise or (|), see #FloodFillFlags.
  5720. *
  5721. * NOTE: Since the mask is larger than the filled image, a pixel `$$(x, y)$$` in image corresponds to the
  5722. * pixel `$$(x+1, y+1)$$` in the mask .
  5723. *
  5724. * @see `+findContours:contours:hierarchy:mode:method:offset:`
  5725. */
  5726. + (int)floodFill:(Mat*)image mask:(Mat*)mask seedPoint:(Point2i*)seedPoint newVal:(Scalar*)newVal NS_SWIFT_NAME(floodFill(image:mask:seedPoint:newVal:));
  5727. //
  5728. // void cv::blendLinear(Mat src1, Mat src2, Mat weights1, Mat weights2, Mat& dst)
  5729. //
  5730. /**
  5731. *
  5732. *
  5733. * variant without `mask` parameter
  5734. */
  5735. + (void)blendLinear:(Mat*)src1 src2:(Mat*)src2 weights1:(Mat*)weights1 weights2:(Mat*)weights2 dst:(Mat*)dst NS_SWIFT_NAME(blendLinear(src1:src2:weights1:weights2:dst:));
  5736. //
  5737. // void cv::cvtColor(Mat src, Mat& dst, ColorConversionCodes code, int dstCn = 0)
  5738. //
  5739. /**
  5740. * Converts an image from one color space to another.
  5741. *
  5742. * The function converts an input image from one color space to another. In case of a transformation
  5743. * to-from RGB color space, the order of the channels should be specified explicitly (RGB or BGR). Note
  5744. * that the default color format in OpenCV is often referred to as RGB but it is actually BGR (the
  5745. * bytes are reversed). So the first byte in a standard (24-bit) color image will be an 8-bit Blue
  5746. * component, the second byte will be Green, and the third byte will be Red. The fourth, fifth, and
  5747. * sixth bytes would then be the second pixel (Blue, then Green, then Red), and so on.
  5748. *
  5749. * The conventional ranges for R, G, and B channel values are:
  5750. * - 0 to 255 for CV_8U images
  5751. * - 0 to 65535 for CV_16U images
  5752. * - 0 to 1 for CV_32F images
  5753. *
  5754. * In case of linear transformations, the range does not matter. But in case of a non-linear
  5755. * transformation, an input RGB image should be normalized to the proper value range to get the correct
  5756. * results, for example, for RGB `$$\rightarrow$$` L\*u\*v\* transformation. For example, if you have a
  5757. * 32-bit floating-point image directly converted from an 8-bit image without any scaling, then it will
  5758. * have the 0..255 value range instead of 0..1 assumed by the function. So, before calling #cvtColor ,
  5759. * you need first to scale the image down:
  5760. *
  5761. * img *= 1./255;
  5762. * cvtColor(img, img, COLOR_BGR2Luv);
  5763. *
  5764. * If you use #cvtColor with 8-bit images, the conversion will have some information lost. For many
  5765. * applications, this will not be noticeable but it is recommended to use 32-bit images in applications
  5766. * that need the full range of colors or that convert an image before an operation and then convert
  5767. * back.
  5768. *
  5769. * If conversion adds the alpha channel, its value will set to the maximum of corresponding channel
  5770. * range: 255 for CV_8U, 65535 for CV_16U, 1 for CV_32F.
  5771. *
  5772. * @param src input image: 8-bit unsigned, 16-bit unsigned ( CV_16UC... ), or single-precision
  5773. * floating-point.
  5774. * @param dst output image of the same size and depth as src.
  5775. * @param code color space conversion code (see #ColorConversionCodes).
  5776. * @param dstCn number of channels in the destination image; if the parameter is 0, the number of the
  5777. * channels is derived automatically from src and code.
  5778. *
  5779. * @see `REF: imgproc_color_conversions`
  5780. */
  5781. + (void)cvtColor:(Mat*)src dst:(Mat*)dst code:(ColorConversionCodes)code dstCn:(int)dstCn NS_SWIFT_NAME(cvtColor(src:dst:code:dstCn:));
  5782. /**
  5783. * Converts an image from one color space to another.
  5784. *
  5785. * The function converts an input image from one color space to another. In case of a transformation
  5786. * to-from RGB color space, the order of the channels should be specified explicitly (RGB or BGR). Note
  5787. * that the default color format in OpenCV is often referred to as RGB but it is actually BGR (the
  5788. * bytes are reversed). So the first byte in a standard (24-bit) color image will be an 8-bit Blue
  5789. * component, the second byte will be Green, and the third byte will be Red. The fourth, fifth, and
  5790. * sixth bytes would then be the second pixel (Blue, then Green, then Red), and so on.
  5791. *
  5792. * The conventional ranges for R, G, and B channel values are:
  5793. * - 0 to 255 for CV_8U images
  5794. * - 0 to 65535 for CV_16U images
  5795. * - 0 to 1 for CV_32F images
  5796. *
  5797. * In case of linear transformations, the range does not matter. But in case of a non-linear
  5798. * transformation, an input RGB image should be normalized to the proper value range to get the correct
  5799. * results, for example, for RGB `$$\rightarrow$$` L\*u\*v\* transformation. For example, if you have a
  5800. * 32-bit floating-point image directly converted from an 8-bit image without any scaling, then it will
  5801. * have the 0..255 value range instead of 0..1 assumed by the function. So, before calling #cvtColor ,
  5802. * you need first to scale the image down:
  5803. *
  5804. * img *= 1./255;
  5805. * cvtColor(img, img, COLOR_BGR2Luv);
  5806. *
  5807. * If you use #cvtColor with 8-bit images, the conversion will have some information lost. For many
  5808. * applications, this will not be noticeable but it is recommended to use 32-bit images in applications
  5809. * that need the full range of colors or that convert an image before an operation and then convert
  5810. * back.
  5811. *
  5812. * If conversion adds the alpha channel, its value will set to the maximum of corresponding channel
  5813. * range: 255 for CV_8U, 65535 for CV_16U, 1 for CV_32F.
  5814. *
  5815. * @param src input image: 8-bit unsigned, 16-bit unsigned ( CV_16UC... ), or single-precision
  5816. * floating-point.
  5817. * @param dst output image of the same size and depth as src.
  5818. * @param code color space conversion code (see #ColorConversionCodes).
  5819. * channels is derived automatically from src and code.
  5820. *
  5821. * @see `REF: imgproc_color_conversions`
  5822. */
  5823. + (void)cvtColor:(Mat*)src dst:(Mat*)dst code:(ColorConversionCodes)code NS_SWIFT_NAME(cvtColor(src:dst:code:));
  5824. //
  5825. // void cv::cvtColorTwoPlane(Mat src1, Mat src2, Mat& dst, int code)
  5826. //
  5827. /**
  5828. * Converts an image from one color space to another where the source image is
  5829. * stored in two planes.
  5830. *
  5831. * This function only supports YUV420 to RGB conversion as of now.
  5832. *
  5833. * - #COLOR_YUV2BGR_NV12
  5834. * - #COLOR_YUV2RGB_NV12
  5835. * - #COLOR_YUV2BGRA_NV12
  5836. * - #COLOR_YUV2RGBA_NV12
  5837. * - #COLOR_YUV2BGR_NV21
  5838. * - #COLOR_YUV2RGB_NV21
  5839. * - #COLOR_YUV2BGRA_NV21
  5840. * - #COLOR_YUV2RGBA_NV21
  5841. */
  5842. + (void)cvtColorTwoPlane:(Mat*)src1 src2:(Mat*)src2 dst:(Mat*)dst code:(int)code NS_SWIFT_NAME(cvtColorTwoPlane(src1:src2:dst:code:));
  5843. //
  5844. // void cv::demosaicing(Mat src, Mat& dst, int code, int dstCn = 0)
  5845. //
  5846. /**
  5847. * main function for all demosaicing processes
  5848. *
  5849. * @param src input image: 8-bit unsigned or 16-bit unsigned.
  5850. * @param dst output image of the same size and depth as src.
  5851. * @param code Color space conversion code (see the description below).
  5852. * @param dstCn number of channels in the destination image; if the parameter is 0, the number of the
  5853. * channels is derived automatically from src and code.
  5854. *
  5855. * The function can do the following transformations:
  5856. *
  5857. * - Demosaicing using bilinear interpolation
  5858. *
  5859. * #COLOR_BayerBG2BGR , #COLOR_BayerGB2BGR , #COLOR_BayerRG2BGR , #COLOR_BayerGR2BGR
  5860. *
  5861. * #COLOR_BayerBG2GRAY , #COLOR_BayerGB2GRAY , #COLOR_BayerRG2GRAY , #COLOR_BayerGR2GRAY
  5862. *
  5863. * - Demosaicing using Variable Number of Gradients.
  5864. *
  5865. * #COLOR_BayerBG2BGR_VNG , #COLOR_BayerGB2BGR_VNG , #COLOR_BayerRG2BGR_VNG , #COLOR_BayerGR2BGR_VNG
  5866. *
  5867. * - Edge-Aware Demosaicing.
  5868. *
  5869. * #COLOR_BayerBG2BGR_EA , #COLOR_BayerGB2BGR_EA , #COLOR_BayerRG2BGR_EA , #COLOR_BayerGR2BGR_EA
  5870. *
  5871. * - Demosaicing with alpha channel
  5872. *
  5873. * #COLOR_BayerBG2BGRA , #COLOR_BayerGB2BGRA , #COLOR_BayerRG2BGRA , #COLOR_BayerGR2BGRA
  5874. *
  5875. * @see `+cvtColor:dst:code:dstCn:`
  5876. */
  5877. + (void)demosaicing:(Mat*)src dst:(Mat*)dst code:(int)code dstCn:(int)dstCn NS_SWIFT_NAME(demosaicing(src:dst:code:dstCn:));
  5878. /**
  5879. * main function for all demosaicing processes
  5880. *
  5881. * @param src input image: 8-bit unsigned or 16-bit unsigned.
  5882. * @param dst output image of the same size and depth as src.
  5883. * @param code Color space conversion code (see the description below).
  5884. * channels is derived automatically from src and code.
  5885. *
  5886. * The function can do the following transformations:
  5887. *
  5888. * - Demosaicing using bilinear interpolation
  5889. *
  5890. * #COLOR_BayerBG2BGR , #COLOR_BayerGB2BGR , #COLOR_BayerRG2BGR , #COLOR_BayerGR2BGR
  5891. *
  5892. * #COLOR_BayerBG2GRAY , #COLOR_BayerGB2GRAY , #COLOR_BayerRG2GRAY , #COLOR_BayerGR2GRAY
  5893. *
  5894. * - Demosaicing using Variable Number of Gradients.
  5895. *
  5896. * #COLOR_BayerBG2BGR_VNG , #COLOR_BayerGB2BGR_VNG , #COLOR_BayerRG2BGR_VNG , #COLOR_BayerGR2BGR_VNG
  5897. *
  5898. * - Edge-Aware Demosaicing.
  5899. *
  5900. * #COLOR_BayerBG2BGR_EA , #COLOR_BayerGB2BGR_EA , #COLOR_BayerRG2BGR_EA , #COLOR_BayerGR2BGR_EA
  5901. *
  5902. * - Demosaicing with alpha channel
  5903. *
  5904. * #COLOR_BayerBG2BGRA , #COLOR_BayerGB2BGRA , #COLOR_BayerRG2BGRA , #COLOR_BayerGR2BGRA
  5905. *
  5906. * @see `+cvtColor:dst:code:dstCn:`
  5907. */
  5908. + (void)demosaicing:(Mat*)src dst:(Mat*)dst code:(int)code NS_SWIFT_NAME(demosaicing(src:dst:code:));
  5909. //
  5910. // Moments cv::moments(Mat array, bool binaryImage = false)
  5911. //
  5912. /**
  5913. * Calculates all of the moments up to the third order of a polygon or rasterized shape.
  5914. *
  5915. * The function computes moments, up to the 3rd order, of a vector shape or a rasterized shape. The
  5916. * results are returned in the structure cv::Moments.
  5917. *
  5918. * @param array Raster image (single-channel, 8-bit or floating-point 2D array) or an array (
  5919. * `$$1 \times N$$` or `$$N \times 1$$` ) of 2D points (Point or Point2f ).
  5920. * @param binaryImage If it is true, all non-zero image pixels are treated as 1's. The parameter is
  5921. * used for images only.
  5922. * @return moments.
  5923. *
  5924. * NOTE: Only applicable to contour moments calculations from Python bindings: Note that the numpy
  5925. * type for the input array should be either np.int32 or np.float32.
  5926. *
  5927. * @see `+contourArea:oriented:`, `+arcLength:closed:`
  5928. */
  5929. + (Moments*)moments:(Mat*)array binaryImage:(BOOL)binaryImage NS_SWIFT_NAME(moments(array:binaryImage:));
  5930. /**
  5931. * Calculates all of the moments up to the third order of a polygon or rasterized shape.
  5932. *
  5933. * The function computes moments, up to the 3rd order, of a vector shape or a rasterized shape. The
  5934. * results are returned in the structure cv::Moments.
  5935. *
  5936. * @param array Raster image (single-channel, 8-bit or floating-point 2D array) or an array (
  5937. * `$$1 \times N$$` or `$$N \times 1$$` ) of 2D points (Point or Point2f ).
  5938. * used for images only.
  5939. * @return moments.
  5940. *
  5941. * NOTE: Only applicable to contour moments calculations from Python bindings: Note that the numpy
  5942. * type for the input array should be either np.int32 or np.float32.
  5943. *
  5944. * @see `+contourArea:oriented:`, `+arcLength:closed:`
  5945. */
  5946. + (Moments*)moments:(Mat*)array NS_SWIFT_NAME(moments(array:));
  5947. //
  5948. // void cv::HuMoments(Moments m, Mat& hu)
  5949. //
  5950. + (void)HuMoments:(Moments*)m hu:(Mat*)hu NS_SWIFT_NAME(HuMoments(m:hu:));
  5951. //
  5952. // void cv::matchTemplate(Mat image, Mat templ, Mat& result, TemplateMatchModes method, Mat mask = Mat())
  5953. //
  5954. /**
  5955. * Compares a template against overlapped image regions.
  5956. *
  5957. * The function slides through image , compares the overlapped patches of size `$$w \times h$$` against
  5958. * templ using the specified method and stores the comparison results in result . #TemplateMatchModes
  5959. * describes the formulae for the available comparison methods ( `$$I$$` denotes image, `$$T$$`
  5960. * template, `$$R$$` result, `$$M$$` the optional mask ). The summation is done over template and/or
  5961. * the image patch: `$$x' = 0...w-1, y' = 0...h-1$$`
  5962. *
  5963. * After the function finishes the comparison, the best matches can be found as global minimums (when
  5964. * #TM_SQDIFF was used) or maximums (when #TM_CCORR or #TM_CCOEFF was used) using the
  5965. * #minMaxLoc function. In case of a color image, template summation in the numerator and each sum in
  5966. * the denominator is done over all of the channels and separate mean values are used for each channel.
  5967. * That is, the function can take a color template and a color image. The result will still be a
  5968. * single-channel image, which is easier to analyze.
  5969. *
  5970. * @param image Image where the search is running. It must be 8-bit or 32-bit floating-point.
  5971. * @param templ Searched template. It must be not greater than the source image and have the same
  5972. * data type.
  5973. * @param result Map of comparison results. It must be single-channel 32-bit floating-point. If image
  5974. * is `$$W \times H$$` and templ is `$$w \times h$$` , then result is `$$(W-w+1) \times (H-h+1)$$` .
  5975. * @param method Parameter specifying the comparison method, see #TemplateMatchModes
  5976. * @param mask Optional mask. It must have the same size as templ. It must either have the same number
  5977. * of channels as template or only one channel, which is then used for all template and
  5978. * image channels. If the data type is #CV_8U, the mask is interpreted as a binary mask,
  5979. * meaning only elements where mask is nonzero are used and are kept unchanged independent
  5980. * of the actual mask value (weight equals 1). For data tpye #CV_32F, the mask values are
  5981. * used as weights. The exact formulas are documented in #TemplateMatchModes.
  5982. */
  5983. + (void)matchTemplate:(Mat*)image templ:(Mat*)templ result:(Mat*)result method:(TemplateMatchModes)method mask:(Mat*)mask NS_SWIFT_NAME(matchTemplate(image:templ:result:method:mask:));
  5984. /**
  5985. * Compares a template against overlapped image regions.
  5986. *
  5987. * The function slides through image , compares the overlapped patches of size `$$w \times h$$` against
  5988. * templ using the specified method and stores the comparison results in result . #TemplateMatchModes
  5989. * describes the formulae for the available comparison methods ( `$$I$$` denotes image, `$$T$$`
  5990. * template, `$$R$$` result, `$$M$$` the optional mask ). The summation is done over template and/or
  5991. * the image patch: `$$x' = 0...w-1, y' = 0...h-1$$`
  5992. *
  5993. * After the function finishes the comparison, the best matches can be found as global minimums (when
  5994. * #TM_SQDIFF was used) or maximums (when #TM_CCORR or #TM_CCOEFF was used) using the
  5995. * #minMaxLoc function. In case of a color image, template summation in the numerator and each sum in
  5996. * the denominator is done over all of the channels and separate mean values are used for each channel.
  5997. * That is, the function can take a color template and a color image. The result will still be a
  5998. * single-channel image, which is easier to analyze.
  5999. *
  6000. * @param image Image where the search is running. It must be 8-bit or 32-bit floating-point.
  6001. * @param templ Searched template. It must be not greater than the source image and have the same
  6002. * data type.
  6003. * @param result Map of comparison results. It must be single-channel 32-bit floating-point. If image
  6004. * is `$$W \times H$$` and templ is `$$w \times h$$` , then result is `$$(W-w+1) \times (H-h+1)$$` .
  6005. * @param method Parameter specifying the comparison method, see #TemplateMatchModes
  6006. * of channels as template or only one channel, which is then used for all template and
  6007. * image channels. If the data type is #CV_8U, the mask is interpreted as a binary mask,
  6008. * meaning only elements where mask is nonzero are used and are kept unchanged independent
  6009. * of the actual mask value (weight equals 1). For data tpye #CV_32F, the mask values are
  6010. * used as weights. The exact formulas are documented in #TemplateMatchModes.
  6011. */
  6012. + (void)matchTemplate:(Mat*)image templ:(Mat*)templ result:(Mat*)result method:(TemplateMatchModes)method NS_SWIFT_NAME(matchTemplate(image:templ:result:method:));
  6013. //
  6014. // int cv::connectedComponents(Mat image, Mat& labels, int connectivity, int ltype, int ccltype)
  6015. //
  6016. /**
  6017. * computes the connected components labeled image of boolean image
  6018. *
  6019. * image with 4 or 8 way connectivity - returns N, the total number of labels [0, N-1] where 0
  6020. * represents the background label. ltype specifies the output label image type, an important
  6021. * consideration based on the total number of labels or alternatively the total number of pixels in
  6022. * the source image. ccltype specifies the connected components labeling algorithm to use, currently
  6023. * Bolelli (Spaghetti) CITE: Bolelli2019, Grana (BBDT) CITE: Grana2010 and Wu's (SAUF) CITE: Wu2009 algorithms
  6024. * are supported, see the #ConnectedComponentsAlgorithmsTypes for details. Note that SAUF algorithm forces
  6025. * a row major ordering of labels while Spaghetti and BBDT do not.
  6026. * This function uses parallel version of the algorithms if at least one allowed
  6027. * parallel framework is enabled and if the rows of the image are at least twice the number returned by #getNumberOfCPUs.
  6028. *
  6029. * @param image the 8-bit single-channel image to be labeled
  6030. * @param labels destination labeled image
  6031. * @param connectivity 8 or 4 for 8-way or 4-way connectivity respectively
  6032. * @param ltype output image label type. Currently CV_32S and CV_16U are supported.
  6033. * @param ccltype connected components algorithm type (see the #ConnectedComponentsAlgorithmsTypes).
  6034. */
  6035. + (int)connectedComponentsWithAlgorithm:(Mat*)image labels:(Mat*)labels connectivity:(int)connectivity ltype:(int)ltype ccltype:(int)ccltype NS_SWIFT_NAME(connectedComponents(image:labels:connectivity:ltype:ccltype:));
  6036. //
  6037. // int cv::connectedComponents(Mat image, Mat& labels, int connectivity = 8, int ltype = CV_32S)
  6038. //
  6039. /**
  6040. *
  6041. *
  6042. * @param image the 8-bit single-channel image to be labeled
  6043. * @param labels destination labeled image
  6044. * @param connectivity 8 or 4 for 8-way or 4-way connectivity respectively
  6045. * @param ltype output image label type. Currently CV_32S and CV_16U are supported.
  6046. */
  6047. + (int)connectedComponents:(Mat*)image labels:(Mat*)labels connectivity:(int)connectivity ltype:(int)ltype NS_SWIFT_NAME(connectedComponents(image:labels:connectivity:ltype:));
  6048. /**
  6049. *
  6050. *
  6051. * @param image the 8-bit single-channel image to be labeled
  6052. * @param labels destination labeled image
  6053. * @param connectivity 8 or 4 for 8-way or 4-way connectivity respectively
  6054. */
  6055. + (int)connectedComponents:(Mat*)image labels:(Mat*)labels connectivity:(int)connectivity NS_SWIFT_NAME(connectedComponents(image:labels:connectivity:));
  6056. /**
  6057. *
  6058. *
  6059. * @param image the 8-bit single-channel image to be labeled
  6060. * @param labels destination labeled image
  6061. */
  6062. + (int)connectedComponents:(Mat*)image labels:(Mat*)labels NS_SWIFT_NAME(connectedComponents(image:labels:));
  6063. //
  6064. // int cv::connectedComponentsWithStats(Mat image, Mat& labels, Mat& stats, Mat& centroids, int connectivity, int ltype, ConnectedComponentsAlgorithmsTypes ccltype)
  6065. //
  6066. /**
  6067. * computes the connected components labeled image of boolean image and also produces a statistics output for each label
  6068. *
  6069. * image with 4 or 8 way connectivity - returns N, the total number of labels [0, N-1] where 0
  6070. * represents the background label. ltype specifies the output label image type, an important
  6071. * consideration based on the total number of labels or alternatively the total number of pixels in
  6072. * the source image. ccltype specifies the connected components labeling algorithm to use, currently
  6073. * Bolelli (Spaghetti) CITE: Bolelli2019, Grana (BBDT) CITE: Grana2010 and Wu's (SAUF) CITE: Wu2009 algorithms
  6074. * are supported, see the #ConnectedComponentsAlgorithmsTypes for details. Note that SAUF algorithm forces
  6075. * a row major ordering of labels while Spaghetti and BBDT do not.
  6076. * This function uses parallel version of the algorithms (statistics included) if at least one allowed
  6077. * parallel framework is enabled and if the rows of the image are at least twice the number returned by #getNumberOfCPUs.
  6078. *
  6079. * @param image the 8-bit single-channel image to be labeled
  6080. * @param labels destination labeled image
  6081. * @param stats statistics output for each label, including the background label.
  6082. * Statistics are accessed via stats(label, COLUMN) where COLUMN is one of
  6083. * #ConnectedComponentsTypes, selecting the statistic. The data type is CV_32S.
  6084. * @param centroids centroid output for each label, including the background label. Centroids are
  6085. * accessed via centroids(label, 0) for x and centroids(label, 1) for y. The data type CV_64F.
  6086. * @param connectivity 8 or 4 for 8-way or 4-way connectivity respectively
  6087. * @param ltype output image label type. Currently CV_32S and CV_16U are supported.
  6088. * @param ccltype connected components algorithm type (see #ConnectedComponentsAlgorithmsTypes).
  6089. */
  6090. + (int)connectedComponentsWithStatsWithAlgorithm:(Mat*)image labels:(Mat*)labels stats:(Mat*)stats centroids:(Mat*)centroids connectivity:(int)connectivity ltype:(int)ltype ccltype:(ConnectedComponentsAlgorithmsTypes)ccltype NS_SWIFT_NAME(connectedComponentsWithStats(image:labels:stats:centroids:connectivity:ltype:ccltype:));
  6091. //
  6092. // int cv::connectedComponentsWithStats(Mat image, Mat& labels, Mat& stats, Mat& centroids, int connectivity = 8, int ltype = CV_32S)
  6093. //
  6094. /**
  6095. *
  6096. * @param image the 8-bit single-channel image to be labeled
  6097. * @param labels destination labeled image
  6098. * @param stats statistics output for each label, including the background label.
  6099. * Statistics are accessed via stats(label, COLUMN) where COLUMN is one of
  6100. * #ConnectedComponentsTypes, selecting the statistic. The data type is CV_32S.
  6101. * @param centroids centroid output for each label, including the background label. Centroids are
  6102. * accessed via centroids(label, 0) for x and centroids(label, 1) for y. The data type CV_64F.
  6103. * @param connectivity 8 or 4 for 8-way or 4-way connectivity respectively
  6104. * @param ltype output image label type. Currently CV_32S and CV_16U are supported.
  6105. */
  6106. + (int)connectedComponentsWithStats:(Mat*)image labels:(Mat*)labels stats:(Mat*)stats centroids:(Mat*)centroids connectivity:(int)connectivity ltype:(int)ltype NS_SWIFT_NAME(connectedComponentsWithStats(image:labels:stats:centroids:connectivity:ltype:));
  6107. /**
  6108. *
  6109. * @param image the 8-bit single-channel image to be labeled
  6110. * @param labels destination labeled image
  6111. * @param stats statistics output for each label, including the background label.
  6112. * Statistics are accessed via stats(label, COLUMN) where COLUMN is one of
  6113. * #ConnectedComponentsTypes, selecting the statistic. The data type is CV_32S.
  6114. * @param centroids centroid output for each label, including the background label. Centroids are
  6115. * accessed via centroids(label, 0) for x and centroids(label, 1) for y. The data type CV_64F.
  6116. * @param connectivity 8 or 4 for 8-way or 4-way connectivity respectively
  6117. */
  6118. + (int)connectedComponentsWithStats:(Mat*)image labels:(Mat*)labels stats:(Mat*)stats centroids:(Mat*)centroids connectivity:(int)connectivity NS_SWIFT_NAME(connectedComponentsWithStats(image:labels:stats:centroids:connectivity:));
  6119. /**
  6120. *
  6121. * @param image the 8-bit single-channel image to be labeled
  6122. * @param labels destination labeled image
  6123. * @param stats statistics output for each label, including the background label.
  6124. * Statistics are accessed via stats(label, COLUMN) where COLUMN is one of
  6125. * #ConnectedComponentsTypes, selecting the statistic. The data type is CV_32S.
  6126. * @param centroids centroid output for each label, including the background label. Centroids are
  6127. * accessed via centroids(label, 0) for x and centroids(label, 1) for y. The data type CV_64F.
  6128. */
  6129. + (int)connectedComponentsWithStats:(Mat*)image labels:(Mat*)labels stats:(Mat*)stats centroids:(Mat*)centroids NS_SWIFT_NAME(connectedComponentsWithStats(image:labels:stats:centroids:));
  6130. //
  6131. // void cv::findContours(Mat image, vector_vector_Point& contours, Mat& hierarchy, RetrievalModes mode, ContourApproximationModes method, Point offset = Point())
  6132. //
  6133. /**
  6134. * Finds contours in a binary image.
  6135. *
  6136. * The function retrieves contours from the binary image using the algorithm CITE: Suzuki85 . The contours
  6137. * are a useful tool for shape analysis and object detection and recognition. See squares.cpp in the
  6138. * OpenCV sample directory.
  6139. * NOTE: Since opencv 3.2 source image is not modified by this function.
  6140. *
  6141. * @param image Source, an 8-bit single-channel image. Non-zero pixels are treated as 1's. Zero
  6142. * pixels remain 0's, so the image is treated as binary . You can use #compare, #inRange, #threshold ,
  6143. * #adaptiveThreshold, #Canny, and others to create a binary image out of a grayscale or color one.
  6144. * If mode equals to #RETR_CCOMP or #RETR_FLOODFILL, the input can also be a 32-bit integer image of labels (CV_32SC1).
  6145. * @param contours Detected contours. Each contour is stored as a vector of points (e.g.
  6146. * std::vector<std::vector<cv::Point> >).
  6147. * @param hierarchy Optional output vector (e.g. std::vector<cv::Vec4i>), containing information about the image topology. It has
  6148. * as many elements as the number of contours. For each i-th contour contours[i], the elements
  6149. * hierarchy[i][0] , hierarchy[i][1] , hierarchy[i][2] , and hierarchy[i][3] are set to 0-based indices
  6150. * in contours of the next and previous contours at the same hierarchical level, the first child
  6151. * contour and the parent contour, respectively. If for the contour i there are no next, previous,
  6152. * parent, or nested contours, the corresponding elements of hierarchy[i] will be negative.
  6153. * NOTE: In Python, hierarchy is nested inside a top level array. Use hierarchy[0][i] to access hierarchical elements of i-th contour.
  6154. * @param mode Contour retrieval mode, see #RetrievalModes
  6155. * @param method Contour approximation method, see #ContourApproximationModes
  6156. * @param offset Optional offset by which every contour point is shifted. This is useful if the
  6157. * contours are extracted from the image ROI and then they should be analyzed in the whole image
  6158. * context.
  6159. */
  6160. + (void)findContours:(Mat*)image contours:(NSMutableArray<NSMutableArray<Point2i*>*>*)contours hierarchy:(Mat*)hierarchy mode:(RetrievalModes)mode method:(ContourApproximationModes)method offset:(Point2i*)offset NS_SWIFT_NAME(findContours(image:contours:hierarchy:mode:method:offset:));
  6161. /**
  6162. * Finds contours in a binary image.
  6163. *
  6164. * The function retrieves contours from the binary image using the algorithm CITE: Suzuki85 . The contours
  6165. * are a useful tool for shape analysis and object detection and recognition. See squares.cpp in the
  6166. * OpenCV sample directory.
  6167. * NOTE: Since opencv 3.2 source image is not modified by this function.
  6168. *
  6169. * @param image Source, an 8-bit single-channel image. Non-zero pixels are treated as 1's. Zero
  6170. * pixels remain 0's, so the image is treated as binary . You can use #compare, #inRange, #threshold ,
  6171. * #adaptiveThreshold, #Canny, and others to create a binary image out of a grayscale or color one.
  6172. * If mode equals to #RETR_CCOMP or #RETR_FLOODFILL, the input can also be a 32-bit integer image of labels (CV_32SC1).
  6173. * @param contours Detected contours. Each contour is stored as a vector of points (e.g.
  6174. * std::vector<std::vector<cv::Point> >).
  6175. * @param hierarchy Optional output vector (e.g. std::vector<cv::Vec4i>), containing information about the image topology. It has
  6176. * as many elements as the number of contours. For each i-th contour contours[i], the elements
  6177. * hierarchy[i][0] , hierarchy[i][1] , hierarchy[i][2] , and hierarchy[i][3] are set to 0-based indices
  6178. * in contours of the next and previous contours at the same hierarchical level, the first child
  6179. * contour and the parent contour, respectively. If for the contour i there are no next, previous,
  6180. * parent, or nested contours, the corresponding elements of hierarchy[i] will be negative.
  6181. * NOTE: In Python, hierarchy is nested inside a top level array. Use hierarchy[0][i] to access hierarchical elements of i-th contour.
  6182. * @param mode Contour retrieval mode, see #RetrievalModes
  6183. * @param method Contour approximation method, see #ContourApproximationModes
  6184. * contours are extracted from the image ROI and then they should be analyzed in the whole image
  6185. * context.
  6186. */
  6187. + (void)findContours:(Mat*)image contours:(NSMutableArray<NSMutableArray<Point2i*>*>*)contours hierarchy:(Mat*)hierarchy mode:(RetrievalModes)mode method:(ContourApproximationModes)method NS_SWIFT_NAME(findContours(image:contours:hierarchy:mode:method:));
  6188. //
  6189. // void cv::approxPolyDP(vector_Point2f curve, vector_Point2f& approxCurve, double epsilon, bool closed)
  6190. //
  6191. /**
  6192. * Approximates a polygonal curve(s) with the specified precision.
  6193. *
  6194. * The function cv::approxPolyDP approximates a curve or a polygon with another curve/polygon with less
  6195. * vertices so that the distance between them is less or equal to the specified precision. It uses the
  6196. * Douglas-Peucker algorithm <http://en.wikipedia.org/wiki/Ramer-Douglas-Peucker_algorithm>
  6197. *
  6198. * @param curve Input vector of a 2D point stored in std::vector or Mat
  6199. * @param approxCurve Result of the approximation. The type should match the type of the input curve.
  6200. * @param epsilon Parameter specifying the approximation accuracy. This is the maximum distance
  6201. * between the original curve and its approximation.
  6202. * @param closed If true, the approximated curve is closed (its first and last vertices are
  6203. * connected). Otherwise, it is not closed.
  6204. */
  6205. + (void)approxPolyDP:(NSArray<Point2f*>*)curve approxCurve:(NSMutableArray<Point2f*>*)approxCurve epsilon:(double)epsilon closed:(BOOL)closed NS_SWIFT_NAME(approxPolyDP(curve:approxCurve:epsilon:closed:));
  6206. //
  6207. // double cv::arcLength(vector_Point2f curve, bool closed)
  6208. //
  6209. /**
  6210. * Calculates a contour perimeter or a curve length.
  6211. *
  6212. * The function computes a curve length or a closed contour perimeter.
  6213. *
  6214. * @param curve Input vector of 2D points, stored in std::vector or Mat.
  6215. * @param closed Flag indicating whether the curve is closed or not.
  6216. */
  6217. + (double)arcLength:(NSArray<Point2f*>*)curve closed:(BOOL)closed NS_SWIFT_NAME(arcLength(curve:closed:));
  6218. //
  6219. // Rect cv::boundingRect(Mat array)
  6220. //
  6221. /**
  6222. * Calculates the up-right bounding rectangle of a point set or non-zero pixels of gray-scale image.
  6223. *
  6224. * The function calculates and returns the minimal up-right bounding rectangle for the specified point set or
  6225. * non-zero pixels of gray-scale image.
  6226. *
  6227. * @param array Input gray-scale image or 2D point set, stored in std::vector or Mat.
  6228. */
  6229. + (Rect2i*)boundingRect:(Mat*)array NS_SWIFT_NAME(boundingRect(array:));
  6230. //
  6231. // double cv::contourArea(Mat contour, bool oriented = false)
  6232. //
  6233. /**
  6234. * Calculates a contour area.
  6235. *
  6236. * The function computes a contour area. Similarly to moments , the area is computed using the Green
  6237. * formula. Thus, the returned area and the number of non-zero pixels, if you draw the contour using
  6238. * #drawContours or #fillPoly , can be different. Also, the function will most certainly give a wrong
  6239. * results for contours with self-intersections.
  6240. *
  6241. * Example:
  6242. *
  6243. * vector<Point> contour;
  6244. * contour.push_back(Point2f(0, 0));
  6245. * contour.push_back(Point2f(10, 0));
  6246. * contour.push_back(Point2f(10, 10));
  6247. * contour.push_back(Point2f(5, 4));
  6248. *
  6249. * double area0 = contourArea(contour);
  6250. * vector<Point> approx;
  6251. * approxPolyDP(contour, approx, 5, true);
  6252. * double area1 = contourArea(approx);
  6253. *
  6254. * cout << "area0 =" << area0 << endl <<
  6255. * "area1 =" << area1 << endl <<
  6256. * "approx poly vertices" << approx.size() << endl;
  6257. *
  6258. * @param contour Input vector of 2D points (contour vertices), stored in std::vector or Mat.
  6259. * @param oriented Oriented area flag. If it is true, the function returns a signed area value,
  6260. * depending on the contour orientation (clockwise or counter-clockwise). Using this feature you can
  6261. * determine orientation of a contour by taking the sign of an area. By default, the parameter is
  6262. * false, which means that the absolute value is returned.
  6263. */
  6264. + (double)contourArea:(Mat*)contour oriented:(BOOL)oriented NS_SWIFT_NAME(contourArea(contour:oriented:));
  6265. /**
  6266. * Calculates a contour area.
  6267. *
  6268. * The function computes a contour area. Similarly to moments , the area is computed using the Green
  6269. * formula. Thus, the returned area and the number of non-zero pixels, if you draw the contour using
  6270. * #drawContours or #fillPoly , can be different. Also, the function will most certainly give a wrong
  6271. * results for contours with self-intersections.
  6272. *
  6273. * Example:
  6274. *
  6275. * vector<Point> contour;
  6276. * contour.push_back(Point2f(0, 0));
  6277. * contour.push_back(Point2f(10, 0));
  6278. * contour.push_back(Point2f(10, 10));
  6279. * contour.push_back(Point2f(5, 4));
  6280. *
  6281. * double area0 = contourArea(contour);
  6282. * vector<Point> approx;
  6283. * approxPolyDP(contour, approx, 5, true);
  6284. * double area1 = contourArea(approx);
  6285. *
  6286. * cout << "area0 =" << area0 << endl <<
  6287. * "area1 =" << area1 << endl <<
  6288. * "approx poly vertices" << approx.size() << endl;
  6289. *
  6290. * @param contour Input vector of 2D points (contour vertices), stored in std::vector or Mat.
  6291. * depending on the contour orientation (clockwise or counter-clockwise). Using this feature you can
  6292. * determine orientation of a contour by taking the sign of an area. By default, the parameter is
  6293. * false, which means that the absolute value is returned.
  6294. */
  6295. + (double)contourArea:(Mat*)contour NS_SWIFT_NAME(contourArea(contour:));
  6296. //
  6297. // RotatedRect cv::minAreaRect(vector_Point2f points)
  6298. //
  6299. /**
  6300. * Finds a rotated rectangle of the minimum area enclosing the input 2D point set.
  6301. *
  6302. * The function calculates and returns the minimum-area bounding rectangle (possibly rotated) for a
  6303. * specified point set. Developer should keep in mind that the returned RotatedRect can contain negative
  6304. * indices when data is close to the containing Mat element boundary.
  6305. *
  6306. * @param points Input vector of 2D points, stored in std::vector\<\> or Mat
  6307. */
  6308. + (RotatedRect*)minAreaRect:(NSArray<Point2f*>*)points NS_SWIFT_NAME(minAreaRect(points:));
  6309. //
  6310. // void cv::boxPoints(RotatedRect box, Mat& points)
  6311. //
  6312. /**
  6313. * Finds the four vertices of a rotated rect. Useful to draw the rotated rectangle.
  6314. *
  6315. * The function finds the four vertices of a rotated rectangle. This function is useful to draw the
  6316. * rectangle. In C++, instead of using this function, you can directly use RotatedRect::points method. Please
  6317. * visit the REF: tutorial_bounding_rotated_ellipses "tutorial on Creating Bounding rotated boxes and ellipses for contours" for more information.
  6318. *
  6319. * @param box The input rotated rectangle. It may be the output of REF: minAreaRect.
  6320. * @param points The output array of four vertices of rectangles.
  6321. */
  6322. + (void)boxPoints:(RotatedRect*)box points:(Mat*)points NS_SWIFT_NAME(boxPoints(box:points:));
  6323. //
  6324. // void cv::minEnclosingCircle(vector_Point2f points, Point2f& center, float& radius)
  6325. //
  6326. /**
  6327. * Finds a circle of the minimum area enclosing a 2D point set.
  6328. *
  6329. * The function finds the minimal enclosing circle of a 2D point set using an iterative algorithm.
  6330. *
  6331. * @param points Input vector of 2D points, stored in std::vector\<\> or Mat
  6332. * @param center Output center of the circle.
  6333. * @param radius Output radius of the circle.
  6334. */
  6335. + (void)minEnclosingCircle:(NSArray<Point2f*>*)points center:(Point2f*)center radius:(float*)radius NS_SWIFT_NAME(minEnclosingCircle(points:center:radius:));
  6336. //
  6337. // double cv::minEnclosingTriangle(Mat points, Mat& triangle)
  6338. //
  6339. /**
  6340. * Finds a triangle of minimum area enclosing a 2D point set and returns its area.
  6341. *
  6342. * The function finds a triangle of minimum area enclosing the given set of 2D points and returns its
  6343. * area. The output for a given 2D point set is shown in the image below. 2D points are depicted in
  6344. * red* and the enclosing triangle in *yellow*.
  6345. *
  6346. * ![Sample output of the minimum enclosing triangle function](pics/minenclosingtriangle.png)
  6347. *
  6348. * The implementation of the algorithm is based on O'Rourke's CITE: ORourke86 and Klee and Laskowski's
  6349. * CITE: KleeLaskowski85 papers. O'Rourke provides a `$$\theta(n)$$` algorithm for finding the minimal
  6350. * enclosing triangle of a 2D convex polygon with n vertices. Since the #minEnclosingTriangle function
  6351. * takes a 2D point set as input an additional preprocessing step of computing the convex hull of the
  6352. * 2D point set is required. The complexity of the #convexHull function is `$$O(n log(n))$$` which is higher
  6353. * than `$$\theta(n)$$`. Thus the overall complexity of the function is `$$O(n log(n))$$`.
  6354. *
  6355. * @param points Input vector of 2D points with depth CV_32S or CV_32F, stored in std::vector\<\> or Mat
  6356. * @param triangle Output vector of three 2D points defining the vertices of the triangle. The depth
  6357. * of the OutputArray must be CV_32F.
  6358. */
  6359. + (double)minEnclosingTriangle:(Mat*)points triangle:(Mat*)triangle NS_SWIFT_NAME(minEnclosingTriangle(points:triangle:));
  6360. //
  6361. // double cv::matchShapes(Mat contour1, Mat contour2, ShapeMatchModes method, double parameter)
  6362. //
  6363. /**
  6364. * Compares two shapes.
  6365. *
  6366. * The function compares two shapes. All three implemented methods use the Hu invariants (see #HuMoments)
  6367. *
  6368. * @param contour1 First contour or grayscale image.
  6369. * @param contour2 Second contour or grayscale image.
  6370. * @param method Comparison method, see #ShapeMatchModes
  6371. * @param parameter Method-specific parameter (not supported now).
  6372. */
  6373. + (double)matchShapes:(Mat*)contour1 contour2:(Mat*)contour2 method:(ShapeMatchModes)method parameter:(double)parameter NS_SWIFT_NAME(matchShapes(contour1:contour2:method:parameter:));
  6374. //
  6375. // void cv::convexHull(vector_Point points, vector_int& hull, bool clockwise = false, _hidden_ returnPoints = true)
  6376. //
  6377. /**
  6378. * Finds the convex hull of a point set.
  6379. *
  6380. * The function cv::convexHull finds the convex hull of a 2D point set using the Sklansky's algorithm CITE: Sklansky82
  6381. * that has *O(N logN)* complexity in the current implementation.
  6382. *
  6383. * @param points Input 2D point set, stored in std::vector or Mat.
  6384. * @param hull Output convex hull. It is either an integer vector of indices or vector of points. In
  6385. * the first case, the hull elements are 0-based indices of the convex hull points in the original
  6386. * array (since the set of convex hull points is a subset of the original point set). In the second
  6387. * case, hull elements are the convex hull points themselves.
  6388. * @param clockwise Orientation flag. If it is true, the output convex hull is oriented clockwise.
  6389. * Otherwise, it is oriented counter-clockwise. The assumed coordinate system has its X axis pointing
  6390. * to the right, and its Y axis pointing upwards.
  6391. * @param returnPoints Operation flag. In case of a matrix, when the flag is true, the function
  6392. * returns convex hull points. Otherwise, it returns indices of the convex hull points. When the
  6393. * output array is std::vector, the flag is ignored, and the output depends on the type of the
  6394. * vector: std::vector\<int\> implies returnPoints=false, std::vector\<Point\> implies
  6395. * returnPoints=true.
  6396. *
  6397. * NOTE: `points` and `hull` should be different arrays, inplace processing isn't supported.
  6398. *
  6399. * Check REF: tutorial_hull "the corresponding tutorial" for more details.
  6400. *
  6401. * useful links:
  6402. *
  6403. * https://www.learnopencv.com/convex-hull-using-opencv-in-python-and-c/
  6404. */
  6405. + (void)convexHull:(NSArray<Point2i*>*)points hull:(IntVector*)hull clockwise:(BOOL)clockwise NS_SWIFT_NAME(convexHull(points:hull:clockwise:));
  6406. /**
  6407. * Finds the convex hull of a point set.
  6408. *
  6409. * The function cv::convexHull finds the convex hull of a 2D point set using the Sklansky's algorithm CITE: Sklansky82
  6410. * that has *O(N logN)* complexity in the current implementation.
  6411. *
  6412. * @param points Input 2D point set, stored in std::vector or Mat.
  6413. * @param hull Output convex hull. It is either an integer vector of indices or vector of points. In
  6414. * the first case, the hull elements are 0-based indices of the convex hull points in the original
  6415. * array (since the set of convex hull points is a subset of the original point set). In the second
  6416. * case, hull elements are the convex hull points themselves.
  6417. * Otherwise, it is oriented counter-clockwise. The assumed coordinate system has its X axis pointing
  6418. * to the right, and its Y axis pointing upwards.
  6419. * returns convex hull points. Otherwise, it returns indices of the convex hull points. When the
  6420. * output array is std::vector, the flag is ignored, and the output depends on the type of the
  6421. * vector: std::vector\<int\> implies returnPoints=false, std::vector\<Point\> implies
  6422. * returnPoints=true.
  6423. *
  6424. * NOTE: `points` and `hull` should be different arrays, inplace processing isn't supported.
  6425. *
  6426. * Check REF: tutorial_hull "the corresponding tutorial" for more details.
  6427. *
  6428. * useful links:
  6429. *
  6430. * https://www.learnopencv.com/convex-hull-using-opencv-in-python-and-c/
  6431. */
  6432. + (void)convexHull:(NSArray<Point2i*>*)points hull:(IntVector*)hull NS_SWIFT_NAME(convexHull(points:hull:));
  6433. //
  6434. // void cv::convexityDefects(vector_Point contour, vector_int convexhull, vector_Vec4i& convexityDefects)
  6435. //
  6436. /**
  6437. * Finds the convexity defects of a contour.
  6438. *
  6439. * The figure below displays convexity defects of a hand contour:
  6440. *
  6441. * ![image](pics/defects.png)
  6442. *
  6443. * @param contour Input contour.
  6444. * @param convexhull Convex hull obtained using convexHull that should contain indices of the contour
  6445. * points that make the hull.
  6446. * @param convexityDefects The output vector of convexity defects. In C++ and the new Python/Java
  6447. * interface each convexity defect is represented as 4-element integer vector (a.k.a. #Vec4i):
  6448. * (start_index, end_index, farthest_pt_index, fixpt_depth), where indices are 0-based indices
  6449. * in the original contour of the convexity defect beginning, end and the farthest point, and
  6450. * fixpt_depth is fixed-point approximation (with 8 fractional bits) of the distance between the
  6451. * farthest contour point and the hull. That is, to get the floating-point value of the depth will be
  6452. * fixpt_depth/256.0.
  6453. */
  6454. + (void)convexityDefects:(NSArray<Point2i*>*)contour convexhull:(IntVector*)convexhull convexityDefects:(NSMutableArray<Int4*>*)convexityDefects NS_SWIFT_NAME(convexityDefects(contour:convexhull:convexityDefects:));
  6455. //
  6456. // bool cv::isContourConvex(vector_Point contour)
  6457. //
  6458. /**
  6459. * Tests a contour convexity.
  6460. *
  6461. * The function tests whether the input contour is convex or not. The contour must be simple, that is,
  6462. * without self-intersections. Otherwise, the function output is undefined.
  6463. *
  6464. * @param contour Input vector of 2D points, stored in std::vector\<\> or Mat
  6465. */
  6466. + (BOOL)isContourConvex:(NSArray<Point2i*>*)contour NS_SWIFT_NAME(isContourConvex(contour:));
  6467. //
  6468. // float cv::intersectConvexConvex(Mat p1, Mat p2, Mat& p12, bool handleNested = true)
  6469. //
  6470. /**
  6471. * Finds intersection of two convex polygons
  6472. *
  6473. * @param p1 First polygon
  6474. * @param p2 Second polygon
  6475. * @param p12 Output polygon describing the intersecting area
  6476. * @param handleNested When true, an intersection is found if one of the polygons is fully enclosed in the other.
  6477. * When false, no intersection is found. If the polygons share a side or the vertex of one polygon lies on an edge
  6478. * of the other, they are not considered nested and an intersection will be found regardless of the value of handleNested.
  6479. *
  6480. * @return Absolute value of area of intersecting polygon
  6481. *
  6482. * NOTE: intersectConvexConvex doesn't confirm that both polygons are convex and will return invalid results if they aren't.
  6483. */
  6484. + (float)intersectConvexConvex:(Mat*)p1 p2:(Mat*)p2 p12:(Mat*)p12 handleNested:(BOOL)handleNested NS_SWIFT_NAME(intersectConvexConvex(p1:p2:p12:handleNested:));
  6485. /**
  6486. * Finds intersection of two convex polygons
  6487. *
  6488. * @param p1 First polygon
  6489. * @param p2 Second polygon
  6490. * @param p12 Output polygon describing the intersecting area
  6491. * When false, no intersection is found. If the polygons share a side or the vertex of one polygon lies on an edge
  6492. * of the other, they are not considered nested and an intersection will be found regardless of the value of handleNested.
  6493. *
  6494. * @return Absolute value of area of intersecting polygon
  6495. *
  6496. * NOTE: intersectConvexConvex doesn't confirm that both polygons are convex and will return invalid results if they aren't.
  6497. */
  6498. + (float)intersectConvexConvex:(Mat*)p1 p2:(Mat*)p2 p12:(Mat*)p12 NS_SWIFT_NAME(intersectConvexConvex(p1:p2:p12:));
  6499. //
  6500. // RotatedRect cv::fitEllipse(vector_Point2f points)
  6501. //
  6502. /**
  6503. * Fits an ellipse around a set of 2D points.
  6504. *
  6505. * The function calculates the ellipse that fits (in a least-squares sense) a set of 2D points best of
  6506. * all. It returns the rotated rectangle in which the ellipse is inscribed. The first algorithm described by CITE: Fitzgibbon95
  6507. * is used. Developer should keep in mind that it is possible that the returned
  6508. * ellipse/rotatedRect data contains negative indices, due to the data points being close to the
  6509. * border of the containing Mat element.
  6510. *
  6511. * @param points Input 2D point set, stored in std::vector\<\> or Mat
  6512. */
  6513. + (RotatedRect*)fitEllipse:(NSArray<Point2f*>*)points NS_SWIFT_NAME(fitEllipse(points:));
  6514. //
  6515. // RotatedRect cv::fitEllipseAMS(Mat points)
  6516. //
  6517. /**
  6518. * Fits an ellipse around a set of 2D points.
  6519. *
  6520. * The function calculates the ellipse that fits a set of 2D points.
  6521. * It returns the rotated rectangle in which the ellipse is inscribed.
  6522. * The Approximate Mean Square (AMS) proposed by CITE: Taubin1991 is used.
  6523. *
  6524. * For an ellipse, this basis set is `$$ \chi= \left(x^2, x y, y^2, x, y, 1\right) $$`,
  6525. * which is a set of six free coefficients `$$ A^T=\left\{A_{\text{xx}},A_{\text{xy}},A_{\text{yy}},A_x,A_y,A_0\right\} $$`.
  6526. * However, to specify an ellipse, all that is needed is five numbers; the major and minor axes lengths `$$ (a,b) $$`,
  6527. * the position `$$ (x_0,y_0) $$`, and the orientation `$$ \theta $$`. This is because the basis set includes lines,
  6528. * quadratics, parabolic and hyperbolic functions as well as elliptical functions as possible fits.
  6529. * If the fit is found to be a parabolic or hyperbolic function then the standard #fitEllipse method is used.
  6530. * The AMS method restricts the fit to parabolic, hyperbolic and elliptical curves
  6531. * by imposing the condition that `$$ A^T ( D_x^T D_x + D_y^T D_y) A = 1 $$` where
  6532. * the matrices `$$ Dx $$` and `$$ Dy $$` are the partial derivatives of the design matrix `$$ D $$` with
  6533. * respect to x and y. The matrices are formed row by row applying the following to
  6534. * each of the points in the set:
  6535. * `$$\begin{aligned}
  6536. * D(i,:)&=\left\{x_i^2, x_i y_i, y_i^2, x_i, y_i, 1\right\} &
  6537. * D_x(i,:)&=\left\{2 x_i,y_i,0,1,0,0\right\} &
  6538. * D_y(i,:)&=\left\{0,x_i,2 y_i,0,1,0\right\}
  6539. * \end{aligned}$$`
  6540. * The AMS method minimizes the cost function
  6541. * `$$\begin{aligned}
  6542. * \epsilon ^2=\frac{ A^T D^T D A }{ A^T (D_x^T D_x + D_y^T D_y) A^T }
  6543. * \end{aligned}$$`
  6544. *
  6545. * The minimum cost is found by solving the generalized eigenvalue problem.
  6546. *
  6547. * `$$\begin{aligned}
  6548. * D^T D A = \lambda \left( D_x^T D_x + D_y^T D_y\right) A
  6549. * \end{aligned}$$`
  6550. *
  6551. * @param points Input 2D point set, stored in std::vector\<\> or Mat
  6552. */
  6553. + (RotatedRect*)fitEllipseAMS:(Mat*)points NS_SWIFT_NAME(fitEllipseAMS(points:));
  6554. //
  6555. // RotatedRect cv::fitEllipseDirect(Mat points)
  6556. //
  6557. /**
  6558. * Fits an ellipse around a set of 2D points.
  6559. *
  6560. * The function calculates the ellipse that fits a set of 2D points.
  6561. * It returns the rotated rectangle in which the ellipse is inscribed.
  6562. * The Direct least square (Direct) method by CITE: Fitzgibbon1999 is used.
  6563. *
  6564. * For an ellipse, this basis set is `$$ \chi= \left(x^2, x y, y^2, x, y, 1\right) $$`,
  6565. * which is a set of six free coefficients `$$ A^T=\left\{A_{\text{xx}},A_{\text{xy}},A_{\text{yy}},A_x,A_y,A_0\right\} $$`.
  6566. * However, to specify an ellipse, all that is needed is five numbers; the major and minor axes lengths `$$ (a,b) $$`,
  6567. * the position `$$ (x_0,y_0) $$`, and the orientation `$$ \theta $$`. This is because the basis set includes lines,
  6568. * quadratics, parabolic and hyperbolic functions as well as elliptical functions as possible fits.
  6569. * The Direct method confines the fit to ellipses by ensuring that `$$ 4 A_{xx} A_{yy}- A_{xy}^2 > 0 $$`.
  6570. * The condition imposed is that `$$ 4 A_{xx} A_{yy}- A_{xy}^2=1 $$` which satisfies the inequality
  6571. * and as the coefficients can be arbitrarily scaled is not overly restrictive.
  6572. *
  6573. * `$$\begin{aligned}
  6574. * \epsilon ^2= A^T D^T D A \quad \text{with} \quad A^T C A =1 \quad \text{and} \quad C=\left(\begin{matrix}
  6575. * 0 & 0 & 2 & 0 & 0 & 0 \\
  6576. * 0 & -1 & 0 & 0 & 0 & 0 \\
  6577. * 2 & 0 & 0 & 0 & 0 & 0 \\
  6578. * 0 & 0 & 0 & 0 & 0 & 0 \\
  6579. * 0 & 0 & 0 & 0 & 0 & 0 \\
  6580. * 0 & 0 & 0 & 0 & 0 & 0
  6581. * \end{matrix} \right)
  6582. * \end{aligned}$$`
  6583. *
  6584. * The minimum cost is found by solving the generalized eigenvalue problem.
  6585. *
  6586. * `$$\begin{aligned}
  6587. * D^T D A = \lambda \left( C\right) A
  6588. * \end{aligned}$$`
  6589. *
  6590. * The system produces only one positive eigenvalue `$$ \lambda$$` which is chosen as the solution
  6591. * with its eigenvector `$$\mathbf{u}$$`. These are used to find the coefficients
  6592. *
  6593. * `$$\begin{aligned}
  6594. * A = \sqrt{\frac{1}{\mathbf{u}^T C \mathbf{u}}} \mathbf{u}
  6595. * \end{aligned}$$`
  6596. * The scaling factor guarantees that `$$A^T C A =1$$`.
  6597. *
  6598. * @param points Input 2D point set, stored in std::vector\<\> or Mat
  6599. */
  6600. + (RotatedRect*)fitEllipseDirect:(Mat*)points NS_SWIFT_NAME(fitEllipseDirect(points:));
  6601. //
  6602. // void cv::fitLine(Mat points, Mat& line, DistanceTypes distType, double param, double reps, double aeps)
  6603. //
  6604. /**
  6605. * Fits a line to a 2D or 3D point set.
  6606. *
  6607. * The function fitLine fits a line to a 2D or 3D point set by minimizing `$$\sum_i \rho(r_i)$$` where
  6608. * `$$r_i$$` is a distance between the `$$i^{th}$$` point, the line and `$$\rho(r)$$` is a distance function, one
  6609. * of the following:
  6610. * - DIST_L2
  6611. * `$$\rho (r) = r^2/2 \quad \text{(the simplest and the fastest least-squares method)}$$`
  6612. * - DIST_L1
  6613. * `$$\rho (r) = r$$`
  6614. * - DIST_L12
  6615. * `$$\rho (r) = 2 \cdot ( \sqrt{1 + \frac{r^2}{2}} - 1)$$`
  6616. * - DIST_FAIR
  6617. * `$$\rho \left (r \right ) = C^2 \cdot \left ( \frac{r}{C} - \log{\left(1 + \frac{r}{C}\right)} \right ) \quad \text{where} \quad C=1.3998$$`
  6618. * - DIST_WELSCH
  6619. * `$$\rho \left (r \right ) = \frac{C^2}{2} \cdot \left ( 1 - \exp{\left(-\left(\frac{r}{C}\right)^2\right)} \right ) \quad \text{where} \quad C=2.9846$$`
  6620. * - DIST_HUBER
  6621. * `$$\newcommand{\fork}[4]{ \left\{ \begin{array}{l l} #1 & \text{#2}\\\\ #3 & \text{#4}\\\\ \end{array} \right.} \rho (r) = \fork{r^2/2}{if \(r < C\)}{C \cdot (r-C/2)}{otherwise} \quad \text{where} \quad C=1.345$$`
  6622. *
  6623. * The algorithm is based on the M-estimator ( <http://en.wikipedia.org/wiki/M-estimator> ) technique
  6624. * that iteratively fits the line using the weighted least-squares algorithm. After each iteration the
  6625. * weights `$$w_i$$` are adjusted to be inversely proportional to `$$\rho(r_i)$$` .
  6626. *
  6627. * @param points Input vector of 2D or 3D points, stored in std::vector\<\> or Mat.
  6628. * @param line Output line parameters. In case of 2D fitting, it should be a vector of 4 elements
  6629. * (like Vec4f) - (vx, vy, x0, y0), where (vx, vy) is a normalized vector collinear to the line and
  6630. * (x0, y0) is a point on the line. In case of 3D fitting, it should be a vector of 6 elements (like
  6631. * Vec6f) - (vx, vy, vz, x0, y0, z0), where (vx, vy, vz) is a normalized vector collinear to the line
  6632. * and (x0, y0, z0) is a point on the line.
  6633. * @param distType Distance used by the M-estimator, see #DistanceTypes
  6634. * @param param Numerical parameter ( C ) for some types of distances. If it is 0, an optimal value
  6635. * is chosen.
  6636. * @param reps Sufficient accuracy for the radius (distance between the coordinate origin and the line).
  6637. * @param aeps Sufficient accuracy for the angle. 0.01 would be a good default value for reps and aeps.
  6638. */
  6639. + (void)fitLine:(Mat*)points line:(Mat*)line distType:(DistanceTypes)distType param:(double)param reps:(double)reps aeps:(double)aeps NS_SWIFT_NAME(fitLine(points:line:distType:param:reps:aeps:));
  6640. //
  6641. // double cv::pointPolygonTest(vector_Point2f contour, Point2f pt, bool measureDist)
  6642. //
  6643. /**
  6644. * Performs a point-in-contour test.
  6645. *
  6646. * The function determines whether the point is inside a contour, outside, or lies on an edge (or
  6647. * coincides with a vertex). It returns positive (inside), negative (outside), or zero (on an edge)
  6648. * value, correspondingly. When measureDist=false , the return value is +1, -1, and 0, respectively.
  6649. * Otherwise, the return value is a signed distance between the point and the nearest contour edge.
  6650. *
  6651. * See below a sample output of the function where each image pixel is tested against the contour:
  6652. *
  6653. * ![sample output](pics/pointpolygon.png)
  6654. *
  6655. * @param contour Input contour.
  6656. * @param pt Point tested against the contour.
  6657. * @param measureDist If true, the function estimates the signed distance from the point to the
  6658. * nearest contour edge. Otherwise, the function only checks if the point is inside a contour or not.
  6659. */
  6660. + (double)pointPolygonTest:(NSArray<Point2f*>*)contour pt:(Point2f*)pt measureDist:(BOOL)measureDist NS_SWIFT_NAME(pointPolygonTest(contour:pt:measureDist:));
  6661. //
  6662. // int cv::rotatedRectangleIntersection(RotatedRect rect1, RotatedRect rect2, Mat& intersectingRegion)
  6663. //
  6664. /**
  6665. * Finds out if there is any intersection between two rotated rectangles.
  6666. *
  6667. * If there is then the vertices of the intersecting region are returned as well.
  6668. *
  6669. * Below are some examples of intersection configurations. The hatched pattern indicates the
  6670. * intersecting region and the red vertices are returned by the function.
  6671. *
  6672. * ![intersection examples](pics/intersection.png)
  6673. *
  6674. * @param rect1 First rectangle
  6675. * @param rect2 Second rectangle
  6676. * @param intersectingRegion The output array of the vertices of the intersecting region. It returns
  6677. * at most 8 vertices. Stored as std::vector\<cv::Point2f\> or cv::Mat as Mx1 of type CV_32FC2.
  6678. * @return One of #RectanglesIntersectTypes
  6679. */
  6680. + (int)rotatedRectangleIntersection:(RotatedRect*)rect1 rect2:(RotatedRect*)rect2 intersectingRegion:(Mat*)intersectingRegion NS_SWIFT_NAME(rotatedRectangleIntersection(rect1:rect2:intersectingRegion:));
  6681. //
  6682. // Ptr_GeneralizedHoughBallard cv::createGeneralizedHoughBallard()
  6683. //
  6684. /**
  6685. * Creates a smart pointer to a cv::GeneralizedHoughBallard class and initializes it.
  6686. */
  6687. + (GeneralizedHoughBallard*)createGeneralizedHoughBallard NS_SWIFT_NAME(createGeneralizedHoughBallard());
  6688. //
  6689. // Ptr_GeneralizedHoughGuil cv::createGeneralizedHoughGuil()
  6690. //
  6691. /**
  6692. * Creates a smart pointer to a cv::GeneralizedHoughGuil class and initializes it.
  6693. */
  6694. + (GeneralizedHoughGuil*)createGeneralizedHoughGuil NS_SWIFT_NAME(createGeneralizedHoughGuil());
  6695. //
  6696. // void cv::applyColorMap(Mat src, Mat& dst, ColormapTypes colormap)
  6697. //
  6698. /**
  6699. * Applies a GNU Octave/MATLAB equivalent colormap on a given image.
  6700. *
  6701. * @param src The source image, grayscale or colored of type CV_8UC1 or CV_8UC3.
  6702. * @param dst The result is the colormapped source image. Note: Mat::create is called on dst.
  6703. * @param colormap The colormap to apply, see #ColormapTypes
  6704. */
  6705. + (void)applyColorMap:(Mat*)src dst:(Mat*)dst colormap:(ColormapTypes)colormap NS_SWIFT_NAME(applyColorMap(src:dst:colormap:));
  6706. //
  6707. // void cv::applyColorMap(Mat src, Mat& dst, Mat userColor)
  6708. //
  6709. /**
  6710. * Applies a user colormap on a given image.
  6711. *
  6712. * @param src The source image, grayscale or colored of type CV_8UC1 or CV_8UC3.
  6713. * @param dst The result is the colormapped source image. Note: Mat::create is called on dst.
  6714. * @param userColor The colormap to apply of type CV_8UC1 or CV_8UC3 and size 256
  6715. */
  6716. + (void)applyColorMap:(Mat*)src dst:(Mat*)dst userColor:(Mat*)userColor NS_SWIFT_NAME(applyColorMap(src:dst:userColor:));
  6717. //
  6718. // void cv::line(Mat& img, Point pt1, Point pt2, Scalar color, int thickness = 1, LineTypes lineType = LINE_8, int shift = 0)
  6719. //
  6720. /**
  6721. * Draws a line segment connecting two points.
  6722. *
  6723. * The function line draws the line segment between pt1 and pt2 points in the image. The line is
  6724. * clipped by the image boundaries. For non-antialiased lines with integer coordinates, the 8-connected
  6725. * or 4-connected Bresenham algorithm is used. Thick lines are drawn with rounding endings. Antialiased
  6726. * lines are drawn using Gaussian filtering.
  6727. *
  6728. * @param img Image.
  6729. * @param pt1 First point of the line segment.
  6730. * @param pt2 Second point of the line segment.
  6731. * @param color Line color.
  6732. * @param thickness Line thickness.
  6733. * @param lineType Type of the line. See #LineTypes.
  6734. * @param shift Number of fractional bits in the point coordinates.
  6735. */
  6736. + (void)line:(Mat*)img pt1:(Point2i*)pt1 pt2:(Point2i*)pt2 color:(Scalar*)color thickness:(int)thickness lineType:(LineTypes)lineType shift:(int)shift NS_SWIFT_NAME(line(img:pt1:pt2:color:thickness:lineType:shift:));
  6737. /**
  6738. * Draws a line segment connecting two points.
  6739. *
  6740. * The function line draws the line segment between pt1 and pt2 points in the image. The line is
  6741. * clipped by the image boundaries. For non-antialiased lines with integer coordinates, the 8-connected
  6742. * or 4-connected Bresenham algorithm is used. Thick lines are drawn with rounding endings. Antialiased
  6743. * lines are drawn using Gaussian filtering.
  6744. *
  6745. * @param img Image.
  6746. * @param pt1 First point of the line segment.
  6747. * @param pt2 Second point of the line segment.
  6748. * @param color Line color.
  6749. * @param thickness Line thickness.
  6750. * @param lineType Type of the line. See #LineTypes.
  6751. */
  6752. + (void)line:(Mat*)img pt1:(Point2i*)pt1 pt2:(Point2i*)pt2 color:(Scalar*)color thickness:(int)thickness lineType:(LineTypes)lineType NS_SWIFT_NAME(line(img:pt1:pt2:color:thickness:lineType:));
  6753. /**
  6754. * Draws a line segment connecting two points.
  6755. *
  6756. * The function line draws the line segment between pt1 and pt2 points in the image. The line is
  6757. * clipped by the image boundaries. For non-antialiased lines with integer coordinates, the 8-connected
  6758. * or 4-connected Bresenham algorithm is used. Thick lines are drawn with rounding endings. Antialiased
  6759. * lines are drawn using Gaussian filtering.
  6760. *
  6761. * @param img Image.
  6762. * @param pt1 First point of the line segment.
  6763. * @param pt2 Second point of the line segment.
  6764. * @param color Line color.
  6765. * @param thickness Line thickness.
  6766. */
  6767. + (void)line:(Mat*)img pt1:(Point2i*)pt1 pt2:(Point2i*)pt2 color:(Scalar*)color thickness:(int)thickness NS_SWIFT_NAME(line(img:pt1:pt2:color:thickness:));
  6768. /**
  6769. * Draws a line segment connecting two points.
  6770. *
  6771. * The function line draws the line segment between pt1 and pt2 points in the image. The line is
  6772. * clipped by the image boundaries. For non-antialiased lines with integer coordinates, the 8-connected
  6773. * or 4-connected Bresenham algorithm is used. Thick lines are drawn with rounding endings. Antialiased
  6774. * lines are drawn using Gaussian filtering.
  6775. *
  6776. * @param img Image.
  6777. * @param pt1 First point of the line segment.
  6778. * @param pt2 Second point of the line segment.
  6779. * @param color Line color.
  6780. */
  6781. + (void)line:(Mat*)img pt1:(Point2i*)pt1 pt2:(Point2i*)pt2 color:(Scalar*)color NS_SWIFT_NAME(line(img:pt1:pt2:color:));
  6782. //
  6783. // void cv::arrowedLine(Mat& img, Point pt1, Point pt2, Scalar color, int thickness = 1, LineTypes line_type = 8, int shift = 0, double tipLength = 0.1)
  6784. //
  6785. /**
  6786. * Draws an arrow segment pointing from the first point to the second one.
  6787. *
  6788. * The function cv::arrowedLine draws an arrow between pt1 and pt2 points in the image. See also #line.
  6789. *
  6790. * @param img Image.
  6791. * @param pt1 The point the arrow starts from.
  6792. * @param pt2 The point the arrow points to.
  6793. * @param color Line color.
  6794. * @param thickness Line thickness.
  6795. * @param line_type Type of the line. See #LineTypes
  6796. * @param shift Number of fractional bits in the point coordinates.
  6797. * @param tipLength The length of the arrow tip in relation to the arrow length
  6798. */
  6799. + (void)arrowedLine:(Mat*)img pt1:(Point2i*)pt1 pt2:(Point2i*)pt2 color:(Scalar*)color thickness:(int)thickness line_type:(LineTypes)line_type shift:(int)shift tipLength:(double)tipLength NS_SWIFT_NAME(arrowedLine(img:pt1:pt2:color:thickness:line_type:shift:tipLength:));
  6800. /**
  6801. * Draws an arrow segment pointing from the first point to the second one.
  6802. *
  6803. * The function cv::arrowedLine draws an arrow between pt1 and pt2 points in the image. See also #line.
  6804. *
  6805. * @param img Image.
  6806. * @param pt1 The point the arrow starts from.
  6807. * @param pt2 The point the arrow points to.
  6808. * @param color Line color.
  6809. * @param thickness Line thickness.
  6810. * @param line_type Type of the line. See #LineTypes
  6811. * @param shift Number of fractional bits in the point coordinates.
  6812. */
  6813. + (void)arrowedLine:(Mat*)img pt1:(Point2i*)pt1 pt2:(Point2i*)pt2 color:(Scalar*)color thickness:(int)thickness line_type:(LineTypes)line_type shift:(int)shift NS_SWIFT_NAME(arrowedLine(img:pt1:pt2:color:thickness:line_type:shift:));
  6814. /**
  6815. * Draws an arrow segment pointing from the first point to the second one.
  6816. *
  6817. * The function cv::arrowedLine draws an arrow between pt1 and pt2 points in the image. See also #line.
  6818. *
  6819. * @param img Image.
  6820. * @param pt1 The point the arrow starts from.
  6821. * @param pt2 The point the arrow points to.
  6822. * @param color Line color.
  6823. * @param thickness Line thickness.
  6824. * @param line_type Type of the line. See #LineTypes
  6825. */
  6826. + (void)arrowedLine:(Mat*)img pt1:(Point2i*)pt1 pt2:(Point2i*)pt2 color:(Scalar*)color thickness:(int)thickness line_type:(LineTypes)line_type NS_SWIFT_NAME(arrowedLine(img:pt1:pt2:color:thickness:line_type:));
  6827. /**
  6828. * Draws an arrow segment pointing from the first point to the second one.
  6829. *
  6830. * The function cv::arrowedLine draws an arrow between pt1 and pt2 points in the image. See also #line.
  6831. *
  6832. * @param img Image.
  6833. * @param pt1 The point the arrow starts from.
  6834. * @param pt2 The point the arrow points to.
  6835. * @param color Line color.
  6836. * @param thickness Line thickness.
  6837. */
  6838. + (void)arrowedLine:(Mat*)img pt1:(Point2i*)pt1 pt2:(Point2i*)pt2 color:(Scalar*)color thickness:(int)thickness NS_SWIFT_NAME(arrowedLine(img:pt1:pt2:color:thickness:));
  6839. /**
  6840. * Draws an arrow segment pointing from the first point to the second one.
  6841. *
  6842. * The function cv::arrowedLine draws an arrow between pt1 and pt2 points in the image. See also #line.
  6843. *
  6844. * @param img Image.
  6845. * @param pt1 The point the arrow starts from.
  6846. * @param pt2 The point the arrow points to.
  6847. * @param color Line color.
  6848. */
  6849. + (void)arrowedLine:(Mat*)img pt1:(Point2i*)pt1 pt2:(Point2i*)pt2 color:(Scalar*)color NS_SWIFT_NAME(arrowedLine(img:pt1:pt2:color:));
  6850. //
  6851. // void cv::rectangle(Mat& img, Point pt1, Point pt2, Scalar color, int thickness = 1, LineTypes lineType = LINE_8, int shift = 0)
  6852. //
  6853. /**
  6854. * Draws a simple, thick, or filled up-right rectangle.
  6855. *
  6856. * The function cv::rectangle draws a rectangle outline or a filled rectangle whose two opposite corners
  6857. * are pt1 and pt2.
  6858. *
  6859. * @param img Image.
  6860. * @param pt1 Vertex of the rectangle.
  6861. * @param pt2 Vertex of the rectangle opposite to pt1 .
  6862. * @param color Rectangle color or brightness (grayscale image).
  6863. * @param thickness Thickness of lines that make up the rectangle. Negative values, like #FILLED,
  6864. * mean that the function has to draw a filled rectangle.
  6865. * @param lineType Type of the line. See #LineTypes
  6866. * @param shift Number of fractional bits in the point coordinates.
  6867. */
  6868. + (void)rectangle:(Mat*)img pt1:(Point2i*)pt1 pt2:(Point2i*)pt2 color:(Scalar*)color thickness:(int)thickness lineType:(LineTypes)lineType shift:(int)shift NS_SWIFT_NAME(rectangle(img:pt1:pt2:color:thickness:lineType:shift:));
  6869. /**
  6870. * Draws a simple, thick, or filled up-right rectangle.
  6871. *
  6872. * The function cv::rectangle draws a rectangle outline or a filled rectangle whose two opposite corners
  6873. * are pt1 and pt2.
  6874. *
  6875. * @param img Image.
  6876. * @param pt1 Vertex of the rectangle.
  6877. * @param pt2 Vertex of the rectangle opposite to pt1 .
  6878. * @param color Rectangle color or brightness (grayscale image).
  6879. * @param thickness Thickness of lines that make up the rectangle. Negative values, like #FILLED,
  6880. * mean that the function has to draw a filled rectangle.
  6881. * @param lineType Type of the line. See #LineTypes
  6882. */
  6883. + (void)rectangle:(Mat*)img pt1:(Point2i*)pt1 pt2:(Point2i*)pt2 color:(Scalar*)color thickness:(int)thickness lineType:(LineTypes)lineType NS_SWIFT_NAME(rectangle(img:pt1:pt2:color:thickness:lineType:));
  6884. /**
  6885. * Draws a simple, thick, or filled up-right rectangle.
  6886. *
  6887. * The function cv::rectangle draws a rectangle outline or a filled rectangle whose two opposite corners
  6888. * are pt1 and pt2.
  6889. *
  6890. * @param img Image.
  6891. * @param pt1 Vertex of the rectangle.
  6892. * @param pt2 Vertex of the rectangle opposite to pt1 .
  6893. * @param color Rectangle color or brightness (grayscale image).
  6894. * @param thickness Thickness of lines that make up the rectangle. Negative values, like #FILLED,
  6895. * mean that the function has to draw a filled rectangle.
  6896. */
  6897. + (void)rectangle:(Mat*)img pt1:(Point2i*)pt1 pt2:(Point2i*)pt2 color:(Scalar*)color thickness:(int)thickness NS_SWIFT_NAME(rectangle(img:pt1:pt2:color:thickness:));
  6898. /**
  6899. * Draws a simple, thick, or filled up-right rectangle.
  6900. *
  6901. * The function cv::rectangle draws a rectangle outline or a filled rectangle whose two opposite corners
  6902. * are pt1 and pt2.
  6903. *
  6904. * @param img Image.
  6905. * @param pt1 Vertex of the rectangle.
  6906. * @param pt2 Vertex of the rectangle opposite to pt1 .
  6907. * @param color Rectangle color or brightness (grayscale image).
  6908. * mean that the function has to draw a filled rectangle.
  6909. */
  6910. + (void)rectangle:(Mat*)img pt1:(Point2i*)pt1 pt2:(Point2i*)pt2 color:(Scalar*)color NS_SWIFT_NAME(rectangle(img:pt1:pt2:color:));
  6911. //
  6912. // void cv::rectangle(Mat& img, Rect rec, Scalar color, int thickness = 1, LineTypes lineType = LINE_8, int shift = 0)
  6913. //
  6914. /**
  6915. *
  6916. *
  6917. * use `rec` parameter as alternative specification of the drawn rectangle: `r.tl() and
  6918. * r.br()-Point(1,1)` are opposite corners
  6919. */
  6920. + (void)rectangle:(Mat*)img rec:(Rect2i*)rec color:(Scalar*)color thickness:(int)thickness lineType:(LineTypes)lineType shift:(int)shift NS_SWIFT_NAME(rectangle(img:rec:color:thickness:lineType:shift:));
  6921. /**
  6922. *
  6923. *
  6924. * use `rec` parameter as alternative specification of the drawn rectangle: `r.tl() and
  6925. * r.br()-Point(1,1)` are opposite corners
  6926. */
  6927. + (void)rectangle:(Mat*)img rec:(Rect2i*)rec color:(Scalar*)color thickness:(int)thickness lineType:(LineTypes)lineType NS_SWIFT_NAME(rectangle(img:rec:color:thickness:lineType:));
  6928. /**
  6929. *
  6930. *
  6931. * use `rec` parameter as alternative specification of the drawn rectangle: `r.tl() and
  6932. * r.br()-Point(1,1)` are opposite corners
  6933. */
  6934. + (void)rectangle:(Mat*)img rec:(Rect2i*)rec color:(Scalar*)color thickness:(int)thickness NS_SWIFT_NAME(rectangle(img:rec:color:thickness:));
  6935. /**
  6936. *
  6937. *
  6938. * use `rec` parameter as alternative specification of the drawn rectangle: `r.tl() and
  6939. * r.br()-Point(1,1)` are opposite corners
  6940. */
  6941. + (void)rectangle:(Mat*)img rec:(Rect2i*)rec color:(Scalar*)color NS_SWIFT_NAME(rectangle(img:rec:color:));
  6942. //
  6943. // void cv::circle(Mat& img, Point center, int radius, Scalar color, int thickness = 1, LineTypes lineType = LINE_8, int shift = 0)
  6944. //
  6945. /**
  6946. * Draws a circle.
  6947. *
  6948. * The function cv::circle draws a simple or filled circle with a given center and radius.
  6949. * @param img Image where the circle is drawn.
  6950. * @param center Center of the circle.
  6951. * @param radius Radius of the circle.
  6952. * @param color Circle color.
  6953. * @param thickness Thickness of the circle outline, if positive. Negative values, like #FILLED,
  6954. * mean that a filled circle is to be drawn.
  6955. * @param lineType Type of the circle boundary. See #LineTypes
  6956. * @param shift Number of fractional bits in the coordinates of the center and in the radius value.
  6957. */
  6958. + (void)circle:(Mat*)img center:(Point2i*)center radius:(int)radius color:(Scalar*)color thickness:(int)thickness lineType:(LineTypes)lineType shift:(int)shift NS_SWIFT_NAME(circle(img:center:radius:color:thickness:lineType:shift:));
  6959. /**
  6960. * Draws a circle.
  6961. *
  6962. * The function cv::circle draws a simple or filled circle with a given center and radius.
  6963. * @param img Image where the circle is drawn.
  6964. * @param center Center of the circle.
  6965. * @param radius Radius of the circle.
  6966. * @param color Circle color.
  6967. * @param thickness Thickness of the circle outline, if positive. Negative values, like #FILLED,
  6968. * mean that a filled circle is to be drawn.
  6969. * @param lineType Type of the circle boundary. See #LineTypes
  6970. */
  6971. + (void)circle:(Mat*)img center:(Point2i*)center radius:(int)radius color:(Scalar*)color thickness:(int)thickness lineType:(LineTypes)lineType NS_SWIFT_NAME(circle(img:center:radius:color:thickness:lineType:));
  6972. /**
  6973. * Draws a circle.
  6974. *
  6975. * The function cv::circle draws a simple or filled circle with a given center and radius.
  6976. * @param img Image where the circle is drawn.
  6977. * @param center Center of the circle.
  6978. * @param radius Radius of the circle.
  6979. * @param color Circle color.
  6980. * @param thickness Thickness of the circle outline, if positive. Negative values, like #FILLED,
  6981. * mean that a filled circle is to be drawn.
  6982. */
  6983. + (void)circle:(Mat*)img center:(Point2i*)center radius:(int)radius color:(Scalar*)color thickness:(int)thickness NS_SWIFT_NAME(circle(img:center:radius:color:thickness:));
  6984. /**
  6985. * Draws a circle.
  6986. *
  6987. * The function cv::circle draws a simple or filled circle with a given center and radius.
  6988. * @param img Image where the circle is drawn.
  6989. * @param center Center of the circle.
  6990. * @param radius Radius of the circle.
  6991. * @param color Circle color.
  6992. * mean that a filled circle is to be drawn.
  6993. */
  6994. + (void)circle:(Mat*)img center:(Point2i*)center radius:(int)radius color:(Scalar*)color NS_SWIFT_NAME(circle(img:center:radius:color:));
  6995. //
  6996. // void cv::ellipse(Mat& img, Point center, Size axes, double angle, double startAngle, double endAngle, Scalar color, int thickness = 1, LineTypes lineType = LINE_8, int shift = 0)
  6997. //
  6998. /**
  6999. * Draws a simple or thick elliptic arc or fills an ellipse sector.
  7000. *
  7001. * The function cv::ellipse with more parameters draws an ellipse outline, a filled ellipse, an elliptic
  7002. * arc, or a filled ellipse sector. The drawing code uses general parametric form.
  7003. * A piecewise-linear curve is used to approximate the elliptic arc
  7004. * boundary. If you need more control of the ellipse rendering, you can retrieve the curve using
  7005. * #ellipse2Poly and then render it with #polylines or fill it with #fillPoly. If you use the first
  7006. * variant of the function and want to draw the whole ellipse, not an arc, pass `startAngle=0` and
  7007. * `endAngle=360`. If `startAngle` is greater than `endAngle`, they are swapped. The figure below explains
  7008. * the meaning of the parameters to draw the blue arc.
  7009. *
  7010. * ![Parameters of Elliptic Arc](pics/ellipse.svg)
  7011. *
  7012. * @param img Image.
  7013. * @param center Center of the ellipse.
  7014. * @param axes Half of the size of the ellipse main axes.
  7015. * @param angle Ellipse rotation angle in degrees.
  7016. * @param startAngle Starting angle of the elliptic arc in degrees.
  7017. * @param endAngle Ending angle of the elliptic arc in degrees.
  7018. * @param color Ellipse color.
  7019. * @param thickness Thickness of the ellipse arc outline, if positive. Otherwise, this indicates that
  7020. * a filled ellipse sector is to be drawn.
  7021. * @param lineType Type of the ellipse boundary. See #LineTypes
  7022. * @param shift Number of fractional bits in the coordinates of the center and values of axes.
  7023. */
  7024. + (void)ellipse:(Mat*)img center:(Point2i*)center axes:(Size2i*)axes angle:(double)angle startAngle:(double)startAngle endAngle:(double)endAngle color:(Scalar*)color thickness:(int)thickness lineType:(LineTypes)lineType shift:(int)shift NS_SWIFT_NAME(ellipse(img:center:axes:angle:startAngle:endAngle:color:thickness:lineType:shift:));
  7025. /**
  7026. * Draws a simple or thick elliptic arc or fills an ellipse sector.
  7027. *
  7028. * The function cv::ellipse with more parameters draws an ellipse outline, a filled ellipse, an elliptic
  7029. * arc, or a filled ellipse sector. The drawing code uses general parametric form.
  7030. * A piecewise-linear curve is used to approximate the elliptic arc
  7031. * boundary. If you need more control of the ellipse rendering, you can retrieve the curve using
  7032. * #ellipse2Poly and then render it with #polylines or fill it with #fillPoly. If you use the first
  7033. * variant of the function and want to draw the whole ellipse, not an arc, pass `startAngle=0` and
  7034. * `endAngle=360`. If `startAngle` is greater than `endAngle`, they are swapped. The figure below explains
  7035. * the meaning of the parameters to draw the blue arc.
  7036. *
  7037. * ![Parameters of Elliptic Arc](pics/ellipse.svg)
  7038. *
  7039. * @param img Image.
  7040. * @param center Center of the ellipse.
  7041. * @param axes Half of the size of the ellipse main axes.
  7042. * @param angle Ellipse rotation angle in degrees.
  7043. * @param startAngle Starting angle of the elliptic arc in degrees.
  7044. * @param endAngle Ending angle of the elliptic arc in degrees.
  7045. * @param color Ellipse color.
  7046. * @param thickness Thickness of the ellipse arc outline, if positive. Otherwise, this indicates that
  7047. * a filled ellipse sector is to be drawn.
  7048. * @param lineType Type of the ellipse boundary. See #LineTypes
  7049. */
  7050. + (void)ellipse:(Mat*)img center:(Point2i*)center axes:(Size2i*)axes angle:(double)angle startAngle:(double)startAngle endAngle:(double)endAngle color:(Scalar*)color thickness:(int)thickness lineType:(LineTypes)lineType NS_SWIFT_NAME(ellipse(img:center:axes:angle:startAngle:endAngle:color:thickness:lineType:));
  7051. /**
  7052. * Draws a simple or thick elliptic arc or fills an ellipse sector.
  7053. *
  7054. * The function cv::ellipse with more parameters draws an ellipse outline, a filled ellipse, an elliptic
  7055. * arc, or a filled ellipse sector. The drawing code uses general parametric form.
  7056. * A piecewise-linear curve is used to approximate the elliptic arc
  7057. * boundary. If you need more control of the ellipse rendering, you can retrieve the curve using
  7058. * #ellipse2Poly and then render it with #polylines or fill it with #fillPoly. If you use the first
  7059. * variant of the function and want to draw the whole ellipse, not an arc, pass `startAngle=0` and
  7060. * `endAngle=360`. If `startAngle` is greater than `endAngle`, they are swapped. The figure below explains
  7061. * the meaning of the parameters to draw the blue arc.
  7062. *
  7063. * ![Parameters of Elliptic Arc](pics/ellipse.svg)
  7064. *
  7065. * @param img Image.
  7066. * @param center Center of the ellipse.
  7067. * @param axes Half of the size of the ellipse main axes.
  7068. * @param angle Ellipse rotation angle in degrees.
  7069. * @param startAngle Starting angle of the elliptic arc in degrees.
  7070. * @param endAngle Ending angle of the elliptic arc in degrees.
  7071. * @param color Ellipse color.
  7072. * @param thickness Thickness of the ellipse arc outline, if positive. Otherwise, this indicates that
  7073. * a filled ellipse sector is to be drawn.
  7074. */
  7075. + (void)ellipse:(Mat*)img center:(Point2i*)center axes:(Size2i*)axes angle:(double)angle startAngle:(double)startAngle endAngle:(double)endAngle color:(Scalar*)color thickness:(int)thickness NS_SWIFT_NAME(ellipse(img:center:axes:angle:startAngle:endAngle:color:thickness:));
  7076. /**
  7077. * Draws a simple or thick elliptic arc or fills an ellipse sector.
  7078. *
  7079. * The function cv::ellipse with more parameters draws an ellipse outline, a filled ellipse, an elliptic
  7080. * arc, or a filled ellipse sector. The drawing code uses general parametric form.
  7081. * A piecewise-linear curve is used to approximate the elliptic arc
  7082. * boundary. If you need more control of the ellipse rendering, you can retrieve the curve using
  7083. * #ellipse2Poly and then render it with #polylines or fill it with #fillPoly. If you use the first
  7084. * variant of the function and want to draw the whole ellipse, not an arc, pass `startAngle=0` and
  7085. * `endAngle=360`. If `startAngle` is greater than `endAngle`, they are swapped. The figure below explains
  7086. * the meaning of the parameters to draw the blue arc.
  7087. *
  7088. * ![Parameters of Elliptic Arc](pics/ellipse.svg)
  7089. *
  7090. * @param img Image.
  7091. * @param center Center of the ellipse.
  7092. * @param axes Half of the size of the ellipse main axes.
  7093. * @param angle Ellipse rotation angle in degrees.
  7094. * @param startAngle Starting angle of the elliptic arc in degrees.
  7095. * @param endAngle Ending angle of the elliptic arc in degrees.
  7096. * @param color Ellipse color.
  7097. * a filled ellipse sector is to be drawn.
  7098. */
  7099. + (void)ellipse:(Mat*)img center:(Point2i*)center axes:(Size2i*)axes angle:(double)angle startAngle:(double)startAngle endAngle:(double)endAngle color:(Scalar*)color NS_SWIFT_NAME(ellipse(img:center:axes:angle:startAngle:endAngle:color:));
  7100. //
  7101. // void cv::ellipse(Mat& img, RotatedRect box, Scalar color, int thickness = 1, LineTypes lineType = LINE_8)
  7102. //
  7103. /**
  7104. *
  7105. * @param img Image.
  7106. * @param box Alternative ellipse representation via RotatedRect. This means that the function draws
  7107. * an ellipse inscribed in the rotated rectangle.
  7108. * @param color Ellipse color.
  7109. * @param thickness Thickness of the ellipse arc outline, if positive. Otherwise, this indicates that
  7110. * a filled ellipse sector is to be drawn.
  7111. * @param lineType Type of the ellipse boundary. See #LineTypes
  7112. */
  7113. + (void)ellipse:(Mat*)img box:(RotatedRect*)box color:(Scalar*)color thickness:(int)thickness lineType:(LineTypes)lineType NS_SWIFT_NAME(ellipse(img:box:color:thickness:lineType:));
  7114. /**
  7115. *
  7116. * @param img Image.
  7117. * @param box Alternative ellipse representation via RotatedRect. This means that the function draws
  7118. * an ellipse inscribed in the rotated rectangle.
  7119. * @param color Ellipse color.
  7120. * @param thickness Thickness of the ellipse arc outline, if positive. Otherwise, this indicates that
  7121. * a filled ellipse sector is to be drawn.
  7122. */
  7123. + (void)ellipse:(Mat*)img box:(RotatedRect*)box color:(Scalar*)color thickness:(int)thickness NS_SWIFT_NAME(ellipse(img:box:color:thickness:));
  7124. /**
  7125. *
  7126. * @param img Image.
  7127. * @param box Alternative ellipse representation via RotatedRect. This means that the function draws
  7128. * an ellipse inscribed in the rotated rectangle.
  7129. * @param color Ellipse color.
  7130. * a filled ellipse sector is to be drawn.
  7131. */
  7132. + (void)ellipse:(Mat*)img box:(RotatedRect*)box color:(Scalar*)color NS_SWIFT_NAME(ellipse(img:box:color:));
  7133. //
  7134. // void cv::drawMarker(Mat& img, Point position, Scalar color, MarkerTypes markerType = MARKER_CROSS, int markerSize = 20, int thickness = 1, LineTypes line_type = 8)
  7135. //
  7136. /**
  7137. * Draws a marker on a predefined position in an image.
  7138. *
  7139. * The function cv::drawMarker draws a marker on a given position in the image. For the moment several
  7140. * marker types are supported, see #MarkerTypes for more information.
  7141. *
  7142. * @param img Image.
  7143. * @param position The point where the crosshair is positioned.
  7144. * @param color Line color.
  7145. * @param markerType The specific type of marker you want to use, see #MarkerTypes
  7146. * @param thickness Line thickness.
  7147. * @param line_type Type of the line, See #LineTypes
  7148. * @param markerSize The length of the marker axis [default = 20 pixels]
  7149. */
  7150. + (void)drawMarker:(Mat*)img position:(Point2i*)position color:(Scalar*)color markerType:(MarkerTypes)markerType markerSize:(int)markerSize thickness:(int)thickness line_type:(LineTypes)line_type NS_SWIFT_NAME(drawMarker(img:position:color:markerType:markerSize:thickness:line_type:));
  7151. /**
  7152. * Draws a marker on a predefined position in an image.
  7153. *
  7154. * The function cv::drawMarker draws a marker on a given position in the image. For the moment several
  7155. * marker types are supported, see #MarkerTypes for more information.
  7156. *
  7157. * @param img Image.
  7158. * @param position The point where the crosshair is positioned.
  7159. * @param color Line color.
  7160. * @param markerType The specific type of marker you want to use, see #MarkerTypes
  7161. * @param thickness Line thickness.
  7162. * @param markerSize The length of the marker axis [default = 20 pixels]
  7163. */
  7164. + (void)drawMarker:(Mat*)img position:(Point2i*)position color:(Scalar*)color markerType:(MarkerTypes)markerType markerSize:(int)markerSize thickness:(int)thickness NS_SWIFT_NAME(drawMarker(img:position:color:markerType:markerSize:thickness:));
  7165. /**
  7166. * Draws a marker on a predefined position in an image.
  7167. *
  7168. * The function cv::drawMarker draws a marker on a given position in the image. For the moment several
  7169. * marker types are supported, see #MarkerTypes for more information.
  7170. *
  7171. * @param img Image.
  7172. * @param position The point where the crosshair is positioned.
  7173. * @param color Line color.
  7174. * @param markerType The specific type of marker you want to use, see #MarkerTypes
  7175. * @param markerSize The length of the marker axis [default = 20 pixels]
  7176. */
  7177. + (void)drawMarker:(Mat*)img position:(Point2i*)position color:(Scalar*)color markerType:(MarkerTypes)markerType markerSize:(int)markerSize NS_SWIFT_NAME(drawMarker(img:position:color:markerType:markerSize:));
  7178. /**
  7179. * Draws a marker on a predefined position in an image.
  7180. *
  7181. * The function cv::drawMarker draws a marker on a given position in the image. For the moment several
  7182. * marker types are supported, see #MarkerTypes for more information.
  7183. *
  7184. * @param img Image.
  7185. * @param position The point where the crosshair is positioned.
  7186. * @param color Line color.
  7187. * @param markerType The specific type of marker you want to use, see #MarkerTypes
  7188. */
  7189. + (void)drawMarker:(Mat*)img position:(Point2i*)position color:(Scalar*)color markerType:(MarkerTypes)markerType NS_SWIFT_NAME(drawMarker(img:position:color:markerType:));
  7190. /**
  7191. * Draws a marker on a predefined position in an image.
  7192. *
  7193. * The function cv::drawMarker draws a marker on a given position in the image. For the moment several
  7194. * marker types are supported, see #MarkerTypes for more information.
  7195. *
  7196. * @param img Image.
  7197. * @param position The point where the crosshair is positioned.
  7198. * @param color Line color.
  7199. */
  7200. + (void)drawMarker:(Mat*)img position:(Point2i*)position color:(Scalar*)color NS_SWIFT_NAME(drawMarker(img:position:color:));
  7201. //
  7202. // void cv::fillConvexPoly(Mat& img, vector_Point points, Scalar color, LineTypes lineType = LINE_8, int shift = 0)
  7203. //
  7204. /**
  7205. * Fills a convex polygon.
  7206. *
  7207. * The function cv::fillConvexPoly draws a filled convex polygon. This function is much faster than the
  7208. * function #fillPoly . It can fill not only convex polygons but any monotonic polygon without
  7209. * self-intersections, that is, a polygon whose contour intersects every horizontal line (scan line)
  7210. * twice at the most (though, its top-most and/or the bottom edge could be horizontal).
  7211. *
  7212. * @param img Image.
  7213. * @param points Polygon vertices.
  7214. * @param color Polygon color.
  7215. * @param lineType Type of the polygon boundaries. See #LineTypes
  7216. * @param shift Number of fractional bits in the vertex coordinates.
  7217. */
  7218. + (void)fillConvexPoly:(Mat*)img points:(NSArray<Point2i*>*)points color:(Scalar*)color lineType:(LineTypes)lineType shift:(int)shift NS_SWIFT_NAME(fillConvexPoly(img:points:color:lineType:shift:));
  7219. /**
  7220. * Fills a convex polygon.
  7221. *
  7222. * The function cv::fillConvexPoly draws a filled convex polygon. This function is much faster than the
  7223. * function #fillPoly . It can fill not only convex polygons but any monotonic polygon without
  7224. * self-intersections, that is, a polygon whose contour intersects every horizontal line (scan line)
  7225. * twice at the most (though, its top-most and/or the bottom edge could be horizontal).
  7226. *
  7227. * @param img Image.
  7228. * @param points Polygon vertices.
  7229. * @param color Polygon color.
  7230. * @param lineType Type of the polygon boundaries. See #LineTypes
  7231. */
  7232. + (void)fillConvexPoly:(Mat*)img points:(NSArray<Point2i*>*)points color:(Scalar*)color lineType:(LineTypes)lineType NS_SWIFT_NAME(fillConvexPoly(img:points:color:lineType:));
  7233. /**
  7234. * Fills a convex polygon.
  7235. *
  7236. * The function cv::fillConvexPoly draws a filled convex polygon. This function is much faster than the
  7237. * function #fillPoly . It can fill not only convex polygons but any monotonic polygon without
  7238. * self-intersections, that is, a polygon whose contour intersects every horizontal line (scan line)
  7239. * twice at the most (though, its top-most and/or the bottom edge could be horizontal).
  7240. *
  7241. * @param img Image.
  7242. * @param points Polygon vertices.
  7243. * @param color Polygon color.
  7244. */
  7245. + (void)fillConvexPoly:(Mat*)img points:(NSArray<Point2i*>*)points color:(Scalar*)color NS_SWIFT_NAME(fillConvexPoly(img:points:color:));
  7246. //
  7247. // void cv::fillPoly(Mat& img, vector_vector_Point pts, Scalar color, LineTypes lineType = LINE_8, int shift = 0, Point offset = Point())
  7248. //
  7249. /**
  7250. * Fills the area bounded by one or more polygons.
  7251. *
  7252. * The function cv::fillPoly fills an area bounded by several polygonal contours. The function can fill
  7253. * complex areas, for example, areas with holes, contours with self-intersections (some of their
  7254. * parts), and so forth.
  7255. *
  7256. * @param img Image.
  7257. * @param pts Array of polygons where each polygon is represented as an array of points.
  7258. * @param color Polygon color.
  7259. * @param lineType Type of the polygon boundaries. See #LineTypes
  7260. * @param shift Number of fractional bits in the vertex coordinates.
  7261. * @param offset Optional offset of all points of the contours.
  7262. */
  7263. + (void)fillPoly:(Mat*)img pts:(NSArray<NSArray<Point2i*>*>*)pts color:(Scalar*)color lineType:(LineTypes)lineType shift:(int)shift offset:(Point2i*)offset NS_SWIFT_NAME(fillPoly(img:pts:color:lineType:shift:offset:));
  7264. /**
  7265. * Fills the area bounded by one or more polygons.
  7266. *
  7267. * The function cv::fillPoly fills an area bounded by several polygonal contours. The function can fill
  7268. * complex areas, for example, areas with holes, contours with self-intersections (some of their
  7269. * parts), and so forth.
  7270. *
  7271. * @param img Image.
  7272. * @param pts Array of polygons where each polygon is represented as an array of points.
  7273. * @param color Polygon color.
  7274. * @param lineType Type of the polygon boundaries. See #LineTypes
  7275. * @param shift Number of fractional bits in the vertex coordinates.
  7276. */
  7277. + (void)fillPoly:(Mat*)img pts:(NSArray<NSArray<Point2i*>*>*)pts color:(Scalar*)color lineType:(LineTypes)lineType shift:(int)shift NS_SWIFT_NAME(fillPoly(img:pts:color:lineType:shift:));
  7278. /**
  7279. * Fills the area bounded by one or more polygons.
  7280. *
  7281. * The function cv::fillPoly fills an area bounded by several polygonal contours. The function can fill
  7282. * complex areas, for example, areas with holes, contours with self-intersections (some of their
  7283. * parts), and so forth.
  7284. *
  7285. * @param img Image.
  7286. * @param pts Array of polygons where each polygon is represented as an array of points.
  7287. * @param color Polygon color.
  7288. * @param lineType Type of the polygon boundaries. See #LineTypes
  7289. */
  7290. + (void)fillPoly:(Mat*)img pts:(NSArray<NSArray<Point2i*>*>*)pts color:(Scalar*)color lineType:(LineTypes)lineType NS_SWIFT_NAME(fillPoly(img:pts:color:lineType:));
  7291. /**
  7292. * Fills the area bounded by one or more polygons.
  7293. *
  7294. * The function cv::fillPoly fills an area bounded by several polygonal contours. The function can fill
  7295. * complex areas, for example, areas with holes, contours with self-intersections (some of their
  7296. * parts), and so forth.
  7297. *
  7298. * @param img Image.
  7299. * @param pts Array of polygons where each polygon is represented as an array of points.
  7300. * @param color Polygon color.
  7301. */
  7302. + (void)fillPoly:(Mat*)img pts:(NSArray<NSArray<Point2i*>*>*)pts color:(Scalar*)color NS_SWIFT_NAME(fillPoly(img:pts:color:));
  7303. //
  7304. // void cv::polylines(Mat& img, vector_vector_Point pts, bool isClosed, Scalar color, int thickness = 1, LineTypes lineType = LINE_8, int shift = 0)
  7305. //
  7306. /**
  7307. * Draws several polygonal curves.
  7308. *
  7309. * @param img Image.
  7310. * @param pts Array of polygonal curves.
  7311. * @param isClosed Flag indicating whether the drawn polylines are closed or not. If they are closed,
  7312. * the function draws a line from the last vertex of each curve to its first vertex.
  7313. * @param color Polyline color.
  7314. * @param thickness Thickness of the polyline edges.
  7315. * @param lineType Type of the line segments. See #LineTypes
  7316. * @param shift Number of fractional bits in the vertex coordinates.
  7317. *
  7318. * The function cv::polylines draws one or more polygonal curves.
  7319. */
  7320. + (void)polylines:(Mat*)img pts:(NSArray<NSArray<Point2i*>*>*)pts isClosed:(BOOL)isClosed color:(Scalar*)color thickness:(int)thickness lineType:(LineTypes)lineType shift:(int)shift NS_SWIFT_NAME(polylines(img:pts:isClosed:color:thickness:lineType:shift:));
  7321. /**
  7322. * Draws several polygonal curves.
  7323. *
  7324. * @param img Image.
  7325. * @param pts Array of polygonal curves.
  7326. * @param isClosed Flag indicating whether the drawn polylines are closed or not. If they are closed,
  7327. * the function draws a line from the last vertex of each curve to its first vertex.
  7328. * @param color Polyline color.
  7329. * @param thickness Thickness of the polyline edges.
  7330. * @param lineType Type of the line segments. See #LineTypes
  7331. *
  7332. * The function cv::polylines draws one or more polygonal curves.
  7333. */
  7334. + (void)polylines:(Mat*)img pts:(NSArray<NSArray<Point2i*>*>*)pts isClosed:(BOOL)isClosed color:(Scalar*)color thickness:(int)thickness lineType:(LineTypes)lineType NS_SWIFT_NAME(polylines(img:pts:isClosed:color:thickness:lineType:));
  7335. /**
  7336. * Draws several polygonal curves.
  7337. *
  7338. * @param img Image.
  7339. * @param pts Array of polygonal curves.
  7340. * @param isClosed Flag indicating whether the drawn polylines are closed or not. If they are closed,
  7341. * the function draws a line from the last vertex of each curve to its first vertex.
  7342. * @param color Polyline color.
  7343. * @param thickness Thickness of the polyline edges.
  7344. *
  7345. * The function cv::polylines draws one or more polygonal curves.
  7346. */
  7347. + (void)polylines:(Mat*)img pts:(NSArray<NSArray<Point2i*>*>*)pts isClosed:(BOOL)isClosed color:(Scalar*)color thickness:(int)thickness NS_SWIFT_NAME(polylines(img:pts:isClosed:color:thickness:));
  7348. /**
  7349. * Draws several polygonal curves.
  7350. *
  7351. * @param img Image.
  7352. * @param pts Array of polygonal curves.
  7353. * @param isClosed Flag indicating whether the drawn polylines are closed or not. If they are closed,
  7354. * the function draws a line from the last vertex of each curve to its first vertex.
  7355. * @param color Polyline color.
  7356. *
  7357. * The function cv::polylines draws one or more polygonal curves.
  7358. */
  7359. + (void)polylines:(Mat*)img pts:(NSArray<NSArray<Point2i*>*>*)pts isClosed:(BOOL)isClosed color:(Scalar*)color NS_SWIFT_NAME(polylines(img:pts:isClosed:color:));
  7360. //
  7361. // void cv::drawContours(Mat& image, vector_vector_Point contours, int contourIdx, Scalar color, int thickness = 1, LineTypes lineType = LINE_8, Mat hierarchy = Mat(), int maxLevel = INT_MAX, Point offset = Point())
  7362. //
  7363. /**
  7364. * Draws contours outlines or filled contours.
  7365. *
  7366. * The function draws contour outlines in the image if `$$\texttt{thickness} \ge 0$$` or fills the area
  7367. * bounded by the contours if `$$\texttt{thickness}<0$$` . The example below shows how to retrieve
  7368. * connected components from the binary image and label them: :
  7369. * INCLUDE: snippets/imgproc_drawContours.cpp
  7370. *
  7371. * @param image Destination image.
  7372. * @param contours All the input contours. Each contour is stored as a point vector.
  7373. * @param contourIdx Parameter indicating a contour to draw. If it is negative, all the contours are drawn.
  7374. * @param color Color of the contours.
  7375. * @param thickness Thickness of lines the contours are drawn with. If it is negative (for example,
  7376. * thickness=#FILLED ), the contour interiors are drawn.
  7377. * @param lineType Line connectivity. See #LineTypes
  7378. * @param hierarchy Optional information about hierarchy. It is only needed if you want to draw only
  7379. * some of the contours (see maxLevel ).
  7380. * @param maxLevel Maximal level for drawn contours. If it is 0, only the specified contour is drawn.
  7381. * If it is 1, the function draws the contour(s) and all the nested contours. If it is 2, the function
  7382. * draws the contours, all the nested contours, all the nested-to-nested contours, and so on. This
  7383. * parameter is only taken into account when there is hierarchy available.
  7384. * @param offset Optional contour shift parameter. Shift all the drawn contours by the specified
  7385. * `$$\texttt{offset}=(dx,dy)$$` .
  7386. * NOTE: When thickness=#FILLED, the function is designed to handle connected components with holes correctly
  7387. * even when no hierarchy data is provided. This is done by analyzing all the outlines together
  7388. * using even-odd rule. This may give incorrect results if you have a joint collection of separately retrieved
  7389. * contours. In order to solve this problem, you need to call #drawContours separately for each sub-group
  7390. * of contours, or iterate over the collection using contourIdx parameter.
  7391. */
  7392. + (void)drawContours:(Mat*)image contours:(NSArray<NSArray<Point2i*>*>*)contours contourIdx:(int)contourIdx color:(Scalar*)color thickness:(int)thickness lineType:(LineTypes)lineType hierarchy:(Mat*)hierarchy maxLevel:(int)maxLevel offset:(Point2i*)offset NS_SWIFT_NAME(drawContours(image:contours:contourIdx:color:thickness:lineType:hierarchy:maxLevel:offset:));
  7393. /**
  7394. * Draws contours outlines or filled contours.
  7395. *
  7396. * The function draws contour outlines in the image if `$$\texttt{thickness} \ge 0$$` or fills the area
  7397. * bounded by the contours if `$$\texttt{thickness}<0$$` . The example below shows how to retrieve
  7398. * connected components from the binary image and label them: :
  7399. * INCLUDE: snippets/imgproc_drawContours.cpp
  7400. *
  7401. * @param image Destination image.
  7402. * @param contours All the input contours. Each contour is stored as a point vector.
  7403. * @param contourIdx Parameter indicating a contour to draw. If it is negative, all the contours are drawn.
  7404. * @param color Color of the contours.
  7405. * @param thickness Thickness of lines the contours are drawn with. If it is negative (for example,
  7406. * thickness=#FILLED ), the contour interiors are drawn.
  7407. * @param lineType Line connectivity. See #LineTypes
  7408. * @param hierarchy Optional information about hierarchy. It is only needed if you want to draw only
  7409. * some of the contours (see maxLevel ).
  7410. * @param maxLevel Maximal level for drawn contours. If it is 0, only the specified contour is drawn.
  7411. * If it is 1, the function draws the contour(s) and all the nested contours. If it is 2, the function
  7412. * draws the contours, all the nested contours, all the nested-to-nested contours, and so on. This
  7413. * parameter is only taken into account when there is hierarchy available.
  7414. * `$$\texttt{offset}=(dx,dy)$$` .
  7415. * NOTE: When thickness=#FILLED, the function is designed to handle connected components with holes correctly
  7416. * even when no hierarchy data is provided. This is done by analyzing all the outlines together
  7417. * using even-odd rule. This may give incorrect results if you have a joint collection of separately retrieved
  7418. * contours. In order to solve this problem, you need to call #drawContours separately for each sub-group
  7419. * of contours, or iterate over the collection using contourIdx parameter.
  7420. */
  7421. + (void)drawContours:(Mat*)image contours:(NSArray<NSArray<Point2i*>*>*)contours contourIdx:(int)contourIdx color:(Scalar*)color thickness:(int)thickness lineType:(LineTypes)lineType hierarchy:(Mat*)hierarchy maxLevel:(int)maxLevel NS_SWIFT_NAME(drawContours(image:contours:contourIdx:color:thickness:lineType:hierarchy:maxLevel:));
  7422. /**
  7423. * Draws contours outlines or filled contours.
  7424. *
  7425. * The function draws contour outlines in the image if `$$\texttt{thickness} \ge 0$$` or fills the area
  7426. * bounded by the contours if `$$\texttt{thickness}<0$$` . The example below shows how to retrieve
  7427. * connected components from the binary image and label them: :
  7428. * INCLUDE: snippets/imgproc_drawContours.cpp
  7429. *
  7430. * @param image Destination image.
  7431. * @param contours All the input contours. Each contour is stored as a point vector.
  7432. * @param contourIdx Parameter indicating a contour to draw. If it is negative, all the contours are drawn.
  7433. * @param color Color of the contours.
  7434. * @param thickness Thickness of lines the contours are drawn with. If it is negative (for example,
  7435. * thickness=#FILLED ), the contour interiors are drawn.
  7436. * @param lineType Line connectivity. See #LineTypes
  7437. * @param hierarchy Optional information about hierarchy. It is only needed if you want to draw only
  7438. * some of the contours (see maxLevel ).
  7439. * If it is 1, the function draws the contour(s) and all the nested contours. If it is 2, the function
  7440. * draws the contours, all the nested contours, all the nested-to-nested contours, and so on. This
  7441. * parameter is only taken into account when there is hierarchy available.
  7442. * `$$\texttt{offset}=(dx,dy)$$` .
  7443. * NOTE: When thickness=#FILLED, the function is designed to handle connected components with holes correctly
  7444. * even when no hierarchy data is provided. This is done by analyzing all the outlines together
  7445. * using even-odd rule. This may give incorrect results if you have a joint collection of separately retrieved
  7446. * contours. In order to solve this problem, you need to call #drawContours separately for each sub-group
  7447. * of contours, or iterate over the collection using contourIdx parameter.
  7448. */
  7449. + (void)drawContours:(Mat*)image contours:(NSArray<NSArray<Point2i*>*>*)contours contourIdx:(int)contourIdx color:(Scalar*)color thickness:(int)thickness lineType:(LineTypes)lineType hierarchy:(Mat*)hierarchy NS_SWIFT_NAME(drawContours(image:contours:contourIdx:color:thickness:lineType:hierarchy:));
  7450. /**
  7451. * Draws contours outlines or filled contours.
  7452. *
  7453. * The function draws contour outlines in the image if `$$\texttt{thickness} \ge 0$$` or fills the area
  7454. * bounded by the contours if `$$\texttt{thickness}<0$$` . The example below shows how to retrieve
  7455. * connected components from the binary image and label them: :
  7456. * INCLUDE: snippets/imgproc_drawContours.cpp
  7457. *
  7458. * @param image Destination image.
  7459. * @param contours All the input contours. Each contour is stored as a point vector.
  7460. * @param contourIdx Parameter indicating a contour to draw. If it is negative, all the contours are drawn.
  7461. * @param color Color of the contours.
  7462. * @param thickness Thickness of lines the contours are drawn with. If it is negative (for example,
  7463. * thickness=#FILLED ), the contour interiors are drawn.
  7464. * @param lineType Line connectivity. See #LineTypes
  7465. * some of the contours (see maxLevel ).
  7466. * If it is 1, the function draws the contour(s) and all the nested contours. If it is 2, the function
  7467. * draws the contours, all the nested contours, all the nested-to-nested contours, and so on. This
  7468. * parameter is only taken into account when there is hierarchy available.
  7469. * `$$\texttt{offset}=(dx,dy)$$` .
  7470. * NOTE: When thickness=#FILLED, the function is designed to handle connected components with holes correctly
  7471. * even when no hierarchy data is provided. This is done by analyzing all the outlines together
  7472. * using even-odd rule. This may give incorrect results if you have a joint collection of separately retrieved
  7473. * contours. In order to solve this problem, you need to call #drawContours separately for each sub-group
  7474. * of contours, or iterate over the collection using contourIdx parameter.
  7475. */
  7476. + (void)drawContours:(Mat*)image contours:(NSArray<NSArray<Point2i*>*>*)contours contourIdx:(int)contourIdx color:(Scalar*)color thickness:(int)thickness lineType:(LineTypes)lineType NS_SWIFT_NAME(drawContours(image:contours:contourIdx:color:thickness:lineType:));
  7477. /**
  7478. * Draws contours outlines or filled contours.
  7479. *
  7480. * The function draws contour outlines in the image if `$$\texttt{thickness} \ge 0$$` or fills the area
  7481. * bounded by the contours if `$$\texttt{thickness}<0$$` . The example below shows how to retrieve
  7482. * connected components from the binary image and label them: :
  7483. * INCLUDE: snippets/imgproc_drawContours.cpp
  7484. *
  7485. * @param image Destination image.
  7486. * @param contours All the input contours. Each contour is stored as a point vector.
  7487. * @param contourIdx Parameter indicating a contour to draw. If it is negative, all the contours are drawn.
  7488. * @param color Color of the contours.
  7489. * @param thickness Thickness of lines the contours are drawn with. If it is negative (for example,
  7490. * thickness=#FILLED ), the contour interiors are drawn.
  7491. * some of the contours (see maxLevel ).
  7492. * If it is 1, the function draws the contour(s) and all the nested contours. If it is 2, the function
  7493. * draws the contours, all the nested contours, all the nested-to-nested contours, and so on. This
  7494. * parameter is only taken into account when there is hierarchy available.
  7495. * `$$\texttt{offset}=(dx,dy)$$` .
  7496. * NOTE: When thickness=#FILLED, the function is designed to handle connected components with holes correctly
  7497. * even when no hierarchy data is provided. This is done by analyzing all the outlines together
  7498. * using even-odd rule. This may give incorrect results if you have a joint collection of separately retrieved
  7499. * contours. In order to solve this problem, you need to call #drawContours separately for each sub-group
  7500. * of contours, or iterate over the collection using contourIdx parameter.
  7501. */
  7502. + (void)drawContours:(Mat*)image contours:(NSArray<NSArray<Point2i*>*>*)contours contourIdx:(int)contourIdx color:(Scalar*)color thickness:(int)thickness NS_SWIFT_NAME(drawContours(image:contours:contourIdx:color:thickness:));
  7503. /**
  7504. * Draws contours outlines or filled contours.
  7505. *
  7506. * The function draws contour outlines in the image if `$$\texttt{thickness} \ge 0$$` or fills the area
  7507. * bounded by the contours if `$$\texttt{thickness}<0$$` . The example below shows how to retrieve
  7508. * connected components from the binary image and label them: :
  7509. * INCLUDE: snippets/imgproc_drawContours.cpp
  7510. *
  7511. * @param image Destination image.
  7512. * @param contours All the input contours. Each contour is stored as a point vector.
  7513. * @param contourIdx Parameter indicating a contour to draw. If it is negative, all the contours are drawn.
  7514. * @param color Color of the contours.
  7515. * thickness=#FILLED ), the contour interiors are drawn.
  7516. * some of the contours (see maxLevel ).
  7517. * If it is 1, the function draws the contour(s) and all the nested contours. If it is 2, the function
  7518. * draws the contours, all the nested contours, all the nested-to-nested contours, and so on. This
  7519. * parameter is only taken into account when there is hierarchy available.
  7520. * `$$\texttt{offset}=(dx,dy)$$` .
  7521. * NOTE: When thickness=#FILLED, the function is designed to handle connected components with holes correctly
  7522. * even when no hierarchy data is provided. This is done by analyzing all the outlines together
  7523. * using even-odd rule. This may give incorrect results if you have a joint collection of separately retrieved
  7524. * contours. In order to solve this problem, you need to call #drawContours separately for each sub-group
  7525. * of contours, or iterate over the collection using contourIdx parameter.
  7526. */
  7527. + (void)drawContours:(Mat*)image contours:(NSArray<NSArray<Point2i*>*>*)contours contourIdx:(int)contourIdx color:(Scalar*)color NS_SWIFT_NAME(drawContours(image:contours:contourIdx:color:));
  7528. //
  7529. // bool cv::clipLine(Rect imgRect, Point& pt1, Point& pt2)
  7530. //
  7531. /**
  7532. *
  7533. * @param imgRect Image rectangle.
  7534. * @param pt1 First line point.
  7535. * @param pt2 Second line point.
  7536. */
  7537. + (BOOL)clipLine:(Rect2i*)imgRect pt1:(Point2i*)pt1 pt2:(Point2i*)pt2 NS_SWIFT_NAME(clipLine(imgRect:pt1:pt2:));
  7538. //
  7539. // void cv::ellipse2Poly(Point center, Size axes, int angle, int arcStart, int arcEnd, int delta, vector_Point& pts)
  7540. //
  7541. /**
  7542. * Approximates an elliptic arc with a polyline.
  7543. *
  7544. * The function ellipse2Poly computes the vertices of a polyline that approximates the specified
  7545. * elliptic arc. It is used by #ellipse. If `arcStart` is greater than `arcEnd`, they are swapped.
  7546. *
  7547. * @param center Center of the arc.
  7548. * @param axes Half of the size of the ellipse main axes. See #ellipse for details.
  7549. * @param angle Rotation angle of the ellipse in degrees. See #ellipse for details.
  7550. * @param arcStart Starting angle of the elliptic arc in degrees.
  7551. * @param arcEnd Ending angle of the elliptic arc in degrees.
  7552. * @param delta Angle between the subsequent polyline vertices. It defines the approximation
  7553. * accuracy.
  7554. * @param pts Output vector of polyline vertices.
  7555. */
  7556. + (void)ellipse2Poly:(Point2i*)center axes:(Size2i*)axes angle:(int)angle arcStart:(int)arcStart arcEnd:(int)arcEnd delta:(int)delta pts:(NSMutableArray<Point2i*>*)pts NS_SWIFT_NAME(ellipse2Poly(center:axes:angle:arcStart:arcEnd:delta:pts:));
  7557. //
  7558. // void cv::putText(Mat& img, String text, Point org, HersheyFonts fontFace, double fontScale, Scalar color, int thickness = 1, LineTypes lineType = LINE_8, bool bottomLeftOrigin = false)
  7559. //
  7560. /**
  7561. * Draws a text string.
  7562. *
  7563. * The function cv::putText renders the specified text string in the image. Symbols that cannot be rendered
  7564. * using the specified font are replaced by question marks. See #getTextSize for a text rendering code
  7565. * example.
  7566. *
  7567. * @param img Image.
  7568. * @param text Text string to be drawn.
  7569. * @param org Bottom-left corner of the text string in the image.
  7570. * @param fontFace Font type, see #HersheyFonts.
  7571. * @param fontScale Font scale factor that is multiplied by the font-specific base size.
  7572. * @param color Text color.
  7573. * @param thickness Thickness of the lines used to draw a text.
  7574. * @param lineType Line type. See #LineTypes
  7575. * @param bottomLeftOrigin When true, the image data origin is at the bottom-left corner. Otherwise,
  7576. * it is at the top-left corner.
  7577. */
  7578. + (void)putText:(Mat*)img text:(NSString*)text org:(Point2i*)org fontFace:(HersheyFonts)fontFace fontScale:(double)fontScale color:(Scalar*)color thickness:(int)thickness lineType:(LineTypes)lineType bottomLeftOrigin:(BOOL)bottomLeftOrigin NS_SWIFT_NAME(putText(img:text:org:fontFace:fontScale:color:thickness:lineType:bottomLeftOrigin:));
  7579. /**
  7580. * Draws a text string.
  7581. *
  7582. * The function cv::putText renders the specified text string in the image. Symbols that cannot be rendered
  7583. * using the specified font are replaced by question marks. See #getTextSize for a text rendering code
  7584. * example.
  7585. *
  7586. * @param img Image.
  7587. * @param text Text string to be drawn.
  7588. * @param org Bottom-left corner of the text string in the image.
  7589. * @param fontFace Font type, see #HersheyFonts.
  7590. * @param fontScale Font scale factor that is multiplied by the font-specific base size.
  7591. * @param color Text color.
  7592. * @param thickness Thickness of the lines used to draw a text.
  7593. * @param lineType Line type. See #LineTypes
  7594. * it is at the top-left corner.
  7595. */
  7596. + (void)putText:(Mat*)img text:(NSString*)text org:(Point2i*)org fontFace:(HersheyFonts)fontFace fontScale:(double)fontScale color:(Scalar*)color thickness:(int)thickness lineType:(LineTypes)lineType NS_SWIFT_NAME(putText(img:text:org:fontFace:fontScale:color:thickness:lineType:));
  7597. /**
  7598. * Draws a text string.
  7599. *
  7600. * The function cv::putText renders the specified text string in the image. Symbols that cannot be rendered
  7601. * using the specified font are replaced by question marks. See #getTextSize for a text rendering code
  7602. * example.
  7603. *
  7604. * @param img Image.
  7605. * @param text Text string to be drawn.
  7606. * @param org Bottom-left corner of the text string in the image.
  7607. * @param fontFace Font type, see #HersheyFonts.
  7608. * @param fontScale Font scale factor that is multiplied by the font-specific base size.
  7609. * @param color Text color.
  7610. * @param thickness Thickness of the lines used to draw a text.
  7611. * it is at the top-left corner.
  7612. */
  7613. + (void)putText:(Mat*)img text:(NSString*)text org:(Point2i*)org fontFace:(HersheyFonts)fontFace fontScale:(double)fontScale color:(Scalar*)color thickness:(int)thickness NS_SWIFT_NAME(putText(img:text:org:fontFace:fontScale:color:thickness:));
  7614. /**
  7615. * Draws a text string.
  7616. *
  7617. * The function cv::putText renders the specified text string in the image. Symbols that cannot be rendered
  7618. * using the specified font are replaced by question marks. See #getTextSize for a text rendering code
  7619. * example.
  7620. *
  7621. * @param img Image.
  7622. * @param text Text string to be drawn.
  7623. * @param org Bottom-left corner of the text string in the image.
  7624. * @param fontFace Font type, see #HersheyFonts.
  7625. * @param fontScale Font scale factor that is multiplied by the font-specific base size.
  7626. * @param color Text color.
  7627. * it is at the top-left corner.
  7628. */
  7629. + (void)putText:(Mat*)img text:(NSString*)text org:(Point2i*)org fontFace:(HersheyFonts)fontFace fontScale:(double)fontScale color:(Scalar*)color NS_SWIFT_NAME(putText(img:text:org:fontFace:fontScale:color:));
  7630. //
  7631. // Size cv::getTextSize(String text, HersheyFonts fontFace, double fontScale, int thickness, int* baseLine)
  7632. //
  7633. /**
  7634. * Calculates the width and height of a text string.
  7635. *
  7636. * The function cv::getTextSize calculates and returns the size of a box that contains the specified text.
  7637. * That is, the following code renders some text, the tight box surrounding it, and the baseline: :
  7638. *
  7639. * String text = "Funny text inside the box";
  7640. * int fontFace = FONT_HERSHEY_SCRIPT_SIMPLEX;
  7641. * double fontScale = 2;
  7642. * int thickness = 3;
  7643. *
  7644. * Mat img(600, 800, CV_8UC3, Scalar::all(0));
  7645. *
  7646. * int baseline=0;
  7647. * Size textSize = getTextSize(text, fontFace,
  7648. * fontScale, thickness, &baseline);
  7649. * baseline += thickness;
  7650. *
  7651. * // center the text
  7652. * Point textOrg((img.cols - textSize.width)/2,
  7653. * (img.rows + textSize.height)/2);
  7654. *
  7655. * // draw the box
  7656. * rectangle(img, textOrg + Point(0, baseline),
  7657. * textOrg + Point(textSize.width, -textSize.height),
  7658. * Scalar(0,0,255));
  7659. * // ... and the baseline first
  7660. * line(img, textOrg + Point(0, thickness),
  7661. * textOrg + Point(textSize.width, thickness),
  7662. * Scalar(0, 0, 255));
  7663. *
  7664. * // then put the text itself
  7665. * putText(img, text, textOrg, fontFace, fontScale,
  7666. * Scalar::all(255), thickness, 8);
  7667. *
  7668. *
  7669. * @param text Input text string.
  7670. * @param fontFace Font to use, see #HersheyFonts.
  7671. * @param fontScale Font scale factor that is multiplied by the font-specific base size.
  7672. * @param thickness Thickness of lines used to render the text. See #putText for details.
  7673. * @param baseLine y-coordinate of the baseline relative to the bottom-most text
  7674. * point.
  7675. * @return The size of a box that contains the specified text.
  7676. *
  7677. * @see `+putText:text:org:fontFace:fontScale:color:thickness:lineType:bottomLeftOrigin:`
  7678. */
  7679. + (Size2i*)getTextSize:(NSString*)text fontFace:(HersheyFonts)fontFace fontScale:(double)fontScale thickness:(int)thickness baseLine:(int*)baseLine NS_SWIFT_NAME(getTextSize(text:fontFace:fontScale:thickness:baseLine:));
  7680. //
  7681. // double cv::getFontScaleFromHeight(int fontFace, int pixelHeight, int thickness = 1)
  7682. //
  7683. /**
  7684. * Calculates the font-specific size to use to achieve a given height in pixels.
  7685. *
  7686. * @param fontFace Font to use, see cv::HersheyFonts.
  7687. * @param pixelHeight Pixel height to compute the fontScale for
  7688. * @param thickness Thickness of lines used to render the text.See putText for details.
  7689. * @return The fontSize to use for cv::putText
  7690. *
  7691. * @see `cv::putText`
  7692. */
  7693. + (double)getFontScaleFromHeight:(int)fontFace pixelHeight:(int)pixelHeight thickness:(int)thickness NS_SWIFT_NAME(getFontScaleFromHeight(fontFace:pixelHeight:thickness:));
  7694. /**
  7695. * Calculates the font-specific size to use to achieve a given height in pixels.
  7696. *
  7697. * @param fontFace Font to use, see cv::HersheyFonts.
  7698. * @param pixelHeight Pixel height to compute the fontScale for
  7699. * @return The fontSize to use for cv::putText
  7700. *
  7701. * @see `cv::putText`
  7702. */
  7703. + (double)getFontScaleFromHeight:(int)fontFace pixelHeight:(int)pixelHeight NS_SWIFT_NAME(getFontScaleFromHeight(fontFace:pixelHeight:));
  7704. //
  7705. // void cv::HoughLinesWithAccumulator(Mat image, Mat& lines, double rho, double theta, int threshold, double srn = 0, double stn = 0, double min_theta = 0, double max_theta = CV_PI)
  7706. //
  7707. /**
  7708. * Finds lines in a binary image using the standard Hough transform and get accumulator.
  7709. *
  7710. * NOTE: This function is for bindings use only. Use original function in C++ code
  7711. *
  7712. * @see `+HoughLines:lines:rho:theta:threshold:srn:stn:min_theta:max_theta:`
  7713. */
  7714. + (void)HoughLinesWithAccumulator:(Mat*)image lines:(Mat*)lines rho:(double)rho theta:(double)theta threshold:(int)threshold srn:(double)srn stn:(double)stn min_theta:(double)min_theta max_theta:(double)max_theta NS_SWIFT_NAME(HoughLinesWithAccumulator(image:lines:rho:theta:threshold:srn:stn:min_theta:max_theta:));
  7715. /**
  7716. * Finds lines in a binary image using the standard Hough transform and get accumulator.
  7717. *
  7718. * NOTE: This function is for bindings use only. Use original function in C++ code
  7719. *
  7720. * @see `+HoughLines:lines:rho:theta:threshold:srn:stn:min_theta:max_theta:`
  7721. */
  7722. + (void)HoughLinesWithAccumulator:(Mat*)image lines:(Mat*)lines rho:(double)rho theta:(double)theta threshold:(int)threshold srn:(double)srn stn:(double)stn min_theta:(double)min_theta NS_SWIFT_NAME(HoughLinesWithAccumulator(image:lines:rho:theta:threshold:srn:stn:min_theta:));
  7723. /**
  7724. * Finds lines in a binary image using the standard Hough transform and get accumulator.
  7725. *
  7726. * NOTE: This function is for bindings use only. Use original function in C++ code
  7727. *
  7728. * @see `+HoughLines:lines:rho:theta:threshold:srn:stn:min_theta:max_theta:`
  7729. */
  7730. + (void)HoughLinesWithAccumulator:(Mat*)image lines:(Mat*)lines rho:(double)rho theta:(double)theta threshold:(int)threshold srn:(double)srn stn:(double)stn NS_SWIFT_NAME(HoughLinesWithAccumulator(image:lines:rho:theta:threshold:srn:stn:));
  7731. /**
  7732. * Finds lines in a binary image using the standard Hough transform and get accumulator.
  7733. *
  7734. * NOTE: This function is for bindings use only. Use original function in C++ code
  7735. *
  7736. * @see `+HoughLines:lines:rho:theta:threshold:srn:stn:min_theta:max_theta:`
  7737. */
  7738. + (void)HoughLinesWithAccumulator:(Mat*)image lines:(Mat*)lines rho:(double)rho theta:(double)theta threshold:(int)threshold srn:(double)srn NS_SWIFT_NAME(HoughLinesWithAccumulator(image:lines:rho:theta:threshold:srn:));
  7739. /**
  7740. * Finds lines in a binary image using the standard Hough transform and get accumulator.
  7741. *
  7742. * NOTE: This function is for bindings use only. Use original function in C++ code
  7743. *
  7744. * @see `+HoughLines:lines:rho:theta:threshold:srn:stn:min_theta:max_theta:`
  7745. */
  7746. + (void)HoughLinesWithAccumulator:(Mat*)image lines:(Mat*)lines rho:(double)rho theta:(double)theta threshold:(int)threshold NS_SWIFT_NAME(HoughLinesWithAccumulator(image:lines:rho:theta:threshold:));
  7747. @end
  7748. NS_ASSUME_NONNULL_END