How to measure intensity in 16bit image using improfile?

3 views (last 30 days)
I'm used this code to measure intensity in a line using improfile tools . The plot show data intensity in 0-255 (8bit), my question how to change bit into 16bit?
I = imread('IMG_1737.JPG');
x = [2032 2032];
y = [0 size(I,1)];
c = improfile(I,x,y);
figure
subplot(2,1,1)
imshow(I);
hold on
plot(x,y,'r')
subplot(2,1,2)
%plot(c(:,1,1),'r')
hold on
plot(c(:,1,2),'g')
%plot(c(:,1,3),'b')

Accepted Answer

Image Analyst
Image Analyst on 31 Dec 2019
Use the uint16 function, like
I = uint16(I);
or
c = uint16(c);
I or c will now be 16 bit but their values will still be the values from the original image. They will not be automatically multiplied by 256, which would be deceptive/dangerous.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!