Skip to content

Commit e9c6569

Browse files
author
coderbot
committed
-
1 parent 7748777 commit e9c6569

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

data/program_face.data

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"dom_code": "<xml xmlns=\"http://www.w3.org/1999/xhtml\"><block type=\"controls_whileUntil\" id=\"8\" inline=\"false\" x=\"43\" y=\"-64\"><field name=\"MODE\">WHILE</field><value name=\"BOOL\"><block type=\"logic_boolean\" id=\"9\"><field name=\"BOOL\">TRUE</field></block></value><statement name=\"DO\"><block type=\"variables_set\" id=\"10\" inline=\"true\"><field name=\"VAR\">faccia_x</field><value name=\"VALUE\"><block type=\"coderbot_adv_findFace\" id=\"11\"></block></value><next><block type=\"text_print\" id=\"12\" inline=\"false\"><value name=\"TEXT\"><block type=\"variables_get\" id=\"13\"><field name=\"VAR\">faccia_x</field></block></value><next><block type=\"controls_if\" id=\"14\" inline=\"false\"><value name=\"IF0\"><block type=\"logic_compare\" id=\"15\" inline=\"true\"><field name=\"OP\">GTE</field><value name=\"A\"><block type=\"variables_get\" id=\"16\"><field name=\"VAR\">faccia_x</field></block></value><value name=\"B\"><block type=\"math_number\" id=\"17\"><field name=\"NUM\">0</field></block></value></block></value><statement name=\"DO0\"><block type=\"controls_if\" id=\"18\" inline=\"false\"><mutation elseif=\"1\"></mutation><value name=\"IF0\"><block type=\"logic_compare\" id=\"19\" inline=\"true\"><field name=\"OP\">LT</field><value name=\"A\"><block type=\"variables_get\" id=\"20\"><field name=\"VAR\">faccia_x</field></block></value><value name=\"B\"><block type=\"math_number\" id=\"21\"><field name=\"NUM\">45</field></block></value></block></value><statement name=\"DO0\"><block type=\"coderbot_adv_move\" id=\"22\" inline=\"true\"><field name=\"ACTION\">LEFT</field><value name=\"SPEED\"><block type=\"math_number\" id=\"23\"><field name=\"NUM\">80</field></block></value><value name=\"ELAPSE\"><block type=\"math_arithmetic\" id=\"45\" inline=\"true\"><field name=\"OP\">DIVIDE</field><value name=\"A\"><block type=\"math_arithmetic\" id=\"46\" inline=\"true\"><field name=\"OP\">MINUS</field><value name=\"A\"><block type=\"math_number\" id=\"48\"><field name=\"NUM\">50</field></block></value><value name=\"B\"><block type=\"variables_get\" id=\"47\"><field name=\"VAR\">faccia_x</field></block></value></block></value><value name=\"B\"><block type=\"math_number\" id=\"49\"><field name=\"NUM\">100.1</field></block></value></block></value></block></statement><value name=\"IF1\"><block type=\"logic_compare\" id=\"25\" inline=\"true\"><field name=\"OP\">GT</field><value name=\"A\"><block type=\"variables_get\" id=\"26\"><field name=\"VAR\">faccia_x</field></block></value><value name=\"B\"><block type=\"math_number\" id=\"27\"><field name=\"NUM\">55</field></block></value></block></value><statement name=\"DO1\"><block type=\"coderbot_adv_move\" id=\"28\" inline=\"true\"><field name=\"ACTION\">RIGHT</field><value name=\"SPEED\"><block type=\"math_number\" id=\"29\"><field name=\"NUM\">80</field></block></value><value name=\"ELAPSE\"><block type=\"math_arithmetic\" id=\"43\" inline=\"true\"><field name=\"OP\">DIVIDE</field><value name=\"A\"><block type=\"math_arithmetic\" id=\"38\" inline=\"true\"><field name=\"OP\">MINUS</field><value name=\"A\"><block type=\"variables_get\" id=\"34\"><field name=\"VAR\">faccia_x</field></block></value><value name=\"B\"><block type=\"math_number\" id=\"39\"><field name=\"NUM\">50</field></block></value></block></value><value name=\"B\"><block type=\"math_number\" id=\"44\"><field name=\"NUM\">100.1</field></block></value></block></value></block></statement></block></statement></block></next></block></next></block></statement></block></xml>", "code": "faccia_x = None\n\n\nwhile True:\n get_prog_eng().check_end()\n faccia_x = get_cam().find_face()\n get_cam().set_text(faccia_x)\n if faccia_x >= 0:\n if faccia_x < 45:\n get_bot().left(speed=80, elapse=(50 - faccia_x) / 100.1)\n elif faccia_x > 55:\n get_bot().right(speed=80, elapse=(faccia_x - 50) / 100.1)\n", "name": "face"}
1+
{"dom_code": "<xml xmlns=\"http://www.w3.org/1999/xhtml\"><block type=\"controls_whileUntil\" id=\"5\" inline=\"false\" x=\"43\" y=\"-64\"><field name=\"MODE\">WHILE</field><value name=\"BOOL\"><block type=\"logic_boolean\" id=\"6\"><field name=\"BOOL\">TRUE</field></block></value><statement name=\"DO\"><block type=\"variables_set\" id=\"7\" inline=\"true\"><field name=\"VAR\">faccia_x</field><value name=\"VALUE\"><block type=\"coderbot_adv_findFace\" id=\"8\"></block></value><next><block type=\"text_print\" id=\"9\" inline=\"false\"><value name=\"TEXT\"><block type=\"variables_get\" id=\"10\"><field name=\"VAR\">faccia_x</field></block></value><next><block type=\"controls_if\" id=\"11\" inline=\"false\"><value name=\"IF0\"><block type=\"logic_compare\" id=\"12\" inline=\"true\"><field name=\"OP\">GTE</field><value name=\"A\"><block type=\"variables_get\" id=\"13\"><field name=\"VAR\">faccia_x</field></block></value><value name=\"B\"><block type=\"math_number\" id=\"14\"><field name=\"NUM\">0</field></block></value></block></value><statement name=\"DO0\"><block type=\"controls_if\" id=\"15\" inline=\"false\"><mutation elseif=\"1\"></mutation><value name=\"IF0\"><block type=\"logic_compare\" id=\"16\" inline=\"true\"><field name=\"OP\">LT</field><value name=\"A\"><block type=\"variables_get\" id=\"17\"><field name=\"VAR\">faccia_x</field></block></value><value name=\"B\"><block type=\"math_number\" id=\"18\"><field name=\"NUM\">45</field></block></value></block></value><statement name=\"DO0\"><block type=\"coderbot_adv_move\" id=\"19\" inline=\"true\"><field name=\"ACTION\">LEFT</field><value name=\"SPEED\"><block type=\"math_number\" id=\"20\"><field name=\"NUM\">80</field></block></value><value name=\"ELAPSE\"><block type=\"math_arithmetic\" id=\"21\" inline=\"true\"><field name=\"OP\">DIVIDE</field><value name=\"A\"><block type=\"math_arithmetic\" id=\"22\" inline=\"true\"><field name=\"OP\">MINUS</field><value name=\"A\"><block type=\"math_number\" id=\"23\"><field name=\"NUM\">50</field></block></value><value name=\"B\"><block type=\"variables_get\" id=\"24\"><field name=\"VAR\">faccia_x</field></block></value></block></value><value name=\"B\"><block type=\"math_number\" id=\"25\"><field name=\"NUM\">100.1</field></block></value></block></value></block></statement><value name=\"IF1\"><block type=\"logic_compare\" id=\"26\" inline=\"true\"><field name=\"OP\">GT</field><value name=\"A\"><block type=\"variables_get\" id=\"27\"><field name=\"VAR\">faccia_x</field></block></value><value name=\"B\"><block type=\"math_number\" id=\"28\"><field name=\"NUM\">55</field></block></value></block></value><statement name=\"DO1\"><block type=\"coderbot_adv_move\" id=\"29\" inline=\"true\"><field name=\"ACTION\">RIGHT</field><value name=\"SPEED\"><block type=\"math_number\" id=\"30\"><field name=\"NUM\">80</field></block></value><value name=\"ELAPSE\"><block type=\"math_arithmetic\" id=\"31\" inline=\"true\"><field name=\"OP\">DIVIDE</field><value name=\"A\"><block type=\"math_arithmetic\" id=\"32\" inline=\"true\"><field name=\"OP\">MINUS</field><value name=\"A\"><block type=\"variables_get\" id=\"33\"><field name=\"VAR\">faccia_x</field></block></value><value name=\"B\"><block type=\"math_number\" id=\"34\"><field name=\"NUM\">50</field></block></value></block></value><value name=\"B\"><block type=\"math_number\" id=\"35\"><field name=\"NUM\">100.1</field></block></value></block></value></block></statement></block></statement></block></next></block></next></block></statement></block></xml>", "code": "faccia_x = None\n\n\nwhile True:\n get_prog_eng().check_end()\n faccia_x = get_cam().find_face()\n get_cam().set_text(faccia_x)\n if faccia_x >= 0:\n if faccia_x < 45:\n get_bot().left(speed=80, elapse=(50 - faccia_x) / 100.1)\n elif faccia_x > 55:\n get_bot().right(speed=80, elapse=(faccia_x - 50) / 100.1)\n", "name": "face"}

viz/image.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
MIN_MATCH_COUNT = 10
1010

1111
class Image():
12-
_face_cascade = cv2.CascadeClassifier('/usr/share/opencv/haarcascades/haarcascade_frontalface_default.xml')
12+
_face_cascade = cv2.CascadeClassifier('/usr/local/share/OpenCV/haarcascades/haarcascade_frontalface_default.xml')
1313
_kernel = np.ones((3,3),np.uint8)
1414

1515
def __init__(self, array):

0 commit comments

Comments
 (0)