Reputation: 9
I am trying to use SIFT (with OpenCV and Python) to detect key features in two images: image 1 and image 2.
I need to highlight the key features on both images to then further stitch them together.
Looking at the image visually, there are multiple key features that are visibly repeated between the two images (e.g. all the wires in the back).
However, due to the extremely bright line down the center of the images and the similar contrast between the background and the features, I have not been able to correctly detect the key features and then stitch the images together.
sift = cv.SIFT_create()
(kps, features) = sift.detectAndCompute(img, None)
imgKPS = cv.drawKeypoints(img, kps, None)
sift = cv.SIFT_create(contrastThreshold = 0.02)
equalizeHist
function in OpenCV to darken the wires in the background of the image, however the output was horrible: third try. The noise was so bad on this image that the SIFT algorithm was unable to differentiate useful data from the noise.
The change to the code was:tempImage = cv.equalizeHist(tempImage)
when inputting the images.
4) I have now tried using a GaussianBlur
and threshold
, skimage's exposure
function and threshold_yen
. Each continues to make my problem worse and I am stuck.
If anyone could help, I would really appreciate it.
TLDR: Need to highlight find key points in the background of my low-contrast image.
Code for the SIFT Algorithm:
def SIFTAlgo(img):
# SIFT Algorithm
sift = cv.SIFT_create()
(kps, features) = sift.detectAndCompute(img, None)
imgKPS = cv.drawKeypoints(img, kps, None)
print("Number of keypoints", len(kps))
printF(imgKPS)
return (kps, features, imgKPS)
My ideal output image would have points in these locations (obviously, to a much greater extent):
Upvotes: 0
Views: 152