1

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:

Original image

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:

enter image description here

array([[[297., 403.]],

       [[297., 359.]],

       [[268., 359.]],

       [[268., 396.]],

       [[308.,  65.]]], dtype=float32)

Any ideas on how to make these points the same?

1 Answer 1

0

As a rule, feature points are unstable and will vary in position and score when you modify the image.

Take more feature points (say 100, 5 is by far too small) and associate them in pairs by the nearest neighbor rule. This will given more insight in what you can achieve with this detector.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.