惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

M
MIT News - Artificial intelligence
罗磊的独立博客
Hugging Face - Blog
Hugging Face - Blog
J
Java Code Geeks
G
Google Developers Blog
美团技术团队
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
腾讯CDC
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
T
The Blog of Author Tim Ferriss
月光博客
月光博客
B
Blog
WordPress大学
WordPress大学
云风的 BLOG
云风的 BLOG
博客园_首页
人人都是产品经理
人人都是产品经理
aimingoo的专栏
aimingoo的专栏
Y
Y Combinator Blog
Jina AI
Jina AI
S
SegmentFault 最新的问题
H
Help Net Security
博客园 - 聂微东
Microsoft Azure Blog
Microsoft Azure Blog
Google DeepMind News
Google DeepMind News

又见苍岚

COLMAP PatchMatch Stereo 算法详解 事件驱动的状态机框架:从理论到工程实践 Git 在国内网络环境下无法 Push 的排查与修复 —— 配置 Clash 代理 分段五次多项式插值原理详解 路径插值方法深度对比研究 Claude Code 使用指南 OpenClaw 记忆管理与技能创建指南 CBS(Conflict-Based Search)算法详解 A* 算法及其变种详解 OpenClaw 配置多 Agents Windows Powershell 无法加载文件,因为在此系统上禁止运行脚本问题的解决方案 MaxClaw 安装流程 大模型 AI 名词介绍 AList 网盘聚合工具简介 Protobuf 简介与测试 Claude Code 简介以及 GLM 4.7 模型接入 Github 歌词下载工具 163MusicLyrics Python __getattr__ 懒加载 Python TypedDict 机器人仿真平台 Gazebo 安装记录 机器人仿真平台 Gazebo 简介 多机器人路径规划问题(Multi-Agent Path Finding, MAPF)简介 Python exifread 读取修改过的 jpeg 信息错误问题修复 3D 坐标系变换的理解 3D 旋转矩阵基本概念 MongoDB Compass 介绍 Python 环境管理工具 uv Flutter 开发指南 Snipaste 安装下载与黑屏问题解决方案 全局路径规划算法记录
Halcon MapImage 复刻 remap
Yiwei Zhang · 2022-12-28 · via 又见苍岚
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71

Mat map1, map2, R;
initUndistortRectifyMap(cameraMatrix, distCoeffs, R, newcameramatrix, imageSize, CV_32FC1, map1, map2);

Mat main_map, sub_map2, sub_map3, sub_map4, sub_map5;
main_map = main_map.zeros(imageSize, CV_32S);
sub_map2 = sub_map2.zeros(imageSize, CV_16U);
sub_map3 = sub_map3.zeros(imageSize, CV_16U);
sub_map4 = sub_map4.zeros(imageSize, CV_16U);
sub_map5 = sub_map5.zeros(imageSize, CV_16U);

float x_value, y_value;
float x_diff, y_diff;
int x_temp, y_temp;

for (int row(0); row < imageSize.height; row++) {
for (int col(0); col < imageSize.width; col++) {
x_value = map1.at<float>(row, col);
y_value = map2.at<float>(row, col);

x_temp = floor(x_value);
y_temp = floor(y_value);

if (x_value < 0 or y_value < 0)
{
main_map.at<int32_t>(row, col) = 0;
sub_map2.at<uint16_t>(row, col) = 0;
sub_map3.at<uint16_t>(row, col) = 0;
sub_map4.at<uint16_t>(row, col) = 0;
sub_map5.at<uint16_t>(row, col) = 0;
}
else
{
x_diff = x_value - x_temp;
y_diff = y_value - y_temp;

main_map.at<int32_t>(row, col) = y_temp * imageSize.width + x_temp;
sub_map2.at<uint16_t>(row, col) = (1 - x_diff) * (1 - y_diff) * 65535;
sub_map3.at<uint16_t>(row, col) = x_diff * (1 - y_diff) * 65535;
sub_map4.at<uint16_t>(row, col) = (1 - x_diff) * y_diff * 65535;
sub_map5.at<uint16_t>(row, col) = x_diff * y_diff * 65535;
}
}
}

HalconCpp::HImage main_data, sub_map_data2, sub_map_data3, sub_map_data4, sub_map_data5;
int height1 = main_map.rows, width1 = main_map.cols;
int size = height1 * width1;

uchar *temp = new uchar[size * 4];

memcpy(temp, main_map.data, size * 4);
HalconCpp::GenImage1(&main_data, "int4", imageSize.width, imageSize.height, (Hlong)(temp));

memcpy(temp, sub_map2.data, size * 2);
HalconCpp::GenImage1(&sub_map_data2, "uint2", imageSize.width, imageSize.height, (Hlong)(temp));

memcpy(temp, sub_map3.data, size * 2);
HalconCpp::GenImage1(&sub_map_data3, "uint2", imageSize.width, imageSize.height, (Hlong)(temp));

memcpy(temp, sub_map4.data, size * 2);
HalconCpp::GenImage1(&sub_map_data4, "uint2", imageSize.width, imageSize.height, (Hlong)(temp));

memcpy(temp, sub_map5.data, size * 2);
HalconCpp::GenImage1(&sub_map_data5, "uint2", imageSize.width, imageSize.height, (Hlong)(temp));
delete[] temp;

HalconCpp::HImage map_h, map_res_h;
Compose5(main_data, sub_map_data2, sub_map_data3, sub_map_data4, sub_map_data5, &map_h);

MapImage(ImageGray, map_h, &map_res_h);