Optimizing "nested" variables with a genetic algorithm
Ältere Kommentare anzeigen
Hi there,
I'm trying to optimize the camera positions for a 3D reconstruction. There are 2 cameras available which can be placed anywhere around the object. The camera position is determined by its 3 spherical coordinates.
I am currently running a ga() optimization where the objective function has an input of a 2x3 matrix, determining camera positions. The output is a scalar characterizing the exactness of the 3D reconstruction.
objfun = @(xarray)reconstruction_fun(xarray);
The problem with this approach is that all entries of the matrix are scored as individuals. I would like the algorithm to take 2 vectors as an entry, each describing one camera position. And then optimize the 2 camera positions. The objective function would have to take 2 inputs as variables.
cam1=(radius1, phi1, theta1)
cam2= (..)
objfun = @(cam1, cam2)reconstruction_fun(cam1, cam2);
Is there a better way to achieve the optimization than with all variables thrown into one array?
Thanks, Simon
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Choose a Solver finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!