Camera rotation in Blender
So, the answer is. Instead of measuring the angles between camera direction and axis I should measure the angles between axes and the local axes of the plain aligned with the camera.