operate() with double** as input (vector input)

23 views
Skip to first unread message

yan

unread,
Apr 4, 2018, 7:17:34 PM4/4/18
to Ceres Solver
Hi,

I'm new to ceres and trying to solve a sparse problem with every sub problem defined based a subset of the variables. Code structure is as following.  sub_cam only saves the pointers to the subset variable. However, I got following messages:
'bool Nonrigid_Control_Sparse_PointToPlaneError::operator ()(const T *const *,T *) const': could not deduce template argument for 'const T *const *' from 'const double *const '  \internal\variadic_evaluate.h 176. 
Is there anyway to solve this? Thank you.





double cam[600];

vector<double*> sub_cam;
for (int j=0;j<4;j++)
{
  for (int k = 0; k < 6; k++)
  {
   sub_cam.push_back(&cam[neighbor_graph[selected_id[i]][k]]);
   }
}

   ceres::CostFunction* cost_function = Nonrigid_Control_Sparse_PointToPlaneError::Create(dst[i], src[i], dst_normal[i], neighbor_weight[selected_id[i]]);
   problem.AddResidualBlock(cost_function, NULL, sub_cam);




template <typename T>
bool operator()(T const *const * camera, T* residuals) const {
;
}

yan

unread,
Apr 5, 2018, 8:18:29 PM4/5/18
to Ceres Solver
Have solved the problem by decomposing sub_cam as several continuous blocks and then pass them to the cost function as problem.AddResidualBlock(cost_function, NULL, sub_cam[0], sub_cam[1],...)
Reply all
Reply to author
Forward
0 new messages