Best way to check objects on images?

I know this is very specific, but I would like to hear some ideas on detecting objects on a captured image while the object I desire to detect is on another picture.

The methods I tried:

  1. Template Matching - Seems the most promising, but didn’t detect for me, probably because of the light sources.

  2. Haar Cascades - Out-of-date, cannot use in OpenCV 4.

  3. Hough Lines - Didn’t seem effective in my task.

  4. Arithmetic Operations on Images - Couldn’t check how close the subtracted image was to the original. I still need to find a way.

I am interested to hear what you have to say. Thank you for reading through this.

Here are the links for all method’s documentation (I can only put 2 links into a post, that’s why I put it into a Pastebin).

Hi,
What is your object?

Let’s say a blue piece of paper. The photo taken is just above it and the paper is lying on the surface of the table.

Now, let’s say that I want to detect multiple of these blue papers, but there could be some that are slightly torn, and I don’t want it to detect torn papers.

a photo of the situation would be helpful

Here is the template image:

And here is the camera capture of the image I want the object to be detected on:

I might add, I played around with the brightness options, and it didn’t help.

the picture of the scene is nearly useless for machine vision. insufficient illumination.

that “blue rectangle” is a solar cell including the usual wire strips.

what precise information do you want out of the “detection”?

I know what it is, I wanted to give an example of what it might look like hence the phrase “let’s say.” I just want the program to output if the cell is broken or not, like is there a crack, or is it in multiple pieces.