Coding and STEMOhbot Ohbot ChatGPTOhBot ChatGPT BasicOhBot 如何設定及加入鏡頭 ?

OhBot 如何設定及加入鏡頭 ?

Ohbot 可以配合鏡頭認出人貌 , 配合編程後當 Ohbot 看到人時可以做出聊天對答等情景。

加入鏡頭 :

首先將 OhBot 的USB 鏡頭(或能用其他鏡頭) 插至電腦上。

在 「Settings」中選擇「Sensor」

原裝的 Camera 名稱應為「HD 720P Webcam」 , 選擇這個 Video Device

Resolution 建議選擇高一點 , 這樣畫面會較為清析有助認出人面。

成功的話你會在 Virtual OhBot 下方見到鏡頭現在拍攝的內容。

加入簡單編程 :

在「Sensing」上勾選「camera face detected」 , 這個 block 可偵測鏡頭有沒有拍攝到人面。

勾選後你會在 Dashboard 上看到「detected face : n 」 (在 Coding 分頁下方)

左圖為拍攝到一個人面 -  detected face :1  , 右圖則沒有所以 detected face : 0

先取出「if then else」 , 然後加入「Operators」中的「 x = x」 作為這次編程的條件。

將剛剛的「camera face detected」拖拉至 if 的前方 , 後方則輸入 1

代表偵測到一個人像時 then ....

偵測到人面時加入「say xxxx until done」示意有人

在 「Motion」選取「set eye to ....」表示無人經過正在待機 , 也能更改成其他 Output 如 : motion / speech 等等