• SEARCH

    통합검색
  • DIY Holic
    • Welcome
    • 자유게시판
    • 3D Printing
      • 3D 자유게시판
      • STLs
      • Pics
      • 3D Neon 제작
      • 3D 프린팅 영상
    • 미싱 놀이
      • 미싱 자유게시판
      • 사진
      • 터프팅
      • 나눔게시판
    • CNC
      • CNC 자유게시판
      • CNC PICs
    • Computer
      • S/W
      • Com 자유게시판
    • 프린트
      • 관련사진
      • 프린트 자유게시판
    • 회원가입
  • TOP VIEW

    • 한인회 싸이트 완료 그리고 요즘
      1178

      한인회 싸이트 완료 했는데 ... 한지 몇달 됬는데 이제야 완료 글을 쓰네.... 일단 회장님이 너무 마음에 들어 하셨음. 예전 만든건 정말 시큰둥 하셨걸랑... 뭐 .. 솔직히 나도 마음에 안들었고... 이번꺼는 마음에 드셨던지 열심히 사람들한테 소개 하시더라.. ^^;;; 요즘 예전에 가지고 있던 띠 동물 그림으로 neon 싸인 ...

    • 싸이트 를 만든이유
      885

      그냥 나 편한데로 맘대로 할수 있는곳이 있었으면 했었다. 우연히 지금에 디자인을 접했고 너무~ 마음에 들어 호스팅 바로 신청하고 설치시작! 솔직히 처음에 호스팅 신청후 빨리 해봐서 샘플과 다르면(보통 좀 다르더라) 서비스 켄슬해야지.... 하며 ( 켄슬 시간은 일주일 ) 설치 했는데 왠걸.... 이건 너무 쉽고 이쁘쟈나....

    • 알씨
      507

      사진 사이즈 변경할때 내가 많이 쓰는 알씨 프로그램이야. 서버에서 다운받으면 크지도 않은 파일이 오래 걸려서 아예 여기에 올려놓는거니까 필요한 사람 다운받아써.. 크렉버전 아니니까 광고 나올꺼야 참고해~ ALSee939.exe <---- 클릭

    TOP SUGGEST

    RANDOM

    • 알씨

      사진 사이즈 변경할때 내가 많이 쓰는 알씨 프로그램이야. 서버에서 다운받으면 크지도 않은 파일이 오래 걸려서 아예 여기에 올려놓는거니까 필요한 사람 다운받아써.. 크렉버전 아니니까 광고 나올꺼야 참고해~ ALSee939.exe <---- 클릭

    • Labubu The Monster Cosplay

      Labubu The Monster Cosplay Labubu The Monster Cosplay Mask Anime Props Halloween.zip

    • 프랩 총 (이름까먹음)
      프랩 총 (이름까먹음)
    포인트

    대상을 찾을 수 없습니다.

  • 3D Printing 3D 자유게시판
    • 3D Printing 3D 자유게시판
    • Implementing Face Tracking for WALL-E

    • Profile
      • redclip
      • 2025.11.29 - 02:59 2025.11.29 - 02:51 230

    🤖 Guide: Implementing Face Tracking for WALL-E

     

    This guide outlines how to enable Face Tracking on your WALL-E robot using OpenCV. This feature allows WALL-E to detect a human face and automatically rotate its head to follow the movement.

     

    1. Prerequisites

     

    Ensure that the OpenCV data files (Haar Cascades) are installed on your Raspberry Pi.

    Bash

    sudo apt install opencv-data -y
    

     

    2. Locate Data File

     

    Find the absolute path of the haarcascade_frontalface_default.xml file, as the system might not locate it automatically.

    Bash

    find /usr -name "haarcascade_frontalface_default.xml"
    # Common path: /usr/share/opencv4/haarcascades/haarcascade_frontalface_default.xml
    

     

    3. Modify Backend (app.py)

     

    Update the USBCameraStreamer class in web_interface/app.py to include the face detection and tracking logic.

     

    A. Initialization (__init__)

     

    Load the Haar Cascade model using the absolute path found in Step 2 and initialize the head position variable.

    Python

    def __init__(self):
        self.camera = cv2.VideoCapture(0)
        # Load the face detection model using the absolute path
        self.face_cascade = cv2.CascadeClassifier('/usr/share/opencv4/haarcascades/haarcascade_frontalface_default.xml')
        self.is_running = False
        self.head_pos = 50  # Initial head position (Center)
    

     

    B. Tracking Logic (get_frame)

     

    Implement the logic to detect faces and send servo commands to the Arduino.

    Python

    def get_frame(self):
        if self.is_running:
            success, frame = self.camera.read()
            if success:
                # 1. Convert to grayscale for performance
                gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
                
                # 2. Detect faces
                faces = self.face_cascade.detectMultiScale(gray, 1.1, 4)
    
                for (x, y, w, h) in faces:
                    # Draw a rectangle around the face
                    cv2.rectangle(frame, (x, y), (x+w, y+h), (255, 0, 0), 2)
                    
                    # 3. Calculate the center of the face
                    x_center = x + (w / 2)
                    
                    # 4. Control Motors (Center is 320, Deadzone is 40px)
                    global arduino
                    
                    # If face is on the left -> Rotate head left (Decrease angle)
                    if x_center < 280: 
                        if self.head_pos > 0:
                            self.head_pos -= 1
                            arduino.send_command("G" + str(self.head_pos))
                            
                    # If face is on the right -> Rotate head right (Increase angle)
                    elif x_center > 360: 
                        if self.head_pos < 100:
                            self.head_pos += 1
                            arduino.send_command("G" + str(self.head_pos))
    
                ret, buffer = cv2.imencode('.jpg', frame)
                return buffer.tobytes()
        return None
    

     

    4. Run & Test

     

    Restart the WALL-E service to apply the changes.

    Bash

    sudo systemd restart walle.service
    sudo systemd status walle.service
    
    • Note: Verify that the service status is active (running).

    이 게시물을..
    0
    0
    • R2D2 - Arduino BLDC Motor Controller Wiring Guideredclip
    • Wall-E USB camera 작동시키기redclip
    • redclip 0
      redclip

    redclip 님의 최근 글

    R2D2 를 품기에는 우리집이 너무작아..ㅜ.ㅜ 43 2026 02.21 dControl 162 2026 02.11 NFC 명함 마패 66 2026 02.05 NFC 마패 89 2026 01.27 QR-Code 공짜로 만들기 141 2026 01.22

    redclip 님의 최근 댓글

    작성 댓글이 없습니다.
    글쓴이의 서명작성글 감추기 
    • 댓글 입력
    • 에디터 전환
    댓글 쓰기 에디터 사용하기 닫기
    • view_headline 목록
    • 14px
    • R2D2 - Arduino BLDC Motor Controller Wiring Guide
    • Wall-E USB camera 작동시키기
    • 목록
      view_headline
    × CLOSE
    기본 (3) 제목 날짜 수정 조회 댓글 추천 비추
    분류 정렬 검색
    3
    R2D2 - Arduino BLDC Motor Controller Wiring Guide
    redclip 2026.01.18 - 23:06 207
    Implementing Face Tracking for WALL-E
    redclip 2025.11.29 - 02:51 230
    1
    Wall-E USB camera 작동시키기
    redclip 2025.11.29 - 00:53 219
    • 1
    • / 1 GO
    • 글쓰기
  • 3D Printing
    • 3D 자유게시판
    • STLs
    • Pics
    • 3D Neon 제작
    • 3D 프린팅 영상

    COMMENT

    NOTICE

    • R2D2 를 품기에는 우리집이 너무작아..ㅜ.ㅜ
    • dControl
    • NFC 명함 마패

    COMMENT

    • Today119
    • Yesterday119
    • Total29,222
  • DIY Holic
 DIY Holic all rights reserved.
by OrangeDay