Slide 1

Slide 1 text

഑৴ΞϓϦͷͨΊͷ ϦΞϧλΠϜϓογϡ௨஌΅͔͠ͷເ ʙ௿ෛՙͰߴ଎ͳϓϥΠόγʔอޢΛ໨ࢦͯ͠ʙ 🌟 🌟

Slide 2

Slide 2 text

/BSVLJ$IJHJSB גࣜձࣾϛϥςΟϒ !@OBSV@KQO OBSVKQO

Slide 3

Slide 3 text

ϛϥςΟϒ͸ϞόΠϧ୺຤͚ͩͰखܰʹ഑৴͕Ͱ͖ΔΞϓϦ🌟 ୺຤ͷը໘ͷө૾͕ ͦͷ··ࢹௌऀʹಧ͘ʂ 📱 ഑৴ऀ 📱 ࢹௌऀ

Slide 4

Slide 4 text

͔͠͠ɺϓογϡ௨஌ʹΑͬͯ ೔ৗͷ΍ΓͱΓͳͲ͕өΓࠐΜͰ͠·͏৔߹΋͋Δ ϝʔϧ΍ϦϚΠϯμͳͲͷ಺༰͕ ഑৴ʹөΓࠐΜͰ͠·͏ 📱 ഑৴ऀ 📱 ࢹௌऀ

Slide 5

Slide 5 text

ࠓճ͓࿩͢͠ΔϦΞϧλΠϜϓογϡ௨஌΅͔͠ͱ͸ 📱 ഑৴ऀ 📱 ࢹௌऀ ഑৴αʔόʔ 􀪹 ഑৴ऀͷ୺຤Ͱө૾Λௐ΂ɺϓογϡ௨஌Λݕग़͠ ө૾ΛՃ޻͔ͯ͠Β഑৴αʔόʔʹૹΔ

Slide 6

Slide 6 text

աڈ ʹ΋ಉ༷ͷ௅ઓ͕͋Γ·ͨ͠ .JSSBUJW5FDI#MPH .JSSBUJWʹ͓͚Δϓογϡ௨஌΅͔͠΁ͷ௅ઓ ɾॲཧͷύϑΥʔϚϯεʹ՝୊͕͋ͬͨ ɾ04ͷΞοϓσʔτͰ௨஌ͷΞχϝʔγϣϯ͸มΘΓɺγϟυ ΢΋ബ͘ͳΓ೉қ౓্͕͕͍ͬͯΔ

Slide 7

Slide 7 text

αʔόʔαΠυͰݱࡏՔಇ͍ͯ͠ΔγεςϜ΋͋Γ·͢ ઌ೔ͷ(P$POGFSFODFͰ΋(P$HPͰө૾ɾԻ੠ͷϦΞϧλΠ ϜॲཧΛ΍Δ·ͰͷಓͷΓͱ͍͏λΠτϧͰ͓࿩͠͞Ε͍ͯ·͢ .JSSBUJW5FDI#MPH NTҎԼͷϦΞϧλΠϜΦϒδΣΫτݕग़ը૾ॲཧΛ໨ࢦͯ͠ (Pͷ഑৴αʔόαΠυͰ௨஌΅͔͠Λ࣮૷ͯ͠Έͨ͜ͱ

Slide 8

Slide 8 text

ࠓճͷϦΞϧλΠϜϓογϡ௨஌΅͔͠ͷओࢫ ΫϥΠΞϯτͰݕग़ͱՃ޻Λߦͬͨ৔߹ʹ ࣮༻ʹ଍Δਫ਼౓ͱύϑΥʔϚϯεΛୡ੒Ͱ͖Δ͔ ٕज़తʹݕূΛ͠ɺՄೳੑΛ୳Δ ΞϓϦΞΠίϯͷൺֱͳͲɺΫϥΠΞϯτͰͳ͍ͱ࣮ݱ͕೉͍͠ॲཧ΋͋Δ

Slide 9

Slide 9 text

࣮ࡍͷಈ͖

Slide 10

Slide 10 text

഑৴ऀ ࢹௌऀ

Slide 11

Slide 11 text

഑৴ऀ ࢹௌऀ

Slide 12

Slide 12 text

௨஌΅͔͠ͷཁ݅ ɾϓογϡ௨஌ͷܗঢ়Λݕग़ͨ͠Βɺ഑৴୺຤ଆͰө૾ΛՃ޻͢Δ ɹɾͨͩ͠ɺϛϥςΟϒ͔Βͷ௨஌͸Ճ޻͠ͳ͍ ɹɾ୺຤ͷճసʹରԠ͢Δ ɹɾμʔΫϞʔυʹରԠ͢Δ ɾϦΞϧλΠϜͷॲཧʹ଱͑ΔύϑΥʔϚϯεΛग़͢

Slide 13

Slide 13 text

௨஌΅͔͠ͷཁ݅ ɾϓογϡ௨஌ͷܗঢ়Λݕग़ͨ͠Βɺ഑৴୺຤ଆͰө૾ΛՃ޻͢Δ ɹɾͨͩ͠ɺϛϥςΟϒ͔Βͷ௨஌͸Ճ޻͠ͳ͍ ɹɾ୺຤ͷճసʹରԠ͢Δ ɹɾμʔΫϞʔυʹରԠ͢Δ ɾϦΞϧλΠϜͷॲཧʹ଱͑ΔύϑΥʔϚϯε < 33ms Λग़͢

Slide 14

Slide 14 text

J04ʹ͓͚Δը໘࿥ըͱө૾ͷܗࣜΛ஌Δ "DDFMFSBUFGSBNFXPSLΛ஌Δ

Slide 15

Slide 15 text

J04ʹ͓͚Δը໘࿥ըͱө૾ͷܗࣜΛ஌Δ "DDFMFSBUFGSBNFXPSLΛ஌Δ

Slide 16

Slide 16 text

#SPBEDBTU6QMPBE&YUFOTJPO

Slide 17

Slide 17 text

override func processSampleBuffer( _ sampleBuffer: CMSampleBuffer, with sampleBufferType: RPSampleBufferType ) { switch sampleBufferType { case RPSampleBufferType.video: break case RPSampleBufferType.audioApp: break case RPSampleBufferType.audioMic: break @unknown default: fatalError("Unknown type of sample buffer") } } 4BNQMF)BOEMFSTXJGU

Slide 18

Slide 18 text

override func processSampleBuffer( _ sampleBuffer: CMSampleBuffer, with sampleBufferType: RPSampleBufferType ) { switch sampleBufferType { case RPSampleBufferType.video: break case RPSampleBufferType.audioApp: break case RPSampleBufferType.audioMic: break @unknown default: fatalError("Unknown type of sample buffer") } } 4BNQMF)BOEMFSTXJGU

Slide 19

Slide 19 text

override func processSampleBuffer( _ sampleBuffer: CMSampleBuffer, with sampleBufferType: RPSampleBufferType ) { switch sampleBufferType { case RPSampleBufferType.video: break ॲཧ࣌ؒͱ࢖༻ϝϞϦͷ੍໿ ͜ͷؔ਺͸ܧଓతʹݺ͹Εɺಈը΍Ի੠ʹରԠ͢ΔTBNQMF#VGGFS͕ڙڅ͞ΕΔ ಈը͕'14ͱ͢Δͱɺඵؒʹճݺ͹ΕΔʢ໿NTִؒʣ ϝϞϦ࢖༻ྔ͸؂ࢹ͞Ε͍ͯͯɺ.#Λ௒͑Δͱϓϩηε͕ऴྃ͢Δ

Slide 20

Slide 20 text

case RPSampleBufferType.video: let imageBuffer = CMSampleBufferGetImageBuffer(sampleBuffer)! let pixelFormatType = CVPixelBufferGetPixelFormatType(imageBuffer) // pixelFormatType == kCVPixelFormatType_420YpCbCr8BiPlanarFullRange TBNQMF#VGGFS͔ΒಈըͷϑϨʔϜʹ૬౰͢ΔJNBHF#VGGFSΛऔಘͯ͠ ϑΥʔϚοτΛௐ΂Δ L$71JYFM'PSNBU5ZQF@:Q$C$S#J1MBOBS'VMM3BOHF

Slide 21

Slide 21 text

·ͣ͸਌͠Έͷ͋ΔL$71JYFM'PSNBU5ZQF@"3(#ͷߏ଄Λ஌Δ

Slide 22

Slide 22 text

0 1 2 3 4 5 6 7 8

Slide 23

Slide 23 text

L$71JYFM'PSNBU5ZQF@"3(#͸ 6*OUͷ஋͕" 3 ( #ͷॱʹฒΜͰ͍Δ 6*OU [ … A0, R0, G0, B0, A1, R1, G1, B1, A2, R2, G2, B2, … A3, R3, G3, B3, A4, R4, G4, B4, A5, R5, G5, B5, … A6, R6, G6, B6, A7, R7, G7, B7, A8, R8, G8, B8, … … ] 0 1 2 3 4 5 6 7 8

Slide 24

Slide 24 text

// (0,0) Λࢦ͢ΞυϨε let address = CVPixelBufferGetBaseAddress(imageBuffer) // ઌ಄ͷϐΫηϧ͔Β ARGB ͷॱͰ৭৘ใ͕֨ೲ͞Ε͍ͯΔ let arbg = address!.assumingMemoryBound(to: UInt8.self) let a_0_0 = arbg[0] // A let r_0_0 = arbg[1] // R let g_0_0 = arbg[2] // G let b_0_0 = arbg[3] // B let a_1_0 = arbg[4] // A L$71JYFM'PSNBU5ZQF@"3(#ܗࣜͷ ը૾σʔλͷઌ಄ΞυϨεΛऔಘͯ͠ɺըૉʹΞΫηε͢Δ

Slide 25

Slide 25 text

L$71JYFM'PSNBU5ZQF@:Q$C$S#J1MBOBS'VMM3BOHFͷߏ଄Λ஌Δ

Slide 26

Slide 26 text

L$71JYFM'PSNBU5ZQF@:Q$C$S#J1MBOBS'VMM3BOHF͸ ً౓ : ɾ৭ࠩ $C$S ͷͭͷฏ໘͔Βߏ੒͞Ε͍ͯΔ ً౓ : ฏ໘ ৭ࠩ $C$S ฏ໘ ը໘දࣔ

Slide 27

Slide 27 text

ً౓ : ฏ໘͸ϐΫηϧͷً౓ʹରԠ͢Δ 6*OUͷ஋ d ͕ॱʹฒΜͰ͍Δ 6*OU [… Y0, Y1, Y2, Y3,… Y4, Y5, Y6, Y7,… Y8, Y9, Y10, Y11,… Y12, Y13, Y14, Y15,… …] 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

Slide 28

Slide 28 text

৭ࠩ $C$S ฏ໘Ͱ͸ɺ$Cͱ$Sͷ૊Έ߹ΘͤͰ৭Λදݱ͢Δ ˞ը૾͸IUUQTKBXJLJQFEJBPSHXJLJ:67ΑΓҾ༻ ࣅͨߏ੒ͷ67৭ฏ໘ͷྫʢ:ͷ৔߹ʣ

Slide 29

Slide 29 text

৭ࠩ $C$S ฏ໘͸6*OUͷ஋ d ͕$C $SͷॱʹฒΜͰ͍Δ 0 1 2 3 6*OU [… Cb0, Cr0, Cb1, Cr1,… Cb2, Cr2, Cb3, Cr3,… …]

Slide 30

Slide 30 text

L$71JYFM'PSNBU5ZQF@:Q$C$S#J1MBOBS'VMM3BOHFͰ͸ ৭ࠩ $C$S ฏ໘ͷղ૾౓͸ɺً౓ : ฏ໘ͷ൒෼Ͱ͋Δ ً౓ : ฏ໘ ৭ࠩ $C$S ฏ໘ ը໘දࣔ

Slide 31

Slide 31 text

ً౓ : ฏ໘ ৭ࠩ $C$S ฏ໘ 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 1 2 3 L$71JYFM'PSNBU5ZQF@:Q$C$S#J1MBOBS'VMM3BOHFͰ͸ ৭ࠩ $C$S ฏ໘ͷղ૾౓͸ɺً౓ : ฏ໘ͷ൒෼Ͱ͋Δ ը໘දࣔ

Slide 32

Slide 32 text

ը໘දࣔ 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ً౓ : ฏ໘ ৭ࠩ $C$S ฏ໘ 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 1 2 3 ը໘දࣔ : $C $S

Slide 33

Slide 33 text

ը໘දࣔ 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ً౓ : ฏ໘ ৭ࠩ $C$S ฏ໘ 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 1 2 3 ը໘දࣔ : $C $S

Slide 34

Slide 34 text

ը໘දࣔ 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ً౓ : ฏ໘ ৭ࠩ $C$S ฏ໘ 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 1 2 3 ը໘දࣔ : $C $S

Slide 35

Slide 35 text

L$71JYFM'PSNBU5ZQF@:Q$C$S#J1MBOBS'VMM3BOHFܗࣜͷ ֤ฏ໘ͷઌ಄ΞυϨεΛऔಘ͢Δ // ً౓(Y)ฏ໘ͷઌ಄Λࢦ͢ΞυϨε let address0 = CVPixelBufferGetBaseAddressOfPlane(imageBuffer, 0) // ৭ࠩ(CbCr)ฏ໘ͷઌ಄Λࢦ͢ΞυϨε let address1 = CVPixelBufferGetBaseAddressOfPlane(imageBuffer, 1)

Slide 36

Slide 36 text

ɾ"3(#ܗࣜͷํ͕௚ײతͰѻ͍΍͍͢ ɾ3FQMBZ,JU͔Β໯͑Δͷ͸:Q$C$S#J1MBOBS'VMM3BOHFܗࣜ ɾ:Q$C$S#J1MBOBS'VMM3BOHFܗࣜ͸"3(#ܗࣜʹม׵͢Δ͜ͱ͕Ͱ͖Δ ɹɾ͔͠͠ɺม׵ʹ͸ϝϞϦͱܭࢉͷίετ͕͔͔Δʜ ɹɹɾϝϞϦɿը໘ճస΋ߟྀ͢Δͱɺݩσʔλͱಉ͚ͩ͡ͷ༰ྔ͕ඞཁ ɹɹɾܭࢉɿݩσʔλͷ͢΂ͯͷըૉͷม׵͕ඞཁ ɹɾม׵͠ͳ͚Ε͹ɺܭࢉʹඞཁͳϕΫτϧ෼͚ͩͷϝϞϦΛ֬อ͢Ε͹े෼ ˠ:Q$C$S#J1MBOBS'VMM3BOHFܗࣜͷ··ܭࢉ͢ΔಓΛબΜͩ

Slide 37

Slide 37 text

J04ʹ͓͚Δը໘࿥ըͱө૾ͷܗࣜΛ஌Δ "DDFMFSBUFGSBNFXPSLΛ஌Δ

Slide 38

Slide 38 text

"DDFMFSBUFGSBNFXPSLʹؚ·Ε͍ͯΔϥΠϒϥϦ ɾ#//4ɿχϡʔϥϧωοτϫʔΫ ɾW%41ɿσδλϧ৴߸ॲཧ ɾW*NBHFɿը૾Ճ޻ ɾW'PSDFɿߦྻͱ௒ӽؔ਺ ɾ4QBSTF4PMWFST #-"4 BOE-"1"$,ɿߦྻܭࢉ

Slide 39

Slide 39 text

ɾ#//4ɿχϡʔϥϧωοτϫʔΫ ɾW%41ɿσδλϧ৴߸ॲཧ ɾW*NBHFɿը૾Ճ޻ ɾW'PSDFɿߦྻͱ௒ӽؔ਺ ɾ4QBSTF4PMWFST #-"4 BOE-"1"$,ɿߦྻܭࢉ "DDFMFSBUFGSBNFXPSLʹؚ·Ε͍ͯΔϥΠϒϥϦ

Slide 40

Slide 40 text

ॲཧͷྫͱܭଌ͔ΒW%41Λ஌Δ IUUQTHJUIVCDPNOBSVKQO.FBTVSF"DDFMFSBUFT 9$5FTUͷNFBTVSFΛ༻͍ͯॲཧ࣌ؒΛܭଌͯ͠ൺֱ͢Δ .FBTVSF"DDFMFSBUFT

Slide 41

Slide 41 text

let length = 1_000_000 let v1 = UnsafeMutablePointer.allocate(capacity: length) let v2 = UnsafeMutablePointer.allocate(capacity: length) v1.initialize(repeating: 10, count: length) v2.initialize(repeating: 20, count: length) ௕͞ສͷߦྻʹର͢Δॲཧ଎౓Λൺֱ͢Δ

Slide 42

Slide 42 text

// Others for i in 0.. ߦྻͷཁૉͷ଍͠ࢉ

Slide 43

Slide 43 text

// Others for i in 0.. ߦྻͷཁૉͷֻ͚ࢉ

Slide 44

Slide 44 text

ۮ਺ΠϯσοΫε ͷཁૉʹͷΈΛ଍͢ // Others (whole loop) for i in 0..

Slide 45

Slide 45 text

ΑΓେ͖͍TUSJEFΛࢦఆͯ͠ ҰఆͷִؒΛۭ͚ͨϕΫτϧ্ͷܭࢉ͕Ͱ͖Δ // Accelerate var value: Float = 1 vDSP_vsadd(v, 2, &value, v, 2, vDSP_Length(length / 2)) // Others (loop with stride) for i in stride(from: 0, to: length, by: 2) { v[i] = v[i] + 1 } " 3 # (΍$C $SͷΑ͏ʹ ౳ִؒͰಉ͡छྨͷ৘ใ͕ฒΜͰ͍Δ৔߹ͳͲʹศར

Slide 46

Slide 46 text

TUSJEFͱΞΫηεͰ͖Δըૉͷؔ܎ TUSJEF TUSJEF TUSJEF TUSJEF

Slide 47

Slide 47 text

W*NBHF https://developer.apple.com/documentation/accelerate/vimage vImage is particularly suited for: • Ef fi ciently processing large images • Real-time video processing software • Scienti fi c applications that require high-accuracy numerical calculations ެࣜΑΓҾ༻

Slide 48

Slide 48 text

W*NBHF $71JYF#VGGFS QMBOF let data = UnsafeMutableRawPointer(addressOfPlane) let buffer = vImage_Buffer( data: data, height: height, width: width, rowBytes: rowBytes ) W*NBHF@#VGGFS

Slide 49

Slide 49 text

W*NBHF https://developer.apple.com/documentation/accelerate/convolution ৭ʑͳϑΥʔϚοτͷσʔλͷՃ޻ʹରԠ͍ͯ͠Δ ྫɿW*NBHF$POWPMWF@"3(# W*NBHF$POWPMWF@1MBOBS W*NBHF$POWPMWF@1MBOBS' W*NBHF$POWPMWF@1MBOBS' W*NBHF$POWPMWF@"3(#' W*NBHF$POWPMWF@"3(#''''

Slide 50

Slide 50 text

W*NBHF "QQMZJOHW*NBHFPQFSBUJPOTUPSFHJPOTPGJOUFSFTU https://developer.apple.com/documentation/accelerate/applying_vimage_operations_to_regions_of_interest

Slide 51

Slide 51 text

௨஌΅͔͠ͷཁ݅Λࢥ͍ग़͢ ɾϓογϡ௨஌ͷܗঢ়Λݕग़ͨ͠Βɺ഑৴୺຤ଆͰө૾ΛՃ޻͢Δ ɹɾͨͩ͠ɺϛϥςΟϒ͔Βͷ௨஌͸Ճ޻͠ͳ͍ ɹɾ୺຤ͷճసʹରԠ͢Δ ɹɾμʔΫϞʔυʹରԠ͢Δ ɾϦΞϧλΠϜͷॲཧʹ଱͑ΔύϑΥʔϚϯεΛग़͢

Slide 52

Slide 52 text

ϓογϡ௨஌΅͔࣮͠ݱ΁ͷεςοϓ ϓογϡ௨஌ྖҬΛݕग़͢Δ ΞΠίϯྖҬΛൺֱ͢Δ ө૾ΛՃ޻͢Δ

Slide 53

Slide 53 text

ϓογϡ௨஌΅͔࣮͠ݱ΁ͷεςοϓ ϓογϡ௨஌ྖҬΛݕग़͢Δ ΞΠίϯྖҬΛൺֱ͢Δ ө૾ΛՃ޻͢Δ

Slide 54

Slide 54 text

No content

Slide 55

Slide 55 text

ݕग़͍ۣͨ͠ܗ

Slide 56

Slide 56 text

ݕग़͍ۣͨ͠ܗ ଆ໘Λݟ͚ͭΔˠఈΛݟ͚ͭΔˠશମͷۣܗΛܾΊΔ

Slide 57

Slide 57 text

ϓογϡ௨஌ͷࠨӈͷϚʔδϯ͸୺຤αΠζຖʹҰఆ

Slide 58

Slide 58 text

୺຤ͷը໘αΠζ͝ͱʹϓογϡ௨஌ͷࠨӈͷϚʔδϯΛܭଌͯ͠ ݕग़ͷࡍͷܭࢉʹ࢖༻͍ͯ͠Δ … // iPhone 12,13,14 iPhone Pro 12,13 "1170x2532": .init(width: 1170, height: 2532, x: 24), "2532x1170": .init(width: 2532, height: 1170, x: 432), // iPhone Pro Max 14 "1290x2796": .init(width: 1290, height: 2796, x: 24), "2796x1290": .init(width: 2796, height: 1290, x: 564), // iPad 3rd,4th,5th,6th / iPad mini 2nd,3rd,4th,5th / iPad Air 1st,2nd "1536x2048": .init(width: 1536, height: 2048, x: 212), "2048x1536": .init(width: 2048, height: 1536, x: 468), …

Slide 59

Slide 59 text

ϓογϡ௨஌ͷଆ໘Λ؍࡯͢Δ

Slide 60

Slide 60 text

ϓογϡ௨஌ͷଆ໘ʹ͸ڥք͕͋Γɺ಺ଆͷྖҬ͸৭ͷมԽ͕খ͍͞ ڥք ಺ଆ ϕΫτϧܭࢉͷ໰୊ʹ຋༁ͯ͠ɺ"DDFMFSBUFͰܭࢉ͍ͨ͠

Slide 61

Slide 61 text

৭ ً౓ ͷมԽ : : c::c

Slide 62

Slide 62 text

: : c::c : : c::c ৭ ً౓ ͷมԽͷେখ େ খ

Slide 63

Slide 63 text

৭ ً౓৭ࠩ ͷมԽ : $C $S : $C $S c::cc$C$Ccc$S$Sc

Slide 64

Slide 64 text

৭ ً౓৭ࠩ ͷมԽ : $C $S c::cc$C$Ccc$S$Sc : $C $S ˞Ҏ߱Ͱ͸ɺ؆୯ͷͨΊʹً౓ͷΈͷܭࢉͱݟཱͯͯߟ͑·͢

Slide 65

Slide 65 text

ڥքˠ৭ͷมԽ͕େ͖͍ ಺ଆͷྖҬˠ৭ͷมԽ͕খ͍͞ ڥք ಺ଆ

Slide 66

Slide 66 text

W W ڥքˠ৭ͷมԽ͕େ͖͍ vDSP_vsub(v1, 1, v2, 1, boundary, 1, length) vDSP_vabs(boundary, 1, boundary, 1, length) CPVOEBSZcWWc ڥքͷϕΫτϧͷཁૉͷࠩͷઈର஋͸ɺҰఆΑΓେ͖͍ CPVOEBSZDPOTU

Slide 67

Slide 67 text

W W ಺ଆͷྖҬˠ৭ͷมԽ͕খ͍͞ vDSP_vsub(v2, 1, v3, 1, inner, 1, length) vDSP_vabs(inner, 1, inner, 1, length) JOOFScWWc ಺ଆͷϕΫτϧͷཁૉͷࠩͷઈର஋͸ɺҰఆΑΓখ͍͞ JOOFSDPOTU

Slide 68

Slide 68 text

JOOFS ಺ଆͷྖҬʹରͯ͠ɺڥքͷํ͕৭ͷมԽ͕େ͖͍ vDSP_vdiv(boundary, 1, inner, 1, out, 1, length) PVUCPVOEBSZJOOFS ϓογϡ௨஌ͷଆ໘Ͱ͸ɺ৭ͷมԽͷൺ͕ҰఆΑΓେ͖͍ CPVOEBSZ PVUCPVOEBSZJOOFSDPOTU େ খ

Slide 69

Slide 69 text

// ڥք vDSP_vsub(v1, 1, v2, 1, boundary, 1, length) vDSP_vabs(boundary, 1, boundary, 1, length) // ಺ଆ vDSP_vsub(v2, 1, v3, 1, inner, 1, length) vDSP_vabs(inner, 1, inner, 1, length) // ڥք / ಺ଆ vDSP_vdiv(boundary, 1, inner, 1, out, 1, length) ϓογϡ௨஌͕௨ա͢Δ۠ؒʹ౉ͬͯܭࢉΛ͢Δ

Slide 70

Slide 70 text

ࠨӈͰಉ࣌ʹ৚݅Λຬͨ͢Α͏ͳɺҰఆҎ্ͷ௕͞ͷ͋ΔྖҬΛ୳͠ ϓογϡ௨஌ͷଆ໘Ͱ͋ΔͱΈͳ͢

Slide 71

Slide 71 text

ϓογϡ௨஌ͷଆ໘͕ݕग़Ͱ͖ͨ

Slide 72

Slide 72 text

ϓογϡ௨஌ͷఈΛ؍࡯͢Δ

Slide 73

Slide 73 text

ϓογϡ௨஌ͷ಺ଆ͸৭ͷมԽ͕খ͘͞ɺڥքͰ৭ͷมԽ͕͋Δ ڥք ಺ଆ ϕΫτϧܭࢉͷ໰୊ʹ຋༁ͯ͠ɺ"DDFMFSBUFͰܭࢉ͍ͨ͠

Slide 74

Slide 74 text

ϕΫτϧΛͣΒͯ͠Ҿ͖ࢉ͢ΔͱɺมԽ͕Θ͔Δ [100, 100, 100, 10, 10, 10, 10, …]

Slide 75

Slide 75 text

[100, 100, 100, 10, 10, 10, 10, …] [100, 100, 100, 10, 10, 10, 10, …] ϕΫτϧΛͣΒͯ͠Ҿ͖ࢉ͢ΔͱɺมԽ͕Θ͔Δ

Slide 76

Slide 76 text

[100, 100, 100, 10, 10, 10, 10, …] [100, 100, 100, 10, 10, 10, 10, …] - [ 0, 0, 90, 0, 0, 0, …] ϕΫτϧΛͣΒͯ͠Ҿ͖ࢉ͢ΔͱɺมԽ͕Θ͔Δ

Slide 77

Slide 77 text

BEWBODFEͰͣΒͨ͠ϕΫτϧͷࠩΛܭࢉ͠ɺ৭ͷมԽ఺Λ୳Δ vDSP_vsub(v, 1, v.advanced(by: 1), 1, out, 1, length-1) vDSP_vabs(out, 1, out, 1, length) PVUcWWBEWBODFE c PVU͕ҰఆΑΓେ͖͍৔ॴ͕ϓογϡ௨஌ͷఈͷީิʹͳΔ W WBEWBODFE

Slide 78

Slide 78 text

ఈͷީิ͕ܾ·ͬͨΒɺఈ͔Ͳ͏͔ݕࠪΛ͢Δ

Slide 79

Slide 79 text

JOOFS CPVOEBSZ ଆ໘ͷݕग़ͱಉ༷ʹɺ಺෦ͱڥքͷ৭ͷࠩͷେ͖͞Λܭࢉͯ͠ ൣғ಺Ͱ಺෦ͷมԽ͕খ͘͞ɺڥքͷมԽ͕େ͖͍͜ͱΛ֬ೝ͢Δ

Slide 80

Slide 80 text

ϓογϡ௨஌ͷଆ໘ͱఈ͕ݕग़Ͱ͖ͨ

Slide 81

Slide 81 text

ϓογϡ௨஌ͷఱҪ͸ఈͷ൓ରʹ͋ΔͷͰ͙͢Θ͔Δ

Slide 82

Slide 82 text

ݕग़Ͱ͖·ͨ͠ʂ🎉 ۣܗͷݕग़ʶ J1IPOF1SP

Slide 83

Slide 83 text

ϓογϡ௨஌΅͔࣮͠ݱ΁ͷεςοϓ ϓογϡ௨஌ྖҬΛݕग़͢Δ ΞΠίϯྖҬΛൺֱ͢Δ ө૾ΛՃ޻͢Δ

Slide 84

Slide 84 text

ϛϥςΟϒ͔Βͷ௨஌͸಺༰ΛӅ͢ඞཁ͸ͳ͍ ΞΠίϯͷൺֱʹΑͬͯϛϥςΟϒ͔Βͷ௨஌͔ΛͲ͏͔ௐ΂Δ

Slide 85

Slide 85 text

ΞΠίϯྖҬͷൺֱ ΞΠίϯྖҬͷ୳ࡧ ΞΠίϯը૾ͷൺֱ

Slide 86

Slide 86 text

ϓογϡ௨஌ͷۣܗ͸෼͔͍ͬͯΔͷͰେମͷ৔ॴ͸෼͔Δ ఈͷਪఆͱಉ͡Α͏ʹɺࠨଆͱ্Լ͔ΒΞΠίϯͷڥ໨Λ୳͢

Slide 87

Slide 87 text

ΞΠίϯྖҬͷൺֱ ΞΠίϯྖҬͷ୳ࡧ ΞΠίϯը૾ͷൺֱ

Slide 88

Slide 88 text

.JSSBUJW 􀈕 "QQ(SPVQT 􀅈 #SPBEDBTU6QMPBE &YUFOTJPO ΞΠίϯը૾ "QQ(SPVQTΛհͯ͠ɺ࠷৽ͷΞϓϦΞΠίϯΛڞ༗͢Δ

Slide 89

Slide 89 text

ݕग़ͨ͠ΞΠίϯը૾ͷҐஔ͸dQYͣΕͨΓ എܠ৭ͷӨڹ΋ड͚ΔͷͰɺͦͷ··ͷεέʔϧͰ׬શҰக͸೉͍͠

Slide 90

Slide 90 text

ɾը૾Λ੾Γൈ͖ɺ͋Β͔͡ΊܾΊͨେ͖͞ Y ʹॖখ͢Δ ɾϐΫηϧຖʹൺֱΛͯ͠ɺҰக౓Λܭࢉ͢Δ ΞϓϦΞΠίϯ ௨஌ .JSSBUJW ௨஌ λΠϚʔ

Slide 91

Slide 91 text

ΞϓϦΞΠίϯ ௨஌ .JSSBUJW ௨஌ λΠϚʔ ΞΠίϯͷൺֱʶ J1IPOF1SP

Slide 92

Slide 92 text

ϓογϡ௨஌΅͔࣮͠ݱ΁ͷεςοϓ ϓογϡ௨஌ྖҬΛݕग़͢Δ ΞΠίϯྖҬΛൺֱ͢Δ ө૾ΛՃ޻͢Δ

Slide 93

Slide 93 text

੩ࢭըͷൺֱ

Slide 94

Slide 94 text

L$71JYFM'PSNBU5ZQF@:Q$C$S#J1MBOBS'VMM3BOHF͸ ً౓ : ɾ৭ࠩ $C$S ͷͭͷฏ໘͔Βߏ੒͞Ε͍ͯΔ ً౓ : ฏ໘ ৭ࠩ $C$S ฏ໘ ը໘දࣔ

Slide 95

Slide 95 text

// ً౓(Y)ฏ໘ͷઌ಄Λࢦ͢ΞυϨε let address0 = CVPixelBufferGetBaseAddressOfPlane(imageBuffer, 0) // ৭ࠩ(CbCr)ฏ໘ͷઌ಄Λࢦ͢ΞυϨε let address1 = CVPixelBufferGetBaseAddressOfPlane(imageBuffer, 1) ً౓ : ฏ໘ͱ৭ࠩ $C$S ฏ໘͸ผʑʹՃ޻͢Δඞཁ͕͋Δ

Slide 96

Slide 96 text

W*NBHFΛ׆༻ͨ͠ө૾ͷՃ޻ ً౓ : ฏ໘ͷՃ޻ ৭ࠩ $C$S ฏ໘ͷՃ޻

Slide 97

Slide 97 text

ً౓ : ฏ໘͸ϐΫηϧͷً౓ʹରԠ͢Δ 6*OUͷ஋ d ͕ॱʹฒΜͰ͍Δ 6*OU [… Y0, Y1, Y2, Y3,… Y4, Y5, Y6, Y7,… Y8, Y9, Y10, Y11,… Y12, Y13, Y14, Y15,… …] 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

Slide 98

Slide 98 text

W*NBHF#PY$POWPMWF@1MBOBSͳͲΛ࢖༻͢Δͱ ΅͔͠ͷ൒ܘΛࢦఆͨ͠΅͔͠ॲཧΛద༻Ͱ͖Δ ͕ɺॲཧʹ͕͔͔࣌ؒΔʜ😢 ΅͔͠ॲཧΛॎํ޲ͱԣํ޲Ͱ෼ׂͯ͠ߴ଎Խ͢ΔςΫχοΫΛ ࢖ͬͨͱͯ͠΋͕͔͔࣌ؒΔ NTऑ

Slide 99

Slide 99 text

W*NBHF.BY@1MBOBS पғͷࢦఆൣғ಺ͷϐΫηϧͷ࠷େ஋Λ࠾༻͢Δ W*NBHF#PY$POWPMWF@1MBOBSΑΓஅવૣ͍ ً౓ : ฏ໘ͷΈՃ޻ͨ͠ྫ ˞μʔΫϞʔυͷ৔߹ʹ͸W*NBHF.JO@1MBOBSΛ࢖༻

Slide 100

Slide 100 text

W*NBHFΛ׆༻ͨ͠ө૾ͷՃ޻ ً౓ : ฏ໘ͷՃ޻ ৭ࠩ $C$S ฏ໘ͷՃ޻

Slide 101

Slide 101 text

W*NBHF#VGGFS'JMM@$C$S ࢦఆൣғΛಛఆͷ$C $Sͷ஋ͰృΓ௵͢ ৭ࠩ $C$S ฏ໘ͷΈՃ޻ͨ͠ྫനͰృΓ௵͢ ˞৭ͷՃ޻͸Өڹ͕େ͖͍ͷͰɺ௨஌ͷྖҬ಺ͷΈՃ޻͍ͯ͠Δ

Slide 102

Slide 102 text

ө૾ͷՃ޻ʶ J1IPOF1SP ً౓ : ฏ໘ɺ৭ࠩ $C$S ฏ໘ͷ྆ํΛՃ޻ͯ͠৘ใΛӅณ͢Δ

Slide 103

Slide 103 text

ۣܗͷݕग़ ΞΠίϯͷൺֱ ө૾ͷՃ޻ ʶ ʶ ʶ ʶ J1IPOF1SP ݕग़ͱՃ޻

Slide 104

Slide 104 text

഑৴ऀ ࢹௌऀ

Slide 105

Slide 105 text

·ͱΊ ɾ:$C$Sͷߏ଄Λৄ͘͠஌Γɺॲཧ΍ϝϞϦͷ࡟ݮΛͨ͠ ɾ"DDFMFSBUFΛՄೳͳݶΓ׆༻͠ɺܭࢉΛߴ଎ʹͨ͠ ɾݕग़ͱՃ޻ॲཧΛ߹ΘͤͯɺϦΞϧλΠϜͷॲཧʹ଱͑ΔύϑΥ ʔϚϯεΛग़ͤΔ͜ͱΛࣔͨ͠

Slide 106

Slide 106 text

ࠓޙͷల๬ ɾ044ԽΛࢹ໺ʹೖΕͨίʔυͷ੔උ ɹɾ͢Ͱʹ௨஌΅͔͠ͷػೳ͸ύοέʔδʹ෼ׂ͍ͯͯ͠ɺΞϓ Ϧຊମͱ͸෼཭͞Ε͍ͯΔ ɹɾεΫϦʔϯγϣοτΛ༻͍ͨςετͷॆ࣮ ɹɹɾIUUQTHJUIVCDPNOBSVKQO'SBNF.JOU ɾ࣮ӡ༻্ͷ໰୊ͷ೺ѲͱରԠ ɾΫϥΠΞϯτͳΒͰ͸ͷॲཧͷݕ౼

Slide 107

Slide 107 text

͋Γ͕ͱ͏͍͟͝·ͨ͠ 🌟 🌟