Slide 1

Slide 1 text

-&(0#0045Ͱ
 େਓ΋༡΅͏ʂ ʙϥζύΠΧϝϥ࿈ܞฤʙ

Slide 2

Slide 2 text

ࣗݾ঺հ ීஈ͸ΤϯλʔϓϥΠζܥͷιϑτ΢ΣΞΤϯδχΞ ಀආ׆ಈͱͯ͠ϚΠίϯϘʔυܥ΋ &5ϩϘίϯ๺ւಓ஍۠ɹ࣮ߦҕһ 1ZUIPOࡳຈཪํ

Slide 3

Slide 3 text

˞೥݄೔ݱࡏ

Slide 4

Slide 4 text

̏छྨͷ#0045ϒϩοΫ Ϝʔϒϋϒ ֎෦Ϟʔλʔ Χϥʔˍڑ཭ηϯαʔ ಺ଂϞʔλʔY ಺ଂνϧτηϯαʔ 3(#-&%

Slide 5

Slide 5 text

BLE ίϚϯυ ௨஌ ϓϩάϥϜ͕ಈ͘ ͷ͸ΞϓϦ্

Slide 6

Slide 6 text

https://github.com/JorgePe/BOOSTreveng #-&ͷ௨৴಺༰͸େํղੳ͞Ε͍ͯΔ

Slide 7

Slide 7 text

https://github.com/JorgePe/pyb00st 1ZUIPOͷ"1*΋͋Δ QZCTU ˞ଞʹOPEFKT +BWB4DSJQU ͷ"1*΋͋Δ

Slide 8

Slide 8 text

https://qiita.com/sonoisa/items/cf0bc6c0ed4d244407b4 εϚʔτϩοΫ࣮ݱͨ͠ڧऀ΋͍Δ

Slide 9

Slide 9 text

ΧϝϥϞδϡʔϧ 3BTQCFSSZ1J;FSP8 ʢը૾ॲཧɺߦಈ൑ఆʣ #-& ʢಈ࡞ࢦࣔʣ ࠓճ΍ͬͯΈͨ͜ͱ ※εΠοναΠΤϯεͰͷՁ֨ʢ2019೥1݄19೔ݱࡏʣ ɹRaspberry Pi Zero W 1,296ԁ
 ɹRaspberry Pi ΧϝϥϞδϡʔϧ V2 4,680ԁ ɹRaspberry Pi Zero έʔε 648ԁ ͍ΘΏΔʮϚγϯϏδϣϯʯͷ·Ͷ͝ͱ
 https://ja.wikipedia.org/wiki/ϚγϯϏδϣϯ

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

No content

Slide 12

Slide 12 text

ϥζύΠΧϝϥ͔Βͷը૾࿈ଓऔΓࠐΈ import picamera import picamera.array import cv2 import time : with picamera.PiCamera() as camera: camera.resolution = (160, 120) # 160x120ͷղ૾౓ time.sleep(2) with picamera.array.PiRGBArray(camera) as frame: time.sleep(0.1) for frame in camera.capture_continuous(frame, 'bgr', use_video_port=True): image = frame.array # ͜͜Ͱ֤ϑϨʔϜͷΠϝʔδΛॲཧʢOpenCV 2Λར༻ʣ

Slide 13

Slide 13 text

roi = image[60:120, 0:160] # ؔ৺ྖҬͷ੾Γग़͠ ݩͷΠϝʔδ(image)

Slide 14

Slide 14 text

mono = cv2.cvtColor(roi, cv2.COLOR_BGR2GRAY) # ϞϊΫϩԽ blur = cv2.GaussianBlur(mono, (9, 9), 0) # ฏ׈Խ

Slide 15

Slide 15 text

ret,thresh = cv2.threshold(blur, 60, 255,cv2.THRESH_BINARY_INV|cv2.THRESH_OTSU) # ೋ஋Խ erode_img = cv2.erode(thresh, None, iterations=2) # ऩॖ(Erosion) dilate_img = cv2.dilate(erode_img, None, iterations=2) # ๲ு(Dilation)

Slide 16

Slide 16 text

_,contours,hierarchy = cv2.findContours(dilate_img, 1, 
 cv2.CHAIN_APPROX_NONE)# ྠֲݕग़ c = max(contours, key=cv2.contourArea) # ໘ੵ͕࠷େͷྠֲ M = cv2.moments(c) # Ϟʔϝϯτʢॏ৺ʣ cx = int(M[‘m10’]/M['m00']) # ॏ৺࠲ඪ x cy = int(M[‘m01']/M['m00']) # ॏ৺࠲ඪ y

Slide 17

Slide 17 text

mymovehub = MoveHub(MY_MOVEHUB_ADD, 'BlueZ', MY_BTCTRLR_HCI) : if cx >= 120: # ӈટճ (duty_a, duty_b) = (100, 10) elif cx > 50: # ௚ਐ (duty_a, duty_b) = (100, 100) elif cx > 0: # ࠨટճ (duty_a, duty_b) = (10, 100) else: # ఀࢭ (duty_a, duty_b) = (0, 0) mymovehub.run_motors_for_time(MOTOR_AB, 150, duty_a, duty_b)

Slide 18

Slide 18 text

No content

Slide 19

Slide 19 text

No content

Slide 20

Slide 20 text

·ͱΊ -&(0#0045ͷ௨৴͸΄΅ղੳࡁΈͰେਓ΋༡΂Δ #-&͕࢖͑Ε͹ͲΜͳػث͔ΒͰ΋ #-&Χϝϥ͕࢖͑ΔػثͱͳΒϚγϯϏδϣϯͰ͖Δ %FFQ3BDFSͷϚω͝ͱ͍ͨ͠