How to Find the image gradient and magnitude and angle. I’ve attached the 2pic, tells which is foreground & background needs to remove for process. thanks

3 views (last 30 days)
%Aim is how to find multiple gradient and magnitude and angle for edge detection of this image?

Answers (2)

Image Analyst
Image Analyst on 10 Jan 2022
There are imgradient() and imgradientxy() functions. I'm not sure what is background in the images. There are lots of regions that could potentially be considered as "background". Can you identify the background and foreground regions? And what is your algorithm for detecting defects? Some sort of morphological subtraction based on using imbinarize on the original image? Note that you cannot use imbinarize on two images if the images are different because it may choose different thresholds for each image so you can't compare them. You'll have to use graythresh() on one of the images and then use that threshold gray level to apply to both images.

Image Analyst
Image Analyst on 10 Jan 2022
Try calling imregister() to align your perfect, reference image, and your test image. Then subtract and threshold.
Image Analyst
Image Analyst on 11 Jan 2022
If they're not proprietary/secret, attach your two images - your reference/perfect image, and your moved one with the defects.

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by