아두이노 초음파센서 4개, 부저 RGB LED 4개, LCD
1m 이상일 경우 안전함 추가 #include //LCD 라이브러리 추가 //LiquidCrystal lcd(RS, Enable, DB4, DB5, DB6, DB7); LiquidCrystal lcd(40, 41, 42, 43, 44, 45); //purple40, gray41, blue42,green43,yellow44,orange45 int go = 52; //buzzer int trigPin1 = 23; //후방 int echoPin1 = 22; int red1 = 10; int grn1 = 9; int blu1 = 8; int trigPin2 = 24; //전방 int echoPin2 = 25; int red2 = 13; int grn2 = 12; int blu2 = 11; int trigPin3..
2021. 1. 26.
아두이노 초음파센서 4개, 부저 RGB LED 4개
50 < distance 이면 led 꺼짐 추가 #include //LCD 라이브러리 추가 //LiquidCrystal lcd(RS, Enable, DB4, DB5, DB6, DB7); LiquidCrystal lcd(40, 41, 42, 43, 44, 45); int go = 52; //buzzer int trigPin1 = 23; //후방 int echoPin1 = 22; int red1 = 10; int grn1 = 9; int blu1 = 8; int trigPin2 = 24; //전방 int echoPin2 = 25; int red2 = 13; int grn2 = 12; int blu2 = 11; int trigPin3 = 32; //좌 int echoPin3 = 33; int red3 = 7;..
2021. 1. 22.
if x<80 : print('right') elif x>300 : print('left')
import cv2 import numpy as np cap = cv2.VideoCapture("1eun2.mp4") while True: ret, frame = cap.read() if ret is False: break roi = frame[100: 795, 700: 1300] rows, cols, _ = roi.shape gray_roi = cv2.cvtColor(roi, cv2.COLOR_BGR2GRAY) gray_roi = cv2.GaussianBlur(gray_roi, (7, 7), 0) _, threshold = cv2.threshold(gray_roi, 30, 255, cv2.THRESH_BINARY_INV) _, contours, _ = cv2.findContours(threshold, ..
2021. 1. 20.
0eun, 주석 포함 코드, 주석 삭제한 코드
import cv2 import numpy as np cap = cv2.VideoCapture("0eun.mp4") while True: ret, frame = cap.read() if ret is False: break roi = frame[100: 795, 537: 1300] rows, cols, _ = roi.shape gray_roi = cv2.cvtColor(roi, cv2.COLOR_BGR2GRAY) gray_roi = cv2.GaussianBlur(gray_roi, (7, 7), 0) _, threshold = cv2.threshold(gray_roi, 30, 255, cv2.THRESH_BINARY_INV) _, contours, _ = cv2.findContours(threshold, c..
2021. 1. 19.