- Converting the Image to HSV color space uning 'rgb2hsv' function.
- Define color specific thresholdsholds.
- Color thresholding can be done using ‘Color Thresholder app’ or writing custom code.
- Apply the mask to the original image and extract specific colors using 'bsxfun' function.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1807624/image.png)