Sliding window search and Entropy value for each window

14 visualizzazioni (ultimi 30 giorni)
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?

Risposte (1)

Subhadeep Koley
Subhadeep Koley il 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;
blockEntropy.png

Categorie

Scopri di più su Images in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by