Getting Started with Image Processing with MATLAB - MATLAB
Video Player is loading.
Current Time 0:00
Duration 3:30
Loaded: 4.70%
Stream Type LIVE
Remaining Time 3:30
 
1x
  • Chapters
  • descriptions off, selected
  • en (Main), selected
    Video length is 3:31

    Getting Started with Image Processing with MATLAB

    From the series: “How To” Video Series for Biomedical and Pharmaceutical Applications

    Learn how to prototype image processing tasks with MATLAB® before writing any code.

    Published: 14 Sep 2021

    Hello, everyone. Paul here from MathWorks. Today I'm going to demonstrate how you can get started quickly prototyping image processing tasks in MATLAB before writing any code. In this example, we'll be working with images of thin blood smears, but I encourage you to consider how these techniques might be applied to your own image data set. The blood smears we'll be using were obtained from the Centers for Disease Control's DPDx website. Our goal is to explore options for developing an automated function to detect the presence of a parasite in these blood smears and then quantify the portion of red blood cells in the sample that are infected.

    The image processing toolbox comes with several interactive apps to help you get started with common image processing techniques. To begin, let's first try segmenting the individual red blood cells from the background using the Color Thresholder app. Since the blood cells are purple against a light background, we can use the green intensity values of the image pixels to determine which pixels correspond to cells and which are background.

    Now that we have our cells segmented, we can clean up our cell mask and examine cell properties using the Image Region Analyzer app. This app allows us to quickly fill in region holes and filter out regions based on their properties, such as area, dimensions, or eccentricity.

    Alternatively, since most of the cells in our blood smears are roughly circular, we could instead pursue an algorithm based on finding circles. We can do this using the Image Segmenter app. We can then quickly gauge and specify the expected diameter range of the cells and pixels and indicate that the circles are dark relative to the background.

    As with most MATLAB apps, once we're satisfied, we can then automatically generate a MATLAB function to help automate our parasite detection algorithm. If desired, this code can then be modified to include additional functionality. With the cells isolated, we can then identify parasites within the cells based on their darker pixel intensity in a grayscale version of the image. We can once again use the Image Segmenter app to help us determine the appropriate threshold value.

    However, in order to determine a threshold value that is meaningful across all of our images, we'll first need to account for the varying image quality. One way to handle this variability is to use the imhistmatch function to adjust the histogram of a 2D image to match the histogram of a reference image. Finally, I've combined the code for finding circles, matching image histograms, and the parasite threshold detection logic into a single function.

    We can now quickly examine the performance of this function on the other images using the Image Batch Processing app. Our detection function labels the detected cells with blue circles, the parasites are marked in red, and the infected cells are highlighted in green. It looks like we're off to a good start, and our algorithm has appropriately compensated for the variability in image quality. But as you can see in the documentation examples, there are many other techniques we could try, including edge detection and watershed segmentation.

    If you'd like to learn more, please check out our free Image Processing Onramp at matlabacademy.mathworks.com. This free interactive tutorial will provide you with a practical introduction to image processing in MATLAB in under two hours. Thanks for watching.

    Up Next:

    View full series (10 Videos)

    View more related videos