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

 채택된 답변

Matt J
Matt J 2020년 10월 15일
편집: Matt J 2020년 10월 15일

0 개 추천

The problem with this approach is that all entries of the matrix are scored as individuals.
No, that shouldn't be. As long as you've specified nvars=6, ga() should know to treat a 1x6 input vector as single population member.

추가 답변 (0개)

제품

릴리스

R2020b

질문:

2020년 10월 15일

댓글:

2020년 10월 15일

Community Treasure Hunt

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

Start Hunting!

Translated by