背景:
用户单击蒙版并在蒙版上上传自己的图像。
图片上传后,“ 编辑文本”就会显示在图片上。
用户单击“ 编辑文本”后,我们将显示一个弹出框。
显示缩放和旋转按钮。用户也可以拖动上传的图像...。
要求:
缩放,旋转或拖动图像后,我想在控制台中动态显示相关的Transformation-Matrix值。
我在代码片段中使用以下功能:
container.zoom
container.rotate
container.onDragStart
container.onDragOver
Run Code Online (Sandbox Code Playgroud)
代码段:
container.zoom
container.rotate
container.onDragStart
container.onDragOver
Run Code Online (Sandbox Code Playgroud)
var target;
const imageUrl = "https://i.imgur.com/RzEm1WK.png";
let jsonData = {
"layers": [{
"x": 0,
"height": 612,
"layers": [{
"x": 160,
"src": "ax0HVTs.png",
"y": 291,
"height": 296,
"width": 429,
"name": "mask_1"
}, {
"x": 25,
"src": "hEM2kEP.png",
"height": 324,
"width": 471,
"y": 22, …Run Code Online (Sandbox Code Playgroud)我正在尝试计算来自 KITTI 原始数据集的视频中两帧之间的相对姿势。该oxts数据提供了lat, lon, alt, roll, pitch, yaw对每个帧。如何将此数据转换为转换矩阵(旋转矩阵和平移向量)?
这个答案表明这是可能的,但没有给出解决方案。Python 是首选,但如果您有其他语言的解决方案,那也很好。我可以将代码翻译成python。
样本数据:
lat, lon, alt, roll, pitch, yaw = 49.015003823272, 8.4342971002335, 116.43032836914, 0.035752, 0.00903, -2.6087069803847
PS:我正在尝试使用投影几何将一帧姿势扭曲到另一帧。为此,我需要姿势、深度和相机矩阵。KITTI raw 提供相机矩阵。我打算从立体图像计算深度。所以,我只剩下计算它们之间的姿势/变换矩阵
我正在尝试以任何给定的角度旋转图像。我以图像的中心为原点旋转。
但是代码没有按预期进行旋转。我附上下面的代码。
import math
import numpy as np
import cv2
im = cv2.imread("Samples\\baboon.jpg", cv2.IMREAD_GRAYSCALE)
new = np.zeros(im.shape,np.uint8)
new_x = im.shape[0] // 2
new_y = im.shape[1] // 2
x = int(input("Enter the angle : "))
trans_mat = np.array([[math.cos(x), math.sin(x), 0],[-math.sin(x), math.cos(x), 0],[0, 0, 1]])
for i in range(-new_x, im.shape[0] - new_x):
for j in range(-new_y, im.shape[1] - new_y):
vec = np.matmul([i, j, 1], trans_mat)
if round(vec[0] + new_x) < 512 and round(vec[1] + new_y) < 512:
new[round(vec[0]+new_x), round(vec[1]+new_y)] = im[i+new_x,j+new_y]
cv2.imshow("rot",new) …Run Code Online (Sandbox Code Playgroud) python numpy image-processing linear-algebra transformation-matrix
我最近开始使用 SimpleITK 进行图像配准。对于我当前的项目,我需要配准 X 射线图像和 CT 图像,然后在 X 射线图像上跟踪的 ROI 掩模上应用逆矩阵。
我得到了这一行的逆矩阵:
inverse_transform = final_transform.GetInverse()
Run Code Online (Sandbox Code Playgroud)
如何将变换应用于 ROI 蒙版?
python registration image-processing transformation-matrix simpleitk
python ×3
canvas ×1
html5 ×1
javascript ×1
jquery ×1
kitti ×1
numpy ×1
pose ×1
registration ×1
simpleitk ×1