Weighted adjacency matrix of an image using energy function
Creates a weighted adjacency matrix from a energy matrix (E) for an image. Average, similarity and dissimilarity between the nodes i,j can be computed. If a custom energy matrix is provided, the same functions can be used to fill the adjacency matrix with edge weights.
Type | Images |
---|---|
4-noded unidirection | ![]() |
4-noded bidirection | ![]() |
8-noded, six edges, vertical and cross directions | ![]() |
8-noded, eight edges, unidirection | ![]() |
8-noded, eight edges, bidirection | ![]() |
MATLAB
Please use the demo.m
to run the program.
Change the hyper parameters accordingly if needed.
% Inputs
h = 3; w = 6; % Image size [height x width]
edgeDirection = 1; % Edge direction 1 - uni | 2 - bi
noded = 8; % Nodes 4-noded, 6-direction, 8-noded (pixels)
weight_type = 'Average'; % Average (E(i), E(j)) / 2
% Similarity (E(i) - E(j))
% Dissimilarity 1 / (E(i) - E(j)).
% Where E is the energy at node i, j.
flowDirection = 'col_wise'; % 'row_wise' | 'col_wise'
- Sometimes
plot(G)
orplot(G,'Layout','force')
produces strange looking graphs.
Some of the MATLAB adjacency functions are adapted from the Stack Overflow.
Please rate and provide feedback for the further improvements.
Citar como
Preetham Manjunatha (2024). Weighted adjacency matrix of an image using energy function (https://github.com/preethamam/Weighted-Adjacency-Matrix-of-Image/releases/tag/1.3.3), GitHub. Recuperado .
Compatibilidad con la versión de MATLAB
Compatibilidad con las plataformas
Windows macOS LinuxEtiquetas
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Descubra Live Editor
Cree scripts con código, salida y texto formateado en un documento ejecutable.
Versión | Publicado | Notas de la versión | |
---|---|---|---|
1.3.3 | See release notes for this release on GitHub: https://github.com/preethamam/Weighted-Adjacency-Matrix-of-Image/releases/tag/1.3.3 |
||
1.3.2 | See release notes for this release on GitHub: https://github.com/preethamam/Weighted-Adjacency-Matrix-of-Image/releases/tag/1.3.2 |
||
1.3.1 | See release notes for this release on GitHub: https://github.com/preethamam/Weighted-Adjacency-Matrix-of-Image/releases/tag/1.3.1 |
||
1.3.0 | See release notes for this release on GitHub: https://github.com/preethamam/Weighted-Adjacency-Matrix-of-Image/releases/tag/1.3.0 |
||
1.2.0 | See release notes for this release on GitHub: https://github.com/preethamam/Weighted-Adjacency-Matrix-of-Image/releases/tag/1.2.0 |
||
1.0.2 | See release notes for this release on GitHub: https://github.com/preethamam/Weighted-Adjacency-Matrix-of-Image/releases/tag/1.0.2 |
||
1.0.1 | See release notes for this release on GitHub: https://github.com/preethamam/Weighted-Adjacency-Matrix-of-Image/releases/tag/1.0.1 |
||
1.0.0 |