You may want to look at scipy.ndimageand skimage as those two python libraries will make your life easier dealing with such simple image comparison.
To give you a short view of what you can do with both libraries.
>>> from scipy.ndimage import find_objects,label
>>> import scipy.misc
>>> img=scipy.misc.imread('filename.jpg')
>>> labeled,number=label(img) # (label) returns the lebeled objects while
# (number) returns the numer ofthe labeled signs
>>> signs=find_objects(labeled) #this will extract the signs in your image
#once you got that,you can simply determine
# if two images have the same sign using sum simple math-work.
But to use the above code you need to make your background black so the label method can work.If you don't want to bother yourself inverting you background to black then you should use the alternative library skimage
>>> import skimage.morphology.label
>>> labeled=skimage.morphology.label(img,8,255) #255 for the white background
#in the gray-scale mode
#after you label the signs you can use the wonderful method
#`skimag.measure.regionprops` as this method will surely
# help you decide which two signs are the same.