CV_64F is defined to be 6. what did you expect depth() to return?
CV_64F
6
depth()
and where is your code that does the imwrite?
imwrite