I have a picture displaying certain remarkable features (high intensity peaks). Is there a function that allows me to automatically draw a (Region Of Interests) ROI around the features and crop the initial image according to this ROI ?

The initial image

This is the test image

the ROI

This is the ROI to be automatically detected more or less

The final image after cropping

This is the final picture

Any idea ? Thank you !


1 Answer 1

img = Import["https://i.stack.imgur.com/1xt1Q.jpg"];
lsImgKeyPoints = ImageKeypoints[img];

HighlightImage[img, BoundingRegion[lsImgKeyPoints]]

ImageTrim[img, BoundingRegion[lsImgKeyPoints]]

enter image description here

  • $\begingroup$ Perfect, thank you! $\endgroup$
    – DarkBulle
    Dec 25, 2020 at 15:44
  • $\begingroup$ @yfs Welcome, good luck! $\endgroup$ Dec 25, 2020 at 16:04

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.