How to analyze-particles as beginner?

117 Views Asked by At

I am totally new in image analysis and have tried alot with ImageJ or QuPath but unfortunately I can’t find a proper way into it. Here is an image example I would like to quantify: enter image description here

Has anyone a recommendation which software I should use or how I can quantify those little “dots” also finding out their position?

I tried it with ImageJ, but the image quality is so bad that it does not allow thresholding…

With thresholding it seems impossible to quantify just the “little dots”…

2

There are 2 best solutions below

2
Bilal On BEST ANSWER

result

you can solve it in simple way using OpenCV, or you can go further with more sophisticated approach like this one.

import cv2
import numpy as np

img = cv2.imread('img.png')

mask = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
th = 35

mask[mask<th] = 0
mask[mask>0] = 255
mask = np.stack([mask, mask, mask], axis=2)

result = np.hstack((img, mask))

cv2.namedWindow("peaks", cv2.WINDOW_NORMAL)
cv2.imshow("peaks", result)
cv2.waitKey(0)
cv2.destroyAllWindows()
0
Ricardo Guerreiro On

I find cv2 complicated and slow. I would do something like this:

from osgeo import gdal


thresh = 100 
raster = gdal.Open(r'image.jpg')
# Extract raster band (each band is a primary colour)
img = raster.GetRasterBand(1).ReadAsArray(x_start,y_start,x_end,y_end) # reading the image on a specific window, keep empty for whole image.

binary_img = img > thresh

Gdal is a great package, but has many dependencies and is a bit harder to install, especially on windows.