鱼眼摄像头-opencv校准(基于棋盘+畸变表)

一:主要参数说明

1:内参矩阵K

是3*3的矩阵,其类似格式

K=np.array([
[389.2109574522624, 0.0, 630.2525667489842], 
[0.0, 388.505701978078, 360.7886749292513], 
[0.0, 0.0, 1.0]])

2:畸变系数

针对鱼眼相机:为1*4的数组,格式如下:

D=np.array([[0.0590137867946409], [-0.030903466430950866], [0.002123587326450784], [-1.851242815594123e-05]])
rms 0.18562501602552903

二:畸变表

这个文摄像头的镜头场景

1:焦距

2:镜头尺寸

三:参考连接


https://github.com/792864625/AroundViewMonitor-China-Developer/tree/d664bf75a8c43bb52bf69a71c420b31cbefa5a07?tab=readme-ov-file
https://www.eet-china.com/mp/a213856.html
https://blog.csdn.net/Yong_Qi2015/article/details/130299413?utm_medium=distribute.pc_relevant.none-task-blog-2~default~baidujs_baidulandingword~default-4-130299413-blog-108095636.235^v43^pc_blog_bottom_relevance_base2&spm=1001.2101.3001.4242.3&utm_relevant_index=7

四:实际测试

import cv2
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
import os
from simple_gui import display_image, PointSelectorfrom math import radiansimport argparse
# 在这里修改各参数值
parser = argparse.ArgumentParser(description="Fisheye Camera Undistortion")
parser.add_argument('-width', default=1280, type=int, help='Camera Frame Width')
parser.add_argument('-height', default=720, type=int, help='Camera Frame Height')
parser.add_argument('-load', default=False, type=bool, help='Load New Camera K/D Data (True/False)')'''
parser.add_argument('-path_read', default='./data/ligong/', type=str, help='Original Image Read Path')
parser.add_argument('-path_save', default='./data/ligong/', type=str, help='Undistortion Image Save Path')
'''
parser.add_argument('-path_read', default='./data/orig_3_3_npy_data/', type=str, help='Original Image Read Path')
parser.add_argument('-path_save', default='./data/orig_3_3_npy_data/', type=str, help='Undistortion Image Save Path')parser.add_argument('-path_k', default='./KD_01/camera_1_K.npy', type=str, help='Camera K File Path')
parser.add_argument('-path_d', default='./KD_01/camera_1_D.npy', type=str, help='Camera D File Path')
parser.add_argument('-focalscale', default=1, type=float, help='Camera Undistortion Focal Scale')
parser.add_argument('-sizescale', default=2, type=float, help='Camera Undistortion Size Scale')
parser.add_argument('-offset_h', default=0, type=float, help='Horizontal Offset of Optical Axis')
parser.add_argument('-offset_v', default=0, type=float, help='Vertical Offset of Optical Axis')
parser.add_argument('-srcformat', default='npy', type=str, help='Original Image Format (jpg/png)')
parser.add_argument('-dstformat', default='jpg', type=str, help='Final Image Format (jpg/png)')
parser.add_argument('-quality', default=100, type=int, help='Save Image Quality (jpg:0-100, png:9-0 (low-high))')
parser.add_argument('-name', default=None, type=str, help='Save Image Name')
args = parser.parse_args()#https://github.com/792864625/AroundViewMonitor-China-Developer/tree/d664bf75a8c43bb52bf69a71c420b31cbefa5a07?tab=readme-ov-file
#https://www.eet-china.com/mp/a213856.html
#https://blog.csdn.net/Yong_Qi2015/article/details/130299413?utm_medium=distribute.pc_relevant.none-task-blog-2~default~baidujs_baidulandingword~default-4-130299413-blog-108095636.235^v43^pc_blog_bottom_relevance_base2&spm=1001.2101.3001.4242.3&utm_relevant_index=7#用来描述每个像素在实际世界中代表多少毫米。换句话说,它告诉我们在图像中每个像素的大小对应于实际场景中多大的长度。
sensorRatio = 0.003 #;% 由厂家提供,单位 mm/pixel
sensorRatio=0.0029  #这个值应该是正确的值
sensorRatio_cm=1
sensorH=3.876/720
sensorW=5.138/1280
sensorW=sensorRatio
sensorW=sensorRatio
#下面的参数是当前可以的
sensorH=3.876/1080 #0.00358888888888888888888888888889
sensorW=5.138/1920 #0.00267604166666666666666666666667
sensorH=sensorRatio #0.00358888888888888888888888888889'''
下面是通过棋盘格校准而来,在最终的校准参数中,使用给了棋盘校准的畸变系数参数
Found 541 valid images for calibration
DIM=(1280, 720)
K=np.array([
[389.2109574522624, 0.0, 630.2525667489842], 
[0.0, 388.505701978078, 361.7886749292513], 
[0.0, 0.0, 1.0]])
D=np.array([[0.0590137867946409], [-0.030903466430950866], [0.002123587326450784], [-1.851242815594123e-05]])
rms 0.18562501602552903下面是通过畸变表计算而来
0.06244240163136363,-0.03908688528398631,0.006663506063585303,-0.0009067163647851509
[[479.34904735   0.         768.        ]
[  0.         642.86385797 432.        ]
[  0.           0.           1.        ]]畸变焦距 = 1.71781
畸变焦距 = 1.72033
畸变焦距 = 1.71520
上面三个平均值为:1.71778根据目前的测试结果,畸变系数从肉眼上面看不来有什么差异1:配置参数K=np.array([
[389.2109574522624, 0.0, 630.2525667489842], 
[0.0, 388.505701978078, 360.7886749292513], 
[0.0, 0.0, 1.0]])其中focal=1.7,sensorW=sensorRatio=0.0029
K = np.array([[389.2109574522624, 0, w/2 ],[0, focal / sensorW,  h/2  ],[0, 0, 1]])   opencvCoeffs = np.array([[0.09780962], [-0.07203037],  [0.01673093], [-0.0017944 ]], dtype=np.float64) # 来自畸变表2:配置参数
K=np.array([
[389.2109574522624, 0.0, 630.2525667489842], 
[0.0, 388.505701978078, 360.7886749292513], 
[0.0, 0.0, 1.0]])
opencvCoeffs =  np.array([[0.0590137867946409], [-0.030903466430950866], [0.002123587326450784], [-1.851242815594123e-05]], dtype=np.float64) # 这个来自450张照片校准生成的。3: 配置参数
newCameraMatrixK6=np.array([
[289.67227465, 0.0, w/2], 
[0.0, 558.505701978078, h/2], 
[0.0, 0.0, 1.0]])
opencvCoeffs = np.array([[0.09780962], [-0.07203037],  [0.01673093], [-0.0017944 ]], dtype=np.float64) # 来自畸变表其实主要更改的参数是:内参矩阵的
k[0][0] 和 k[1][1]'''distortionTablePath = "./data/distorti_table/distortionTable.xlsx"
distortionTablePath = "./data/distorti_table/backupDistortionTable.xlsx"
distortionTablePath = "./data/distorti_table/3.xlsx"def manual_select_point(img,cam_id):radius = 1color = (0, 0, 255)  # BGR格式,红色thickness = 2    pts_dir = args.path_readcamera_file = os.path.join(pts_dir, 'cam'+cam_id + '_dst_point.npy')point_corners=[]if os.path.exists(camera_file):print("load dst point from ",camera_file)dst_corners = np.load(camera_file)  print("dst_corners",dst_corners)else:     gui = PointSelector(img, title="cam"+cam_id)choice = gui.loop()if choice > 0:point_corners = np.float32(gui.keypoints)print(point_corners)print(len(point_corners))cam_pts = np.array(point_corners, dtype=np.float32)np.save(camera_file, cam_pts)cnt=0for index in range(len(point_corners)): x, y = point_corners[index]color = (0, 0, 255)  # BGR格式,红色cv2.putText(img, str(cnt), (int(x), int(y)), cv2.FONT_HERSHEY_SIMPLEX, 1,color, thickness)color = (0, 255, 255)  # BGR格式,红色cv2.circle(img,(int(x),int(y)), radius, color, thickness)cameraData = pd.read_excel(distortionTablePath)
#print(cameraData)
#print(type(cameraData)) # 如果表格有多个 sheet,可以用 sheet_name='Sheet1' 指定具体的 sheet 名称# 假设我们读取的是第一个 sheet,根据 MATLAB 代码推测,数据从第四行开始
cameraData = cameraData.iloc[0:101, :]  
print(cameraData)angleIn = cameraData.iloc[:, 0].values  # 入射角列
print(angleIn)
theta_input = np.radians(angleIn)
focal = np.mean(cameraData.iloc[:, 2].values / np.tan(theta_input))  # 计算焦距
print("focal:",focal)distortFrame = np.load("./data/orig_3_3_npy_data/img_cam4.npy")
def test_measure_distance():shift_h=1000shift_w=1000cam2_world_point = np.array([[0.+shift_h, 200.+shift_w],[200.+shift_h, 200.+shift_w],[ 0.+shift_h, 960.+shift_w],[ 200.+shift_h, 960.+shift_w],]).astype(np.int32)  cam2_img_point = np.array([[1166.*sensorRatio_cm, 419.*sensorRatio_cm],[1233.*sensorRatio_cm, 530.*sensorRatio_cm],[1096.*sensorRatio_cm, 422.*sensorRatio_cm],[1191.*sensorRatio_cm, 578.*sensorRatio_cm],[ 349.*sensorRatio_cm, 381.*sensorRatio_cm],[ 216.*sensorRatio_cm, 505.*sensorRatio_cm],[ 271.*sensorRatio_cm,369.*sensorRatio_cm],[ 171.*sensorRatio_cm,456.*sensorRatio_cm]]).astype(np.float64)      shift_h=200shift_w=200cam2_world_point = np.array([[0.+shift_h, 0.+shift_w],[200.+shift_h, 0.+shift_w],[0.+shift_h, 200.+shift_w],[200.+shift_h, 200.+shift_w],[ 0.+shift_h, 940.+shift_w],[ 200.+shift_h, 940.+shift_w],[ 0.+shift_h,1140.+shift_w],[ 200.+shift_h,1140.+shift_w]]).astype(np.int32)  cam2_img_point = np.array([[1096.*sensorRatio_cm, 422.*sensorRatio_cm],[1191.*sensorRatio_cm, 578.*sensorRatio_cm],[ 349.*sensorRatio_cm, 381.*sensorRatio_cm],[ 216.*sensorRatio_cm, 505.*sensorRatio_cm],]).astype(np.float64)      cam2_img_point = np.array([[[1167. , 419.],[1234. , 532.],[ 271. , 370.],[ 173. , 454.]]]).astype(np.float64)    cam2_img_point = np.array([[[1137. , 402.],[1264. , 574.],[ 256. , 336.],[  10. , 477.]]]).astype(np.float64)     cam2_undistortImg2 = cv2.imread("./data/ligong/cam2_undistortImg2.jpg")cam_id='2'manual_select_point(distortFrame,cam_id)print("distortFrame.shape",cam2_undistortImg2.shape)H, _ = cv2.findHomography(cam2_img_point, cam2_world_point,method = cv2.RANSAC)holog = cv2.warpPerspective(cam2_undistortImg2, H, (1140*4, 1080*3))print(holog.shape)surround_n=cv2.resize(holog,(720,1280))dstMap = cv2.rotate(surround_n, cv2.ROTATE_90_COUNTERCLOCKWISE)cv2.imshow("camera_homography_vir_1_H", dstMap)h, w, _ = distortFrame.shape  # 获取图像高度和宽度K = np.array([[focal / sensorRatio, 0, w / 2],[0, focal / sensorRatio, h / 2],[0, 0, 1]])K = np.array([[focal / sensorH, 0,w *3/ 5 ],[0, focal / sensorW, h *3/ 5  ],[0, 0, 1]])r_d = 1. / focal * cameraData.iloc[:, 1].values  # 求归一化平面上的 r_dthetaRadian = np.radians(angleIn)  # 度数转为弧度A = np.column_stack([thetaRadian**3, thetaRadian**5, thetaRadian**7, thetaRadian**9])
b = r_d - thetaRadianopencvCoeffs = np.linalg.lstsq(A, b, rcond=None)[0]focal=1.7K = np.array([[focal / sensorH, 0,630.2525667489842 ],[0, focal / sensorW, 400.7886749292513 ],[0, 0, 1]])K = np.array([[focal / sensorH, 0,w*2/5 ],[0, focal / sensorW, h*2/5 ],[0, 0, 1]])K = np.array([[focal / sensorH, 0,730.2525667489842 ],[0, focal / sensorW, 730.7886749292513 ],[0, 0, 1]])
if 1==1:K=np.array([[389.2109574522624, 0.0, 630.2525667489842], [0.0, 388.505701978078, 400.7886749292513], [0.0, 0.0, 1.0]])K = np.array([[focal / sensorH, 0,w*3/5 ],[0, focal / sensorW, h*3/5 ],[0, 0, 1]])K = np.array([[focal / sensorH,0, w/2 ],[0, focal / sensorW, h/2 ],[0, 0, 1]])K = np.array([[focal / sensorH,0, w/2 ],[0, focal / sensorW, h/2 ],[0, 0, 1]])K = np.array([[focal / sensorH, 0,w/2 ],[0, focal / sensorW, h*2/5 ],[0, 0, 1]])K=np.array([[389.2109574522624, 0.0, 630.2525667489842], [0.0, 388.505701978078, 360.7886749292513], [0.0, 0.0, 1.0]])K = np.array([[focal / sensorH, 0,630.2525667489842 ],[0, focal / sensorW, 360.7886749292513 ],[0, 0, 1]])K = np.array([[389.2109574522624, 0, w/2 ],[0, focal / sensorW,  h/2  ],[0, 0, 1]])   opencvCoeffs = np.array([[0.09780962], [-0.07203037],  [0.01673093], [-0.0017944 ]], dtype=np.float64) # 来自畸变表newCameraMatrixK = K.copy()newImageSize = distortFrame.shape[:2]  # 假设 distortFrame 是已定义的畸变图像newCameraMatrixK[0][0]*=0.55 #控制X方向显示多少newCameraMatrixK[1][1]*=0.90newCameraMatrixK6=np.array([[289.67227465, 0.0, w/2], [0.0, 558.505701978078, h/2], [0.0, 0.0, 1.0]])#===========================================================================================================
else:'''
下面的是中间压缩,类似之前程彪校准的,左右比较模糊,但是实际中进行透视变化后,比较直'''K=np.array([[389.2109574522624, 0.0, 630.2525667489842], [0.0, 388.505701978078, 400.7886749292513], [0.0, 0.0, 1.0]])K=np.array([[389.2109574522624, 0.0, w/2], [0.0, 388.505701978078, h/2], [0.0, 0.0, 1.0]])######################################################################################K=np.array([[389.2109574522624, 0.0, 630.2525667489842], [0.0, 388.505701978078, 360.7886749292513], [0.0, 0.0, 1.0]])opencvCoeffs =  np.array([[0.0590137867946409], [-0.030903466430950866], [0.002123587326450784], [-1.851242815594123e-05]], dtype=np.float64) # 这个来自450张照片校准生成的。# 假设接下来的部分中的函数和变量定义,需要根据具体情况修改
#newCameraMatrixK = K  # 假设 K 是已定义的新相机矩阵newCameraMatrixK = K.copy()newImageSize = distortFrame.shape[:2]  # 假设 distortFrame 是已定义的畸变图像newCameraMatrixK[0][0]*=0.35 #控制X方向显示多少,值越小,显示校准后的区域越大newCameraMatrixK[1][1]*=0.72newImageSize = newImageSize[::-1]print(opencvCoeffs)
print("最小二乘拟合 OpenCV 鱼眼模型畸变系数为(k1~k4):" + ",".join(map(str, opencvCoeffs)))
print("K",K)
print("newCameraMatrixK:",newCameraMatrixK)
print("newImageSize:",newImageSize)balance=0
newCameraMatrixK1 = cv2.fisheye.estimateNewCameraMatrixForUndistortRectify(K, opencvCoeffs, newImageSize, np.eye(3), balance=balance)
print("newCameraMatrixK1:",newCameraMatrixK1)balance=1
newCameraMatrixK2 = cv2.fisheye.estimateNewCameraMatrixForUndistortRectify(K, opencvCoeffs, newImageSize, np.eye(3), balance=balance)
print("newCameraMatrixK2:",newCameraMatrixK2)balance=0.1
newCameraMatrixK3 = cv2.fisheye.estimateNewCameraMatrixForUndistortRectify(K, opencvCoeffs, newImageSize, np.eye(3), balance=balance)
print("newCameraMatrixK3:",newCameraMatrixK3)balance=0.3
newCameraMatrixK4 = cv2.fisheye.estimateNewCameraMatrixForUndistortRectify(K, opencvCoeffs, newImageSize, np.eye(3), balance=balance)
print("newCameraMatrixK4:",newCameraMatrixK4)balance=0.5
newCameraMatrixK5 = cv2.fisheye.estimateNewCameraMatrixForUndistortRectify(K, opencvCoeffs, newImageSize, np.eye(3), balance=balance)
print("newCameraMatrixK5:",newCameraMatrixK5)balance=0.7
newCameraMatrixK6 = cv2.fisheye.estimateNewCameraMatrixForUndistortRectify(K, opencvCoeffs, newImageSize, np.eye(3), balance=balance)
print("newCameraMatrixK6:",newCameraMatrixK6)base_newCameraMatrixK6=np.array([
[289.67227465, 0.0, w/2], 
[0.0, 458.505701978078, h/2], 
[0.0, 0.0, 1.0]])newCameraMatrixK7=np.array([
[250.67227465, 0.0, w/2], 
[0.0, 558.505701978078, h/2], 
[0.0, 0.0, 1.0]])print(newCameraMatrixK6)
R = np.eye(3, dtype=np.float64)
mapX, mapY = cv2.fisheye.initUndistortRectifyMap(K, opencvCoeffs, R, newCameraMatrixK, newImageSize, cv2.CV_16SC2)
mapX, mapY = cv2.fisheye.initUndistortRectifyMap(K, opencvCoeffs, R, newCameraMatrixK7, (w,h), cv2.CV_16SC2)undistortImg2 = cv2.remap(distortFrame, mapX, mapY, cv2.INTER_LINEAR)
undistortImg2 = cv2.remap(distortFrame, mapX, mapY, cv2.INTER_LINEAR, borderMode=cv2.BORDER_CONSTANT, borderValue=255)
print(undistortImg2.shape)
cv2.imshow("img",distortFrame)
cv2.imshow("undistortImg2",undistortImg2)
cv2.imwrite('cam2_undistortImg2.jpg', undistortImg2)cv2.waitKey(0) indices = np.indices((720, 1280), dtype=np.float32)
indices = np.stack((indices[1], indices[0], np.zeros((720, 1280))), axis=-1).astype(np.float64)
indices = cv2.remap(indices, mapX, mapY, interpolation=cv2.INTER_LINEAR,borderMode=cv2.BORDER_CONSTANT, borderValue=-1)
position=1
map_dict = np.array(indices[:, :, :-1], dtype=np.float32)while True:if cv2.waitKey(10) & 0xFF == ord('q'):filenames = os.listdir(args.path_read)       # 在argparse中修改图片路径index = 1for filename in filenames:if filename[-4:] == '.' + args.srcformat:    all_name=args.path_read + filenameimg = np.load(all_name)cv2.imwrite(args.path_save + filename[:-4] + '_orig_distort.jpg', img, [cv2.IMWRITE_PNG_COMPRESSION, args.quality])print(filename)print(all_name)undistort_img = cv2.remap(img, mapX, mapY, cv2.INTER_LINEAR)np.save('%sF_cam%s.npy' % ("./fisheye_k_d/", index), map_dict)index+=1print(undistort_img.shape)   print(img.shape)   if args.dstformat == 'jpg':print("save")cv2.imwrite(args.path_save + filename[:-4] + '.jpg', undistort_img, [cv2.IMWRITE_JPEG_QUALITY, args.quality])elif args.dstformat == 'png':cv2.imwrite(args.path_save + filename[:-4] + '.png', undistort_img, [cv2.IMWRITE_PNG_COMPRESSION, args.quality])else:cv2.imwrite(filename[:-4] + '.' + args.dstformat, undistort_img) break
'''
if __name__ == "__main__":main()
'''

五:测试结果

1:原始图片

校准后的

不同的newCameraMatrixK7,有不同的结果

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.xdnf.cn/news/1486080.html

如若内容造成侵权/违法违规/事实不符,请联系一条长河网进行投诉反馈,一经查实,立即删除!

相关文章

粘包问题、mmap和分片上传

一、粘包问题: 如果一端要把文件发给另一端,要发送两个部分的数据:其一是文件名,用于对端创建文件;另一个部分是文件内容。服务端在接收文件名,实际上并不知道有多长, 所以它会试图把网络缓冲区…

v-for 进行列表的 增删改查

通过对象下标替换属性值 但是通过实践此方法是错误的&#xff0c;Vue监听的是students这个对象&#xff0c;而不是这个对象里面的数组信息&#xff0c;也就是说&#xff0c;改变里面的值&#xff0c;并不能在页面上实现更新的功能 <!DOCTYPE html> <html lang"en…

Adobe国际认证详解-动漫制作专业就业方向和前景

动漫制作专业的就业方向和前景随着创意产业的蓬勃发展而愈发广阔。这一专业涵盖了从角色设计、场景绘制到动画制作、特效合成等多个环节&#xff0c;是创意与技术相结合的典型代表。随着数字媒体和互联网的普及&#xff0c;动漫制作专业人才的需求正不断增长&#xff0c;为该专…

c++ primer plus 第16章string 类和标准模板库, 16.3.3 对矢量可执行的其他操作

c primer plus 第16章string 类和标准模板库, 16.3.3 对矢量可执行的其他操作 c primer plus 第16章string 类和标准模板库, 16.3.3 对矢量可执行的其他操作 文章目录 c primer plus 第16章string 类和标准模板库, 16.3.3 对矢量可执行的其他操作16.3.3 对矢量可执行的其他操作…

计算机毕业设计python+neo4j知识图谱中医问答系统 中医中药方剂大数据可视化 vue.js 前后端分离 大数据毕业设计 机器学习 深度学习 人工智能

背景介绍 中医问答系统开题报告 一、项目背景与意义 随着科技的飞速发展和人们生活水平的提高&#xff0c;人们对健康管理的需求日益增强。中医作为中国传统医学的瑰宝&#xff0c;其独特的理论体系、诊疗方法和养生观念在现代社会依然发挥着不可替代的作用。然而&#xff0…

华为云技术精髓笔记(四)-CES基础入门实战

华为云技术精髓笔记(四) CES基础入门实战 一、监控ECS性能 1、 远程登录ECS 步骤一 双击实验桌面的“Xfce终端”打开Terminal&#xff0c;输入以下命令登录云服务器。注意&#xff1a;请使用云服务器的公网IP替换命令中的【EIP】。 LANGen_us.UTF-8 ssh rootEIP说明&#x…

机械学习—零基础学习日志(高数09——函数图形)

零基础为了学人工智能&#xff0c;真的开始复习高数 函数图像&#xff0c;开始新的学习&#xff01; 幂函数 利用函数的性质&#xff0c;以幂函数为例&#xff0c;因为单调性相同&#xff0c;利用图中的2和3公式&#xff0c;求最值问题&#xff0c;可以直接将式子进行简化。这…

东京裸机云多IP服务器全面分析

东京裸机云多IP服务器是一种提供多IP地址分配和高性能网络服务的云计算解决方案&#xff0c;广泛应用于需要多IP管理和高稳定性的网络应用。下面将从几个方面具体介绍东京裸机云多IP服务器&#xff0c;rak部落为您整理发布东京裸机云多IP服务器的全面分析。 在数字化时代&#…

SQL injection UNION attacks SQL注入联合查询攻击

通过使用UNION关键字&#xff0c;拼接新的SQL语句从而获得额外的内容&#xff0c;例如 select a,b FROM table1 UNION select c,d FROM table2&#xff0c;可以一次性查询 2行数据&#xff0c;一行是a&#xff0c;b&#xff0c;一行是c&#xff0c;d。 UNION查询必须满足2个条…

15Kg级无人机降落伞系统技术详解

15Kg级无人机降落伞系统由以下几个主要部分组成&#xff1a; 1. 降落伞主体&#xff1a;采用轻质高强度的材料制成&#xff0c;能够承受无人机在降落过程中产生的冲击力&#xff0c;并确保无人机平稳安全地着陆。 2. 伞绳与连接机构&#xff1a;伞绳负责连接降落伞主体与无人机…

操作系统常用知识总结(基本结构+磁盘+进程)

文章收录在网站&#xff1a;http://hardyfish.top/ 文章收录在网站&#xff1a;http://hardyfish.top/ 文章收录在网站&#xff1a;http://hardyfish.top/ 文章收录在网站&#xff1a;http://hardyfish.top/ 基本结构 冯诺依曼计算机模型 现代计算机模型是基于冯诺依曼计算…

适配器模式详解和应用

目录 适配器模式适配器模式结构适配器模式适用场景适配器模式优缺点练手题目题目描述输入描述输出描述题解 适配器模式 适配器模式是一种结构型设计模式&#xff0c; 它能使接口不兼容的对象能够相互合作。 适配器模式结构 对象适配器 实现时使用了构成原则&#xff1a; 适…

重复图片查找:巧用Python和OpenCV进行图像哈希与汉明距离检测以从海量图片中找出重复图片

重复图片查找&#xff1a;巧用Python和OpenCV进行图像哈希与汉明距离检测以从海量图片中找出重复图片 1. 导言2. 环境准备3. 图像哈希&#xff08;pHash&#xff09;原理4. 汉明距离原理5. 代码实现导入必要的库图像哈希计算函数汉明距离计算函数查找重复图片函数示例使用 在处…

C++:内存管理(new,delete)

目录 C/C内存分布 C语言内存管理 C内存管理&#xff1a; new和delete的原理 new delete malloc/free和new/delete的区别 C/C内存分布 在C/C中&#xff0c;都有一块虚拟地址&#xff0c;内部井然有序的将代码分成了几部分&#xff0c;如下表&#xff1a; 栈&#xff1a;…

C++实现LRU缓存(新手入门详解)

LRU的概念 LRU&#xff08;Least Recently Used&#xff0c;最近最少使用&#xff09;是一种常用的缓存淘汰策略&#xff0c;主要目的是在缓存空间有限的情况下&#xff0c;优先淘汰那些最长时间没有被访问的数据项。LRU 策略的核心思想是&#xff1a; 缓存空间有限&#xff1…

深入浅出C语言指针(进阶篇)

深入浅出C语言指针(基础篇) 深入浅出C语言指针(进阶篇) 目录 引言 一、指针和数组 1.数组名的理解 2.指针访问数组 3.一维数组传参的本质 二、二级指针 1.二级指针的概念 2.二级指针的内存表示 3.二级指针的解引用 三、字符指针 1.指针指向单个字符 2.指针指向字…

【目标检测】Anaconda+PyTorch配置

前言 本文主要介绍在windows系统上的Anaconda、PyTorch关键步骤安装&#xff0c;为使用yolo所需的环境配置完善。同时也算是记录下我的配置流程&#xff0c;为以后用到的时候能笔记查阅。 Anaconda 软件安装 Anaconda官网&#xff1a;https://www.anaconda.com/ 另外&#…

Golang | Leetcode Golang题解之第278题第一个错误的版本

题目&#xff1a; 题解&#xff1a; func firstBadVersion(n int) int {return sort.Search(n, func(version int) bool { return isBadVersion(version) }) }

Elasticsearch基础(六):使用Kibana Lens进行数据可视化

文章目录 使用Kibana Lens进行数据可视化 一、进入Kibana Lens 二、基础可视化 1、指标可视化 2、垂直堆积条形图 3、表格 三、高级可视化 1、多图层和索引 2、子桶 3、树状图 使用Kibana Lens进行数据可视化 一、进入Kibana Lens 在Kibana主页&#xff0c;单击页面…

vxe-table——实现切换页码时排序状态的回显问题(ant-design+elementUi中table排序不同时回显的bug)——js技能提升

之前写的后台管理系统&#xff0c;都是用的antdelement&#xff0c;table组件中的【排序】问题是有一定的缺陷的。 想要实现的效果&#xff1a; antv——table组件一次只支持一个参数的排序 如下图&#xff1a; 就算是可以自行将排序字段拼接到列表接口的入参中&#xff0c…