ルールベース画像処理のススメ
by
fkubota
Link
Embed
Share
Beginning
This slide
Copy link URL
Copy link URL
Copy iframe embed code
Copy iframe embed code
Copy javascript embed code
Copy javascript embed code
Share
Tweet
Share
Tweet
Slide 1
Slide 1 text
ϧʔϧϕʔεը૾ॲཧͷεεϝ fkubota DeepLearning ωΠςΟϒੈ͚ͯ
Slide 2
Slide 2 text
ࣗݾհ 02 fkubota (Twitter, Kaggle) - όϯυϧΧʔυͷձࣾ(ΧϯϜ)ͰػցֶशΤϯδχΞ - Kaggle Expert - ԭೄग़(౦ژʹग़͖ͯͯ3) - ཧֶՊग़(ڧ૬ؔిࢠܥɺ4.2KͷӷମϔϦϜʹ࣓ੑମಥͬࠐΜͰͨ) - ϓϩάϥϛϯάྺ2͙Β͍ - झຯ - ૣى͖(4࣌ىচ) - Kaggle - ίʔώʔɺϏʔϧɺΟεΩʔ - ಡॻɺཧɺֶ
Slide 3
Slide 3 text
ͬͦ͘͞Ͱ͕͢ ͋ΔݐͷϑϩΞը૾ ͜Εʹ ͜Μͳײ͡Ͱ͍Λଧ͍ͪͨ - ੨͍ྖҬʹೖͬͪΌͩΊ - ௨࿏͚ͩ Έͳ͞ΜͳΒͲ͏͠·͔͢ʁ 03
Slide 4
Slide 4 text
ൃදͷϞνϕʔγϣϯ ࣮͜ͷը૾ Indoorίϯϖ ͷը૾Ͱ ͍ΛଧͭͨΊʹ؆୯ͳը૾ॲཧΛͯ͠ଧͪ·ͨ͠ νʔϜϝΠτʹղઆ͢ΔͱԠΑ͔ͬͨͷͰ ϧʔϧϕʔεը૾ॲཧʹ͍ͭͯൃද͠Α͏ͱࢥ͍·ͨ͠ KaggleΛ͖͔͚ͬʹը૾ॲཧɾը૾ೝࣝΛ͡Ίͨਓ͍͖ͳΓ DeepLearning͔Βೖͬͨͱࢥ͍·͕͢ྺ࢙తʹϧʔϧϕʔεͷ΄͏ ͕͘ɺະͩ׆༂͍ͯ͠Δٕज़Ͱ͢ɻ ֶΜͰଛͳ͍ͣʂʂ 04
Slide 5
Slide 5 text
ࠓ͢͜ͱ σΟʔϓϥʔχϯάωΠςΟϒੈʹ͚ͯʂ 05 ը૾ͬͯͳʹʁ ը૾ॲཧೖ Indoorͷ߹ ͦͦը૾ͬͯͳʹ͔Λ ཧ͠·͢ɻ ϧʔϧϕʔεը૾ॲཧʹͪΐͬ ͱ͚ͩೖͯ͠Έ·͢ɻ opencvΛ͍·͢ɻ https://github.com/fkubota/ bunseki_compe_LT_02/blob/main/ notebook/nb01_opencv.ipynb IndoorͰͬͨ͜ͱΛ΄Μͷগ ͠հ͠·͢ɻ
Slide 6
Slide 6 text
ը૾ͬͯԿʁ
Slide 7
Slide 7 text
ը૾Λ؆୯ʹ - pixel ͱ͍͏࠷খ୯ҐΛͭ - ࠲ඪx, y Λͭ - ًΛͭ - ௨ৗ8bit - 0~255ͷΛऔΔ(256ஈ֊) - 0͕ࠇ - 255͕ന y x നͬΆ͍ͷͰ 255ʹ͍ۙ ࠇͳͷͰ0ʹ͍ۙ փ৭ͳͷͰਅΜதͷ 150͙Β͍ʁ ΧϥʔͩͱRGBͷ3͕ͭͦΕͧΕ8bitͷใΛ࣋ͭ ྫ: - (133, 30, 88) ←10ਐ - #56a53f ←16ਐ 07
Slide 8
Slide 8 text
ը૾ॲཧೖ
Slide 9
Slide 9 text
ϧʔϧϕʔεͷ͍͍ͱ͜Ζ ڭࢣσʔλ͍Βͳ͍ ָ͍͠ʂ - ͬͨΒΘ͔Δʂʂʂʂ - ͜Εҙ֎ͱݟམͱ͞Ε͕ͪ 09
Slide 10
Slide 10 text
1 from fkubota shibutsu dataset Έͳ͞ΜͳΒͲ͏͠·͔͢ʁ (ڭࢣσʔλͳ͠Ͱ͢Αʁ) Ωϟοϓͷ࠲ඪΛऔಘ͍ͯͩ͘͠͞ ༡ͼײ֮Ͱʂʂ 10 https://github.com/fkubota/ bunseki_compe_LT_02/blob/main/ notebook/nb01_opencv.ipynb શ෦githubʹ͋ΔΑ
Slide 11
Slide 11 text
ղ๏ͷ1ྫΛհ ·ͣఆ൪ͷ2ԽΛ͢ΔͨΊʹ άϨʔը૾ʹม͠·͢ʂ ֤pixelͷً(r, g, b) ͷ3࣍ݩ͕ 1࣍ݩʹͳΓ͍Ζ͍Ζѻ͍͘͢ͳΓ·͢ɻ 11
Slide 12
Slide 12 text
2Խ എܠͱମΛ͚·͠ΐ͏ ًͷώετάϥϜΛݟͯΈΔͱ - നͬΆ͍৭(255ʹ͍ۙ৭)͕ώετάϥ ϜͷϚδϣϦςΟʹͳͬͯΔ - ͜Εഎܠ͕ը૾ͷେ෦ΛΊΔ͜ ͱʹىҼ͢Δ - threshold = 70 ͷલޙͰ2Խ͢Δʂ 1 0 Ωϟοϓ എܠ 12
Slide 13
Slide 13 text
2Խ݁Ռ ϐϯΫͷ෦͕1 ͦΕҙ֎͕0 ͷ ΦϒδΣΫτ ͕Ͱ͖ͨ ͜ΕΛ “ྖҬ” ͱݴ͍·͢ 13
Slide 14
Slide 14 text
͋ͱ៉ྷʹ͢Δ ࠓճ݀ΛຒΊ͚ͨͩ 14
Slide 15
Slide 15 text
ॏ৺Λܭࢉ ྖҬͷྠֲΛऔͬͯॏ৺Λܭࢉ Ͱ͖ͨʂʂ 15
Slide 16
Slide 16 text
2 from fkubota shibutsu dataset Ωϟοϓͷ࠲ඪΛऔಘ͍ͯͩ͘͠͞ ָ͘͠ͳ͖ͬͯ·ͨ͠ʁ 16
Slide 17
Slide 17 text
Կ͕͍͠ʁ Ωϟοϓͷ࠲ඪΛऔಘ͍ͯͩ͘͠͞ ಉ͡ͳΜ͚ͩͲෳମ͕͋ΔͷͰ қ͕Ͷ্͕Γ·͢Ͷɻ 17
Slide 18
Slide 18 text
ఆ൪ͷॲཧ άϨʔը૾ 2Խ 18
Slide 19
Slide 19 text
νϣοτ͖Ε͍ʹ ϞϧϑΥϩδʔม - ࣌ؒͷ߹্ৄࡉল͖·͢ - ϊΠζআڈɺ݀ຒΊ͕Ͱ͖·͢ - ݪཧ؆୯ͳͷͰͥͻௐͯΈͯ ͍ͩ͘͞ ݀ຒΊ ΊͬͪΌ͖Ε͍ʹͳͬͨʂʂ 19
Slide 20
Slide 20 text
ϥϕϦϯά ࿈ଓͨ͠ΦϒδΣΫτຖʹׂ - ྡΓ߹ͬͨ1ΛಉҰͷϥϕϧͱׂͯ͢͠Δ - ϐϯΫͷྖҬ͕ෳͷྖҬʹׂ͞Εͨ - ׂޙ໘ੵ͕খ͍͞ͷΛϊΠζͱͯ͠আ͍ͨ ໘ੵͷখ͍͞ྖҬ(ϊΠζ) 20
Slide 21
Slide 21 text
͓ΘΓ͡Όͳ͍Αʂ ͜ͷத͔ΒΩϟοϓΛબͼ ग़͞ͳ͍ͱ͍͚·ͤΜ ಛྔΛ͍·͢ ͜ͷ5ͭͷମΛൺֱͯ͠ΩϟοϓʹͲ͏ ͍ͬͨಛ͕͋ΔͰ͠ΐ͏͔ʁ - ؙΈ͕͋Δɹ - ໘ੵ͕খ͍͞ ͕ࢥ͍ͨΓ·͢ɻ ໘ੵ͕খ͍͞ΛͬͯΈ·͢ɻ ͭ·Γ ಛྔʹ໘ੵΛ͏ͱ͍͏͜ͱʹͳΓ·͢ɻ 21
Slide 22
Slide 22 text
ྖҬͷ໘ੵΛܭࢉ ໘ੵ࠷খΛબͿ ಛྔ = ໘ੵ Ͱ͖ͨʂʂ 22
Slide 23
Slide 23 text
3 Ͱ͖ͦʁ from fkubota shibutsu dataset ϖϯͷ࠲ඪΛऔಘ͍ͯͩ͘͠͞ 23
Slide 24
Slide 24 text
ϥϕϦϯά·ͰҰॹ ϖϯͷಛΛߟ͑Δ fkubota͞Μɺʮࡉ͍ʯҙ֎ ࢥ͍͖ͭ·ͤΜͰͨ͠ɻ ࡉ͍͜͏දݱ͢Δ͜ͱʹ͠·͢ɻ 1. ྖҬΛ࠷খ֎ۣܗͰғ͏ 2. ʮลͷ͞ʯΛʮลͷ͞ʯͰׂΔ 3. ͜ΕΛʮࡉ͞ʯͱ͢Δ 24
Slide 25
Slide 25 text
ࡉ͍Λܭࢉ ಛྔ = ࡉ͍ ࠷େΛબͿ Ͱ͖ͨʂʂ 25
Slide 26
Slide 26 text
4 ࠷ޙͩΑʂ from fkubota shibutsu dataset MINTIAͷ࠲ඪΛऔಘ͍ͯͩ͘͠͞ 26
Slide 27
Slide 27 text
ಛʁ MINTIAͷಛΛߟ͑Δ ࢛͍֯ͱ͍͏ಛ͕͋Γ·͕͢ɺ ଞͷମͱࠩผԽ͕͍͠Ͱ͢ɻ ܗͷ؍Ͱͦ͠͏ͳͷͰ ʮ৭ʯͰ߈ΊͯΈ·͠ΐ͏ɻ ʮ੨͞ʯΛදݱ͠·͢ɻ RGBΛHSVʹม͠ H(hue, ৭૬)ͷը૾Λ͍·͢ɻ 27
Slide 28
Slide 28 text
৭૬ʁ ͜ͷล͕੨ ৭૬৭ͷ༷૬Λ 0~180·ͰͰมԽͤͨ͞ͷɻ ੨100~140͋ͨΓɻ 28
Slide 29
Slide 29 text
Hueը૾ hueը૾ ͜ͷลΓ 29
Slide 30
Slide 30 text
2Խͯ͠ϞϧϑΥϩδʔ 2Խ ϞϧϑΥϩδʔ 30
Slide 31
Slide 31 text
ॏ৺Λܭࢉͯ͠ऴΘΓʂ Ͱ͖ͨʂʂ 31
Slide 32
Slide 32 text
Indoorͷ߹
Slide 33
Slide 33 text
࠷ॳͷ࣭ ͋ΔݐͷϑϩΞը૾ ͜Εʹ ͜Μͳײ͡Ͱ͍Λଧ͍ͪͨ - ੨͍ྖҬʹೖͬͪΌͩΊ - ௨࿏͚ͩ Έͳ͞ΜͳΒͲ͏͠·͔͢ʁ 33
Slide 34
Slide 34 text
·ͣ௨࿏Λऔಘ ੨͍෦Λ2Խ ຒΊΔ ന͍෦Λ 2Խ ཧੵ 34
Slide 35
Slide 35 text
ʂ & ͍ʑΛॻ͍ͨը૾Λ༻ҙͯ͠ ཧੵ Ͱ͖ͨʂʂ 35
Slide 36
Slide 36 text
Thanks :)