fixed bitmap to mat conversion