Defects detection

I am doing defects identification in python. My sample image is given below. Size of the object will not vary. Only orientation will be varied. How to identify damages in the sample?

sample without defect:

sample with defect:

Another thing is that, I have to identify the type of defect. If there is any scratches have to differentiate it. How to classify the defect?