[Camera] refactor code for IplImage