linux练习——还未校正

用shell编程,将当前路径下的普通文件归档到hello.tar中,并且将归档的过程列出来

tar命令

用于打包文件(制作归档文件)、释放归档文件。格式:
tar [选项]… 归档文件名 源文件或目录
tar [选项]… 归档文件名 [-C 目标目录]
在这里插入图片描述
tar -vPA /hello.tar

用for语句实现1-8的累加

#方法1:
# 1-8整数和
#!/bin/sh
declare -i SUM=0
for ((i
  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
鱼眼图像畸变校正的透视变换原理如下: 1. 首先,需要确定图像中的两个灭点,这可以通过球面透视投影得到。 2. 然后,根据灭点的位置,确定仿射变换矩阵,将图像进行仿射变换。 3. 最后,对变换后的图像进行裁剪,得到最终的校正图像。 下面是一个使用OpenCV进行鱼眼图像畸变校正的Python代码示例: ```python import cv2 import numpy as np # 读取鱼眼图像 img = cv2.imread('fisheye.jpg') # 确定灭点 h, w = img.shape[:2] K = np.array([[w, 0, w/2], [0, w, h/2], [0, 0, 1]]) D = np.array([0, 0, 0, 0]) newK = cv2.fisheye.estimateNewCameraMatrixForUndistortRectify(K, D, (w, h), np.eye(3)) map1, map2 = cv2.fisheye.initUndistortRectifyMap(K, D, np.eye(3), newK, (w, h), cv2.CV_16SC2) img_undistorted = cv2.remap(img, map1, map2, interpolation=cv2.INTER_LINEAR, borderMode=cv2.BORDER_CONSTANT) # 确定仿射变换矩阵 src_points = np.float32([[0, 0], [w-1, 0], [0, h-1], [w-1, h-1]]) dst_points = np.float32([[w/4, h/4], [w*3/4, h/4], [0, h], [w, h]]) M = cv2.getPerspectiveTransform(src_points, dst_points) # 进行仿射变换 img_transformed = cv2.warpPerspective(img_undistorted, M, (w, h)) # 裁剪图像 img_corrected = img_transformed[int(h/4):int(h*3/4), int(w/4):int(w*3/4)] # 显示结果 cv2.imshow('Original Image', img) cv2.imshow('Undistorted Image', img_undistorted) cv2.imshow('Transformed Image', img_transformed) cv2.imshow('Corrected Image', img_corrected) cv2.waitKey(0) cv2.destroyAllWindows() ```

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值