Path Planning Optimization

Camera Model Building

The camera parameters consist of the intrinsic matrix (focal length and principal point), and extrinsic matrix(rotational matrix and translation vector). First, we generated 200 points randomly on the sphere and connected all the points with the center of the sphere.

The following equations clearly describe the calculation of the camera frame.

For the intrinsic matrix, all the parameters are in the unit of pixels, so we need to convert the unit of focal length and principal point into pixels. The principal point is the center of the image plane and we regard the left top corner as the origin of the image plane.

For the extrinsic matrix, we need to compute the rotation and translation between the world frame and the camera frame.

Path Generation and Optimization

The ABB robot arm has working constraints and safety zone, so the original path is generated based on it.

Initially, we sampled 2000 points uniformly along the original path, which is able to cover all the possible positions for the calibration target which is mounted on the ABB Robot Arm. In order to record projections at each 3D position for all the cameras, we created a cell array which has 140 structs and each of them contains a matrix which is the same size of the image plane. The matrix is initially all zeros. Once got a projection, all the pixels in the covered area plus one. When all the projections are generated, for each matrix, the larger the pixel value, the more overlaps the area has.

 

For evaluating the quality of projections, we develop a score function. When the radius of projection is within 500 ~ 1500 pixels, the projection is valid, and when the radius equals to 800 pixels, the score equals to 1. From 500 ~ 800 pixels, the score is uniformly mapped into 0 ~ 1, the bigger the projection, the better it is. From 800 ~ 1500 pixels, the score is uniformly mapped into 0 ~ 1, the smaller the projection, the better it is. Besides, we also take into consideration the spatial information of the projection. If the center of the projection is out of the range of the camera FOV, we also set the score to be zero.

Then we calculate the score for all the possible 3D positions for all the camera FOVs. For example, if we have 2000 possible positions for calibration target and 140 cameras, the score matrix would be the size of 2000*140, each element in the matrix is the evaluation for a single projection at a specific position onto a specific camera FOV. Then we sum the score matrix along the second axis to obtain a vector of size 2000*1, each element represents the total score for a specific position on all camera FOVs. With this score, we can select positions with higher projection quality.