I have solved the mentioned problem with the solvePnPRansac() function that I mentioned the last week.
The algorithm is structured in this way:
1. compute the pose using only the four corners provided by libdmtx,
2. find the corners on the top and right edges using some filtering operations and and Harris corner detector,
3. compute the pose again using the solvePnPRansac function and the previous calculated pose as initial condition,
4. if the number of inliers is above a fixed threshold, then the algorithm updates the pose estimation.
This approach allows to have a good pose estimation even when only one data matrix is visible and “close” to the camera.
Furthermore, I started to work with the new Robotics System Toolbox. I can’t wait to see ROS and MATLAB (in particular my Kalman Filter) work together.