• SEARCH

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

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

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

    • 싸이트 를 만든이유
      801

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

    • 이게 뭐였드라? 01
      246

    TOP SUGGEST

    RANDOM

    • Implementing Face Tracking for WALL-E

      🤖 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 Casca...

    • 건담완성!!!! 이쁘다..헤헷!!
      건담완성!!!! 이쁘다..헤헷!!
    • 철인 29호 완성
      철인 29호 완성
    댓글

    대상을 찾을 수 없습니다.

  • 3D Printing 3D 자유게시판
    • 3D Printing 3D 자유게시판
    • Wall-E USB camera 작동시키기

    • Profile
      • redclip
      • 2025.11.29 - 01:27 2025.11.29 - 00:53 68

    🛠️ Guide: Enabling USB Camera Support for WALL-E

     

    This guide outlines the steps to replace the default PiCamera module with a USB Webcam using OpenCV in the WALL-E Flask web interface. ( by Gemini )

     

    1. Prerequisites

     

    First, install the OpenCV library for Python on your Raspberry Pi.

    Bash

    sudo apt update
    sudo apt install python3-opencv
    

     

    2. Modify Backend (app.py)

     

    We need to update the Python Flask server to capture frames from the USB camera.

    A. Import OpenCV and Response Add cv2 and Response to the imports at the top of the file.

    Python

    from flask import Flask, ..., Response  # Add Response
    import cv2                              # Add cv2
    

    B. Add Camera Class Insert the USBCameraStreamer class before the app = Flask(__name__) line.

    Python

    class USBCameraStreamer:
        def __init__(self):
            self.camera = cv2.VideoCapture(0) # 0 is usually the default USB camera
            self.is_running = False
    
        def start_stream(self):
            if not self.camera.isOpened():
                self.camera.open(0)
            self.is_running = True
            return True, "USB Camera Started"
    
        def stop_stream(self):
            self.is_running = False
            if self.camera.isOpened():
                self.camera.release()
            return True
    
        def is_stream_active(self):
            return self.is_running
    
        def get_frame(self):
            if self.is_running:
                success, frame = self.camera.read()
                if success:
                    ret, buffer = cv2.imencode('.jpg', frame)
                    return buffer.tobytes()
            return None
    

    C. Initialize Camera Replace the existing PiCameraStreamer initialization with our new class (around line 34).

    Python

    # camera: PiCameraStreamer = PiCameraStreamer()  <-- Comment this out
    camera = USBCameraStreamer()                     # <-- Add this
    

    D. Add Video Route Add the generator function and route at the bottom of the file (before if __name__ == ...).

    Python

    def gen(camera):
        while True:
            frame = camera.get_frame()
            if frame is not None:
                yield (b'--frame\r\n'
                       b'Content-Type: image/jpeg\r\n\r\n' + frame + b'\r\n')
            else:
                 time.sleep(0.1)
    
    @app.route('/video_feed')
    def video_feed():
        return Response(gen(camera),
                        mimetype='multipart/x-mixed-replace; boundary=frame')
    

     

    3. Modify Frontend (index.html)

     

    Update the HTML to load the video from our new route.

    • File: web_interface/templates/index.html

    • Action: Find the <img> tag with id="stream" and change the src attribute.

    HTML

    <img id="stream" src="{{ url_for('static', filename='streamimage.jpg') }}">
    
    <img id="stream" src="{{ url_for('video_feed') }}">
    

     

    4. Update Logic (main.js)

     

    Prevent the JavaScript from overwriting the camera URL with the old port 8080 address.

    • File: web_interface/static/js/main.js

    • Action: Search for $("#stream").attr("src", ...) and replace the URL in two places (inside sendSettings function and window.onload section).

    JavaScript

    // Replace this logic in both locations:
    $("#stream").attr("src", "/video_feed");
    

     

    5. Run

     

    Restart the service to apply changes.

    Bash

    sudo systemd stop walle.service
    python3 app.py
    

    이 매뉴얼이 나중에 도움이 되길 바랍니다! 📝

     

    Attached file
    app.py 26.7KB 10
    이 게시물을..
    0
    0
    • Implementing Face Tracking for WALL-Eredclip
    • redclip 0
      redclip

    redclip 님의 최근 글

    NFC 마패 3 2026 01.27 QR-Code 공짜로 만들기 9 2026 01.22 안티 그래비티 vs 제미니 23 2026 01.18 R2D2 - Arduino BLDC Motor Controller Wiring Guide 17 2026 01.18 이게 얼마만이야.. T.T 16 2026 01.18

    redclip 님의 최근 댓글

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

    COMMENT

    NOTICE

    • NFC 마패
    • QR-Code 공짜로 만들기
    • 안티 그래비티 vs 제미니

    COMMENT

    • Today893
    • Yesterday421
    • Total18,479
  • DIY Holic
 DIY Holic all rights reserved.
by OrangeDay