diff --git a/src/experiments/algorithms/colour_FE.py b/src/experiments/algorithms/colour_FE.py index da41dba..d385282 100644 --- a/src/experiments/algorithms/colour_FE.py +++ b/src/experiments/algorithms/colour_FE.py @@ -14,7 +14,7 @@ class ColourSpace(Enum): BGR = 0 HSV = 1 -class colourTester: +class ColourTester: def __init__(self) -> None: self.bgr_curves = [[[], [], []] for x in range(BARK_TYPES)] self.bgr_ids = ["", "", ""] @@ -144,7 +144,7 @@ class colourTester: return if __name__ == "__main__": - tester = colourTester() + tester = ColourTester() tester.setCsvBgrPath(CSV_PATH + "bgr_curve.csv") tester.setCsvHsvPath(CSV_PATH + "hsv_curve.csv") tester.testDataset("dataset") diff --git a/src/experiments/algorithms/data/sift.csv b/src/experiments/algorithms/data/sift.csv index aa803bc..a3e1f97 100644 --- a/src/experiments/algorithms/data/sift.csv +++ b/src/experiments/algorithms/data/sift.csv @@ -1,111 +1,103 @@ -Accasia_out -698.7577929496765,3.1334430177115538,14.639884948730469,1.828372937292583,0.019404600608275344,4.3272259356454015,223 -835.5868207216263,3.2014820717303687,12.595267295837402,1.6907475606337812,0.019033726119218657,4.96780251711607,261 -1322.7272791862488,3.06897280553654,31.375614166259766,1.9465412537508602,0.020197111614083055,8.704955105669796,431 -616.1432831287384,2.948053986261906,10.182110786437988,1.3003369871725294,0.01828445773126121,3.8214516658335924,209 -2042.4658575057983,3.370405705455113,41.08128356933594,2.6347973287004307,0.025092723959190124,15.206190719269216,606 -679.9872843027115,3.2849627261000554,19.78511619567871,2.3892941334247926,0.020702168241971068,4.285348826088011,207 -702.1195831298828,2.901320591445797,12.382240295410156,1.3507806557012718,0.01787308056661782,4.325285497121513,242 -809.6343139410019,2.772720253222609,7.978091716766357,1.095115195842802,0.017495756149164415,5.108760795556009,292 -991.9575394392014,3.4562980468264857,37.2266845703125,3.4535018683730523,0.02128367463146249,6.108414619229734,287 -883.6591415405273,2.814201087708686,19.852262496948242,1.35472176718185,0.01984180409200252,6.230326484888792,314 -1665.44428896904,3.284899978242682,26.174636840820312,2.252376816106766,0.024839076586435062,12.593411829322577,507 -1716.247862815857,3.7391020976380327,34.431396484375,3.7368679730976226,0.027567605871488068,12.653531095013022,459 -1033.3027093410492,3.093720686649848,26.645557403564453,2.403131773101099,0.022129791454149936,7.391350345686078,334 -1002.2664128541946,3.318762956470843,17.658721923828125,2.2496636828812204,0.020582417291373212,6.21589002199471,302 -905.6036241054535,3.1554133244092455,24.95030975341797,2.079331380141301,0.01953536727326153,5.606650407426059,287 -1573.2526054382324,3.1654982000769265,22.565237045288086,1.8844591835561313,0.027768299585092117,13.800844893790781,497 -1344.9189388751984,3.0705911846465717,10.925896644592285,1.3562763371500577,0.018900907925887195,8.278597671538591,438 -2635.2527647018433,3.4313187040388584,21.754484176635742,2.423580701045881,0.03490584164925773,26.80768638662994,768 -1274.166908979416,3.201424394420643,20.968454360961914,2.089842708717911,0.01874925658790086,7.462204121984541,398 -780.677412033081,3.500795569655072,29.299978256225586,3.1758027558377497,0.017996931807743595,4.0133157931268215,223 -Berk_out -2687.594747185707,3.7172818080023613,48.48632049560547,3.884212269938133,0.02503235707572181,18.098394165746868,723 -2449.5360144376755,3.9129968281752006,48.72830581665039,4.190141018929445,0.026578323430598925,16.638030467554927,626 -2248.9365841150284,3.6687383101387088,24.20957374572754,2.434784715027513,0.02334839300378598,14.312564911320806,613 -2386.9925570487976,3.6221434856582664,24.51873779296875,2.503845528850179,0.028970138332347226,19.091321161016822,659 -2558.578493118286,3.773714591619891,50.86576843261719,3.418055103617325,0.02585626285314384,17.530546214431524,678 -2592.295235991478,3.635757694237697,52.358192443847656,3.2337805396374515,0.024524578845538565,17.486024716868997,713 -2561.138155579567,3.2378484899868103,16.90852165222168,1.978250128109907,0.024490677895243416,19.37212621513754,791 -3345.3579272031784,3.64815477339496,39.54557418823242,2.880069078600365,0.02579340783446507,23.65255498420447,917 -2192.156372189522,3.4740988465761045,48.14958953857422,3.5506460162235087,0.027054107882283192,17.071142073720694,631 -2484.008170723915,3.5384731776693945,37.6187629699707,2.9612951727148524,0.03286086464900407,23.068326983600855,702 -1462.3458621501923,3.4735056108080578,22.076406478881836,2.3849241758099997,0.024276126959226194,10.220249449834228,421 -2419.1333129405975,3.495857388642482,29.215726852416992,2.7948339211851914,0.03273452721762261,22.652292834594846,692 -2687.440049767494,3.467664580345154,34.797386169433594,2.5354207818312107,0.026453086143780138,20.501141761429608,775 -1468.780837059021,3.2785286541496004,19.688207626342773,1.8301759005766227,0.022607883232662322,10.12833168823272,448 -Eik_out -1579.444641828537,3.6816891417914617,19.227346420288086,2.4975664779859987,0.031246154553893006,13.4046003036201,429 -1612.8415837287903,3.895752617702392,19.052034378051758,2.577455127470621,0.030227775289564603,12.514298969879746,414 -1352.4212625026703,3.8640607500076296,15.00854206085205,2.35411413545315,0.031208549745913063,10.922992411069572,350 -1538.6859678030014,3.780555203447178,40.99676513671875,3.3523572759224476,0.029105583906027258,11.845972649753094,407 -1225.0985703468323,3.3290722020294354,19.58705711364746,2.038351397338684,0.025498346643238936,9.383391564711928,368 -1365.3871425390244,3.447947329644001,19.194652557373047,2.2193953246091485,0.025410288173441934,10.062474116683006,396 -1097.9404437541962,2.9998372780169293,12.264142990112305,1.581511211694125,0.023072358251350823,8.444483119994402,366 -1291.582367658615,3.2864691289023287,28.83696937561035,2.3913841440343515,0.022361759129560933,8.788171337917447,393 -1363.1331936120987,3.549826025031507,19.18490219116211,2.6828781845914205,0.022771707088395488,8.744335521943867,384 -Els_out -1359.8641113042831,3.2767809910946584,19.266313552856445,1.897638219600126,0.03115534636539867,12.929468741640449,415 -1134.7650756835938,3.327756820186492,18.936323165893555,1.7635501819834738,0.03266596192182684,11.13909301534295,341 -1632.902286529541,3.5040821599346375,24.11359214782715,2.5618395036682124,0.03067660743626466,14.295299065299332,466 -1536.4152345657349,3.5565167466799417,27.18216896057129,2.786383289622822,0.030237345891590748,13.062533425167203,432 -1107.7055238485336,3.886686048591346,22.485553741455078,2.9948413624608015,0.026233021696016455,7.476411183364689,285 -1616.8189809322357,4.429641043649961,45.3355827331543,4.300393576628321,0.025648677525148815,9.361767296679318,365 -1041.9242010116577,3.2764911981498672,20.875349044799805,2.3053497977427333,0.026208830522900482,8.334408106282353,318 -1111.8425114154816,3.3897637543154926,34.425537109375,2.6968539571918693,0.02739228969780592,8.984671020880342,328 -Esdoorn_out -1804.0408366918564,3.280074248530648,16.878116607666016,2.014352156832684,0.023109257851134647,12.710091818124056,550 -1065.8392305374146,3.125628242045204,12.645761489868164,1.5616937783846487,0.023261115867152942,7.932040510699153,341 -1443.1293832063675,3.164757419312209,13.824272155761719,1.6381495412391829,0.023636438981874994,10.778216175734997,456 -2109.4739229679108,3.3859934558072404,22.446571350097656,1.9491651806275798,0.024649366696049755,15.356555451638997,623 -566.1849731206894,3.494968969880799,14.277800559997559,2.26332032519058,0.02264520879489956,3.668523824773729,162 -654.3276780843735,3.255361582509321,14.174254417419434,2.0223312092105425,0.0228689360798369,4.596656152047217,201 -2245.0964748859406,3.6804860244031814,24.625778198242188,2.75325816629717,0.028883854125733258,17.619151016697288,610 -2144.3980325460434,3.9060073452569095,23.537641525268555,2.982770847358778,0.0322847970131995,17.724353560246527,549 -716.7942097187042,3.303199123127669,12.021895408630371,1.8694689392752937,0.022289771651033706,4.836880448274314,217 -512.756842136383,3.308108658944407,12.388520240783691,1.9337408376098448,0.022146687284111975,3.4327365290373564,155 -203.3936928510666,2.676232800671929,9.652430534362793,1.0712162703218076,0.01939073234404388,1.473695658147335,76 -69.72195136547089,2.9050813068946204,8.56438159942627,1.3172613562659046,0.019768514127160113,0.4744443390518427,24 -760.4716109037399,3.456689140471545,15.6034517288208,1.8629395593771183,0.022623810722407968,4.977238358929753,220 -1182.883133649826,3.360463447868824,19.758787155151367,2.1385583241671227,0.022289208096811886,7.845801250077784,352 -Es_out -321.85712587833405,2.7746303955028795,8.890114784240723,1.3376489632824087,0.01832420542707731,2.125607829540968,116 -552.8187339305878,3.2328580931613318,10.130751609802246,1.8025538661742508,0.018092449095470513,3.093808795325458,171 -588.2388911247253,3.0478699022006492,9.2846097946167,1.3144556549216149,0.017584343860649693,3.3937783651053905,193 -394.3926087617874,3.1301000695379955,10.9545259475708,1.6391168134480771,0.017145832527487997,2.1603748984634876,126 -553.2564067840576,2.8372123424823465,10.358263969421387,1.350251161044622,0.018460245196444867,3.599747813306749,195 -338.75891745090485,2.7996604748008664,9.217413902282715,1.283988791527709,0.018358958323201363,2.221433957107365,121 -720.4328188896179,3.0526814359729575,12.120339393615723,1.6056232318864754,0.018135199863937194,4.279907167889178,236 -849.7654691934586,3.255806395377236,10.75560474395752,1.4615165188330932,0.018580378411459056,4.849478765390813,261 -555.6458119153976,3.388084218996327,14.520678520202637,1.953400702594663,0.01816363431081721,2.9788360269740224,164 -1692.7979286909103,3.632613580881782,20.59199333190918,2.3585647083456562,0.018669820646455615,8.700136421248317,466 -749.9521169662476,3.1643549239082174,12.163043022155762,1.6879179665006827,0.01935904413335937,4.588093459606171,237 -495.28962099552155,2.983672415635672,12.046462059020996,1.60246979233263,0.017850231289504522,2.9631383940577507,166 -547.3506425619125,3.2008809506544593,12.70744514465332,1.6010494871239151,0.017072790629116066,2.9194471975788474,171 -609.8123083114624,3.06438345885157,11.177712440490723,1.6252859374605053,0.01953577640087311,3.887619503773749,199 -1049.4082342386246,3.915702366562032,40.334678649902344,4.186340109661006,0.021392696182618836,5.733242576941848,268 -98.67310166358948,2.666840585502418,5.462077617645264,0.8816751949777557,0.018322708311717253,0.6779402075335383,37 -Linde_out -2461.9480855464935,3.647330497105916,31.023351669311523,2.935188384240195,0.028290224722414103,19.09590168762952,675 -1867.9105838537216,3.612979852715129,32.11227035522461,2.97824320863418,0.024062555778692377,12.440341337583959,517 -2124.3844242095947,3.4099268446381936,25.51401710510254,2.3428222023628127,0.023997853738801436,14.950662879273295,623 -1271.0833770036697,3.5210065844977003,30.341659545898438,2.694577657260915,0.022613988515928676,8.163649854250252,361 -2168.191069126129,3.6379044783995456,22.332868576049805,2.5124689591930625,0.024711657454565966,14.728147842921317,596 -2013.289783000946,3.653883453722225,25.39375114440918,2.890201927887927,0.024696742919714826,13.60790534876287,551 -Plataan_out -393.0376785993576,6.238693311100914,54.77334213256836,8.288615256835522,0.018721998817036078,1.1794859254732728,63 -121.42510282993317,3.0356275707483293,6.407865047454834,1.2202699276482052,0.018214209564030172,0.7285683825612068,40 -535.1427782773972,2.9896244596502632,13.512324333190918,2.097842298338548,0.016643719497922413,2.979225790128112,179 -90.34654986858368,3.1153982713304718,6.734649181365967,1.3800949819155952,0.015865142681989176,0.4600891377776861,29 -437.9166510105133,2.9588962906115763,11.90050983428955,1.4047910909894616,0.01991794491186738,2.9478558469563723,148 -165.1281417608261,2.580127215012908,4.76331090927124,0.7642263750567146,0.018476538331015036,1.1824984531849623,64 -232.94678628444672,2.875886250425268,9.826898574829102,1.3727227350017257,0.019708929284487243,1.5964232720434666,81 -332.89813327789307,3.78293333270333,22.732511520385742,3.045459303553181,0.019926275486465205,1.753512242808938,88 -375.2972539663315,4.415261811368605,24.255054473876953,4.276442351754282,0.017834563169847516,1.515937869437039,85 -55.11076760292053,3.061709311273363,9.913771629333496,1.935650105177096,0.017019378021359444,0.30634880438447,18 -38.28573513031006,2.3928584456443787,3.611070394515991,0.5145855975780511,0.014993195189163089,0.23989112302660942,16 -599.6391468048096,5.259992515831663,40.99736404418945,5.811482494116048,0.01938449298113323,2.2098321998491883,114 -224.61611258983612,4.0110020105327875,38.507686614990234,6.750403253193775,0.01725217021469559,0.966121532022953,56 -316.32959711551666,4.108176585915801,40.63800048828125,6.427567028038508,0.017561782018414566,1.3522572154179215,77 -138.6963803768158,2.52175237048756,6.668946743011475,0.8272403842232803,0.016272347149523823,0.8949790932238102,55 -241.65850698947906,3.0207313373684883,19.399702072143555,2.1353345471026124,0.017683570575900375,1.41468564607203,80 +name,tot_mag,avg_mag,max_mag,std_mag,avg_rep,max_rep,counts +accasia,15164.9898583889,3.4063319538160153,57.976593017578125,2.917065856606418,0.017221197798456545,76.66877259872854,4452 +accasia,15545.022024869919,3.5450449315552834,59.905799865722656,3.2648357170133546,0.01729495062183763,75.838358476758,4385 +accasia,6928.212244153023,9.869248211044193,124.7079849243164,6.9960866404667765,0.019179201324037845,13.463799329474568,702 +accasia,11936.62828195095,3.4202373300719056,41.06315994262695,2.595809195351602,0.01701887700930878,59.39588076248765,3490 +accasia,36589.467280983925,3.878879177460397,164.98324584960938,3.9475491795260664,0.020075884262027,189.37581624370068,9433 +accasia,26599.558555483818,2.872522522190477,83.51063537597656,2.437369350192232,0.018656586407388098,172.7599901324138,9260 +accasia,7907.194328546524,5.144563649021811,49.580970764160156,4.195608238199338,0.016672596838943315,25.625781341455877,1537 +accasia,10200.74049627781,4.718196344254306,33.869163513183594,3.291552362662293,0.016284186741083888,35.206411734223366,2162 +accasia,31148.653141617775,2.980732358049548,150.19122314453125,3.0247675976627186,0.019246410631338518,201.1249910974875,10450 +accasia,28875.25863957405,3.04623469137821,78.77422332763672,2.1939246913220405,0.017976174172203034,170.39615497831255,9479 +accasia,15316.206339716911,5.525326962379838,104.40962982177734,5.2621921394581115,0.02150614555383539,59.61503547523171,2772 +accasia,26347.344432592392,4.147881680194017,137.0272674560547,5.188415872170436,0.02343868701138137,148.88253989629447,6352 +accasia,22511.89281797409,3.504341970419379,106.48409271240234,3.518006774914754,0.01850495697984966,118.87584363855422,6424 +accasia,26173.198886990547,3.1507402054882085,71.0332260131836,2.9714700159332508,0.019877487305312743,165.12228704523295,8307 +accasia,10168.147885918617,4.855849038165529,98.5608901977539,4.701275294236762,0.017976685668187928,37.643179789185524,2094 +accasia,26446.716243505478,3.8311916910771373,94.63233947753906,3.343089116919832,0.022207788116992488,153.30036137159914,6903 +accasia,27516.46874153614,3.3688135090029556,44.093666076660156,2.8204324634995626,0.01760253052904027,143.77746936120093,8168 +accasia,48197.32991504669,3.6797472831765683,201.8857879638672,4.334822389400663,0.023141884257848286,303.11240000929683,13098 +accasia,15747.088212013245,4.372976454321923,76.72649383544922,4.257208435303879,0.016772586843777335,60.398085224442184,3601 +accasia,13369.382207036018,3.3726998504127192,116.50067138671875,4.031291684603461,0.01744039929081901,69.13374278880656,3964 +berk,15165.593639731407,9.790570458186835,194.14788818359375,11.58330875940688,0.021276251428560374,32.95691346284002,1549 +berk,39272.00748074055,3.836280890958342,194.97860717773438,5.205598637577069,0.02092294977963134,214.188236894086,10237 +berk,51839.80159878731,3.2200634572822726,97.60083770751953,3.281217383277221,0.02156046767244086,347.1019690586254,16099 +berk,68079.86972010136,3.075666126952851,97.00767517089844,2.933243861070278,0.025058012977217225,554.6591172507033,22135 +berk,52611.779153466225,3.4176808596509174,203.18980407714844,4.079258678053557,0.02103449909019636,323.80507899448276,15394 +berk,45709.45268702507,3.5488705502348656,207.60891723632812,4.264039135894253,0.02020927820816023,260.29550332110375,12880 +berk,56556.77719140053,3.4473227594417,66.8672103881836,2.991719027888606,0.02075826829247332,340.5601496063173,16406 +berk,69326.75464332104,3.520196742323603,157.0282745361328,3.761617305682108,0.021653500907045535,426.44404686335474,19694 +berk,51514.08223903179,3.4283297111028745,193.7554931640625,3.8365793786921363,0.021894522919173914,328.98710138350725,15026 +berk,41592.69394314289,3.8295455246425645,150.65255737304688,4.4407310707238254,0.024121834594924778,261.987245535478,10861 +berk,29622.170075058937,3.3377093042319927,87.41674041748047,3.4928618450518933,0.020495768032548295,181.8999412888661,8875 +berk,42120.5403380394,3.5982009514812403,117.60240936279297,3.5612159199633155,0.024230402902433164,283.6410963758826,11706 +berk,62913.26529479027,3.2983781742052147,140.00869750976562,3.3620915722297777,0.021727205081485915,414.42470972426236,19074 +berk,45799.692146897316,3.0016838476141903,77.8819351196289,2.452876865742452,0.021599234874936587,329.56112572178245,15258 +eik,63834.814037799835,2.8533351527713138,76.7087631225586,2.5404458006370016,0.028908435189681874,646.7395120635629,22372 +eik,55188.4915984869,2.8565471841866925,76.25062561035156,2.553004505128218,0.031500903321005885,608.5974521618336,19320 +eik,52288.57052016258,2.9721236014416292,60.617530822753906,2.6907289064405018,0.02678722223600569,471.2676007980481,17593 +eik,50725.16963458061,2.87053192431558,165.36187744140625,2.8438650689729807,0.026012771288892723,459.6716814460233,17671 +eik,51767.5250505209,2.7778238382979663,78.12059783935547,2.194832323417288,0.02457406891700393,457.9623483372852,18636 +eik,51367.59564745426,2.7622927321711264,79.17882537841797,2.1496440557092606,0.02451177535195582,455.8209744449705,18596 +eik,50980.52434504032,3.0087656011001136,57.09829330444336,2.0484073231389446,0.02121364530622238,359.444006068632,16944 +eik,55399.77093279362,3.0033487440525652,78.6849594116211,2.1366994107310453,0.02088382376893502,385.22301324177533,18446 +eik,57414.07801401615,2.9029263835583046,76.87667083740234,2.376024314305271,0.02226091847023349,440.27644550427794,19778 +els,29888.712849259377,3.453346371953712,77.54449462890625,2.974133936476013,0.023307244492246023,201.72420108038932,8655 +els,32700.319115042686,3.022769376506072,76.61088562011719,2.482134083814555,0.02650472737265412,286.7281407173723,10818 +els,42571.35042846203,3.065554146213151,96.173583984375,3.079248377258068,0.025765765720768198,357.809188564308,13887 +els,40233.43422353268,3.2795430570209225,225.88340759277344,4.323117946107758,0.023794323647620092,291.9087625090033,12268 +els,43900.124643445015,2.7843042204252564,89.5900650024414,2.6182892137195872,0.023553875548558444,371.373955774121,15767 +els,36148.41038763523,3.147445397269067,181.5131072998047,3.9690857204469085,0.024038225528490144,276.0790201947093,11485 +els,47270.191927194595,2.8045204347193473,83.85931396484375,2.15174193741325,0.022752020757969164,383.48530987557024,16855 +els,47888.50561273098,2.840362135986416,137.18141174316406,2.430663437201275,0.02384652077675546,402.0523402960971,16860 +esdoorn,51964.72780644894,3.1776877518772664,65.31332397460938,2.6779375055754016,0.021021957924735424,343.7720779431984,16353 +esdoorn,36469.041769742966,3.222785592942998,51.52651596069336,2.2908766176355653,0.020919144244291105,236.72103626839817,11316 +esdoorn,44434.62904191017,3.3759785018925825,58.209197998046875,2.5395262662029543,0.020963976894730476,275.9278638884425,13162 +esdoorn,69145.88754487038,3.0275356865392693,90.3474349975586,2.510245671208097,0.023009642571619617,525.5172266932204,22839 +esdoorn,15921.277134418488,3.054148692579798,57.215606689453125,2.9429495370778596,0.022221898823889332,115.8427585689351,5213 +esdoorn,15082.49755358696,3.448216175945807,56.76969528198242,3.128985506805403,0.020565349331860626,89.95283797755837,4374 +esdoorn,51476.25468945503,3.3352504010272797,96.4999008178711,3.634572449729199,0.02638917390368874,407.290510029532,15434 +esdoorn,56530.83743548393,3.10728507862826,94.0808334350586,3.0635875411866738,0.02877198096714066,523.44864973519,18193 +esdoorn,14178.651248455048,3.7739289987902707,51.923377990722656,3.109030855766893,0.021073245825897927,79.17218456789851,3757 +esdoorn,13968.505002975464,3.3147852403833564,51.84489059448242,2.636145941316305,0.021350118181105538,89.96939801517874,4214 +esdoorn,9704.507964253426,2.9186490118055417,39.0592155456543,1.9892928017131728,0.01928112981770944,64.10975664388388,3325 +esdoorn,4105.167162537575,2.917673889507871,34.16384506225586,1.80608932568296,0.019406570240791673,27.305044328793883,1407 +esdoorn,20942.461718678474,3.0852182850145073,62.57198715209961,2.6654445510597586,0.022499254307175646,152.7249382371083,6788 +esdoorn,20403.733518719673,3.6963285359999407,69.86234283447266,3.251308080454981,0.020655884929305025,114.02048480976373,5520 +es,13859.789357066154,3.176664991305559,50.301063537597656,2.2194275031670085,0.018267407934363898,79.7007008176297,4363 +es,18797.46695792675,2.891028446312942,40.70370101928711,2.3766250816626684,0.018375364310268264,119.47661874536425,6502 +es,14539.770388841629,3.025966782277134,57.08477783203125,2.5402523423713848,0.017289947594334755,83.0781981907785,4805 +es,9504.01031088829,3.2075633853824805,34.08616256713867,2.5010490486505024,0.016791504505396876,49.75322784949094,2963 +es,24386.167057275772,2.732343647874036,42.56733322143555,1.6547304167824664,0.019324516822852675,172.47131264396012,8925 +es,14266.262740135193,2.9073288649144473,37.2099609375,1.945462864301448,0.018608255268193954,91.31070860102773,4907 +es,22237.651322841644,3.085991024540889,47.40462112426758,2.312334244836164,0.018053992728043845,130.09707159828395,7206 +es,14912.85695695877,3.2146706093896897,42.73832321166992,2.7790836859857584,0.01712462381407776,79.44112987350672,4639 +es,12068.791072368622,3.093768539443379,58.395687103271484,3.120448712948108,0.01802021693113606,70.29686624836177,3901 +es,17076.999238967896,4.223843492200815,81.8597183227539,5.098221183187558,0.01778623857932783,71.90976257622242,4043 +es,20633.80090200901,3.1367894347839784,48.71122741699219,2.519163694977517,0.0185501757045309,122.02305578440428,6578 +es,13554.606061339378,3.593479867799411,47.93798065185547,2.6917741054294857,0.017044946006158503,64.29353633522987,3772 +es,5528.5674558877945,4.531612668760487,52.1837272644043,4.321579897352088,0.016761698828796384,20.449272571131587,1220 +es,27199.32867872715,2.8139177197110645,44.931453704833984,2.015878584981796,0.019529254731182423,188.76977623160928,9666 +es,32914.70514917374,3.037813119443815,161.8765106201172,3.378283405489069,0.0202808107034981,219.74258397240192,10835 +linde,63871.849345326424,3.162598997094792,123.16515350341797,3.2060532979153304,0.021387362330449182,431.9391696257517,20196 +linde,45863.457280635834,3.1261302760981415,128.25607299804688,3.3289444752338158,0.020177906039165524,296.0300595005974,14671 +linde,51152.2439340353,3.212273545216987,103.11244201660156,3.041080519392309,0.019528893328345967,310.97809736058116,15924 +linde,38751.792929530144,2.8891219659681013,120.66178131103516,2.6880328928215667,0.020017803890407998,268.49880358204246,13413 +linde,53731.68099296093,3.0714348343981324,89.00190734863281,2.990320983622203,0.02108558129099293,368.87115910463035,17494 +linde,56114.80684053898,3.284833275217408,102.59563446044922,3.3060893318294005,0.020988654479059933,358.54918446578085,17083 +plataan,1729.4148353338242,15.580313831836254,219.07583618164062,26.45635168497052,0.016952781862503773,1.8817587867379189,111 +plataan,4357.703786015511,2.8370467356871814,26.809112548828125,2.121002316215746,0.016336855511932907,25.093410066328943,1536 +plataan,21035.534307718277,2.865876608680964,102.953369140625,2.427748326439853,0.016621306377440203,122.0003888104111,7340 +plataan,3647.662783384323,2.99725783351218,27.455228805541992,2.092285785778102,0.016457317008245844,20.02855479903519,1217 +plataan,11276.632598400116,3.133268296304561,48.31289291381836,2.3686226002960895,0.01762741158537051,63.44105429574847,3599 +plataan,2780.628197789192,3.3910099973038927,19.053707122802734,2.173822146963218,0.016518751522753297,13.545376248657703,820 +plataan,8295.696098685265,2.9169114271045236,40.91032791137695,2.008587344002149,0.01774939457963204,50.479278184473515,2844 +plataan,17380.02264869213,2.7508741134365513,94.3486099243164,2.7094429153510995,0.018418108266856418,116.36560802999884,6318 +plataan,4099.102380394936,4.346874210386995,126.37276458740234,7.098989333082836,0.01673552955373379,15.781604369170964,943 +plataan,2547.2662686109543,2.8524818237524685,39.15373992919922,1.9698678997855525,0.01706619038635579,15.240108015015721,893 +plataan,1925.219081878662,2.9303182372582377,12.850839614868164,1.3474462069592477,0.01587614152705243,10.430624983273447,657 +plataan,13615.978735089302,3.0639016055556487,164.1551971435547,5.028849252836136,0.018529106203330852,82.34334796760231,4444 +plataan,3256.649623632431,4.101573833290216,153.08065795898438,9.573489959244478,0.016077877360135693,12.76583462394774,794 +plataan,5729.01670062542,3.3020269167869856,83.26604461669922,3.0823282064947537,0.01664422937274323,28.8777379617095,1735 +plataan,15331.447711229324,2.5467521114998877,26.43955421447754,1.020247154962402,0.018039538105485645,108.59801939502358,6020 +plataan,14527.706436991692,3.045002397189623,77.73555755615234,1.945592025707336,0.017644656706719285,84.18265714775771,4771 diff --git a/src/experiments/algorithms/sift_v3.py b/src/experiments/algorithms/sift_v3.py index af922eb..9d6deb2 100644 --- a/src/experiments/algorithms/sift_v3.py +++ b/src/experiments/algorithms/sift_v3.py @@ -5,84 +5,84 @@ import matplotlib.pyplot as plt import csv import pandas as pd -DATASET_PATH = "C:\\Users\\Tom\\Downloads\\Dataset_out\\" -CSV_PATH = "C:\\Users\\Tom\\Desktop\\Files\\Repositories\\EV5_Beeldherk_Bomen\\src\\experiments\\algorithms\\data\\" -DATASET_FOLDERS_LEN = len(os.listdir(DATASET_PATH)) +DATASET_PATH = "C:\\Users\\tomse\\Downloads\\processed" +CSV_PATH = "C:\\Users\\tomse\\Desktop\\Repositories\\EV5_Beeldherk_Bomen\\src\\experiments\\algorithms\\data\\" +DATASET_FOLDERS_LEN = 7+1 # Actually tree types EARLY_BREAK = 0 -SCALE = .25 +SCALE = 1 sift = cv2.SIFT.create(enable_precise_upscale=True) ## Create 2D lists ## -max_magnitudes = [[] for x in range(DATASET_FOLDERS_LEN)] -avg_magnitudes = [[] for x in range(DATASET_FOLDERS_LEN)] -tot_magnitudes = [[] for x in range(DATASET_FOLDERS_LEN)] -std_magnitudes = [[] for x in range(DATASET_FOLDERS_LEN)] -max_responses = [[] for x in range(DATASET_FOLDERS_LEN)] -avg_responses = [[] for x in range(DATASET_FOLDERS_LEN)] -counts = [[] for x in range(DATASET_FOLDERS_LEN)] +max_magnitudes = [[] for x in range(DATASET_FOLDERS_LEN)] +avg_magnitudes = [[] for x in range(DATASET_FOLDERS_LEN)] +tot_magnitudes = [[] for x in range(DATASET_FOLDERS_LEN)] +std_magnitudes = [[] for x in range(DATASET_FOLDERS_LEN)] +max_responses = [[] for x in range(DATASET_FOLDERS_LEN)] +avg_responses = [[] for x in range(DATASET_FOLDERS_LEN)] +counts = [[] for x in range(DATASET_FOLDERS_LEN)] ## Create other variables ## labels = ['' for x in range(DATASET_FOLDERS_LEN)] -i = 0 +i = -1 +last_name = "" -for folder in os.listdir(DATASET_PATH): - if not folder.endswith("_out"): - continue +for file in os.listdir(DATASET_PATH): + name = file.split('_')[0] + if last_name != name: + last_name = name + i += 1 if EARLY_BREAK: - print("Step %d/%d processing %s:"%(i+1, EARLY_BREAK, folder)) + print("Step %d/%d processing %s:"%(i+1, EARLY_BREAK, file)) else: - print("Step %d/%d processing %s:"%(i+1, DATASET_FOLDERS_LEN, folder)) + print("Step %d/%d processing %s:"%(i+1, DATASET_FOLDERS_LEN, file)) - for file in os.listdir(DATASET_PATH + folder): - ## Load an image ## - path = DATASET_PATH + folder + "\\" + file - full_image = cv2.imread(path, 0) - image = cv2.resize(full_image, (0, 0), fx=SCALE, fy=SCALE) + ## Load an image ## + path = DATASET_PATH + "\\" + file + full_image = cv2.imread(path, 0) + image = cv2.resize(full_image, (0, 0), fx=SCALE, fy=SCALE) - ## Detect keypoints ## - kp = sift.detect(image, None) - image = cv2.drawKeypoints( - image, - kp, - image, - flags=cv2.DRAW_MATCHES_FLAGS_DRAW_RICH_KEYPOINTS) + ## Detect keypoints ## + kp = sift.detect(image, None) + image = cv2.drawKeypoints( + image, + kp, + image, + flags=cv2.DRAW_MATCHES_FLAGS_DRAW_RICH_KEYPOINTS) - ## Average and Max size ## - magnitudes = [keypoint.size for keypoint in kp] - tot_magnitudes[i].append(np.sum(magnitudes)) - max_magnitudes[i].append(np.amax(magnitudes)) - avg_magnitudes[i].append(np.sum(magnitudes)/len(kp)) - std_magnitudes[i].append(np.std(magnitudes)) - - ## Number of keypoints ## - counts[i].append(len(kp)) - - ## Response ## - responses = [keypoint.response for keypoint in kp] - max_responses[i].append(np.sum(responses)) - avg_responses[i].append(np.mean(responses)) - - # cv2.imshow("Opencv tech", image) - # cv2.waitKey(0) + ## Average and Max size ## + magnitudes = [keypoint.size for keypoint in kp] + tot_magnitudes[i].append(np.sum(magnitudes)) + max_magnitudes[i].append(np.amax(magnitudes)) + avg_magnitudes[i].append(np.sum(magnitudes)/len(kp)) + std_magnitudes[i].append(np.std(magnitudes)) + ## Number of keypoints ## + counts[i].append(len(kp)) + + ## Response ## + responses = [keypoint.response for keypoint in kp] + max_responses[i].append(np.sum(responses)) + avg_responses[i].append(np.mean(responses)) + + # cv2.imshow("Opencv tech", image) + # cv2.waitKey(0) + ## Store labels ## - labels[i] = folder + labels[i] = name - ## Increment arrays ## - i += 1 - - if(i == EARLY_BREAK): + if(i == EARLY_BREAK and EARLY_BREAK != 0): break print("Done!") ## CSV ## with open(CSV_PATH + "sift.csv" , 'w', newline='') as file: + file.write("name,tot_mag,avg_mag,max_mag,std_mag,avg_rep,max_rep,counts\n") for i in range(len(labels)): - file.write(labels[i] + '\n') for j in range(len(tot_magnitudes[i])): + file.write(str(labels[i]) + ',') file.write(str(tot_magnitudes[i][j]) + ',') file.write(str(avg_magnitudes[i][j]) + ',') file.write(str(max_magnitudes[i][j]) + ',')