0

i want to match 2 image and detect the similarity. i am trying using color filter concept can any one help me out which method should i follow. i want to detect the color pattern in the image.

import cv2
import numpy as np

img = cv2.imread("img.jpg")
hsv=cv2.cvtColor(img, cv2.COLOR_BGR2HSV)
img1 = cv2.imread("img1.jpg")
img1=cv2.cvtColor(img1, cv2.COLOR_BGR2HSV)

lower_red = np.array([60,60,60])
upper_red=np.array([250,250,250])

mask=cv2.inRange(hsv, lower_red, upper_red)
res = cv2.bitwise_and(img, img1, mask = mask)
#cv2.imshow('frame', img)
#cv2.imshow('mask', mask)
cv2.imshow('img', res)

can anyone suggest me which method can i use.

  • Image similarity is a non-trivial problem. The following fresh scientific paper points to methods and other relevant papers on the topic: https://arxiv.org/abs/2002.04988v1 – Similar pictures Feb 14 '20 at 21:58

1 Answers1

0

Refer this link for pil Link

import Image
import ImageChops

im1 = Image.open("splash.png")
im2 = Image.open("splash2.png")

diff = ImageChops.difference(im2, im1)

also refer these existing questions posted in tensorflow Checking images for similarity with OpenCV
Simple and fast method to compare images for similarity

kumar_ai
  • 143
  • 3