Detect Contours and calculate area

Hello, I am looking for help. I would like to have a code that can detects the white material contours between the metal plates and be able to calculate the are of each side. Thank you.

hello, we won’t write your prog,
please take a nice tour through the tutorials,
try to come up with your own solution, then maybe we can help you improve it !

besides that, try to improve your imaging, – use ambient light, not frontal, avoid those nasty shadows, make sure your ‘white material’ is actually white, etc…