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

2 次查看(过去 30 天)
%Aim is how to find multiple gradient and magnitude and angle for edge detection of this image?

回答(2 个)

Image Analyst
Image Analyst 2022-1-10
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 2022-1-10
Try calling imregister() to align your perfect, reference image, and your test image. Then subtract and threshold.
  3 个评论
Image Analyst
Image Analyst 2022-1-11
No, I've been too busy with my real job. How about you? I'm sure you've tried my suggestions by now, so what do you have?
Image Analyst
Image Analyst 2022-1-11
If they're not proprietary/secret, attach your two images - your reference/perfect image, and your moved one with the defects.

请先登录,再进行评论。

产品


版本

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by