forked from januhlenberg/Signa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
IsShadowImage.m
17 lines (14 loc) · 14.1 KB
/
IsShadowImage.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
function b = IsShadowImage(file)
W1 =[-0.00962856152235370,0.00848974558908420,-0.00250376095554745,0.00282525475939759,0.000292189404092329,-0.0105055984092456,0.00239614242742286,-0.00171762821621007,0.00713646450914894,0.0115730020515153,-0.00357953732593897,0.00186768580275273,-0.00513182729684798,-0.00157529872809393,0.00134747227135494,-0.00186767299876592,0.00173543532029294,0.00171759741038927;0.00848974558908417,-0.0145562570296125,0.00463079335799758,-0.00618776637540714,0.00135498956770467,0.0100017736294268,-0.00728221511125976,0.00661863001617321,-0.00663229297332740,-0.00612696511692420,0.00688296072261269,-0.00447453301611484,0.00732763775501156,0.00103056826500500,-0.00212234070551721,0.00154671747609233,-0.00387043433381126,0.000995507235109060;-0.00250376095554734,0.00463079335799752,-0.00734708334920530,2.68861204081161e-05,-0.00143853446578554,0.00547283802254563,0.00733984850255155,-0.000836994103334825,-0.00159868677536269,-0.00133846475170105,-0.00235298560349889,-0.000844420704064458,-0.000390254766870853,-0.00130136496408191,0.00173644964857855,-0.000805945358468887,-0.000934197092616843,0.000574856643561188;0.00282525475939791,-0.00618776637540743,2.68861204081576e-05,-0.0325709495690770,0.00817422096130115,-0.00772768877452569,0.0154672029726838,0.0208687220921739,0.00213703576160088,0.00421123217394594,-0.0246358358800668,0.00135623686670982,-0.00219379199378508,0.00166880314922754,0.0218871621978917,-0.0116159647011613,-0.00259160292159554,0.00192332834843197;0.000292189404092254,0.00135498956770475,-0.00143853446578554,0.00817422096130113,-0.00604671721834049,0.00798699988986478,-0.00461185476247766,-0.00580297691906139,-0.00190574525820580,-0.00531198102768459,0.0116472788922369,-0.000704764660414981,0.00351855222300804,-0.000569526924346169,-0.00911464921309265,0.00425173872174791,-0.000325517579245228,0.000463728022425202;-0.0105055984092455,0.0100017736294267,0.00547283802254549,-0.00772768877452618,0.00798699988986492,-0.0391677907073991,0.00609741908237488,0.00240115148366421,0.0190440997719635,0.0208730926040409,-0.0256160625788813,0.00818954806476721,-0.0136208788230401,0.00537458797035821,0.0157045328476006,-0.00798171184092616,0.00590109618558941,-0.000715929266332226;0.00239614242742251,-0.00728221511125945,0.00733984850255145,0.0154672029726837,-0.00461185476247763,0.00609741908237440,-0.0297641634547349,-0.00565643088491696,-0.00315924141638637,0.00488606285763653,0.0297107708751055,-0.00534589398012664,0.00520910819109736,-0.00237063070429075,-0.0154038016750136,0.00854771266485302,-0.000557064255963226,0.00108850773094138;-0.00171762821621027,0.00661863001617342,-0.000836994103334814,0.0208687220921739,-0.00580297691906140,0.00240115148366384,-0.00565643088491710,-0.0270466460409375,0.00258443826720961,-0.00609114288755444,0.0205315320935157,0.0136418853006765,-6.62535923060120e-06,-0.00363666747955407,-0.0171986497976060,0.00261840445344198,0.00298432275036327,-0.00156004451205995;0.00713646450914893,-0.00663229297332739,-0.00159868677536260,0.00213703576160120,-0.00190574525820589,0.0190440997719635,-0.00315924141638667,0.00258443826720939,-0.0127992782394902,-0.0106579966501326,0.00734034411065871,-0.00661893719034230,0.00716286680492348,-0.00122880031661426,-0.00411889757125923,0.00390580541457963,-0.00275066084967572,-0.000919797614619895;0.0115730020515153,-0.00612696511692421,-0.00133846475170086,0.00421123217394649,-0.00531198102768472,0.0208730926040410,0.00488606285763596,-0.00609114288755484,-0.0106579966501325,-0.0313827151780568,0.00691064034386426,-0.000209078059009238,0.0103807941501589,0.00707695295108687,-0.00967226837250036,0.00478180916678794,-0.00215425148724637,-0.00385359453330732;-0.00357953732593855,0.00688296072261226,-0.00235298560349886,-0.0246358358800669,0.0116472788922369,-0.0256160625788807,0.0297107708751058,0.0205315320935157,0.00734034411065831,0.00691064034386353,-0.0630309672418470,0.000490453973345469,-0.0114668221451216,0.0116180554039762,0.0392057282584720,-0.0150349620989531,0.00277467779678467,-0.00242653382187900;0.00186768580275272,-0.00447453301611486,-0.000844420704064493,0.00135623686670988,-0.000704764660415022,0.00818954806476733,-0.00534589398012663,0.0136418853006764,-0.00661893719034234,-0.000209078059009337,0.000490453973345534,-0.0227179044725386,0.00403515877055903,0.00223106908728780,0.00170622074453155,0.0114624428473149,-0.00313899688528445,2.90370804639710e-05;-0.00513182729684791,0.00732763775501150,-0.000390254766870884,-0.00219379199378526,0.00351855222300810,-0.0136208788230401,0.00520910819109755,-6.62535923044863e-06,0.00716286680492344,0.0103807941501589,-0.0114668221451219,0.00403515877055896,-0.00918245552689727,-0.000551295278076893,0.00745352929910780,-0.00438242491876227,0.00293919516296392,-0.000719977414640084;-0.00157529872809396,0.00103056826500507,-0.00130136496408192,0.00166880314922749,-0.000569526924346152,0.00537458797035811,-0.00237063070429070,-0.00363666747955403,-0.00122880031661422,0.00707695295108695,0.0116180554039761,0.00223106908728780,-0.000551295278076949,-0.0116710968731629,-0.00401746221410262,-0.000119453900619202,0.000147538674288143,0.00201919051695882;0.00134747227135465,-0.00212234070551694,0.00173644964857857,0.0218871621978918,-0.00911464921309271,0.0157045328476001,-0.0154038016750139,-0.0171986497976061,-0.00411889757125895,-0.00967226837249984,0.0392057282584722,0.00170622074453162,0.00745352929910765,-0.00401746221410271,-0.0320654672374608,0.0113026966383020,-0.000585520509348643,0.000400066881572470;-0.00186767299876579,0.00154671747609222,-0.000805945358468871,-0.0116159647011614,0.00425173872174796,-0.00798171184092602,0.00854771266485313,0.00261840445344201,0.00390580541457952,0.00478180916678776,-0.0150349620989532,0.0114624428473149,-0.00438242491876223,-0.000119453900619181,0.0113026966383020,-0.0135244239975406,0.00111867479093049,0.00110806238242528;0.00173543532029297,-0.00387043433381128,-0.000934197092616836,-0.00259160292159548,-0.000325517579245252,0.00590109618558950,-0.000557064255963266,0.00298432275036322,-0.00275066084967577,-0.00215425148724644,0.00277467779678477,-0.00313899688528444,0.00293919516296395,0.000147538674288130,-0.000585520509348715,0.00111867479093051,-0.00269006622824761,0.000986410130293145;0.00171759741038926,0.000995507235109059,0.000574856643561219,0.00192332834843206,0.000463728022425183,-0.000715929266332249,0.00108850773094129,-0.00156004451205999,-0.000919797614619879,-0.00385359453330731,-0.00242653382187891,2.90370804639599e-05,-0.000719977414640074,0.00201919051695883,0.000400066881572394,0.00110806238242532,0.000986410130293155,-0.00231069028697375];
w1 = [-0.845542360885787;0.280336092997001;0.473183395460263;1.94854199293082;-0.696596587938079;0.0777332144767540;-1.98027183038834;-0.895141812497727;0.718200145769720;1.68966003469882;3.35078646182922;-0.0540454740864566;0.243051405091944;-1.33707233695591;-2.10898398847232;0.999813011036164;0.140855591688891;0.648486386843387];
w10 =[-234.299648694353];
W2 = [-0.00530724524016005,0.00454817062676274,-0.000435240916893160,-0.00408803055750105,0.000969907879501033,-0.000163459920564477,-0.00126543340875670,0.00115264025343273,0.000156227086841308,-0.000817124886608654,0.00140146237307961,0.000677406959549980,-0.00101315902385481,-0.000222639064809069,-0.000538806574352175,0.00179876698138943,0.000248631941132451,-0.000247239598932890;0.00454817062676281,-0.0108627654359778,0.00284318577583854,0.00420795656261930,0.000486407667766317,0.000832687083915307,0.00248250769167592,-0.000266203380545712,-0.00127909430188523,0.00193485514825818,-0.00415225693347698,0.00111869377265832,0.00245990359179191,0.00117880228614640,0.000511261247317680,-0.00431472725919282,-0.000941763739807715,0.000989635762999359;-0.000435240916893202,0.00284318577583856,-0.00480025776462091,0.000474502438823140,-0.000116901805724813,-0.000753805475179307,0.00255716774436570,-0.000773214643133492,0.000602910720466331,-0.000667906658545266,0.000893531323109301,-0.00135823946584902,-0.00112754834024033,1.11192253384879e-05,-0.000514163788370380,0.00203994525826972,0.000132582921718144,-0.000619510353954327;-0.00408803055750102,0.00420795656261916,0.000474502438823196,-0.0136339254793149,0.000639357902585840,8.11552571359209e-05,0.000378427632553722,0.00974103427050173,2.61557682867570e-05,-0.00278705592441160,0.00266860170005291,-0.00447930363125230,-0.00390449562119280,0.00353924781426644,-0.00335475660959336,0.00304021756240377,0.00184161116541754,-0.000397196116910372;0.000969907879501016,0.000486407667766319,-0.000116901805724817,0.000639357902585824,-0.00275083793317447,3.43609769109556e-05,-0.000333992070971738,0.000824273725776534,0.00225057873539305,-0.000794930255486163,0.000832501160291446,-0.00174597951694838,-0.000126514773386888,-0.000740640886635535,-0.000280308382301078,0.00229112683595463,-0.000270920451734134,9.98452094219660e-06;-0.000163459920564466,0.000832687083915289,-0.000753805475179310,8.11552571359381e-05,3.43609769109559e-05,-0.00298526328943923,0.00263855610007310,-0.000743979261603789,0.000494036080350963,0.000933044088959043,-0.00100763220007017,0.00125764448648223,0.000703137425097933,-0.000306461211603082,-0.000960423400197523,-0.000307594903222540,-0.000557046202071864,0.000358514299266734;-0.00126543340875672,0.00248250769167596,0.00255716774436570,0.000378427632553653,-0.000333992070971750,0.00263855610007310,-0.00804904083248973,0.000594412978788517,-0.000341120680942907,0.000149004646768411,0.00219050539204321,-0.000870034421191998,0.000288926560952380,-0.00219099027985024,0.00231792689249577,-0.000184125060517954,0.000385112878992857,3.00838257234668e-05;0.00115264025343272,-0.000266203380545595,-0.000773214643133539,0.00974103427050174,0.000824273725776524,-0.000743979261603783,0.000594412978788460,-0.0154933530486446,-0.00137041374002160,0.00219861807896149,-0.00247405066646140,0.0111530746455330,0.00247037437592682,-0.00163443734748052,0.00211365774494228,-0.00420649281374744,-0.00102874421627131,-0.000668425830725273;0.000156227086841327,-0.00127909430188521,0.000602910720466325,2.61557682867795e-05,0.00225057873539304,0.000494036080350962,-0.000341120680942923,-0.00137041374002161,-0.00362579239264346,0.00176937330764412,-0.00138987856168217,0.00205444999399772,0.00105216895365354,0.000709851090214832,0.00127514890606510,-0.00337895622587702,0.000484191543395222,-7.87444280414302e-05;-0.000817124886608681,0.00193485514825815,-0.000667906658545252,-0.00278705592441164,-0.000794930255486148,0.000933044088959033,0.000149004646768442,0.00219861807896151,0.00176937330764411,-0.00469238988081763,0.00405143046244047,-0.00328480250376605,-0.00232562958034410,0.00137931890645087,-0.00200868770933298,0.00362105629776204,0.000738728534716378,-0.000555669254972055;0.00140146237307965,-0.00415225693347698,0.000893531323109289,0.00266860170005299,0.000832501160291438,-0.00100763220007016,0.00219050539204318,-0.00247405066646145,-0.00138987856168218,0.00405143046244049,-0.00521980849656911,0.00412346117926445,0.00187631667225910,-0.000247964408898805,0.00129587458237890,-0.00362585486330325,-0.000635544184137285,0.000433260561474536;0.000677406959549931,0.00111869377265828,-0.00135823946584900,-0.00447930363125238,-0.00174597951694837,0.00125764448648223,-0.000870034421191959,0.0111530746455331,0.00205444999399773,-0.00328480250376608,0.00412346117926445,-0.0157578186753851,-0.00277967781419073,0.000271125390975065,-0.00316203659605192,0.00946645553871518,0.000706617988650315,0.000461156059825358;-0.00101315902385484,0.00245990359179189,-0.00112754834024031,-0.00390449562119283,-0.000126514773386881,0.000703137425097929,0.000288926560952399,0.00247037437592684,0.00105216895365354,-0.00232562958034410,0.00187631667225908,-0.00277967781419071,-0.00382867343316080,0.00159433594961183,-0.00157961446151282,0.00347648689731285,0.00130489209995016,-0.000879715133050869;-0.000222639064809085,0.00117880228614644,1.11192253384778e-05,0.00353924781426641,-0.000740640886635542,-0.000306461211603081,-0.00219099027985025,-0.00163443734748049,0.000709851090214847,0.00137931890645085,-0.000247964408898776,0.000271125390975026,0.00159433594961182,-0.00380713354301085,0.00229099721940816,-7.15091252075254e-05,-0.000582278014715556,0.000418205290671489;-0.000538806574352182,0.000511261247317635,-0.000514163788370365,-0.00335475660959337,-0.000280308382301066,-0.000960423400197524,0.00231792689249580,0.00211365774494227,0.00127514890606509,-0.00200868770933296,0.00129587458237887,-0.00316203659605189,-0.00157961446151281,0.00229099721940817,-0.00439206091152177,0.00414798412349746,9.42537899523892e-06,-0.000150402789215756;0.00179876698138950,-0.00431472725919279,0.00203994525826969,0.00304021756240386,0.00229112683595461,-0.000307594903222535,-0.000184125060517989,-0.00420649281374750,-0.00337895622587702,0.00362105629776206,-0.00362585486330325,0.00946645553871516,0.00347648689731286,-7.15091252075608e-05,0.00414798412349749,-0.0125846087797283,-0.000275685991358213,0.00104061701724317;0.000248631941132458,-0.000941763739807716,0.000132582921718142,0.00184161116541755,-0.000270920451734135,-0.000557046202071861,0.000385112878992853,-0.00102874421627132,0.000484191543395219,0.000738728534716380,-0.000635544184137285,0.000706617988650313,0.00130489209995016,-0.000582278014715559,9.42537899524327e-06,-0.000275685991358214,-0.00117306791897135,0.000635114225773954;-0.000247239598932907,0.000989635762999374,-0.000619510353954330,-0.000397196116910386,9.98452094219942e-06,0.000358514299266731,3.00838257234683e-05,-0.000668425830725266,-7.87444280414279e-05,-0.000555669254972059,0.000433260561474541,0.000461156059825357,-0.000879715133050875,0.000418205290671490,-0.000150402789215760,0.00104061701724317,0.000635114225773955,-0.00105569188896980];
w2 = [0.647673245481513;-0.0250949732893267;0.371195648831197;0.958077990710540;-0.239846539328666;0.194625963782764;-0.503965370642220;-0.126645069059679;0.101169519725979;0.122806295490619;0.0122392651788638;0.0863553362567834;0.345388807098214;-0.334696066238067;0.621163704880328;-0.342533249294288;-0.0888989700417266;0.0964063628174281];
w20 =[-157.791813805234];
x = ExtractShadowFeature(file);
r = zeros(2,1) - 1e12;
r(1) = x'*W1*x+w1'*x+w10;
r(2) = x'*W2*x+w2'*x+w20;
[a,classNumber] = max(r);
b = classNumber == 1;
end