I'm trying to find the same feature points within an image, before and after the print-scan process. To do this, I used cv2.goodFeaturesToTrack
method:
import numpy as np
import matplotlib.pyplot as plt
from PIL import Image
from skimage import color, transform
import cv2
# Read image as Numpy array
image = np.array(Image.open('images/stairway512.jpg'))
# Blur image
imageBlurred = cv2.blur(image, (10, 10))
# Find 5 feature points in cropped & blurred image
points = cv2.goodFeaturesToTrack(imageBlurred, 5, 0.01, 10)
The points I get are these:
array([[[ 62., 186.]],
[[298., 398.]],
[[ 47., 185.]],
[[298., 68.]],
[[195., 135.]]], dtype=float32)
I used blur because I assumed it would minimize the impact of the print-scan process (because I can then blur the scanned image the same way), but I end up with different feature points for the scanned image. However, when I use the same code for the scanned image, I get these points:
array([[[297., 403.]],
[[297., 359.]],
[[268., 359.]],
[[268., 396.]],
[[308., 65.]]], dtype=float32)
Any ideas on how to make these points the same?
question from:
https://stackoverflow.com/questions/65901717/how-to-find-the-same-feature-points-within-an-image-after-print-scan-process 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…