【优化求解】基于灰狼优化算法改进相机姿态估计matlab代码

 ✅作者简介:热爱科研的Matlab仿真开发者,修心和技术同步精进,代码获取、论文复现及科研仿真合作可私信。

🍎个人主页:Matlab科研工作室

🍊个人信条:格物致知。

更多Matlab完整代码及仿真定制内容点击👇

智能优化算法       神经网络预测       雷达通信       无线传感器        电力系统

信号处理              图像处理               路径规划       元胞自动机        无人机 

物理应用        机器学习

🔥 内容介绍

1- Introduction

First, we introduce the articles used for this work and then we explain the implementations for the algorithms. Finally, we test and compare the results. The problems is follows: We have 2 images captured by the same or different cameras at different positions and rotations (poses). We want to estimate the relative orientation between these two poses from the 2 captured images. In this problem, we know the intrinsic parameters of the cameras, but we don’t have any knowledge about the scene. The general flow is like this:

·Estimate some camera poses with five-point algorithm as the initial solutions of the swarm algorithm. We do it by repeating the five-point algorithm multiple times by choosing random matched points.

·Then, we apply the Grey Wolf Optimizer over the solutions until certain iterations. We choose the alpha wolf as the best solution.

For finding the feature points and matching them, we use the SURF algorithm. For the fitness function we use an innovative way the calculated the distances of the match points on the assumed second camera

2- Improving Camera Pose Estimation Using Swarm Particle Algorithms

Camera pose estimation has been a common problem in the field of computer vision. There have been introduced many methods to solve it. They all propose valid solutions and estimate good poses for the cameras, but they may or may not be good enough. The proposed method in that article aims to improve those solutions by evolutionary algorithms (EA) or swarm algorithms (SA) to find the optimum solution in the search space.

It first describes some of the EA and SA algorithms that it wants to apply on the pose estimation including the Genetic Algorithm, Particle Swarm Optimization, Grey Wolf Optimization, Improved Grey Wolf Optimization, and Whal Optimization. Then, it compares the results of these algorithms on the SPIN Lab dataset by best obtained score, mean square error, and computation time. Finally, it concludes that the IGWO performs best in finding the optimum solution and requires most computation time.

1- An Efficient Solution to the Five-Point Relative Pose Problem

This article tries to find the essential matrix by giving five matched points between two images and knowing the intrinsic parameters of the cameras. It solves a tenth-degree polynomial equation to find the coefficients.

Note that in this report, we use a different five-point algorithm from what the Elashry and Toth [1] used in its experiments.

2- Grey Wolf Optimizer

This algorithm Mirjalili, Mirjalili [2] aims to simulate the hunting behavior of the grey wolfs who move in a pack usually consists of 5-12 members. It considers each wolf as candidate solution and the prey as the best solution trying to find. It first categorizes the wolfs into a hierarchy of ranks that determines how the wolfs will move in the search space. There are leader wolfs from the top to the bottom named alpha, beta, and delta wolfs. There is only one of each rank. They are considered as the best three solutions found so far. These leaders are assumed to know the most probable position for the prey. They are responsible for pursuing the solution and leading the pack. The other wolfs are called omega and the move according to the movement of the leaders and some randomness. They follow this pattern until they encircle and hunt the prey.

Figure 4: Hierarchy of grey wolf (dominance decreases from top down)

The method consists of different aspects:

2-1- Encircling

The wolves try to close the prey. So, they need to decrease their distance from the prey over time. It controls this closing with A and C vectors. The Xp is the position of the prey and the X(t) is the position of the wolf. On each iteration, the wolf updates its position to get closer to the prey.

1-1- Attacking

When the coefficient |A| is less than 1, is makes the wolf to close the prey. When it’s greater than 1, it makes the wolf to gets farther from the prey for searching and exploration. The coefficient is decreasing from 2 to 0. So, the A is in the range [-a,a]. This means the |A| coefficient is slowly decreasing and finally causing the wolves to reach the prey.

1-2- Searching

When the |A| > 1, it forces the wolves to diverge and search for the prey. Also, the C coefficient has random values in the range [0, 2], so, sometimes the C > 1 and sometimes C < 1. This allows more randomness during exploration and allows avoiding the local optima better. This means the wolves sometimes close the prey and sometimes search for the prey.

1-3- Algorithm

The algorithm of the Grey Wolf Optimizer is as follows:

Initialize the grey wolf population X(i = 1, 2, ..., n)

Initialize a, A, and C

Calculate the fitness of each search agent

Xα=the best search agent

Xβ=the second best search agent

Xδ=the third best search agent

while (t < Max number of iterations)

for each search agent

Update the position of the current search agent by equation (3.7)

end for

Update a, A, and C

Calculate the fitness of all search agents

Update Xα, Xβ, and Xδ

t=t+1

end while

return Xα

First, an initial population of the wolves is created. Then we initialize the coefficients a, A, and C. Then we calculate the fitness of all the wolves and chose the best 3 candidates as the alpha, beta, and delta. Then, we start the iterations by first updating the positions of the wolves according to the leader wolves. Then we repeat updating the coefficients, calculating the fitness and choosing the new leaders. We repeat it until some criteria or maximum number of iterations. Then, the alpha is chosen as the best answer.

2- Fitness Function

To give a fitness value to each candidate relative pose, we need to define a value that describes how accurate is this pose if it was the pose for the second camera. The matched points found by the SURF algorithm tell us that they are the same points in the 3D space. So, we simulate reconstructing those points in the 3D space and examine how feasible it is. For each matched point in the first camera, we find a ray emitting from the camera origin toward a that pixel on hypothetical plane in front of that camera in the pinhole camera model. This ray will cross the real point the 3D space. We do the same for that matched point on the second image with assumed second camera pose. Then, we determine how close these to rays are by finding the distance between those lines. We repeat this process for all matched points and give the sum of those distances as the fitness value for that candidate relative pose (solution). Because the GWO algorithm tries to find a solution with the minimum fitness, the distance sum must also be minimized.

⛳️ 运行结果

🔗 参考文献

[1]Elashry, A. and C. Toth (2023). "IMPROVING CAMERA POSE ESTIMATION USING SWARM PARTICLE ALGORITHMS." Int. Arch. Photogramm. Remote Sens. Spatial Inf. Sci. XLVIII-M-3-2023: 87-93.

[2]Mirjalili, S., et al. (2014). "Grey wolf optimizer." Advances in engineering software 69: 46-61.

[3]Nister, D. (2004). "An efficient solution to the five-point relative pose problem." IEEE Transactions on Pattern Analysis and Machine Intelligence 26(6): 756-770.

[4]7 scenes data set. (n.d.). Retrieved from https://www.microsoft.com/en-us/research/project/rgb-d-dataset-7-scenes/

[5]SergioRAgostinho. "Five-Point Algorithm." from https://github.com/SergioRAgostinho/five_point_algorithm.

🎈 部分理论引用网络文献,若有侵权联系博主删除
👇 关注我领取海量matlab电子书和数学建模资料

🎁  私信完整代码和数据获取及论文数模仿真定制🌈

🌈 各类智能优化算法改进及应用
生产调度、经济调度、装配线调度、充电优化、车间调度、发车优化、水库调度、三维装箱、物流选址、货位优化、公交排班优化、充电桩布局优化、车间布局优化、集装箱船配载优化、水泵组合优化、解医疗资源分配优化、设施布局优化、可视域基站和无人机选址优化、背包问题、 风电场布局、时隙分配优化、 最佳分布式发电单元分配、多阶段管道维修、 工厂-中心-需求点三级选址问题、 应急生活物质配送中心选址、 基站选址、 道路灯柱布置、 枢纽节点部署、 输电线路台风监测装置、 集装箱调度、 机组优化、 投资优化组合、云服务器组合优化、 天线线性阵列分布优化、CVRP问题、VRPPD问题、多中心VRP问题、多层网络的VRP问题、多中心多车型的VRP问题、 动态VRP问题、双层车辆路径规划(2E-VRP)、充电车辆路径规划(EVRP)、油电混合车辆路径规划、混合流水车间问题、 订单拆分调度问题、 公交车的调度排班优化问题、航班摆渡车辆调度问题、选址路径规划问题、港口调度、港口岸桥调度、停机位分配、机场航班调度、泄漏源定位
🌈 机器学习和深度学习时序、回归、分类、聚类和降维

2.1 bp时序、回归预测和分类

2.2 ENS声神经网络时序、回归预测和分类

2.3 SVM/CNN-SVM/LSSVM/RVM支持向量机系列时序、回归预测和分类

2.4 CNN|TCN|GCN卷积神经网络系列时序、回归预测和分类

2.5 ELM/KELM/RELM/DELM极限学习机系列时序、回归预测和分类
2.6 GRU/Bi-GRU/CNN-GRU/CNN-BiGRU门控神经网络时序、回归预测和分类

2.7 ELMAN递归神经网络时序、回归\预测和分类

2.8 LSTM/BiLSTM/CNN-LSTM/CNN-BiLSTM/长短记忆神经网络系列时序、回归预测和分类

2.9 RBF径向基神经网络时序、回归预测和分类

2.10 DBN深度置信网络时序、回归预测和分类
2.11 FNN模糊神经网络时序、回归预测
2.12 RF随机森林时序、回归预测和分类
2.13 BLS宽度学习时序、回归预测和分类
2.14 PNN脉冲神经网络分类
2.15 模糊小波神经网络预测和分类
2.16 时序、回归预测和分类
2.17 时序、回归预测预测和分类
2.18 XGBOOST集成学习时序、回归预测预测和分类
2.19 Transform各类组合时序、回归预测预测和分类
方向涵盖风电预测、光伏预测、电池寿命预测、辐射源识别、交通流预测、负荷预测、股价预测、PM2.5浓度预测、电池健康状态预测、用电量预测、水体光学参数反演、NLOS信号识别、地铁停车精准预测、变压器故障诊断
🌈图像处理方面
图像识别、图像分割、图像检测、图像隐藏、图像配准、图像拼接、图像融合、图像增强、图像压缩感知
🌈 路径规划方面
旅行商问题(TSP)、车辆路径问题(VRP、MVRP、CVRP、VRPTW等)、无人机三维路径规划、无人机协同、无人机编队、机器人路径规划、栅格地图路径规划、多式联运运输问题、 充电车辆路径规划(EVRP)、 双层车辆路径规划(2E-VRP)、 油电混合车辆路径规划、 船舶航迹规划、 全路径规划规划、 仓储巡逻
🌈 无人机应用方面
无人机路径规划、无人机控制、无人机编队、无人机协同、无人机任务分配、无人机安全通信轨迹在线优化、车辆协同无人机路径规划
🌈 通信方面
传感器部署优化、通信协议优化、路由优化、目标定位优化、Dv-Hop定位优化、Leach协议优化、WSN覆盖优化、组播优化、RSSI定位优化、水声通信、通信上传下载分配
🌈 信号处理方面
信号识别、信号加密、信号去噪、信号增强、雷达信号处理、信号水印嵌入提取、肌电信号、脑电信号、信号配时优化、心电信号、DOA估计、编码译码、变分模态分解、管道泄漏、滤波器、数字信号处理+传输+分析+去噪、数字信号调制、误码率、信号估计、DTMF、信号检测
🌈电力系统方面
微电网优化、无功优化、配电网重构、储能配置、有序充电、MPPT优化、家庭用电
🌈 元胞自动机方面
交通流 人群疏散 病毒扩散 晶体生长 金属腐蚀
🌈 雷达方面
卡尔曼滤波跟踪、航迹关联、航迹融合、SOC估计、阵列优化、NLOS识别
🌈 车间调度
零等待流水车间调度问题NWFSP 、 置换流水车间调度问题PFSP、 混合流水车间调度问题HFSP 、零空闲流水车间调度问题NIFSP、分布式置换流水车间调度问题 DPFSP、阻塞流水车间调度问题BFSP
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值