In the simplest case, I believe the OP is looking for a similarity measure that compares point-wise the images in question. If both these grayscale images are thresholded, one can measure the amount of overlap they have. For instance, if X and Y are binary label images then,
DSC(X, Y) = 2|X ∩ Y| / |X| + |Y|
This is called the Dice similarity coefficient and it tells you the degree of overlap. A DSC value of 1 indicates perfect overlap while 0 indicates no overlap at all. There are also other similarity measures like the Tannimoto coefficient.
In the comments, the OP says "whether they look the same or not, from a human eye". If I'm interpreting this correctly, the OP is talking about segmentation. This is a rather large field and there are plenty of ways to segment an image. I recommend starting with scikit-image's edge-based segmentation. Once both images are segmented, the above DSC can give you a similarity measure.
Edit: I forgot to explain the formula. ∩ are the regions in the images where both equal 1 and |.| is a summation.