Skip to content

Latest commit

 

History

History
40 lines (29 loc) · 2.45 KB

README.md

File metadata and controls

40 lines (29 loc) · 2.45 KB

Image Analysis for microplastic extraction of chitinous gut tissue of large decapods

Image preparation

  1. Take the images of stainless-steel filter under the same condition (same location on the image, same light, same white balance for the same batch you need to compare), one filter per image
  2. Find the universal location of the filter, i.e. draw a square around the filter and find the coordinate of the top left corner (x,y), and the length of the square (l)

Requirements

  • miniconda
  • Python==3.8
  • numpy==1.21.1
  • opencv-python==4.5.3.56

Go to line 103-105in filterAnalysis.py, change x,y,l according to what you find out in step 2 while prepare image

  • If the images are in other format, open the filterAnalysis.py in notepad, go to line 139 tif_dir = img_dir+"/*.tif, change .tif to the image file type you have, e.g. .jpg, .png, etc

Set up

  1. Clone repository to your local directory: git clone https://github.com/joanlyq/microplastic-filter-analysis.git
  2. Change directory to inside repo: cd microplastic-filter-analysis/
  3. Create conda environment from yml file: conda env create -f environment.yml
  4. Activate the conda environment: conda activate microplastic

Run

  1. Analyze one image, run python filterAnalysis.py --img_name <the file directory of one single image>
  2. Analyze multiple image, run python filterAnalysis.py --img_dir <the folder directory of all images>

Check the result

The pixel result is saved in the output.csv file in the same folder as the scripts

Each row contains:

  • img_name - file name;
  • ave_int- average blue intensity (not normalized with sample weight);
  • res_cov - residual coverage (full coverage = 1);
  • 0, 1, 2, 3, ... - all values in blue channel (0-255)

To understand the result, please check the publication. Li, J. Y., Nankervis, L., & Dawson, A. L. (2022). Digesting the Indigestible: Microplastic Extraction from Prawn Digestive Tracts. Frontiers in Environmental Chemistry, 3, 903314. Access at: https://doi.org/10.3389/fenvc.2022.903314