上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 96 下一页
摘要: python opencv putText import cv2 # Load image img = cv2.imread("image.jpg") # Define text to draw text = "Hello, World!" # Define position to draw tex 阅读全文
posted @ 2023-04-11 19:32 西北逍遥 阅读(217) 评论(0) 推荐(0)
摘要: python播放视频 pip install pygame import pygame pygame.init() # Set the dimensions of the window screen = pygame.display.set_mode((640, 480)) # Load the v 阅读全文
posted @ 2023-04-10 09:37 西北逍遥 阅读(75) 评论(0) 推荐(0)
摘要: python time测试 import time def timer(seconds): start_time = time.time() while True: elapsed_time = time.time() - start_time if elapsed_time >= seconds: 阅读全文
posted @ 2023-04-09 19:11 西北逍遥 阅读(33) 评论(0) 推荐(0)
摘要: python opencv inRange import cv2 import numpy as np # Load the image img = cv2.imread('20220320151016_144_c.jpg') hsv = cv2.cvtColor(img,cv2.COLOR_BGR 阅读全文
posted @ 2023-04-08 00:36 西北逍遥 阅读(90) 评论(0) 推荐(0)
摘要: python opencv line import cv2 # Load an image img = cv2.imread("image1.jpg") # Draw a red line from (0, 0) to (100, 100) with a thickness of 5 pixels 阅读全文
posted @ 2023-04-07 21:03 西北逍遥 阅读(13) 评论(0) 推荐(0)
摘要: python datetime日期格式化 from datetime import datetime currentDateTime = datetime.now() print(currentDateTime.strftime("%Y-%m-%d %H:%M:%S")) ############# 阅读全文
posted @ 2023-04-06 22:16 西北逍遥 阅读(169) 评论(0) 推荐(0)
摘要: QHBoxLayout清空子控件 layout = QHBoxLayout() widget1 = QLabel("Widget 1") widget2 = QLabel("Widget 2") widget3 = QLabel("Widget 3") layout.addWidget(widget 阅读全文
posted @ 2023-04-05 22:50 西北逍遥 阅读(518) 评论(0) 推荐(0)
摘要: python判断是否是零时 from datetime import datetime now = datetime.now() if now.hour == 0 and now.minute == 0 and now.second == 0: print("It's midnight!") ### 阅读全文
posted @ 2023-04-04 21:13 西北逍遥 阅读(85) 评论(0) 推荐(0)
摘要: QLabel 显示opencv Mat import cv2 from PyQt5.QtGui import QImage, QPixmap from PyQt5.QtWidgets import QLabel label = QLabel() # Load the image using Open 阅读全文
posted @ 2023-04-03 13:02 西北逍遥 阅读(124) 评论(0) 推荐(0)
摘要: QDateTime计算时间差 from PyQt5.QtCore import QDateTime # Create two QDateTime objects dt1 = QDateTime.currentDateTime() dt2 = QDateTime(2022, 1, 1, 0, 0) # 阅读全文
posted @ 2023-04-02 17:55 西北逍遥 阅读(293) 评论(0) 推荐(0)
摘要: python pygame播放音频文件 pip install pygame import pygame # Initialize pygame pygame.init() # Load the MP3 file pygame.mixer.music.load("1.mp3") # Play the 阅读全文
posted @ 2023-04-01 19:14 西北逍遥 阅读(80) 评论(0) 推荐(0)
摘要: pyqt播放音频 from PyQt5.QtCore import QUrl from PyQt5.QtMultimedia import QMediaPlayer from PyQt5.QtWidgets import QApplication import sys app = QApplicat 阅读全文
posted @ 2023-03-31 06:06 西北逍遥 阅读(119) 评论(0) 推荐(0)
摘要: python opencv line import cv2 # Load the image img = cv2.imread('path/to/image.jpg') # Draw a red line from (0, 0) to (100, 100) with a thickness of 5 阅读全文
posted @ 2023-03-30 07:11 西北逍遥 阅读(18) 评论(0) 推荐(0)
摘要: pyqt时间格式化 from PyQt5.QtCore import QDateTime currentDateTime = QDateTime.currentDateTime() print(currentDateTime.toString("yyyy-MM-dd hh:mm:ss")) #### 阅读全文
posted @ 2023-03-29 14:42 西北逍遥 阅读(92) 评论(0) 推荐(0)
摘要: python opencv canny import cv2 # Load the image img = cv2.imread('path/to/image.jpg') # Convert the image to grayscale gray = cv2.cvtColor(img, cv2.CO 阅读全文
posted @ 2023-03-28 16:09 西北逍遥 阅读(18) 评论(0) 推荐(0)
摘要: OpenCV提供了多种方法来提取图像中的区域。其中,最常用的方法是使用cv2.rectangle函数绘制矩形框,然后使用切片操作提取矩形框内的像素。 import cv2 # 读取图片 img = cv2.imread('path/to/image') # 绘制矩形框 x, y, w, h = 10 阅读全文
posted @ 2023-03-27 20:01 西北逍遥 阅读(1289) 评论(0) 推荐(0)
摘要: python绘制wav音频文件波形图 #-*- coding: utf-8 -*- import wave import pylab as pl import numpy as np print('working') #打开wav文档 file = wave.open(r"02.wav", "rb" 阅读全文
posted @ 2023-03-26 20:51 西北逍遥 阅读(519) 评论(0) 推荐(0)
摘要: pip install gtts (wind_2021) J:\test>pip install gtts Collecting gtts Downloading gTTS-2.3.1-py3-none-any.whl (28 kB) Collecting requests<3,>=2.27 Usi 阅读全文
posted @ 2023-03-25 20:01 西北逍遥 阅读(71) 评论(0) 推荐(0)
摘要: OpenCV提供了两种计算图像相似度的方法:结构相似性(SSIM)和均方误差(MSE)。其中,SSIM是一种更加准确的方法,它不仅考虑了像素之间的差异,还考虑了人眼对图像的感知。而MSE则只是简单地计算像素之间的差异。 import cv2 # 读取图片 img1 = cv2.imread('pat 阅读全文
posted @ 2023-03-24 16:29 西北逍遥 阅读(2923) 评论(0) 推荐(0)
摘要: python清空cmd命令行 import os os.system('cls') ################### 阅读全文
posted @ 2023-03-23 21:58 西北逍遥 阅读(66) 评论(0) 推荐(0)
摘要: def convert(size, box): dw = 1. / (size[0]) dh = 1. / (size[1]) x = (box[0] + box[1]) / 2.0 - 1 y = (box[2] + box[3]) / 2.0 - 1 w = box[1] - box[0] h 阅读全文
posted @ 2023-03-22 14:33 西北逍遥 阅读(93) 评论(0) 推荐(0)
摘要: matlab查找数组中大于某个数的位置 >> k2=[1,4,2,7,6.6,7.8,3.2,5.6,9,11,14,17,2,7] k2 = 1.0000 4.0000 2.0000 7.0000 6.6000 7.8000 3.2000 5.6000 9.0000 11.0000 14.0000 阅读全文
posted @ 2023-03-21 19:12 西北逍遥 阅读(1606) 评论(0) 推荐(0)
摘要: # for inference class LoadImages: def __init__(self, path, img_size=640): p = str(Path(path)) # os-agnostic p = os.path.abspath(p) # absolute path if 阅读全文
posted @ 2023-03-20 22:06 西北逍遥 阅读(49) 评论(0) 推荐(0)
摘要: opencv修改图像像素值 point_cloud_img.at<cv::Vec3b>(row1, col1)[0] = 255; point_cloud_img.at<cv::Vec3b>(row1, col1)[1] = 255; point_cloud_img.at<cv::Vec3b>(ro 阅读全文
posted @ 2023-03-19 21:25 西北逍遥 阅读(64) 评论(0) 推荐(0)
摘要: 计算斜率k double calculate_k(float x1,float y1,float x2,float y2) { double k1 = 0.00001; if (x1 == x2 && y1 == y2)//1.共位 { k1 = 0.00001; } else if (x1 == 阅读全文
posted @ 2023-03-18 21:21 西北逍遥 阅读(94) 评论(0) 推荐(0)
摘要: 绘制点数据 import os import matplotlib.pyplot as plt import cv2 import math def loadTxtData(uwb_data_file): list_x = [] list_y = [] #txtFile = open("2.txt" 阅读全文
posted @ 2023-03-17 20:21 西北逍遥 阅读(32) 评论(0) 推荐(0)
摘要: osg创建立方体 osg::Geode* createBox(double minX, double maxX, double minY, double maxY, double minZ, double maxZ) { double X1 = minX; double X2 = maxX; dou 阅读全文
posted @ 2023-03-16 21:33 西北逍遥 阅读(111) 评论(0) 推荐(0)
摘要: 训练yolov5 模型 (wind_2021) H:\PytorchProject\yolov5_train_xiaotian_2023031401> (wind_2021) H:\PytorchProject\yolov5_train_xiaotian_2023031401>python trai 阅读全文
posted @ 2023-03-15 07:35 西北逍遥 阅读(59) 评论(0) 推荐(0)
摘要: dict1 = {} dict2={"id":12,"x":23} dict1[str(1)] = dict2 print(dict1) print(dict1[str(1)]) ############## 阅读全文
posted @ 2023-03-14 21:11 西北逍遥 阅读(14) 评论(0) 推荐(0)
摘要: python 全排列 import itertools # 利用itertools库中的permutations函数,给定一个排列,输出他的全排列 def all_permutation_fun(permutation): # itertools.permutations返回的只是一个对象,需要将其 阅读全文
posted @ 2023-03-13 17:04 西北逍遥 阅读(103) 评论(0) 推荐(0)
上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 96 下一页