Simply shape

Download Simply shape

Post on 06-Jul-2015

5.976 views

Category:

Documents

3 download

Embed Size (px)

DESCRIPTION

...[CC BY]

TRANSCRIPT

<ul><li> 1. Simply ShapesThis is a simply memo</li></ul><p> 2. Classical shape analysis methodsCircularity:Irregularity: The degree of circularity is how much thisMeasurement of the irregu- larity of a solid. Itpolygon is similar to a circle. Where 1 is a is calculated based on its perimeter and theperfect circle and 0.492 is an isosceles perimeter of the sur- rounding circle. Thetriangle.minimum irregularity is a circle, corresponding at the value 1. A square is the maximum 4p ss: object areairregularity with a value of 1.402.C=p2 p: object perimeterpc I=Quadrature:pThe degree of quadrature of a solid,where 1 is a square and 0.800 an isosceles Elongation:triangle.The degree of ellipticity of a solid, where a circle and a square are the less elliptic shape.pQ=D 4 s E=d D: maximum diameter within an object d: minimum diameter perpendicular at D 3. The Workflow of Morphometric Analysis for Shape Original Shape Distance Matrix (Polygon) Fourier TransformTest the number of ClusteringInverse Fourier Transform Clustering by PAMApproximate ShapeAssign Class info to each object(Polygon) Procrustes AnalysisVisualize on Geo-space 4. Fourier descriptors of closed polygonsFourier transform enables to represent any periodic function with indefinite summation oftrigonometric function, which terms Fourier descriptors. Because polygon shape could bedenote as periodic function when decomposed into X and Y axis, this method could beapplicable to polygons.X axsis139.7110 35.54651 2p nt2p ntf( x ) = + an cos + bn sin2 n=1LL139.7106 t(i)139.7102139.7098 35.5460 0.0000.001 0.0020.003 0.004 0.005org_58[,2]t(xi, yi)tY axsis35.5465 1 2p nt2p nt g( y) =+ an cos + bn sin 2 n=1LL 35.545535.5460 t(i)35.5455 139.7098 139.7100 139.7102 139.7104139.7106 139.7108 139.7110 0.0000.001 0.0020.003 0.004 0.005 org_58[,1]t 5. Original Shape 6. Simplifying with approximate ShapeBy configuring higher number of harmonicsand of approximate points, shapes would bemore approximate to original shapes. 7. Inverse Fourier TransformOriginal polygons can be approximatelyOriginal ShapeFirst Approximate Ellipsereconstruct. To reconstruct original 35.5465Approximate Shape t(xj, yj)shapes, number of points should bespecified, and each point is arranged onconstant degree apart in a circle. 35.5460 Approximate with 10 pointsorg_58[,2] 1.0 1 0.5 35.5455 0.0 0 y-10 1 -0.5 -1.0 -1-1.0-0.50.0 0.5 1.0x139.7098 139.7100 139.7102 139.7104139.7106 139.7108 139.7110org_58[,1] H j 2p i j 2p i xj = ai cos + bi sin + cx i=2 L L H j 2p i j 2p i yi = ci cos + di sin + cyi=2 L L 8. Proclustes AnalysisThe aim is to obtain a similar placementand size between two shapes, byminimizing a measure of shape Find an optimum angle of rotation that thedifference called the Procrustes distance sum of the squared distances betweenbetween the objects. To conduct thiscorresponding points is minimized. nanalysis, number of control points inui yi - wi xieach shape should be same.q = tan -1 i=1 n i=1 ui xi - wi yiCalculate root mean square distance for Then, optimum coordinates are assigned byuniform scaling following fomula. ( x - x ) + ( y - y)n 2 2s=i=1 i i (hi, n i ) = ( cosqui -sinqwi,sinqui +sinqwi ) nDissimilarity between two shapes are Translate &amp; uniform scalingmeasured as squared distance.xi - x yi - y(ui, wi ) = , d=i=1(hi - xi ) + (n i - yi ) n22 SS 9. Proclustes AnalysisProcrustes errors 35.5465 sum of squares: 35.5460 1.758e-065e-04org_58[,2] 35.5455Dimension 2 139.7098139.7102139.7106 139.71100e+00org_58[,1] 35.702-5e-04 35.700org_2570[,2] 35.698 35.696 -5e-04 0e+00 5e-04 139.650139.654139.658 Dimension 1 org_2570[,1] 10. Partition Around Medoids (PAM)Partition Around Medoids(PAM) is a clustering algorithm which attempt to minimizesquared error as well as the k-means. In contrast to k-means, PAM chooses existing pointsas centers, terms medoids, and the algorithm is more robust to noise and outliers ascompared to k-means.Silhouette plot of pam(x = tokyo.dist^2, k = 5)k n = 4373 5 clusters Cjargmin x j - mi j : nj | aveiCj si 1 : 1388 | 0.62 i=1 x j SiWhere mi is the medoid of Si.2 : 740 | 0.41$classinfo (output of PAM clustering)3 : 1070 | 0.44sizemax_dissav_diss diameter separation[1,] 138865.80418.27153 193.87860.20960664 : 693 | 0.41[2,] 740 239.5017 29.9133463.2270.1864726[3,] 1070 200.8129 31.75182 429.51830.20960665 : 482 | 0.35[4,] 693 737.196530.68781 1044.5552 0.1864726[5,] 482 460.6608 46.2136 803.36250.3181256 -0.20.0 0.2 0.4 0.6 0.8 1.0 Silhouette width si Average silhouette width : 0.48 11. Silhouette Width - Test the number of clustering -For each datum i, average dissimilarity distanceC k-=4within the same class is calculated At first.1a(i) =(a(i) - a j )2 B n(k )a(i) ,a j KiiDCalculate the lowest averaged dissimilarity todatum j of any other cluster as following. b(i) = argmin 1 (a - b )2 A n b K (i ) jK (k j ) j jThe index of clustering efficiency at datum i The index of clustering efficiency at eachis calculated as silhouette width.cluster k is average silhouette width.a(i) - b(i) S(i) (-1 Sk 1)1S(i) = (-1 S(i) 1) Sk ={ max a(i) , b(i) } n(k j ) S(i) Ki 12. Average Silhouette Width The highest average width = 5Average Silhouette Width Silhouette Width N=50Averaged with PAM from 2 to 50 clusters0.481- a(i)0.46 b(i ) if (a(i) &gt; b(i) ) S(i) = 0if (a(i) = b(i) )0.44 b(i ) if (a(i) &lt; b(i) )res$sila(i) -10.420.40 010 20 30 4050Index Averaged silhouette width suggests that the number of cluster = 5 13. Clustering by PAM 14. Silhouette Width 15. res$sil0.29 0.30 0.31 0.320.33 0.34 0.35 n = 4373-0.5Average silhouette width : 0.36 5 Silhouette plot of (x = tk.ward.cut3, dist = tk.dist^2)0.0 10 IndexSilhouette width si0.5 Averaged Silhouette Width N=20 15 that the number of cluster = 3" Average silhouette width suggests3 clusters Cj1.0 3 : 900 | 0.452 : 2447 | 0.341 : 1026 | 0.30j : nj | aveiCj sHeight0 50000 100000 1500003923 148108382 18184 1936288029362 132531310 17206 27020678097184422 2638582 17602 15052 232763052 18956 22255 15497 164788634 23122 56348822635 107688920 18364 253681369 148588578 11327 10388 17776 15035 162396172 12607 271126057 12024 11766 14012 23905 23918 833 124132667 14502 154364652 252717197 2489985699558 18008 26560 10571 10956 11515 16711 20874 12908 2657744034612 1887914534682 25449 21132 245625271 10375 15421 11692 2386873276924 14926 20796 13485 21036 12735 151937896 10460 19425 2228514307639 590 16410 193601137 26393 11742 136901874 120287516 24452 153409554 102564084 19498 135868056 172206462 18970 11140 10441 11593 369 153627898 23852 122986448 173583293 14018 150698248 100229542 187334885 17329 15833 24985 253992533 10084179286099961 24777 15415 23046 23255 270654401 17348 7777504 14566 19103 12164 26336 10180 11255 238481327 11891 14406 251088635 189015754 197752977 18876 136481401 159764577 25708 12580 27182 25667 26478 16618 272863186 25592342958694686921745402095 18377 18261 22296 11029 18081 482 14427 15361 22378 1061770019668 22567 2611672852812 12519 143825287 14357 12933 14864 2124425066621 10873 2280570298341284542328642 252541225 1575710735439 19118341692272059 11824 10145 24459 14568 26127604467568447 20716 1049423925281 18817 24903 271671607 22707 16421 11536 16268 27184 19855 2014755635888 19973 21356 256208719 188277526 15294 435 176189177 19896 21010 263849936 1433476243207 20000 12632 2494667599294 16148 20291 198799240 16552 21226 15671 12016 23016 154873145 1479118641075 11691 10498 247341797 193942906 16952436199785834 1601029326135 226708749 13097 15204 19858 241759866 20367 24680 167728388 17993 12514 15575 26494 19689 12545 138874756 13726 4997061 13384 19884 925 1040559896929 22536 154818552 25680 910523063116787 11339 10984 24639 12477 19517 10609 18819 20692 13509 24848 20078 336 241513602 154565446 25682 27028 8388441 258195354 1271923768054982325554226 13940 12147 17213 25863 12673 237825180 10347 15426 202012076 14366 158 15442 24820 2616329199030467160182201 15569 220924019450455725590 225745987 15354 25702 21234 25266 160001913 18425 773676879662478 2314337207417 20650 252898722 265299678 149872132 25584114969881795 128673054 11586 253679388 20326 20486 24158 26686 709 969 22425691461464591 173102414965773992762 25082 179223988 12637 13688 10476 17919 15909 2728167575411 269576409680721616381843599641064 232228495 22475 4838083 13613 204632070 21905 5537993 27470 10364 17760 22699 16163373862626334 13927 13722 12326 2422330795278 12341 10402 24824 24840 19010 10046 122274072 26582 19412 24082 25257316550071152 1037318721473 20361 191645741 256977486 26094 211823026 11652 18365 124178624 1068023752801 10784 110102257 25905 12446 14955967151782999 13335 26866 16401 190578016 24227 126651516 25061499486549639 17655 11359 20909 14622 238696508 17985 262504710 25207 14570 257208607 1936998215561 237888106 19262 16139 23116 27095 772 6559121 763 17621 18324 27202 23163 19889 209389270 20873361385 19031 13210 13523 11057 2520917796782 13809 2103153497013 150207377 214399260308602 21292 16046 192701547 22397 24947 1269649 2070738843478 140499129 159219947 13381 13787177493677880 274579719 21348 11963 24254 26800 10356 12768 211581814 24006 16537 20613 15994 14546 215841842 231558503 24574 11607 22830 24199 25101439947666534 259593439 22501 18940 25044 1054742689074 153374794 178872704 200308025 11076 13796 252825586 17057 10010 15855 24408 1835632467072 26654 230627603 23833 11850 272296499 2111255028923463061571889 13798 19806 11051 23858 26696613292315739 10679 206853587 151734607 14703 212847782 26991 10139 17248 212018524 22988 1419210368837 23236 12522 216597983 117827631 268332792 10837 15579 204375359 1831732651978 20892 332 142132006 20018 22909 15081 210925451 219977992 24632465447019209 253146214 149613967 23742 27023 11806 12402 189962472 262047934 22882 247703916 24637 4334707 10414 16124 16649 479 2552516358149 1144116 272381577629360 1897554556156579584 12667 13908 13597 13886 12781 13197 13315 16909 16998 20396 20634 17045 17560 26580 26627 19509 20297 23930 21595 20380 220472588114011281437 107 214 263 274 2846343798144395429506754095526 10622877586188673407544466803544056185659240526892767335533943149326431513675367736113641379742854681 10302 11050710671965000641557606702698480598247928176368724 13217 13646 12676 12895 11417 11183 11526 10533 10745635965267330696770359863929194897839821791529234905889649040835385458845881186748840 10133 1051798279968 10008 10013 10537 1067270176419957790616762765173107685526759936181353436243674362236103564359432143397469846794547460927843235 383 455 794 823151717111730166916782058261423012378 13960 26873 26607 26632 26700 25084 25507 24909 24993 25433 26115 25825 25899 25775 25698 25705 24186 24363 24375 22473 22978 23003 22437 22535 22690 22774 17181 20191 20493 25028 24561 24309 24328 27165 25445 25739 25754 17847 19273 19939 21123 18831 18933 18959 18962 19303 19399 15320 15943 16507 13031 13620 13259 13336 13718 15254 11693 11620 11629 10944 11226 11319 12943 11542 12351 15553 15610 15678 18116 18898 14664 14339 14748 14838 13427 13884 25327 22727 23669 20651 23721 21604 22398 22915 2634784209154 215824497 1545937939943 139269979 14006 179888897 204901235 16351745974952552 20048 225459100 132057791 15583 1516941525360 231219319 19316 14046 19609 16639 199457382 167013380 136553573 143988379 167207707 152767551 163479003 257101844 1514191143519 15482 14516 11632 176985670 2592446652603 12982 299 11414 19772 24907 12330 149318440 19053 18541 20464 232957064 272302826 112077341 24240349654387792 14543 113285655 18072 17950 14027 15078 14669 19600 19096 14902 206736335 2047256915994 13479 26162 20194 11182 13050 160785374 11080385893876589 262627270 11925 12564 211813702 12783 10926 192979457372450767851 12565 13022 117913647 17869 24195 15940 248898887 1600225375511 23855 269863031 208454220 10862 14468 21499 158828229 23334 13570 14918624542007788 21701 23335 13759 107108118 10351 209813920 21200 1271049 243865092 9392270 19463 23659 17697 236833601 265321989 19510 130448549 1218237406926 13478 20841 22937 117532310 131381571 11730 13933 20797 10652 26726 263388589 13425 9161947 17649 197024326 123548253 192181439 13830 10838 21861 11712 117216069 22837571640364272 166816447 157645426 18665 13281 151722738542484987320 231889787 226126318 16314 192858310 113306090591172281251 252615471 264049444 16418 17183 23098 13486 13695 23485 20655 22067 242571731 22600 10763 13212 12936 17575 15170 15323 261103286 19690 22295 15604 198522927 13771 12126 13076 13673 14856 4683771 18631 194367909 977 21912 14021 23488129373817825 20259 111918783 1336546235194 149756896 12478 1415615967661 20298 24904 11779 25892 18955 20704 4704812 217704853 237811101 11930 205238890 12987 17178 25822 104118574 1254777523765 19778 267731185 24377 266524430 133045566 26685 10479 25348 10413 201039172 14280 178326734 23508 191464968 24851 26061 193819192 16201 116735003 104652800 25918 262 20827 12649 20387 11505 203007411 10740 10382 193766033 177527471 153879071 264387405 20047 20041 12285 154453288984125803744 13387 10943 20243 194667708 22027 16545 19397 27075 2243395 11922 20352 15102 15773 27190 18836 333 24580 18499 15714 255322300 18160 190301595535143538677 154052688 14033 26948 17875 13993 186049524 21588 217113153 13230 221766772 21216 17552 2092546805229 10543 11866 102865905 20806 230643834 25244 13432 248923990 14370 239521515 18904 13181 273814237 20117 261605297 12069 15704 24200 20956 2389084966226 128067370 14004 13446 212649267 16493 11913 218567784 25807 21571 13603 236803183965134214354 12093 13797 15116 21904 272605392 22064 397275015704068 6642754 10281 15366 10864 11731 1312945008999 11456 188013327 1590374578787 10024 16646 221714789 245247414 110638226 15955 14035 12146 219023014 22444 270072532 13455 16457 2640263678269 18071 21344 158496686 134185588 15771 12706 22178 26535 20952 2350150117180 126009690 24211 22923 23739 20819 243471125 157179492 165941970 11078 141433423 174139835 203435738 16222 126639786 170194997 260182755952054838893 17647 112838756 227664082 19073 207804312 16802 12149 14023 246577991 220282998 11575 20224 20733 24861 10869 2145632413310 23126 169569222 10884 12666245961601681 10308 1789613528297 242097803 1295174264820 10346 267643228 10366 245755589 23684 271987289 10021 27406 26096 513 23924 27197 15147 2446733638860 15175 2185164248115 15924 18914 12104 17979 258743333 202578663 251943545 10228 11084 12038 10572 20250 14173 197686456 2366346039424 23000 26880 914 17412 13829 213368367 15503 14692 25139 10872 16320 27069 10468 136984393 27203 26624 321 10214 10449 14777 17097 21606 206115406 21145 14726 2071453968871392630407914 14195 12738 19027 2447 samples2663 11983 1277761665616 16511 693 18267 25062713485951754 14065975058867698 18594220655965301 17210 19041172080359005 16231 10229 22068 21751 15935 18110 11875 22134 1314463 8247822 13727 200373751380675759897 147973000 21102 1483345887611 10490 11649 114689126337476752422 22919 11655 26504 2057841613841 26400 17091 15793 24919 129447179 10629 146...</p>