This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from onvif import ONVIFCamera | |
# Replace with your camera's details | |
camera = ONVIFCamera('192.168.1.100', 80, 'username', 'password') | |
# Create media service | |
media_service = camera.create_media_service() | |
# Get the profiles | |
profiles = media_service.GetProfiles() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
import os | |
def resize_images_in_directory(input_dir, output_dir, width, height): | |
# Create the output directory if it doesn't exist | |
if not os.path.exists(output_dir): | |
os.makedirs(output_dir) | |
# Iterate over all files in the input directory | |
for filename in os.listdir(input_dir): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from onvif import ONVIFCamera | |
import cv2 | |
import requests | |
import numpy as np | |
from requests.auth import HTTPDigestAuth | |
from fastapi import FastApi | |
# Replace with your camera's details | |
CAMERA_HOST = "10.10.44.119" | |
CAMERA_PORT = 80 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from onvif import ONVIFCamera | |
import cv2 | |
import requests | |
import numpy as np | |
# Replace with your camera's details | |
CAMERA_HOST = '192.168.0.189' | |
CAMERA_PORT = 80 | |
CAMERA_USER = 'admin' | |
CAMERA_PASS = 'password' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
def open_rtsp_stream(rtsp_url): | |
gst_str = ( | |
f"rtspsrc location={rtsp_url} ! " | |
"rtph264depay ! h264parse ! " | |
"nvv4l2decoder ! nvvidconv ! " | |
"video/x-raw, format=(string)BGRx ! " | |
"videoconvert ! video/x-raw, format=(string)BGR ! appsink" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import socket | |
import cv2 | |
import base64 | |
import numpy as np | |
def udp_listener(port): | |
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) | |
server_address = ('', port) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import socket | |
import struct | |
UDP_IP = "127.0.0.1" | |
UDP_PORT = 60002 | |
BUFFER_SIZE = 1024 | |
# Create a UDP socket | |
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) | |
sock.bind((UDP_IP, UDP_PORT)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <fstream> | |
#include <sstream> | |
#include <vector> | |
#include <string> | |
// Function to parse CSV file | |
std::vector<std::vector<std::string>> parseCSV(const std::string& filename) { | |
std::vector<std::vector<std::string>> data; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd ~/dbox/mcu | |
../../arduino-cli compile --fqbn esp32:esp32:tamc_termod_s3 -v | |
../../arduino-cli upload -p /dev/ttyACM0 --fqbn esp32:esp32:tamc_termod_s3 -v |