Steve on Image Processing with MATLAB

Image processing concepts, algorithms, and MATLAB

Color Thresholder App in R2014a

I had way too much fun this morning playing with the new Color Thresholder app (new in R2014a) in the Image Processing Toolbox, so I wanted to show it to you.

color-thresholder-initial

I've shown that picture of M&Ms in this blog before. A few years ago I used that image in a post about color segmentation in a*-b* space. Here's the original image:

You can find the Color Thresholder app by clicking on the APPS tab.

apps-tab

ipcv-apps

I found the Color Thresholder to be a fun way to explore the a* coordinate (green to red/magenta) and the b* coordinate (blue to yellow) in the L*a*b* color space. Some of the M&Ms have colors that can be segmented completely just using one of the color coordinates. Below I have segmented the green ones just by selecting one of the peaks in the a* coordinate.

color-thresholder-green

But sometimes it is necessary to use both the a* and b* coordinates. The screen shot below demonstrates that one of the a* peaks corresponds to two different candy colors, orange and red.

color-thresholder-red-orange

To get either orange or red, you have to narrow down the range in the b* coordinate.

color-thresholder-orange

color-thresholder-red-a

It turns out the color of my desk is different from all of the candy colors.

color-thresholder-desk

You can use the opacity slider to let some of the rest of the image show through.

color-thresholder-opacity

If you want to automate the segmentation process, the Color Thresholder app can help you get started by generating some code for you.

color-thresholder-export-function

color-thresholder-generated-code

This post has been kind of hard to write! There was a lot of fooling around with screen captures, and it's hard to do the app justice in this format. I just might have to learn how to do blog videos like Doug does.

If you have ideas for other interactive image processing apps you'd like to see, post a comment here and I'll make sure the team sees it.

|
  • print

Comments

To leave a comment, please click here to sign in to your MathWorks Account or create a new one.