Iteratively selecting rotation angle for alingment

5 次查看(过去 30 天)

Hi all, I am trying to build an alignment function to find the lowest RMSE. I can’t upload the code but this works by taking 3 rotation angle for x,y and z as input. My polblme is trying to not just brute force try all angle possibilities so for example right now I have x = linspace(-10,0,50) for each but this is a crazy amount of permutations to try has anybody tried to solve anything similar. I know I could just randomly choose an angle and see if lowers my error. Any tips please tim

回答(2 个)

Star Strider
Star Strider 2025-1-5
I do not understand what you are doing or want to do. Calculating the RMSE implies that you have something you want to compare the input values to, however it is not obvious what that is.
If (x,y,z) are Cartesian values (with respect to an origin at (0,0,0)), you can use the cart2pol function to convert them to azimuth, elevation, and radius.
  2 个评论
tim pearce
tim pearce 2025-1-5
移动:Walter Roberson 2025-1-5

Hi thanks for the reply’s the optimisation toolbox may be helpful if I can use my own function with it I’ll have a read of it to see if it will help. @starstrider. Sorry it’s not all that clear. But yea these are Cartesian angles I know there is no built in function to do as I which it’s more about setting out how to solve to reduce the error as small as possible with the 3 angles being my changing variables. I have it working in a loop that would just take a value for each angle and compute the error but to brute force this would be crazy and take weeks to run! I know this is an optimisation problem so looking for how others have set-up similar workflows.

Star Strider
Star Strider 2025-1-5
To do nonlinear optimisation, using your own function would be required.
What I still do not understand are the data you are working with, and what you want to do with them. What are you comparing? (Wanting to calculate the RMSE implies minimising the error in comparing your data with something.) What information do you want as the result?

请先登录,再进行评论。


Matt J
Matt J 2025-1-5
Use imregtform if you are aligning images. If you are aligning points, use this,
Even if these do not use the alignment cost function you want, they ought to provide decent initial guesses for the Optimization Toolbox solvers.

类别

Help CenterFile Exchange 中查找有关 Multidimensional Arrays 的更多信息

产品


版本

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by