Phase fraction calculation of microstructure

Phase fraction calculation for optical and SEM microstructure. Can do single and Batch processing too. Enjoy!
108 Downloads
Updated 18 Dec 2021

View License

%% Phase fraction calculation from optical or SEM microstructure. %%
% Works on Matlab 2021a (Not checked with previous version ;hopefully it works)
It is based on Adaptive image threshold. {https://uk.mathworks.com/help/images/ref/adaptthresh.html}
The sensitivity is set to default 0.8. It could be changed manually in code if required.
There are two options available
****************************************************************
Option one : Analaysis of single Image
Use the script names single_image_analysis.
=>select the image
=>Crop the image and double click
=>Should give you the result.
**************************************************************************
Option Two : Batch Image processing
This is useful when you have several images to process at one go.
{https://uk.mathworks.com/help/images/batch-processing-using-the-image-batch-processor-app.html}
Open matlab => open apps=> select Image Batch Processer
=> load the folders with all the images
=> Under Function name, browse the batch_processing script file
=> Under Process you can select either single or all and run.
=> Crop the image and double click for all the image.
=> Enter the threshold sensitivity. Generally it varies from 0-1. Adjust according to your image quality.
=> you can see the results at right column for respective image
=> Under Export option => you can export result of all processed image to workspace.
=> Tick the required black ,white fraction and name of the image and export.
=> you should be able to see the allresults in workspace.
=> Use this to save as excel in cmd :
{writetable(allresults,'statistics.xls','WriteRowNames',true) }
It would be saved in matlab directory.
Hope you enjoy it !

Cite As

Santosh Kumar (2024). Phase fraction calculation of microstructure (https://www.mathworks.com/matlabcentral/fileexchange/94490-phase-fraction-calculation-of-microstructure), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2021a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!

Option 1- Single Image

Option 2- Batch Image processing

Version Published Release Notes
1.0.5

Threshold sensitivity is prompted by new dialog , which could adjusted in batch processing.

1.0.4

Summary update!

1.0.3

Summary update

1.0.2

FIles updated!

1.0.1

Changed the cover Image

1.0.0