You could use the "Image Acquisition Toolbox" to acquire the pictures: https://www.mathworks.com/products/imaq/features.html#app-for-image-and-video-acquisition
Then you could use the "Image processing Toolbox" to identify the individual colors and demarcate them for different functionalities: https://www.mathworks.com/help/images/index.html
Then you could use the Statistics and Machine Learning Toolbox" to classify them into different categories as required. This should automatically identify your appropriate PH values. https://www.mathworks.com/help/stats/classification.html
or you could send an email using the "sendmail" function: https://www.mathworks.com/help/matlab/ref/sendmail.html
The above documentation links contain examples with code as well as explanations which may prove helpful. Hope this helps!