liubangzi 2 years ago
commit 1ae51c848e

Binary file not shown.

After

Width:  |  Height:  |  Size: 958 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 580 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 281 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 337 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 512 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 357 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 321 KiB

After

Width:  |  Height:  |  Size: 329 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 578 KiB

Binary file not shown.

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 6.5 KiB

@ -0,0 +1,3 @@
{
"CurrentProjectSetting": "无配置"
}

@ -0,0 +1,7 @@
{
"ExpandedNodes": [
""
],
"SelectedNode": "\\避障",
"PreviewInSolutionExplorer": false
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -0,0 +1,49 @@
import math
import time
# 风速计数
wind_count = 0
# 风速上次计数时间
wind_last_time = 0
# 风速
wind_speed = 0
# 风向角度
wind_direction_angle = 0
# 风向字符串
wind_direction_str = ""
# 风向刻度表
wind_directions = ["N", "NNE", "NE", "ENE", "E", "ESE", "SE", "SSE",
"S", "SSW", "SW", "WSW", "W", "WNW", "NW", "NNW", "N"]
# 风速计数回调函数
def wind_speed_callback():
global wind_count
wind_count += 1
# 风向计数回调函数
def wind_direction_callback():
global wind_direction_angle
wind_direction_angle = int(input("请输入当前风向角度:"))
try:
while True:
# 计算风速
wind_time = time.time() - wind_last_time
if wind_time > 5:
wind_speed = wind_count / wind_time * 2.4 # 转化为mph
wind_count = 0
wind_last_time = time.time()
# 计算风向
wind_direction = math.floor((wind_direction_angle + 11.25) / 22.5)
wind_direction_str = wind_directions[wind_direction % 16]
print("风速:{:.1f} mph\t 风向:{}".format(wind_speed, wind_direction_str))
time.sleep(0.1)
except KeyboardInterrupt:
pass

@ -0,0 +1,603 @@
import math
import threading
import time
import contextlib
import logging
import cv2
import numpy as np
import torch
import torchvision
from models.common import DetectMultiBackend
from utils.plots import Annotator
import json
import base64
import socket
from pathlib import Path
from utils.general import (LOGGER, Profile, check_file, check_imshow, check_requirements, colorstr, cv2,
increment_path, non_max_suppression, print_args, scale_boxes, strip_optimizer, xyxy2xywh)
import sys
import os
import nvidia_smi
from ctypes import windll
import math
from termcolor import colored, cprint
import requests
import platform
if platform.system() == 'Windows':
import windows_curses as curses
else:
import curses
FILE = Path(__file__).resolve()
ROOT = FILE.parents[0] # YOLOv5 root directory
if str(ROOT) not in sys.path:
sys.path.append(str(ROOT)) # add ROOT to PATH
ROOT = Path(os.path.relpath(ROOT, Path.cwd())) # relative
# 清空命令指示符输出
def clear():
# 对于非 Windows 系统使用 ANSI 转义序列来清除屏幕
if platform.system() != 'Windows':
print("\033c")
return
try:
# 使用 curses 库来清除屏幕,从而避免使用 os.system() .
stdscr = curses.initscr()
curses.curs_set(0) # 隐藏光标
stdscr.clear() # 清空屏幕
stdscr.refresh() # 刷新屏幕
time.sleep(0.1) # 等待一会儿以确保清屏成功
except Exception as e:
logging.error(f"Clear screen failed with error: {e}")
# 引发异常以向调用者报告错误
finally:
# 恢复 curses 库的原始设置
curses.endwin()
# 添加一些额外的效果来增强用户体验(可选)
cprint(colored('屏幕已被清除!', 'green', attrs=['bold', 'underline']))
time.sleep(0.5)
cprint(colored('请稍等...', 'cyan', attrs=['blink', 'reverse']))
_cache = None
# 检查是否为管理员权限
def is_admin():
global _cache
if _cache is not None:
# 若缓存可用,则立即返回缓存结果
return _cache
try:
# 检查当前平台是否支持获取管理员权限
if os.name != 'nt':
raise OSError('Unsupported platform')
# 检查当前用户是否为管理员
is_admin = (os.getuid() == 0) or (os.system('net session >nul 2>&1') == 0)
_cache = is_admin # 缓存当前结果
return is_admin
except OSError as err:
logging.error('Failed to check admin status: %s', err)
raise err # 抛出异常以引起关注
# 简单检查gpu是否够格
def check_gpu():
nvidia_smi.nvmlInit()
gpu_handle = nvidia_smi.nvmlDeviceGetHandleByIndex(0) # 默认卡1
gpu_name = nvidia_smi.nvmlDeviceGetName(gpu_handle)
memory_info = nvidia_smi.nvmlDeviceGetMemoryInfo(gpu_handle)
nvidia_smi.nvmlShutdown()
if b'RTX' in gpu_name:
return 2
memory_total = memory_info.total / 1024 / 1024
if memory_total > 3000:
return 1
return 0
#获取最接近 x 且可以被除数 divisor 整除的整数
def make_divisible(x, divisor):
# 取最大值并转换为整数类型
if isinstance(divisor, torch.Tensor):
divisor = int(divisor.max().item())
# 计算最接近 x 且可以被除数 divisor 整除的整数
return math.ceil(x / divisor) * divisor
def check_img_size(imgsz, s=32, floor=0):
# 验证图像大小在每个维度上是否都是 stride s 的倍数
if isinstance(imgsz, int):
# 整数类型,例如 img_size=640
new_size = max(make_divisible(imgsz, int(s)), floor)
elif isinstance(imgsz, (list, tuple)) and len(imgsz) == 2:
# 列表或元组类型,例如 img_size=[640, 480]
new_size = [max(make_divisible(x, int(s)), floor) for x in imgsz]
else:
raise TypeError("imgsz 应该是一个整数或包含两个元素的列表或元组。")
if isinstance(new_size, int):
# 如果 new_size 是整数类型,则构造一个只有一个元素的列表
new_size = [new_size]
if new_size != imgsz:
LOGGER.warning(f'警告⚠️ -- 图像大小 {imgsz} 必须是 {s} 的倍数,已更新为 {new_size}')
return new_size
#将边界框 (xyxy 格式) 限制在图像大小内
def clip_boxes(boxes, shape):
if isinstance(boxes, torch.Tensor):
# 判断输入类型是否为 torch.Tensor以提高处理速度
# 使用 torch.split 方法将 tensor 分割成 x_min、y_min、x_max、y_max 四个部分
x_min, y_min, x_max, y_max = torch.split(boxes, 1, dim=1)
# 使用 clamp_ 方法将 x_min、x_max、y_min、y_max 限制在给定形状范围内
x_min, x_max = x_min.clip(0, shape[1]), x_max.clip(0, shape[1])
y_min, y_max = y_min.clip(0, shape[0]), y_max.clip(0, shape[0])
# 使用 torch.cat 方法将四个部分拼接成新的 tensor
boxes = torch.cat([x_min, y_min, x_max, y_max], dim=1)
else:
# 对于 np.ndarray 类型,可以直接使用 numpy 的 vectorizing 方法进行限制范围
# 使用 clip 函数将 x_min、x_max、y_min、y_max 限制在给定形状范围内
boxes[:, [0, 2]] = np.clip(boxes[:, [0, 2]], a_min=0, a_max=shape[1]) # x1, x2
boxes[:, [1, 3]] = np.clip(boxes[:, [1, 3]], a_min=0, a_max=shape[0]) # y1, y2
return boxes
#将边界框 (xyxy 格式) 从 img1_shape 缩放到 img0_shape
def scale_boxes(img1_shape, boxes, img0_shape, ratio_pad=None):
# 检查输入参数的正确性
if not isinstance(img1_shape, tuple) or len(img1_shape) != 2:
raise TypeError("img1_shape 应该是包含两个元素的元组,分别表示图像的高度和宽度。")
if not isinstance(img0_shape, tuple) or len(img0_shape) != 2:
raise TypeError("img0_shape 应该是包含两个元素的元组,分别表示图像的高度和宽度。")
if not isinstance(boxes, np.ndarray) or boxes.ndim != 2 or boxes.shape[1] != 4:
raise ValueError("boxes 应该是一个二维 numpy 数组,其形状为 [N, 4],其中 N 表示边界框数量。")
if ratio_pad is not None:
if not isinstance(ratio_pad, tuple) or len(ratio_pad) != 2:
raise ValueError("ratio_pad 应该是一个元组,包含两个元素,分别表示宽高比和填充大小。")
if not isinstance(ratio_pad[0], (int, float)):
raise TypeError("ratio_pad[0] 应该是一个整数或浮点数,用于表示缩放比例。")
if not isinstance(ratio_pad[1], tuple) or len(ratio_pad[1]) != 2:
raise ValueError("ratio_pad[1] 应该是一个包含两个元素的元组,分别表示宽度和高度填充大小。")
if not all(isinstance(i, (int, float)) for i in ratio_pad[1]):
raise TypeError("ratio_pad[1] 中的两个元素应该均为整数或浮点数,用于表示填充大小。")
# 复制边界框数组,以避免修改原始数据
boxes = boxes.copy()
# 计算宽高比和填充大小
if ratio_pad is None:
gain = min(img1_shape[0] / img0_shape[0], img1_shape[1] / img0_shape[1])
pad_w = (img1_shape[1] - img0_shape[1] * gain) / 2
pad_h = (img1_shape[0] - img0_shape[0] * gain) / 2
else:
gain = ratio_pad[0]
pad_w, pad_h = ratio_pad[1]
# 对边界框进行填充和缩放操作
boxes[:, [0, 2]] -= pad_w
boxes[:, [1, 3]] -= pad_h
boxes[:, :4] /= gain
# 对边界框的坐标进行限制范围,确保它们不会超出目标图像的大小
boxes = clip_boxes(boxes, img0_shape)
return boxes
#调整图像大小并填充边框以适应模型输入尺寸
def letterbox(image, target_size=(640, 640), color=(114, 114, 114), auto=True, scale_fill=False, scale_up=True, stride=32):
# 计算新的图像比例
height, width = image.shape[:2]
target_h, target_w = target_size
scale = min(target_h / height, target_w / width)
if not scale_up:
scale = min(scale, 1.0)
# 计算填充和缩放后的宽度和高度
new_w = round(width * scale)
new_h = round(height * scale)
dw = target_w - new_w
dh = target_h - new_h
# 如果需要,调整填充以便其尺寸是步幅的倍数
if auto:
dw = dw % stride
dh = dh % stride
# 如果需要,进行缩放和拉伸来填充目标形状
if scale_fill:
target_h = max(target_h, new_h)
target_w = max(target_w, new_w)
dw = (target_w - new_w) / 2
dh = (target_h - new_h) / 2
# 计算填充边框
top = round(dh - 0.1)
bottom = round(dh + 0.1)
left = round(dw - 0.1)
right = round(dw + 0.1)
# 进行填充并返回结果
image = cv2.resize(image, (new_w, new_h), interpolation=cv2.INTER_LINEAR)
image = cv2.copyMakeBorder(image, top, bottom, left, right, cv2.BORDER_CONSTANT, value=color)
ratio = (new_w / width, new_h / height)
padding = (dw, dh)
return image, ratio, padding
#选择推理设备
def select_device(device='', batch_size=0, newline=True):
s = f'torch-{torch.__version__} '
# 转换 device 参数为字符串,'cuda:0' -> '0'
device = str(device).strip().lower().replace('cuda:', '').replace('none', '')
# 如果请求的是 CPU 或 MPS 等非 GPU 设备
cpu = device == 'cpu'
mps = device == 'mps'
if cpu or mps:
os.environ['CUDA_VISIBLE_DEVICES'] = '-1' # 禁止使用 GPU 加速
elif device:
# 请求的是 GPU 设备
os.environ['CUDA_VISIBLE_DEVICES'] = device # 设置 CUDA_VISIBLE_DEVICES 环境变量
assert torch.cuda.is_available() and torch.cuda.device_count() >= len(device.replace(',', '')), \
f"Invalid CUDA '--device {device}' requested, use '--device cpu' or pass valid CUDA device(s)"
# 选择计算设备
if not cpu and not mps and torch.cuda.is_available(): # 优先使用 GPU
devices = device.split(',') if device else '0' # 可选设备编号列表,例如 '0, 1'
n = len(devices) # 设备数量
if n > 1 and batch_size > 0: # 确保 batch_size 是设备数量的倍数
assert batch_size % n == 0, f'batch-size {batch_size} not multiple of GPU count {n}'
space = ' ' * (len(s) + 1)
for i, d in enumerate(devices):
p = torch.cuda.get_device_properties(i)
s += f"{'' if i == 0 else space}CUDA:{d} ({p.name}, {p.total_memory / (1 << 20):.0f}MiB)\n"
arg = 'cuda:0'
elif mps and getattr(torch, 'has_mps', False) and torch.backends.mps.is_available(): # 如果可用,优先使用 MPS
s += 'MPS\n'
arg = 'mps'
else: # 否则回退到 CPU
s += 'CPU\n'
arg = 'cpu'
# 日志输出设备信息
if not newline:
s = s.rstrip()
print(s)
# 返回所选设备的 PyTorch 设备对象
return torch.device(arg)
class YOLO:
# 将参数初始化工作提取出来
def __init__(self,
path,
device,
imgsz,
conf=0.3,
iou=0.25,
classes=None,
max_det=50,
half=True,
dnn=False,
agnostic_nms=False):
self.half = half
self.device = torch.device(device)
self.conf = conf
self.iou_thres = iou
self.agnostic_nms = agnostic_nms
self.max_det = max_det
model = DetectMultiBackend(path, device=self.device, dnn=dnn)
model.eval()
self.stride, self.names, self.pt, self.jit, self.onnx = model.stride, model.names, model.pt, model.jit, model.onnx
imgsz = (imgsz, imgsz) if isinstance(imgsz, int) else imgsz
self.img_size = check_img_size(imgsz, s=self.stride) # check image size
if self.pt:
model.model.half() if half else model.model.float()
dtype = torch.float16 if half else torch.float32
model(torch.zeros(1, 3, *self.img_size).to(device).type(dtype)) # warmup
self.model = model
self.classes = classes
@torch.no_grad()
def predict(self, im, window_name='UAV'):
# Load model
model = self.model
# Half
half = self.half # half precision only supported by PyTorch on CUDA
device = self.device
# 图像预处理
img = preprocess_image(im, self.img_size, self.stride)
im = torch.from_numpy(img).to(device)
im = im.half() if half else im.float()
im /= 255
if len(im.shape) == 3:
im = im[None]
# Inference
pred = model(im)
# NMS
pred = non_max_suppression(pred, self.conf, self.iou_thres, self.classes, self.agnostic_nms,
max_det=self.max_det)
# 新建 annotator 对象并在循环内不断更新
annotator = Annotator(im.squeeze(0).copy(), line_width=2)
for i, det in enumerate(pred):
if len(det):
target_list = []
result = "fire"
det[:, :4] = scale_boxes(im.shape[2:], det[:, :4], img.shape).round()
for *xyxy, conf, cls in reversed(det):
xywh = (xyxy2xywh(torch.tensor(xyxy).view(1, 4))).view(-1).tolist() # normalized xywh
annotator.box_label(xyxy, label=f'[{YOLO.names[int(cls)]} {conf:.2f}]',
color=(34, 139, 34),
txt_color=(0, 191, 255))
target_list.append(xywh)
print('\033[0;31;40m' + f' 发现火情 ' + '\033[0m')
im0 = annotator.result()
cv2.imshow(window_name, im0)
cv2.waitKey(1)
return target_list, im0
# 将图像预处理部分提取成函数
def preprocess_image(im, img_size, stride):
src_shape = im.shape
# 修改到 1x3x416x416
img = letterbox(im, img_size, stride=stride, auto=True)[0]
# Convert
img = img.transpose((2, 0, 1))[::-1] # HWC to CHW, BGR to RGB
# 获取 416x416 大小的图片
img = np.ascontiguousarray(img)
return img
class PID:
def __init__(self, p, i, d, set_value, min_out=None, max_out=None):
"""
初始化 PID 控制器参数
:param p: 比例系数
:param i: 积分系数
:param d: 微分系数
:param set_value: 目标值
:param min_out: 输出最小值可选
:param max_out: 输出最大值可选
"""
self.kp = p
self.ki = i
self.kd = d
self.set_value = set_value
self.min_out = min_out
self.max_out = max_out
self.last_err = 0 # 上一次误差
self.err_sum = 0 # 误差总和
self.cur_time = time.monotonic() # 当前时间
# 增量式PID
def pid_increment(self, cur_value):
"""
实现增量式 PID 控制
:param cur_value: 当前值
:return: PID 输出
"""
err = self.set_value - cur_value
self.err_sum += err
diff_err = err - self.last_err
self.last_err = err
p_out = self.kp * err
i_out = self.ki * self.err_sum
d_out = self.kd * diff_err
out_pid = p_out + i_out + d_out
# 对输出进行限幅操作
if self.min_out is not None and out_pid < self.min_out:
out_pid = self.min_out
if self.max_out is not None and out_pid > self.max_out:
out_pid = self.max_out
return out_pid
# 位置式PID
def pid_position(self, cur_value):
"""
实现位置式 PID 控制
:param cur_value: 当前值
:return: PID 输出
"""
err = self.set_value - cur_value
d_err = (err - self.last_err) / (time.monotonic() - self.cur_time) # 计算微分项
self.err_sum += err
out_pid = self.kp * err + self.ki * self.err_sum + self.kd * d_err
# 对输出进行限幅操作
if self.min_out is not None and out_pid < self.min_out:
out_pid = self.min_out
if self.max_out is not None and out_pid > self.max_out:
out_pid = self.max_out
self.last_err = err
self.cur_time = time.monotonic()
return out_pid
# #设置时延
def delay_milliseconds(t):
"""
延时函数参数 t 表示延时毫秒数
"""
start = time.perf_counter()
while True:
end = time.perf_counter()
if (end - start) * 1000 >= t:
break
# 连接摄像头类
class Capture:
def __init__(self, url='http://admin:admin@192.168.8.126:8081'):
self.url = url
self.cap = None
def open(self):
if self.cap is None:
self.cap = cv2.VideoCapture(self.url)
if not self.cap.isOpened():
raise Exception(f"Cannot open video stream from {self.url}")
def close(self):
if self.cap is not None:
self.cap.release()
self.cap = None
def read(self):
if self.cap is None:
self.open()
ret, img = self.cap.read()
if not ret:
# 发生错误时尝试重连一次
self.close()
self.open()
ret, img = self.cap.read()
if not ret:
raise Exception("Failed to read video frame")
return img
def __del__(self):
self.close()
#图像色彩通道转换
def my_cvtColor(img, code):
choice = {
0: cv2.COLOR_BGRA2BGR,
1: cv2.COLOR_BGR2GRAY,
2: cv2.COLOR_BGRA2RGB,
3: cv2.COLOR_BGRA2RGBA
}
if not isinstance(img, np.ndarray):
raise TypeError("The input image is not a numpy array")
if code not in choice.keys():
raise ValueError("Invalid color conversion code")
# 先判断原图是否为 BGRA/RGBA 格式,在进行颜色转换
if img.ndim == 3 and img.shape[2] == 4:
img = cv2.cvtColor(img, choice[code])
else:
img = cv2.cvtColor(img, cv2.COLOR_BGR2BGRA)
img = cv2.cvtColor(img, choice[code])
return img
#检查数据正确性
def check_data(arr):
try:
iter(arr) # 检查是否可迭代
if len(arr) == 0: # 检查长度是否为0
return True
else:
return False
except TypeError: # 不可迭代的情况
return False
#获取高程坡度
def get_elevation_slope(lat, lng):
"""
获取经纬度对应地点的海拔高度和坡度
:param lat: 纬度
:param lng: 经度
:return: 包含海拔高度和坡度信息的字典
"""
url = 'https://portal.opentopography.org/API/globaldem?demtype=SRTMGL1&west={}&south={}&east={}&north={}&outputFormat=JSON'.format(
lng - 0.001, lat - 0.001, lng + 0.001, lat + 0.001)
response = requests.get(url)
if response.status_code == 200:
json_data = response.json()
if 'elevation' in json_data and 'slope' in json_data:
elevation = json_data['elevation']
slope = json_data['slope']
return {'elevation': elevation, 'slope': slope}
else:
print('获取高度信息失败:{}'.format(json_data))
else:
print('请求失败HTTP错误{}'.format(response.status_code))
return None
def main():
# cap = cv2.VideoCapture("http://admin:admin@192.168.8.126:8081")
# print("图像加载成功")
# 模型路径
path = 'fire.pt'
# 尺寸大小
width, height = 640, 640
ip = input("输入摄像头地址:")
cap = Capture(ip)
conf = float(input("输入置信度:"))
predict = YOLO(path, "cuda:0", imgsz=(width, height), conf=conf, classes=None)
while True:
img = cap.read()
img = np.rot90(img, 0)
img = np.array(img)
img = my_cvtColor(img,1)
target, im0 = predict.predict(img)
img_b64 = base64.b64encode(im0).decode('utf-8')
if check_data(target):
Fire_centX = target[0][0]
Fire_centY = target[0][1]
Fire_W = target[0][2]
Fire_H = target[0][3]
lat = 37.7749
lng = -122.4194
result = get_elevation_slope(lat, lng)
if result:
elevation = result['elevation']
slope = result['slope']
else:
elevation = 200
slope = 12
# print(img_b64)
data = {
"img": img_b64,
"type": "Alarming",
"fire_flag": "fire",
"cent_x": Fire_centX,
"cent_y": Fire_centY,
"length": Fire_W,
"width": Fire_H,
"elevation": elevation,
"slope": slope
}
json_data = json.dumps(data).encode('utf-8')
cs.send(json_data)
delay_milliseconds(100)
else:
continue
if __name__ == "__main__":
IP = int(input("请输入服务器地址:"))
port = input("请输入服务器端口号:")
cs = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
cs.connect((IP, port))
print("服务器连接成功")
is_admin()
check_gpu()
main()
cs.close()

Before

Width:  |  Height:  |  Size: 700 KiB

After

Width:  |  Height:  |  Size: 700 KiB

@ -17,6 +17,11 @@ Setting::Setting(QWidget *parent)
tcpsocket = new QTcpSocket(this);
tcpsocket->connectToHost("192.168.8.100", 9090);
connect(ui.finished, &QPushButton::clicked, this, &Setting::on_finished_button);
QString styleSheet = QString("background-image:url(:/background_1.png);\
background-repeat:no-repeat;background-position:center;").arg(QCoreApplication::applicationDirPath());
this->setStyleSheet(styleSheet);
this->resize(806, 453);
ui.finished->setStyleSheet("background-color: white;");
}
Setting::~Setting()

@ -1,23 +0,0 @@
#pragma once
#include <QMainWindow>
#include "ui_Setting.h"
#include <QTcpServer>
#include <QTcpSocket>
class Setting : public QMainWindow
{
Q_OBJECT
public:
Setting(QWidget *parent = nullptr);
~Setting();
QTcpServer* tcpserver;
QTcpSocket* tcpsocket;
private:
Ui::SettingClass ui;
private slots:
void on_finished_button();
};

@ -17,8 +17,8 @@
<widget class="QWidget" name="gridLayoutWidget">
<property name="geometry">
<rect>
<x>20</x>
<y>20</y>
<x>200</x>
<y>100</y>
<width>451</width>
<height>241</height>
</rect>
@ -166,8 +166,8 @@
<widget class="QPushButton" name="finished">
<property name="geometry">
<rect>
<x>180</x>
<y>290</y>
<x>360</x>
<y>370</y>
<width>93</width>
<height>29</height>
</rect>

Before

Width:  |  Height:  |  Size: 961 KiB

After

Width:  |  Height:  |  Size: 961 KiB

Before

Width:  |  Height:  |  Size: 61 KiB

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

@ -1,5 +1,6 @@
#include "UAV_UI_new.h"
#include "Setting.h"
#include "tips.h"
#include <opencv2/opencv.hpp>
#include <string.h>
#include <qlabel.h>
@ -12,8 +13,10 @@
using namespace cv;
using namespace std;
VideoCapture cap;
//const string VideoCaptureAdress = "http://admin:admin@192.168.8.126:8081";
const string VideoCaptureAdress = "rtsp://192.168.144.108:8000/375897"; //热成像
Prediction* Predict_UI;
int length, wid, start_pos_x, start_pos_y, heig,slope,elevation;
const string VideoCaptureAdress = "http://admin:admin@192.168.8.126:8081";
//const string VideoCaptureAdress = "rtsp://192.168.144.108:8000/375897"; //ÈȳÉÏñ
//const string VideoCaptureAdress = "rtsp://192.168.144.108:8000/165506"; //nomal
//const string VideoCaptureAdress = "C:\\Users\\87334\\Videos\\Captures\\Fast_sent.mp4";
UAV_UI_new::UAV_UI_new(QWidget* parent)
@ -26,7 +29,7 @@ UAV_UI_new::UAV_UI_new(QWidget* parent)
connect(ui.Settings, &QPushButton::clicked, this, &UAV_UI_new::onclick_Setting_button);
connect(ui.connection, &QPushButton::clicked, this, &UAV_UI_new::on_connection_button);
connect(ui.stop, &QPushButton::clicked, this, &UAV_UI_new::on_stop_button);
connect(ui.action, &QPushButton::clicked, this, &UAV_UI_new::on_action_button);
connect(ui.Prediction, &QPushButton::clicked, this, &UAV_UI_new::on_predict_button);
connect(timer, SIGNAL(timeout()), this, SLOT(importImage()));
tcpsocket = new QTcpSocket(this);
tcpsocket->connectToHost("192.168.8.100", 9090);
@ -42,14 +45,29 @@ UAV_UI_new::UAV_UI_new(QWidget* parent)
QByteArray jsonData = tcpsocket->readAll(); // ½ÓÊÕ JSON Êý¾Ý
QJsonDocument jsonDocument = QJsonDocument::fromJson(jsonData);
QJsonObject jsonObject = jsonDocument.object();
QString type = jsonObject.value("type").toString();
QString type = jsonObject.value("type").toString();
if (type == "Alarming") {
QMessageBox msgBox;
msgBox.setWindowTitle("Alarming");
msgBox.setText("Fire and Fire");
msgBox.show();
QPixmap image_Pre(":/Fire.png");
tips* tip = new tips(image_Pre);
tip->show();
ui.Prediction->setStyleSheet("color:red");
length = jsonObject.value("length").toDouble();
wid = jsonObject.value("width").toDouble();
qDebug() << jsonObject.value("center_x").toDouble() << jsonObject.value("length").toDouble() / 2;
start_pos_x = jsonObject.value("center_x").toDouble() - jsonObject.value("length").toDouble() / 2;
start_pos_y = jsonObject.value("center_y").toDouble() - jsonObject.value("width").toDouble() / 2;
qDebug() << start_pos_x << " " << start_pos_y << "mAIN";
slope = jsonObject.value("slope").toDouble();
elevation = jsonObject.value("slope").toDouble();
}
if (type == "Set") {
heig = jsonObject.value("z").toInt();
}
});
QString styleSheet = QString("background-image:url(:/background_3.png);\
background-repeat:no-repeat;background-position:center;").arg(QCoreApplication::applicationDirPath());
this->setStyleSheet(styleSheet);
this->resize(1440, 720);
}
UAV_UI_new::~UAV_UI_new()
@ -72,12 +90,15 @@ void UAV_UI_new::importImage() {
image.step,
QImage::Format_RGB888));
ui.display->setPixmap(showimage);
image_Pre = showimage;
}
void UAV_UI_new::on_stop_button() {
timer->stop();
cap.release();
ui.display->clear();
}
void UAV_UI_new::on_action_button() {
//放警报
void UAV_UI_new::on_predict_button() {
QPixmap image_Pre(":/Fire.png");
Predict_UI = new Prediction(image_Pre, start_pos_x,start_pos_y,length,wid,100);
Predict_UI->show();
}

@ -3,6 +3,7 @@
#include <QtWidgets/QMainWindow>
#include "ui_UAV_UI_new.h"
#include "Setting.h"
#include "Prediction.h"
#include <QTimer>
#include <qpushbutton.h>
#include <QPushbutton>
@ -25,11 +26,12 @@ private:
QTcpServer* tcpserver;
QTcpSocket* tcpsocket;
Setting Settings_UI;
QPixmap image_Pre;
private slots:
void on_connection_button();
void on_stop_button();
void importImage();
void onclick_Setting_button();
void on_action_button();
void on_predict_button();
};

@ -1,4 +1,9 @@
<RCC>
<qresource prefix="UAV_UI_new">
<qresource prefix="/">
<file>background_1.png</file>
<file>background_2.png</file>
<file>background_3.png</file>
<file>Fire.png</file>
<file>kill_fire.jpg</file>
</qresource>
</RCC>

Binary file not shown.

@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.5.33516.290
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "UAV_UI_new", "UAV_UI_new\UAV_UI_new.vcxproj", "{FB496CF3-A3CE-4A50-BAC4-A9F43A71A5F9}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{FB496CF3-A3CE-4A50-BAC4-A9F43A71A5F9}.Debug|x64.ActiveCfg = Debug|x64
{FB496CF3-A3CE-4A50-BAC4-A9F43A71A5F9}.Debug|x64.Build.0 = Debug|x64
{FB496CF3-A3CE-4A50-BAC4-A9F43A71A5F9}.Release|x64.ActiveCfg = Release|x64
{FB496CF3-A3CE-4A50-BAC4-A9F43A71A5F9}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {F3108D61-4572-47E9-AA99-3FC60AB655EB}
EndGlobalSection
EndGlobal

@ -6,10 +6,22 @@
<rect>
<x>0</x>
<y>0</y>
<width>1159</width>
<height>682</height>
<width>1440</width>
<height>1000</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>1440</width>
<height>1200</height>
</size>
</property>
<property name="windowTitle">
<string>UAV_UI_new</string>
</property>
@ -64,7 +76,7 @@
</rect>
</property>
<property name="text">
<string>stop</string>
<string>关闭图像</string>
</property>
</widget>
<widget class="QPushButton" name="connection">
@ -77,7 +89,7 @@
</rect>
</property>
<property name="text">
<string>connection</string>
<string>连接图像</string>
</property>
</widget>
<widget class="QLabel" name="play_tag">
@ -90,20 +102,20 @@
</rect>
</property>
<property name="text">
<string>图像播放处</string>
<string>实时图像</string>
</property>
</widget>
<widget class="QPushButton" name="Settings">
<property name="geometry">
<rect>
<x>1060</x>
<x>1350</x>
<y>0</y>
<width>93</width>
<height>29</height>
</rect>
</property>
<property name="text">
<string>Settings</string>
<string>设置</string>
</property>
</widget>
<widget class="QPushButton" name="action">
@ -119,13 +131,26 @@
<string>出警</string>
</property>
</widget>
<widget class="QPushButton" name="Prediction">
<property name="geometry">
<rect>
<x>820</x>
<y>260</y>
<width>93</width>
<height>29</height>
</rect>
</property>
<property name="text">
<string>预测</string>
</property>
</widget>
</widget>
<widget class="QMenuBar" name="menuBar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1159</width>
<width>1440</width>
<height>26</height>
</rect>
</property>

@ -92,10 +92,12 @@
</ItemDefinitionGroup>
<ItemGroup>
<QtRcc Include="UAV_UI_new.qrc" />
<QtUic Include="Prediction.ui" />
<QtUic Include="Setting.ui" />
<QtUic Include="tips.ui" />
<QtUic Include="UAV_UI_new.ui" />
<QtMoc Include="UAV_UI_new.h" />
<ClCompile Include="Prediction.cpp" />
<ClCompile Include="Setting.cpp" />
<ClCompile Include="tips.cpp" />
<ClCompile Include="UAV_UI_new.cpp" />
@ -105,12 +107,20 @@
<QtMoc Include="tips.h" />
</ItemGroup>
<ItemGroup>
<QtMoc Include="Prediction.h" />
<ClInclude Include="FP.h" />
<ClInclude Include="levelToSpeed.h" />
<ClInclude Include="resource1.h" />
<QtMoc Include="Setting.h" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="UAV_UI_new1.rc" />
</ItemGroup>
<ItemGroup>
<Image Include="background.jpg" />
<Image Include="Settings.jpg" />
<Image Include="Settings_2.jpg" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Condition="Exists('$(QtMsBuild)\qt.targets')">
<Import Project="$(QtMsBuild)\qt.targets" />

@ -46,6 +46,9 @@
<ClCompile Include="Setting.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Prediction.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<QtMoc Include="tips.h">
@ -54,6 +57,9 @@
<QtMoc Include="Setting.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="Prediction.h">
<Filter>Header Files</Filter>
</QtMoc>
</ItemGroup>
<ItemGroup>
<QtUic Include="tips.ui">
@ -62,15 +68,35 @@
<QtUic Include="Setting.ui">
<Filter>Form Files</Filter>
</QtUic>
<QtUic Include="Prediction.ui">
<Filter>Form Files</Filter>
</QtUic>
</ItemGroup>
<ItemGroup>
<ClInclude Include="resource1.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="levelToSpeed.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="FP.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="UAV_UI_new1.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
<ItemGroup>
<Image Include="background.jpg">
<Filter>Resource Files</Filter>
</Image>
<Image Include="Settings.jpg">
<Filter>Resource Files</Filter>
</Image>
<Image Include="Settings_2.jpg">
<Filter>Resource Files</Filter>
</Image>
</ItemGroup>
</Project>

@ -2,9 +2,9 @@
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup />
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<QtLastBackgroundBuild>2023-05-21T16:36:10.6302989Z</QtLastBackgroundBuild>
<QtLastBackgroundBuild>2023-06-14T08:40:27.1306328Z</QtLastBackgroundBuild>
</PropertyGroup>
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<QtLastBackgroundBuild>2023-05-21T16:36:10.6837787Z</QtLastBackgroundBuild>
<QtLastBackgroundBuild>2023-06-14T08:40:27.2066207Z</QtLastBackgroundBuild>
</PropertyGroup>
</Project>

@ -1,56 +0,0 @@
#include "Setting.h"
#include <QTcpServer>
#include <QTcpSocket>
#include <QMessageBox>
#include <QJsonObject>
#include <QJsonDocument>
Setting::Setting(QWidget *parent)
: QMainWindow(parent)
{
ui.setupUi(this);
/*float longitude = ui.longitude->text().toFloat();
float latitude = ui.latitude->text().toFloat();
int hours = ui.hours->text().toInt();
int minutes = ui.minutes->text().toInt();
int seconds = ui.seconds->text().toInt();*/
tcpsocket = new QTcpSocket(this);
tcpsocket->connectToHost("192.168.8.100", 9090);
connect(ui.finished, &QPushButton::clicked, this, &Setting::on_finished_button);
QString styleSheet = QString("background-image:url(:/background_1.png);\
background-repeat:no-repeat;background-position:center;").arg(QCoreApplication::applicationDirPath());
this->setStyleSheet(styleSheet);
this->resize(806, 453);
ui.finished->setStyleSheet("background-color: white;");
}
Setting::~Setting()
{
}
void Setting::on_finished_button() {
float longitude = ui.longitude->text().toFloat();
float latitude = ui.latitude->text().toFloat();
int hours = ui.hours->text().toInt();
int minutes = ui.minutes->text().toInt();
int seconds = ui.seconds->text().toInt();
int x = ui.x->text().toInt();
int y = ui.y->text().toInt();
int z = ui.z->text().toInt();
QJsonObject msg;
msg.insert("type", "Set");
msg.insert("lon", longitude);
msg.insert("lat", latitude);
msg.insert("hours", hours);
msg.insert("minutes", minutes);
msg.insert("seconds", seconds);
msg.insert("x", x);
msg.insert("y", y);
msg.insert("z", z);
QJsonDocument jsonDocument;
jsonDocument.setObject(msg);
QByteArray dataArray = jsonDocument.toJson();
if (tcpsocket->write(dataArray) == -1) {
qDebug() << "send TCP data package failed!";
}
qDebug() << "sent!";
}

@ -1,23 +0,0 @@
#pragma once
#include <QMainWindow>
#include "ui_Setting.h"
#include <QTcpServer>
#include <QTcpSocket>
class Setting : public QMainWindow
{
Q_OBJECT
public:
Setting(QWidget *parent = nullptr);
~Setting();
QTcpServer* tcpserver;
QTcpSocket* tcpsocket;
private:
Ui::SettingClass ui;
private slots:
void on_finished_button();
};

@ -1,203 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>SettingClass</class>
<widget class="QMainWindow" name="SettingClass">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>871</width>
<height>571</height>
</rect>
</property>
<property name="windowTitle">
<string>Setting</string>
</property>
<widget class="QWidget" name="centralWidget">
<widget class="QWidget" name="gridLayoutWidget">
<property name="geometry">
<rect>
<x>200</x>
<y>100</y>
<width>451</width>
<height>241</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="2" column="0">
<widget class="QLabel" name="Start_Timer">
<property name="text">
<string>出发时间:</string>
</property>
</widget>
</item>
<item row="2" column="3">
<widget class="QLineEdit" name="seconds">
<property name="maximumSize">
<size>
<width>150</width>
<height>16777215</height>
</size>
</property>
<property name="placeholderText">
<string>秒</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="hours">
<property name="maximumSize">
<size>
<width>150</width>
<height>16777215</height>
</size>
</property>
<property name="placeholderText">
<string>时</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="longitude">
<property name="maximumSize">
<size>
<width>150</width>
<height>16777215</height>
</size>
</property>
<property name="placeholderText">
<string>经度</string>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QLineEdit" name="minutes">
<property name="maximumSize">
<size>
<width>150</width>
<height>16777215</height>
</size>
</property>
<property name="placeholderText">
<string>分</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QLineEdit" name="latitude">
<property name="maximumSize">
<size>
<width>150</width>
<height>16777215</height>
</size>
</property>
<property name="placeholderText">
<string>纬度</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="Speed_Lable">
<property name="maximumSize">
<size>
<width>80</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>目的地</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>20</height>
</size>
</property>
<property name="text">
<string>x,y,z</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="x">
<property name="maximumSize">
<size>
<width>150</width>
<height>16777215</height>
</size>
</property>
<property name="placeholderText">
<string>0</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QLineEdit" name="y">
<property name="maximumSize">
<size>
<width>150</width>
<height>16777215</height>
</size>
</property>
<property name="placeholderText">
<string>0</string>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QLineEdit" name="z">
<property name="maximumSize">
<size>
<width>150</width>
<height>16777215</height>
</size>
</property>
<property name="placeholderText">
<string>0</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QPushButton" name="finished">
<property name="geometry">
<rect>
<x>360</x>
<y>370</y>
<width>93</width>
<height>29</height>
</rect>
</property>
<property name="text">
<string>完成</string>
</property>
</widget>
</widget>
<widget class="QMenuBar" name="menuBar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>871</width>
<height>26</height>
</rect>
</property>
</widget>
<widget class="QToolBar" name="mainToolBar">
<attribute name="toolBarArea">
<enum>TopToolBarArea</enum>
</attribute>
<attribute name="toolBarBreak">
<bool>false</bool>
</attribute>
</widget>
<widget class="QStatusBar" name="statusBar"/>
</widget>
<layoutdefault spacing="6" margin="11"/>
<resources/>
<connections/>
</ui>

@ -1,6 +1,4 @@
#include "UAV_UI_new.h"
#include "Setting.h"
#include "tips.h"
#include <opencv2/opencv.hpp>
#include <string.h>
#include <qlabel.h>
@ -8,17 +6,11 @@
#include <QTcpServer>
#include <QTcpSocket>
#include <QMessageBox>
#include <QJsonObject>
#include <QJsonDocument>
using namespace cv;
using namespace std;
VideoCapture cap;
Prediction* Predict_UI;
int length, wid, start_pos_x, start_pos_y, heig,slope,elevation;
const string VideoCaptureAdress = "http://admin:admin@192.168.8.126:8081";
//const string VideoCaptureAdress = "rtsp://192.168.144.108:8000/375897"; //ÈȳÉÏñ
//const string VideoCaptureAdress = "rtsp://192.168.144.108:8000/165506"; //nomal
//const string VideoCaptureAdress = "C:\\Users\\87334\\Videos\\Captures\\Fast_sent.mp4";
//const string VideoCaptureAdress = "http://admin:admin@192.168.8.126:8081";
const string VideoCaptureAdress = "C:\\Users\\87334\\Videos\\Captures\\Fast_sent.mp4";
UAV_UI_new::UAV_UI_new(QWidget* parent)
: QMainWindow(parent)
{
@ -26,10 +18,8 @@ UAV_UI_new::UAV_UI_new(QWidget* parent)
timer = new QTimer(this);
ui.display->setStyleSheet("border:1px solid black ");
ui.play_tag->setStyleSheet("background-color:white");
connect(ui.Settings, &QPushButton::clicked, this, &UAV_UI_new::onclick_Setting_button);
connect(ui.connection, &QPushButton::clicked, this, &UAV_UI_new::on_connection_button);
connect(ui.stop, &QPushButton::clicked, this, &UAV_UI_new::on_stop_button);
connect(ui.Prediction, &QPushButton::clicked, this, &UAV_UI_new::on_predict_button);
connect(timer, SIGNAL(timeout()), this, SLOT(importImage()));
tcpsocket = new QTcpSocket(this);
tcpsocket->connectToHost("192.168.8.100", 9090);
@ -42,43 +32,17 @@ UAV_UI_new::UAV_UI_new(QWidget* parent)
tip->show();
});
connect(tcpsocket, &QTcpSocket::readyRead, [=]() {
QByteArray jsonData = tcpsocket->readAll(); // ½ÓÊÕ JSON Êý¾Ý
QJsonDocument jsonDocument = QJsonDocument::fromJson(jsonData);
QJsonObject jsonObject = jsonDocument.object();
QString type = jsonObject.value("type").toString();
if (type == "Alarming") {
QPixmap image_Pre(":/Fire.png");
tips* tip = new tips(image_Pre);
tip->show();
ui.Prediction->setStyleSheet("color:red");
length = jsonObject.value("length").toDouble();
wid = jsonObject.value("width").toDouble();
qDebug() << jsonObject.value("center_x").toDouble() << jsonObject.value("length").toDouble() / 2;
start_pos_x = jsonObject.value("center_x").toDouble() - jsonObject.value("length").toDouble() / 2;
start_pos_y = jsonObject.value("center_y").toDouble() - jsonObject.value("width").toDouble() / 2;
qDebug() << start_pos_x << " " << start_pos_y << "mAIN";
slope = jsonObject.value("slope").toDouble();
elevation = jsonObject.value("slope").toDouble();
}
if (type == "Set") {
heig = jsonObject.value("z").toInt();
}
QString message = tcpsocket->readAll();
ui.message->setText(message);
});
QString styleSheet = QString("background-image:url(:/background_3.png);\
background-repeat:no-repeat;background-position:center;").arg(QCoreApplication::applicationDirPath());
this->setStyleSheet(styleSheet);
this->resize(1440, 720);
}
UAV_UI_new::~UAV_UI_new()
{}
void UAV_UI_new::on_connection_button() {
cap.open(VideoCaptureAdress);
timer->start(100);
timer->start(10);
};
void UAV_UI_new::onclick_Setting_button() {
Settings_UI.show();
}
void UAV_UI_new::importImage() {
Mat image;
cap >> image;
@ -90,15 +54,9 @@ void UAV_UI_new::importImage() {
image.step,
QImage::Format_RGB888));
ui.display->setPixmap(showimage);
image_Pre = showimage;
}
void UAV_UI_new::on_stop_button() {
timer->stop();
cap.release();
ui.display->clear();
}
void UAV_UI_new::on_predict_button() {
QPixmap image_Pre(":/Fire.png");
Predict_UI = new Prediction(image_Pre, start_pos_x,start_pos_y,length,wid,100);
Predict_UI->show();
}

@ -2,8 +2,6 @@
#include <QtWidgets/QMainWindow>
#include "ui_UAV_UI_new.h"
#include "Setting.h"
#include "Prediction.h"
#include <QTimer>
#include <qpushbutton.h>
#include <QPushbutton>
@ -25,13 +23,8 @@ private:
double rate;
QTcpServer* tcpserver;
QTcpSocket* tcpsocket;
Setting Settings_UI;
QPixmap image_Pre;
private slots:
void on_connection_button();
void on_stop_button();
void importImage();
void onclick_Setting_button();
void on_predict_button();
};

@ -1,9 +1,4 @@
<RCC>
<qresource prefix="/">
<file>background_1.png</file>
<file>background_2.png</file>
<file>background_3.png</file>
<file>Fire.png</file>
<file>kill_fire.jpg</file>
<qresource prefix="UAV_UI_new">
</qresource>
</RCC>

@ -6,22 +6,10 @@
<rect>
<x>0</x>
<y>0</y>
<width>1440</width>
<height>1000</height>
<width>1159</width>
<height>682</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>1440</width>
<height>1200</height>
</size>
</property>
<property name="windowTitle">
<string>UAV_UI_new</string>
</property>
@ -76,7 +64,7 @@
</rect>
</property>
<property name="text">
<string>关闭图像</string>
<string>stop</string>
</property>
</widget>
<widget class="QPushButton" name="connection">
@ -89,7 +77,7 @@
</rect>
</property>
<property name="text">
<string>连接图像</string>
<string>connection</string>
</property>
</widget>
<widget class="QLabel" name="play_tag">
@ -102,46 +90,20 @@
</rect>
</property>
<property name="text">
<string>实时图像</string>
</property>
</widget>
<widget class="QPushButton" name="Settings">
<property name="geometry">
<rect>
<x>1350</x>
<y>0</y>
<width>93</width>
<height>29</height>
</rect>
</property>
<property name="text">
<string>设置</string>
</property>
</widget>
<widget class="QPushButton" name="action">
<property name="geometry">
<rect>
<x>820</x>
<y>200</y>
<width>93</width>
<height>29</height>
</rect>
</property>
<property name="text">
<string>出警</string>
<string>图像播放处</string>
</property>
</widget>
<widget class="QPushButton" name="Prediction">
<widget class="QLabel" name="message">
<property name="geometry">
<rect>
<x>820</x>
<y>260</y>
<width>93</width>
<height>29</height>
<x>830</x>
<y>250</y>
<width>201</width>
<height>151</height>
</rect>
</property>
<property name="text">
<string>预测</string>
<string>TextLabel</string>
</property>
</widget>
</widget>
@ -150,7 +112,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>1440</width>
<width>1159</width>
<height>26</height>
</rect>
</property>

@ -92,13 +92,9 @@
</ItemDefinitionGroup>
<ItemGroup>
<QtRcc Include="UAV_UI_new.qrc" />
<QtUic Include="Prediction.ui" />
<QtUic Include="Setting.ui" />
<QtUic Include="tips.ui" />
<QtUic Include="UAV_UI_new.ui" />
<QtMoc Include="UAV_UI_new.h" />
<ClCompile Include="Prediction.cpp" />
<ClCompile Include="Setting.cpp" />
<ClCompile Include="tips.cpp" />
<ClCompile Include="UAV_UI_new.cpp" />
<ClCompile Include="main.cpp" />
@ -106,21 +102,6 @@
<ItemGroup>
<QtMoc Include="tips.h" />
</ItemGroup>
<ItemGroup>
<QtMoc Include="Prediction.h" />
<ClInclude Include="FP.h" />
<ClInclude Include="levelToSpeed.h" />
<ClInclude Include="resource1.h" />
<QtMoc Include="Setting.h" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="UAV_UI_new1.rc" />
</ItemGroup>
<ItemGroup>
<Image Include="background.jpg" />
<Image Include="Settings.jpg" />
<Image Include="Settings_2.jpg" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Condition="Exists('$(QtMsBuild)\qt.targets')">
<Import Project="$(QtMsBuild)\qt.targets" />

@ -43,60 +43,15 @@
<ClCompile Include="tips.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Setting.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Prediction.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<QtMoc Include="tips.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="Setting.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="Prediction.h">
<Filter>Header Files</Filter>
</QtMoc>
</ItemGroup>
<ItemGroup>
<QtUic Include="tips.ui">
<Filter>Form Files</Filter>
</QtUic>
<QtUic Include="Setting.ui">
<Filter>Form Files</Filter>
</QtUic>
<QtUic Include="Prediction.ui">
<Filter>Form Files</Filter>
</QtUic>
</ItemGroup>
<ItemGroup>
<ClInclude Include="resource1.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="levelToSpeed.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="FP.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="UAV_UI_new1.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
<ItemGroup>
<Image Include="background.jpg">
<Filter>Resource Files</Filter>
</Image>
<Image Include="Settings.jpg">
<Filter>Resource Files</Filter>
</Image>
<Image Include="Settings_2.jpg">
<Filter>Resource Files</Filter>
</Image>
</ItemGroup>
</Project>

@ -2,9 +2,9 @@
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup />
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<QtLastBackgroundBuild>2023-06-14T08:40:27.1306328Z</QtLastBackgroundBuild>
<QtLastBackgroundBuild>2023-04-13T07:12:41.7498212Z</QtLastBackgroundBuild>
</PropertyGroup>
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<QtLastBackgroundBuild>2023-06-14T08:40:27.2066207Z</QtLastBackgroundBuild>
<QtLastBackgroundBuild>2023-04-13T07:12:41.8188628Z</QtLastBackgroundBuild>
</PropertyGroup>
</Project>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 134 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 232 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 661 KiB

@ -1,9 +1,5 @@
#include "UAV_UI_new.h"
#include <QtWidgets/QApplication>
#include <opencv2/opencv.hpp>
#include <string.h>
using namespace std;
using namespace cv;
int main(int argc, char *argv[])
{

@ -1,14 +0,0 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by UAV_UI_new.rc
// 新对象的下一组默认值
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 101
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1001
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

@ -1,14 +0,0 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by UAV_UI_new1.rc
// 新对象的下一组默认值
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 101
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1001
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

@ -1,20 +1,10 @@
#include "tips.h"
tips::tips(QPixmap image,QWidget *parent)
tips::tips(QWidget *parent)
: QMainWindow(parent)
{
ui.setupUi(this);
ui.display->setPixmap(image);
connect(ui.action, &QPushButton::clicked, this, &tips::on_action_button);
ui.action->setStyleSheet("background-color:red;");
QString styleSheet = QString("background-image:url(:/kill_fire.jpg);\
background-repeat:no-repeat;background-position:center;").arg(QCoreApplication::applicationDirPath());
this->setStyleSheet(styleSheet);
}
tips::~tips()
{
}
void tips::on_action_button() {
//·Å¾¯±¨
}
{}

@ -8,10 +8,9 @@ class tips : public QMainWindow
Q_OBJECT
public:
tips(QPixmap image, QWidget *parent = nullptr);
tips(QWidget *parent = nullptr);
~tips();
private:
Ui::tipsClass ui;
void on_action_button();
};

@ -1,107 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<UI version="4.0" >
<class>tipsClass</class>
<widget class="QMainWindow" name="tipsClass">
<property name="geometry">
<widget class="QMainWindow" name="tipsClass" >
<property name="objectName" >
<string notr="true">tipsClass</string>
</property>
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>1130</width>
<height>644</height>
<x>0</x>
<y>0</y>
<width>600</width>
<height>400</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>1130</width>
<height>644</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>1130</width>
<height>644</height>
</size>
</property>
<property name="windowTitle">
<property name="windowTitle" >
<string>tips</string>
</property>
<widget class="QWidget" name="centralWidget">
<widget class="QLabel" name="Pre_tag">
<property name="geometry">
<rect>
<x>19</x>
<y>6</y>
<width>81</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>火势状况</string>
</property>
</widget>
<widget class="QLabel" name="display">
<property name="enabled">
<bool>true</bool>
</property>
<property name="geometry">
<rect>
<x>20</x>
<y>30</y>
<width>640</width>
<height>480</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>640</width>
<height>480</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>640</width>
<height>480</height>
</size>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QPushButton" name="action">
<property name="geometry">
<rect>
<x>830</x>
<y>40</y>
<width>93</width>
<height>29</height>
</rect>
</property>
<property name="text">
<string>出警</string>
</property>
</widget>
</widget>
<widget class="QMenuBar" name="menuBar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1130</width>
<height>26</height>
</rect>
</property>
</widget>
<widget class="QToolBar" name="mainToolBar">
<attribute name="toolBarArea">
<enum>TopToolBarArea</enum>
</attribute>
<attribute name="toolBarBreak">
<bool>false</bool>
</attribute>
</widget>
<widget class="QStatusBar" name="statusBar"/>
</property> <widget class="QMenuBar" name="menuBar" /> <widget class="QToolBar" name="mainToolBar" /> <widget class="QWidget" name="centralWidget" /> <widget class="QStatusBar" name="statusBar" />
</widget>
<layoutdefault spacing="6" margin="11"/>
<resources/>
<layoutDefault spacing="6" margin="11" />
<pixmapfunction></pixmapfunction>
<connections/>
</ui>
</UI>

@ -1,25 +1,8 @@
 uic tips.ui
rcc UAV_UI_new.qrc
UAV_UI_new.cpp
tips.cpp
D:\software\UAV_UI\UAV_UI_new\UAV_UI_new\UAV_UI_new.cpp(1,1): warning C4828: 文件包含在偏移 0x249 处开始的字符,该字符在当前源字符集中无效(代码页 65001)。
D:\software\UAV_UI\UAV_UI_new\UAV_UI_new\tips.cpp(1,1): warning C4828: 文件包含在偏移 0x229 处开始的字符,该字符在当前源字符集中无效(代码页 65001)。
D:\software\UAV_UI\UAV_UI_new\UAV_UI_new\UAV_UI_new.cpp(1,1): warning C4828: 文件包含在偏移 0x24b 处开始的字符,该字符在当前源字符集中无效(代码页 65001)。
D:\software\UAV_UI\UAV_UI_new\UAV_UI_new\UAV_UI_new.cpp(1,1): warning C4828: 文件包含在偏移 0x24c 处开始的字符,该字符在当前源字符集中无效(代码页 65001)。
D:\software\UAV_UI\UAV_UI_new\UAV_UI_new\tips.cpp(1,1): warning C4828: 文件包含在偏移 0x22c 处开始的字符,该字符在当前源字符集中无效(代码页 65001)。
D:\software\UAV_UI\UAV_UI_new\UAV_UI_new\UAV_UI_new.cpp(1,1): warning C4828: 文件包含在偏移 0x24e 处开始的字符,该字符在当前源字符集中无效(代码页 65001)。
D:\software\UAV_UI\UAV_UI_new\UAV_UI_new\UAV_UI_new.cpp(1,1): warning C4828: 文件包含在偏移 0x6a3 处开始的字符,该字符在当前源字符集中无效(代码页 65001)。
D:\software\UAV_UI\UAV_UI_new\UAV_UI_new\tips.cpp(1,1): warning C4828: 文件包含在偏移 0x22d 处开始的字符,该字符在当前源字符集中无效(代码页 65001)。
D:\software\UAV_UI\UAV_UI_new\UAV_UI_new\UAV_UI_new.cpp(1,1): warning C4828: 文件包含在偏移 0x6a4 处开始的字符,该字符在当前源字符集中无效(代码页 65001)。
D:\software\UAV_UI\UAV_UI_new\UAV_UI_new\tips.cpp(1,1): warning C4828: 文件包含在偏移 0x22e 处开始的字符,该字符在当前源字符集中无效(代码页 65001)。
D:\software\UAV_UI\UAV_UI_new\UAV_UI_new\UAV_UI_new.cpp(1,1): warning C4828: 文件包含在偏移 0x6a5 处开始的字符,该字符在当前源字符集中无效(代码页 65001)。
D:\software\UAV_UI\UAV_UI_new\UAV_UI_new\UAV_UI_new.cpp(1,1): warning C4828: 文件包含在偏移 0x6aa 处开始的字符,该字符在当前源字符集中无效(代码页 65001)。
D:\software\UAV_UI\UAV_UI_new\UAV_UI_new\UAV_UI_new.cpp(1,1): warning C4828: 文件包含在偏移 0x7b1 处开始的字符,该字符在当前源字符集中无效(代码页 65001)。
D:\software\UAV_UI\UAV_UI_new\UAV_UI_new\UAV_UI_new.cpp(1,1): warning C4828: 文件包含在偏移 0x7b2 处开始的字符,该字符在当前源字符集中无效(代码页 65001)。
D:\software\UAV_UI\UAV_UI_new\UAV_UI_new\UAV_UI_new.cpp(1,1): warning C4828: 文件包含在偏移 0x7b4 处开始的字符,该字符在当前源字符集中无效(代码页 65001)。
D:\software\UAV_UI\UAV_UI_new\UAV_UI_new\UAV_UI_new.cpp(1,1): warning C4828: 文件包含在偏移 0x7bb 处开始的字符,该字符在当前源字符集中无效(代码页 65001)。
D:\software\UAV_UI\UAV_UI_new\UAV_UI_new\UAV_UI_new.cpp(1,1): warning C4828: 文件包含在偏移 0x7bd 处开始的字符,该字符在当前源字符集中无效(代码页 65001)。
D:\software\UAV_UI\UAV_UI_new\UAV_UI_new\UAV_UI_new.cpp(1,1): warning C4828: 文件包含在偏移 0x7be 处开始的字符,该字符在当前源字符集中无效(代码页 65001)。
moc_tips.cpp
qrc_UAV_UI_new.cpp
 UAV_UI_new.cpp
main.cpp
D:\software\UAV_UI\UAV_UI_new\UAV_UI_new\UAV_UI_new.cpp(1,1): warning C4828: 文件包含在偏移 0x48f 处开始的字符,该字符在当前源字符集中无效(代码页 65001)。
D:\software\UAV_UI\UAV_UI_new\UAV_UI_new\UAV_UI_new.cpp(1,1): warning C4828: 文件包含在偏移 0x490 处开始的字符,该字符在当前源字符集中无效(代码页 65001)。
D:\software\UAV_UI\UAV_UI_new\UAV_UI_new\UAV_UI_new.cpp(1,1): warning C4828: 文件包含在偏移 0x491 处开始的字符,该字符在当前源字符集中无效(代码页 65001)。
D:\software\UAV_UI\UAV_UI_new\UAV_UI_new\UAV_UI_new.cpp(1,1): warning C4828: 文件包含在偏移 0x496 处开始的字符,该字符在当前源字符集中无效(代码页 65001)。
moc_UAV_UI_new.cpp
UAV_UI_new.vcxproj -> D:\software\UAV_UI\UAV_UI_new\x64\Debug\UAV_UI_new.exe

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save