How to use LUT in image processing?
Show older comments
Hi,
I have two images:
- one binary image which can be used as a mask (BW) and
- a grayscale image (Image).
I'd like to create an array (or a LUT) so that:
For each blob from the binary image, I can put all the corresponding values from the gray scale image.
How do I initialize the LUT? What would be the size of the LUT?
% Read each blob
L = bwlabel(BW);
nbLabels = max(max(L));
for iBlob = 1:nbLabels
% find all coordinates of the current blob
[r, c] = find(L == iBlob);
rc = [r c];
values = Image(r,c); % rc may be Nx2
LUT(r, c) = values;
end
How to use this LUT later by indexing ?
Thank you very much.
Accepted Answer
More Answers (0)
Categories
Find more on Image Segmentation and Analysis in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!