Merge branch 'master' of https://bdgit.educoder.net/pxsi3jbgc/wwcs-1314
# Conflicts: # doc/软件开发项目的个人自评报告-基于热成像技术的无人机自动跟踪项目.xlsxmaster
commit
03dce11193
After Width: | Height: | Size: 9.8 MiB |
Before Width: | Height: | Size: 59 KiB After Width: | Height: | Size: 59 KiB |
@ -0,0 +1 @@
|
||||
# CMake generation timestamp file for this directory.
|
@ -0,0 +1,11 @@
|
||||
# CMake generation dependency list for this directory.
|
||||
E:/openpose/openpose_prosperity/examples/tutorial_api_python/01_body_from_image.py
|
||||
E:/openpose/openpose_prosperity/examples/tutorial_api_python/02_whole_body_from_image.py
|
||||
E:/openpose/openpose_prosperity/examples/tutorial_api_python/04_keypoints_from_images.py
|
||||
E:/openpose/openpose_prosperity/examples/tutorial_api_python/05_keypoints_from_images_multi_gpu.py
|
||||
E:/openpose/openpose_prosperity/examples/tutorial_api_python/06_face_from_image.py
|
||||
E:/openpose/openpose_prosperity/examples/tutorial_api_python/07_hand_from_image.py
|
||||
E:/openpose/openpose_prosperity/examples/tutorial_api_python/08_heatmaps_from_image.py
|
||||
E:/openpose/openpose_prosperity/examples/tutorial_api_python/09_keypoints_from_heatmaps.py
|
||||
E:/openpose/openpose_prosperity/examples/tutorial_api_python/CMakeLists.txt
|
||||
E:/openpose/openpose_prosperity/examples/tutorial_api_python/openpose_python.py
|
@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="17.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<CustomBuild Include="E:\openpose\openpose_prosperity\build\CMakeFiles\52e4f4e96e416b306a37548352e90ea2\INSTALL_force.rule">
|
||||
<Filter>CMake Rules</Filter>
|
||||
</CustomBuild>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Filter Include="CMake Rules">
|
||||
<UniqueIdentifier>{7BC68FB9-1045-3D7A-A2DB-568B5960D265}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
</Project>
|
@ -0,0 +1,34 @@
|
||||
# Install script for directory: E:/openpose/openpose_prosperity/examples/tutorial_api_python
|
||||
|
||||
# Set the install prefix
|
||||
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
|
||||
set(CMAKE_INSTALL_PREFIX "C:/Program Files/OpenPose")
|
||||
endif()
|
||||
string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
|
||||
|
||||
# Set the install configuration name.
|
||||
if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
|
||||
if(BUILD_TYPE)
|
||||
string(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
|
||||
CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
|
||||
else()
|
||||
set(CMAKE_INSTALL_CONFIG_NAME "Release")
|
||||
endif()
|
||||
message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
|
||||
endif()
|
||||
|
||||
# Set the component getting installed.
|
||||
if(NOT CMAKE_INSTALL_COMPONENT)
|
||||
if(COMPONENT)
|
||||
message(STATUS "Install component: \"${COMPONENT}\"")
|
||||
set(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
|
||||
else()
|
||||
set(CMAKE_INSTALL_COMPONENT)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Is this installation the result of a crosscompile?
|
||||
if(NOT DEFINED CMAKE_CROSSCOMPILING)
|
||||
set(CMAKE_CROSSCOMPILING "FALSE")
|
||||
endif()
|
||||
|
@ -0,0 +1,60 @@
|
||||
# From Python
|
||||
# It requires OpenCV installed for Python
|
||||
import sys
|
||||
import cv2
|
||||
import os
|
||||
from sys import platform
|
||||
import argparse
|
||||
|
||||
try:
|
||||
# Import Openpose (Windows/Ubuntu/OSX)
|
||||
dir_path = os.path.dirname(os.path.realpath(__file__))
|
||||
try:
|
||||
# Windows Import
|
||||
if platform == "win32":
|
||||
# Change these variables to point to the correct folder (Release/x64 etc.)
|
||||
sys.path.append(dir_path + '/../../build/python/openpose/Release');
|
||||
os.environ['PATH'] = os.environ['PATH'] + ';' + dir_path + '/../../x64/Release;' + dir_path + '/../../build/bin;'
|
||||
import pyopenpose as op
|
||||
else:
|
||||
# Change these variables to point to the correct folder (Release/x64 etc.)
|
||||
sys.path.append('../../python');
|
||||
# If you run `make install` (default path is `/usr/local/python` for Ubuntu), you can also access the OpenPose/python module from there. This will install OpenPose and the python library at your desired installation path. Ensure that this is in your python path in order to use it.
|
||||
# sys.path.append('/usr/local/python')
|
||||
from openpose import pyopenpose as op
|
||||
except ImportError as e:
|
||||
print('Error: OpenPose library could not be found. Did you enable `BUILD_PYTHON` in CMake and have this Python script in the right folder?')
|
||||
raise e
|
||||
|
||||
# Flags
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("--image_path", default="../../examples/media/COCO_val2014_000000000192.jpg", help="Process an image. Read all standard formats (jpg, png, bmp, etc.).")
|
||||
args = parser.parse_known_args()
|
||||
|
||||
# Custom Params (refer to include/openpose/flags.hpp for more parameters)
|
||||
params = dict()
|
||||
params["model_folder"] = "../../models/"
|
||||
|
||||
# Add others in path?
|
||||
for i in range(0, len(args[1])):
|
||||
curr_item = args[1][i]
|
||||
if i != len(args[1])-1: next_item = args[1][i+1]
|
||||
else: next_item = "1"
|
||||
if "--" in curr_item and "--" in next_item:
|
||||
key = curr_item.replace('-','')
|
||||
if key not in params: params[key] = "1"
|
||||
elif "--" in curr_item and "--" not in next_item:
|
||||
key = curr_item.replace('-','')
|
||||
if key not in params: params[key] = next_item
|
||||
|
||||
# Construct it from system arguments
|
||||
# op.init_argv(args[1])
|
||||
# oppython = op.OpenposePython()
|
||||
|
||||
# Starting OpenPose
|
||||
opWrapper = op.WrapperPython(op.ThreadManagerMode.Synchronous)
|
||||
opWrapper.configure(params)
|
||||
opWrapper.execute()
|
||||
except Exception as e:
|
||||
print(e)
|
||||
sys.exit(-1)
|
@ -0,0 +1,41 @@
|
||||
|
||||
|
||||
import cv2
|
||||
|
||||
# RTSP地址
|
||||
rtsp_url = "rtsp://192.168.1.135"
|
||||
|
||||
# 打开RTSP流
|
||||
cap = cv2.VideoCapture(rtsp_url)
|
||||
|
||||
# 检查摄像头是否成功打开
|
||||
if not cap.isOpened():
|
||||
print("无法打开摄像头")
|
||||
exit()
|
||||
|
||||
# 创建视频写入对象,用于保存视频
|
||||
out = cv2.VideoWriter('output.mp4', cv2.VideoWriter_fourcc(*'mp4v'), 30, (640, 480))
|
||||
|
||||
# 读取并显示视频流
|
||||
while True:
|
||||
ret, frame = cap.read()
|
||||
if not ret:
|
||||
print("无法读取视频流")
|
||||
break
|
||||
|
||||
# 在这里你可以对帧进行处理,例如进行对象检测、图像处理等
|
||||
|
||||
# 显示视频流
|
||||
cv2.imshow('RTSP Stream', frame)
|
||||
|
||||
# 写入视频帧到输出文件
|
||||
out.write(frame)
|
||||
|
||||
# 按下'q'键退出循环
|
||||
if cv2.waitKey(1) & 0xFF == ord('q'):
|
||||
break
|
||||
|
||||
# 释放资源
|
||||
cap.release()
|
||||
out.release()
|
||||
cv2.destroyAllWindows()
|
@ -0,0 +1,120 @@
|
||||
import tkinter as tk
|
||||
from tkinter import ttk
|
||||
|
||||
def save_settings():
|
||||
# Placeholder for saving settings logic
|
||||
print("Settings saved.")
|
||||
|
||||
# Create main window
|
||||
root = tk.Tk()
|
||||
root.title("设备连接与配置")
|
||||
|
||||
# Frame for serial settings
|
||||
serial_frame = ttk.LabelFrame(root, text="串口和波特率")
|
||||
serial_frame.grid(row=0, column=0, padx=10, pady=5, sticky=tk.W)
|
||||
|
||||
serial_port_label = ttk.Label(serial_frame, text="串口:")
|
||||
serial_port_label.grid(row=0, column=0, padx=5, pady=2, sticky=tk.W)
|
||||
serial_port_combo = ttk.Combobox(serial_frame, width=8, values=["COM1", "COM2", "COM3"])
|
||||
serial_port_combo.grid(row=0, column=1, padx=5, pady=2)
|
||||
serial_port_combo.set("COM1") # Set default value
|
||||
|
||||
baudrate_label = ttk.Label(serial_frame, text="波特率:")
|
||||
baudrate_label.grid(row=1, column=0, padx=5, pady=2, sticky=tk.W)
|
||||
baudrate_combo = ttk.Combobox(serial_frame, width=8, values=["9600", "19200", "115200"])
|
||||
baudrate_combo.grid(row=1, column=1, padx=5, pady=2)
|
||||
baudrate_combo.set("115200") # Set default value
|
||||
|
||||
# Frame for TCP settings
|
||||
tcp_frame = ttk.LabelFrame(root, text="TCP配置")
|
||||
tcp_frame.grid(row=1, column=0, padx=10, pady=5, sticky=tk.W)
|
||||
|
||||
tcp_ip_label = ttk.Label(tcp_frame, text="TCP 远端 IP:")
|
||||
tcp_ip_label.grid(row=0, column=0, padx=5, pady=2, sticky=tk.W)
|
||||
tcp_ip_combo = ttk.Combobox(tcp_frame, width=15, values=["192.168.1.100", "192.168.1.101", "192.168.1.102"])
|
||||
tcp_ip_combo.grid(row=0, column=1, padx=5, pady=2)
|
||||
tcp_ip_combo.set("192.168.1.100") # Set default value
|
||||
|
||||
tcp_port_label = ttk.Label(tcp_frame, text="端口:")
|
||||
tcp_port_label.grid(row=1, column=0, padx=5, pady=2, sticky=tk.W)
|
||||
tcp_port_entry = ttk.Entry(tcp_frame, width=8)
|
||||
tcp_port_entry.grid(row=1, column=1, padx=5, pady=2)
|
||||
tcp_port_entry.insert(0, "2000")
|
||||
|
||||
# Frame for UDP settings
|
||||
udp_frame = ttk.LabelFrame(root, text="UDP配置")
|
||||
udp_frame.grid(row=2, column=0, padx=10, pady=5, sticky=tk.W)
|
||||
|
||||
udp_remote_ip_label = ttk.Label(udp_frame, text="UDP 远端 IP:")
|
||||
udp_remote_ip_label.grid(row=0, column=0, padx=5, pady=2, sticky=tk.W)
|
||||
udp_remote_ip_combo = ttk.Combobox(udp_frame, width=15, values=["192.168.2.100", "192.168.2.101", "192.168.2.102"])
|
||||
udp_remote_ip_combo.grid(row=0, column=1, padx=5, pady=2)
|
||||
udp_remote_ip_combo.set("192.168.2.100") # Set default value
|
||||
|
||||
udp_remote_port_label = ttk.Label(udp_frame, text="远端端口:")
|
||||
udp_remote_port_label.grid(row=1, column=0, padx=5, pady=2, sticky=tk.W)
|
||||
udp_remote_port_entry = ttk.Entry(udp_frame, width=8)
|
||||
udp_remote_port_entry.grid(row=1, column=1, padx=5, pady=2)
|
||||
udp_remote_port_entry.insert(0, "14551")
|
||||
|
||||
udp_local_ip_label = ttk.Label(udp_frame, text="UDP 本地 IP:")
|
||||
udp_local_ip_label.grid(row=2, column=0, padx=5, pady=2, sticky=tk.W)
|
||||
udp_local_ip_combo = ttk.Combobox(udp_frame, width=15, values=["192.168.2.101", "192.168.2.102", "192.168.2.103"])
|
||||
udp_local_ip_combo.grid(row=2, column=1, padx=5, pady=2)
|
||||
udp_local_ip_combo.set("192.168.2.101") # Set default value
|
||||
|
||||
udp_local_port_label = ttk.Label(udp_frame, text="本地端口:")
|
||||
udp_local_port_label.grid(row=3, column=0, padx=5, pady=2, sticky=tk.W)
|
||||
udp_local_port_entry = ttk.Entry(udp_frame, width=8)
|
||||
udp_local_port_entry.grid(row=3, column=1, padx=5, pady=2)
|
||||
udp_local_port_entry.insert(0, "14550")
|
||||
|
||||
# Frame for video settings
|
||||
video_frame = ttk.LabelFrame(root, text="视频功能")
|
||||
video_frame.grid(row=3, column=0, padx=10, pady=5, sticky=tk.W)
|
||||
|
||||
# Network video options
|
||||
network_video_var = tk.IntVar()
|
||||
network_video_label = ttk.Label(video_frame, text="网络视频地址:")
|
||||
network_video_label.grid(row=0, column=1, padx=5, pady=2, sticky=tk.W)
|
||||
network_video_radio1 = ttk.Radiobutton(video_frame, variable=network_video_var, value=1)#text="选项1",
|
||||
network_video_radio1.grid(row=0, column=0, padx=5, pady=2, sticky=tk.W )
|
||||
|
||||
|
||||
network_video_entry = ttk.Entry(video_frame, width=20)
|
||||
network_video_entry.grid(row=0, column=4, padx=5, pady=2)
|
||||
|
||||
network_video_combo = ttk.Combobox(tcp_frame, width=15, values=["192.168.1.100", "192.168.1.101", "192.168.1.102"])
|
||||
network_video_combo.grid(row=0, column=5, padx=5, pady=2)
|
||||
network_video_combo.set("192.168.2.101") # Set default value
|
||||
|
||||
# 禁用网络视频输入框,除非选择了网络视频选项
|
||||
def update_entry_state():
|
||||
network_video_entry.config(state='normal' if network_video_var.get() == 1 else 'disabled')
|
||||
|
||||
|
||||
# network_video_var.trace_add('write', update_entry_state)
|
||||
# update_entry_state() # 初始化时调用一次以设置正确的状态
|
||||
|
||||
# USB device options
|
||||
#usb_device_var = tk.IntVar()
|
||||
usb_device_label = ttk.Label(video_frame, text="USB 设备:")
|
||||
usb_device_label.grid(row=1, column=1, padx=5, pady=2, sticky=tk.W)
|
||||
usb_device_radio1 = ttk.Radiobutton(video_frame, variable=network_video_var, value=2)#text="Camera1",
|
||||
usb_device_radio1.grid(row=1, column=0, padx=5, pady=2, sticky=tk.W)
|
||||
|
||||
|
||||
usb_device_entry = ttk.Entry(video_frame, width=20)
|
||||
usb_device_entry.grid(row=1, column=4, padx=5, pady=2)
|
||||
|
||||
usb_device_combo = ttk.Combobox(tcp_frame, width=15, values=["192.168.1.100", "192.168.1.101", "192.168.1.102"])
|
||||
usb_device_combo.grid(row=1, column=5, padx=5, pady=2)
|
||||
usb_device_combo.set("192.168.2.101") # Set default value
|
||||
|
||||
# Save settings button
|
||||
save_button = ttk.Button(root, text="保存设置", command=save_settings)
|
||||
save_button.grid(row=4, column=0, pady=10)
|
||||
save_button = ttk.Button(root, text="连接设备", command=save_settings)
|
||||
save_button.grid(row=5, column=0, pady=10)
|
||||
|
||||
root.mainloop()
|
After Width: | Height: | Size: 439 KiB |
After Width: | Height: | Size: 106 KiB |
Loading…
Reference in new issue