Skip to content

Commit

Permalink
update chapter about granulometry
Browse files Browse the repository at this point in the history
  • Loading branch information
dlegland committed Jan 17, 2023
1 parent 3d6714d commit 7a1a689
Show file tree
Hide file tree
Showing 9 changed files with 490 additions and 107 deletions.
Binary file added doc/userManual/images/imGranulo/coins.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
56 changes: 56 additions & 0 deletions doc/userManual/images/imGranulo/granulo_coins.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
% Demo script for granulometry applied on grayscale image of coins.
%
% output = granulo_coins(input)
%
% Example
% granulo_coins
%
% See also
%

% ------
% Author: David Legland
% e-mail: david.legland@inrae.fr
% INRAE - BIA Research Unit - BIBS Platform (Nantes)
% Created: 2023-01-17, using Matlab 9.13.0.2049777 (R2022b)
% Copyright 2023 INRAE.

%% Sample image

% read image
img = imread('coins.png');
imwrite(img, 'coins.png');

% compute several steps (before, between and after the two peaks)
radiusList = [15 27 35];
for iPlot = 1:3
se = strel('disk', radiusList(iPlot), 0);
imgOp = imopen(img, se);

imwrite(imgOp, sprintf('coins_OpDisk%02d.tif', radiusList(iPlot)));
end


%% compute granulo.

% granulometry analysis setup
xi = 1:60;
vol0 = sum(img(:));
[gr, diams, vol] = imGranulo(img, 'opening', 'disk', xi);

% display granulo
figure; plot(diams, gr, 'color', 'b', 'linewidth', 2);
xlim([0 100]);
xlabel('Diameter of structuring element (pixels)');
ylabel('Variation of gray levels (%)');
title('Gray level granulometry by opening', 'Interpreter', 'none');
print(gcf, 'coins_grOpDk30.png', '-dpng');

% display volume curve
figure; plot([0 diams], vol, 'color', 'b', 'linewidth', 2);
xlim([0 100]);
xlabel('Diameter of structuring element (pixels)');
ylabel('Sum of gray levels');
title('Gray level granulometry by opening', 'Interpreter', 'none');
print(gcf, 'coins_grOpDk40_sumOfGrays.png', '-dpng');

26 changes: 26 additions & 0 deletions doc/userManual/matImage-manual.bib
Original file line number Diff line number Diff line change
Expand Up @@ -631,4 +631,30 @@ @Article{Hu1962
timestamp = {2021.07.09},
}

@Article{Melelli2020,
author = {Alessia Melelli and Frédéric Jamme and David Legland and Johnny Beaugrand and Alain Bourmaud},
journal = {Industrial Crops and Products},
title = {Microfibril angle of elementary flax fibres investigated with polarised second harmonic generation microscopy},
year = {2020},
issn = {0926-6690},
pages = {112847},
volume = {156},
doi = {https://doi.org/10.1016/j.indcrop.2020.112847},
file = {:Melelli_2020_IndCropProd.pdf:PDF},
groups = {dlegland, Fibres},
keywords = {SHG, Microfibril angle, Elementary fibres, Flax fibres, Image analysis},
timestamp = {2020.08.12},
url = {http://www.sciencedirect.com/science/article/pii/S0926669020307640},
}

@Article{Legland_2020_PlantMethods,
author = {Legland, David and Guillon, Fabienne and Devaux, Marie-Fran\c{c}oise},
journal = {Plant Methods},
title = {Parametric mapping of cellular morphology in plant tissue sections by gray level granulometry},
year = {2020},
number = {63},
volume = {16},
doi = {https://doi.org/10.1186/s13007-020-00603-7},
}

@Comment{jabref-meta: databaseType:bibtex;}
Loading

0 comments on commit 7a1a689

Please sign in to comment.