Extracting Morphological Changes in Nanocrystals Using in Situ Liquid Cell Microscopy
Difficulties with the Segmentation and Binarization of Images
As we alluded to in our last blog, segmentation and binarization of our images has been a serious obstacle. In order to perform our two-phase spatial statistics, we need binarized images. As previously discussed, simple global thresholding was not a good solution for our data sets. Due to saturation in various regions, groups of distinct nanocrystals were clumped together to form large islands by the global threshold. This is shown in the image below.
We explored several potential thresholding routines to get properly binarized images. The simplest, after global thresholding, were adaptive mean and adaptive gaussian thresholding. These methods, rather than apply a single global thresholding value, calculate local thresholding values based on surrounding pixels in the image. In adaptive mean thresholding the threshold value is the mean of the neighborhood area and in adaptive gaussian thresholding the value is the weighted sum of the neighborhood area where the weights are a gaussian window. Our description of these methods, and the code to implement them, come directly from the OpenCV article on image thresholding (found at this link: http://docs.opencv.org/trunk/d7/d4d/tutorial_py_thresholding.html). The results of using these routines and their comparison to global thresholding is shown below. You can see that these adaptive methods are better than global thresholding, but they still did quite not produce the desired results.
The Big Disk Filter
We sought further help with our segmentation/binarization issues, and Ahmet was a great help to us. Basically, the routine finds “structuring elements” that indicate the region is saturated in signal and subtracts them. This removes those regions we previously talked about, where clusters of distinct particles would come out as large clumps or islands in the simple global threshold. With these “structuring elements” removed, it is now easy to denoise the image and apply a global threshold. Below you can see visually how the big disk filter works, and you can also see the final binarized image. There are still some refinements that need to be done, as some particles have small connecting branches between them, but for the most part the image is well binarized and noise-free. Next we will be able to perform two-point statistics.
For more information on thresholding, see the following resource: threshold.pdf (51 KB)