Mathematica Asked on February 15, 2021
A classic problem in computer vision is computing correspondences between keypoints in two similar images, despite modest variations in size, lightness, orientation, etc., of the images, as illustrated here.
Here are the two images I’d like to process (paintings by Jan van der Heyden):
Notice the differences in the cupolas (small towers), for example.
Mathematica implements this function by
ImageCorrespondingPoints[image1,image2]
but when I apply this function to these two paintings I get no more than five points total on each image. (This is far too few for what I need to study, such as the larger deviation in correspondences for the cupola than for the buildings.) I’ve adjusted MaxFeatures
and other thresholds in ImageCorrespondingPoints
, and even pre-processed each image (with contrast enhancement, etc.), tried different Method
s such as "SURF" and "BRISK", but can never get more than about five such points. This seems to be an (undocumented?) limitation of the function.
Traditional ImageKeypoints
extracts enough points (after adjustment of KeypointStrength
):
HighlightImage[image1, {AbsolutePointSize[8], Green,
ImageKeypoints[image1, KeypointStrength -> 0.002]}]
However, ImageCorrespondingPoints
does not work on these highlighted images.
I’ve even tried ImageDisplacements
, but without success.
I suppose I could get two lists of 2D locations of (many) keypoints for each image and write some RANSAC-like optimization, but I have a sense there is some easier way… some option or pre-processing I’m missing in this task.
Incidentally, my ultimate goal is to display these paintings side-by-side, with "good" correspondences linked by green lines, and "bad" correspondences (large deviation, as in the cupolas) in red lines. This last step is not part of my question, as I’m confident I can write that code, once the core correspondence problem is solved.
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP