Detecting difference

I have a project involving batteries(18650 battery). I have a pack of them in a certain order(some are upwards showing the plus side and some are showing minus). What i’m trying to do is take a pack that is in the correct form as a reference image (an image that is the correct order of the batteries) and capture another image(for example with the same pack with one battery that is incorrect in all the pack). How can i detect a difference between the referenced image to the current image and highlight the problematic battery.(to make it more clear, the batteries have a certain “look” on the positive side than the negative.

As of right now the only way to do that is based on some property like color or line edges. Etc. See the find_line_swgments() method for an easy to use function to help give you properties to classify with.