Sliding window search and Entropy value for each window
9 views (last 30 days)
Show older comments
Hello, I want some help here
I need to apply Sliding window search in image, and calculate the Entropy value for each window (I looking for highest Entropy value in the image),
Here is the pseudo code:
(1) Sliding window search
Emax=0
For each window Wi
Compute the Entropy Ei
If Ei > Emax
Then update Emax
End
End
Can someone help me with that please?
0 Comments
Answers (1)
Subhadeep Koley
on 3 Feb 2020
Hi, refer the code below. It calculates entropy values for different (16x16) window of an image and displays them as a heatmap.
clc; close all;
% Read the image
img = im2double(imread('cameraman.tif'));
% Define the function handle
fun = @(block_struct) entropy(block_struct.data);
% Distinct block processing for the image
blockEntropy = blockproc(img, [16 16], fun);
% Display heatmap for visualization
figure; heatmap(blockEntropy); colormap hot;
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!