find homogeneities of each block of quadtree decomposed image
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Imager
le 8 Jan 2023
Réponse apportée : Image Analyst
le 8 Jan 2023

Hello,
The above image is the light house image and its quadtree decomposed image using Matlab.
What I'd like to do is to find the homogeneity of each block from the quadtree decomposed image.
I think I need to get the exact position of black region of each block and then find the homogeneity from RGB (or gray) image with these position of black region.
Any advice is warmly welcome. Thank you.
0 commentaires
Réponse acceptée
Image Analyst
le 8 Jan 2023
Try this:
grayImage = imread('liftingbody.png');
S = qtdecomp(grayImage,.27);
blocks = repmat(uint8(0),size(S));
[rows, columns] = size(S)
for row = 1 : rows
for col = 1 : columns
if S(row, col) ~=0
upperLeftRow = row;
upperLeftCol = col;
width = S(row, col);
height = S(row, col);
hold on;
boundingBox = [upperLeftCol, upperLeftRow, width, height];
rectangle('position', boundingBox, 'EdgeColor','r', 'LineWidth',2)
% Extract the subimage
thisBlock = imcrop(grayImage, boundingBox);
% Compute mean
thisMean = mean2(thisBlock);
stdDev = std2(thisBlock);
end
end
end
0 commentaires
Plus de réponses (0)
Voir également
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!