Follow on Facebook

header ads

How to find average L, A, B from LAB image?


In this post, i will show you how to find L, A, B from LAB image. i hope after reading this post you will be able to find average value of L, A, B from LAB image. below is code for it.


clear;
 close all;
 clc;

 img = imread('C:\Users\US\Desktop\CompVision\images\lenna.jpg');
 %imresize(img,[200 200]);
 img = rgb2lab(img);
 figure('units','normalized','outerposition',[0 0 1 1]),
 subplot(221), imshow(img), title('Lenna Image');

 [r, c, ch] = size(img);
 img_L =img(:,:,1);
 subplot(222), imshow(img_L), title('Channel L');
 img_A =img(:,:,2);
 subplot(223), imshow(img_A), title('Channel A');

 img_B =img(:,:,3);
 subplot(224), imshow(img_B), title('Channel B');



 

Post a Comment

0 Comments