what is the of converting a L*a*b image to double precision

1 view (last 30 days)
clear all;
close all;
he= imread('D:\sharath\major project\photos\imag17.jpg');
figure(1),imshow(he);
cform = makecform('srgb2lab');
lab_he = applycform(he,cform);
figure(2),imshow(lab_he);
ab = double(lab_he(:,:,2:3));

Answers (1)

Star Strider
Star Strider on 7 Feb 2016
It’s not obvious from that code snippet what the reason is for the conversion to double. However for numerical reasons (most notably precision) many functions require double precision data as arguments, and many images are characteristically uint8. It is likely that some function over the horizon in that code (that we can’t see) requires double-precision variables.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!