mathematical-morphology

How to morph a path data to another path data in SVG?

假如想象 提交于 2021-02-05 08:21:39
问题 I'm trying to figure out why it wont morph this path data to another path data, I need to make it look like an real animation. This is my SMIL code: <animate xlink:href="#Barra3" repeatCount="indefinite" attributeName="d" dur="5s" values="M52,346L56,346C61.523,346 66,350.477 66,356L42,356C42,350.477 46.477,346 52,346Z; M54,225C60.627,225 66,230.373 66,237L66,356L42,356L42,237C42,230.373 47.373,225 54,225Z;"/> Here is my codepen: https://codepen.io/joannesalfa/pen/mdPBJxq and go line 181. I'm

morphological opening by reconstruction matlab code

不羁的心 提交于 2021-01-28 18:58:40
问题 I should do morphological opening by reconstruction by my own Matlab code not imreconstruct . this is my code but it is not work well: S = input('Enter the structuring element: '); Im = input('Enter the input image: '); marker = imerode(Im,S); mask = Im; Im2 = imdilate(marker,S); Im3 = min(Im2,Im); i=1; while Im3(i+1)~= Im3(i) i=i+1; Im2 = imdilate(Im3(i),S); Im3(i+1) = min(Im2,Im); end imrecon = Im3; has anyone a better code or can edit my code? please help me. Thank you in advance. 回答1: I

Why multiple openings/closing with a same kernel does not have effect?

此生再无相见时 提交于 2020-04-30 07:43:45
问题 I know about closing and opening, but there is still one question to me! According to the "Digital Image Processing, 3rd edition", by Gonzales, The multiple application of opening/closing doesn't have any effect after the first time you apply it! I couldn't figure it out? Can anyone help? 回答1: This is expected behavior since openings and closings are idempotent operations. An operation is idempotent if, whenever it is applied twice to any value, it gives the same result as if it were applied

Why is the structuring element asymmetric in OpenCV?

99封情书 提交于 2020-02-21 05:22:48
问题 Why is the structuring element asymmetric in OpenCV? cv2.getStructuringElement(cv2.MORPH_ELLIPSE, ksize=(4,4)) returns array([[0, 0, 1, 0], [1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]], dtype=uint8) Why isn't it array([[0, 1, 1, 0], [1, 1, 1, 1], [1, 1, 1, 1], [0, 1, 1, 0]], dtype=uint8) instead? Odd-sized structuring elements are also asymmetric with respect to 90-degree rotations: array([[0, 0, 1, 0, 0], [1, 1, 1, 1, 1], [1, 1, 1, 1, 1], [1, 1, 1, 1, 1], [0, 0, 1, 0, 0]], dtype=uint8) What's

Why is the structuring element asymmetric in OpenCV?

£可爱£侵袭症+ 提交于 2020-02-21 05:21:33
问题 Why is the structuring element asymmetric in OpenCV? cv2.getStructuringElement(cv2.MORPH_ELLIPSE, ksize=(4,4)) returns array([[0, 0, 1, 0], [1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]], dtype=uint8) Why isn't it array([[0, 1, 1, 0], [1, 1, 1, 1], [1, 1, 1, 1], [0, 1, 1, 0]], dtype=uint8) instead? Odd-sized structuring elements are also asymmetric with respect to 90-degree rotations: array([[0, 0, 1, 0, 0], [1, 1, 1, 1, 1], [1, 1, 1, 1, 1], [1, 1, 1, 1, 1], [0, 0, 1, 0, 0]], dtype=uint8) What's

Erose/Dilate image with zeros structuring element

99封情书 提交于 2019-12-24 00:45:59
问题 If I have a structuring element looks like this one (the origin is at the center of SE): 0 0 0 0 0 0 0 0 0 If I perform the erosion/dilation on an binary image, the result turns out all 0 or 1. Can someone please explain this one to me? (Check by matlab) Thank you very much. 回答1: You have a perfectly valid SE. It is a flat square, commonly accepted and available in every image processing library. Now, it is important to understand the difference and similarity between flat and non-flat

Morphology operations using Matlab [closed]

a 夏天 提交于 2019-12-14 04:24:35
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . Here is the problem: A camera takes an image I of a penny, a dime, and a quarter lying on a white background and the coins do not overlap. Suppose that thresholding creates a binary image B successfully with 1 for the coin regions and 0 for the background. You are given the known diameters the coins d_p , d_d ,

Morphology operations using Matlab [closed]

故事扮演 提交于 2019-12-14 04:16:03
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . Here is the problem: A camera takes an image I of a penny, a dime, and a quarter lying on a white background and the coins do not overlap. Suppose that thresholding creates a binary image B successfully with 1 for the coin regions and 0 for the background. You are given the known diameters the coins d_p , d_d ,

Numpy filter to smooth out zero-regions

僤鯓⒐⒋嵵緔 提交于 2019-12-12 14:29:37
问题 I have a 2D numpy array of ints 0 and greater, where the values represent region labels. For example, array([[9, 9, 9, 0, 0, 0, 0, 1, 1, 1], [9, 9, 9, 9, 0, 7, 1, 1, 1, 1], [9, 9, 9, 9, 0, 2, 2, 1, 1, 1], [9, 9, 9, 8, 0, 2, 2, 1, 1, 1], [9, 9, 9, 8, 0, 2, 2, 2, 1, 1], [4, 4, 4, 4, 0, 2, 2, 2, 1, 1], [4, 6, 6, 4, 0, 0, 0, 0, 0, 0], [4, 6, 6, 4, 0, 0, 0, 0, 0, 0], [4, 4, 4, 4, 5, 5, 5, 5, 5, 5], [4, 4, 4, 4, 5, 5, 5, 5, 5, 5]]) I would like the indices equal to 0 (i.e. zero-regions) to take on

Morphological operation to improve the shape of segmented image

空扰寡人 提交于 2019-12-11 12:56:10
问题 I have an ellipse in the image.After segmentation i got a broken ellipse as shown .which morphological operation is used to get the perfect ellipse Actual input file is output obtained is i tried imopen ,but i will lose lower ellipse like structure .how to close the upper ellipse like structure without losing lower ones Mask i created is i want to segment the ellipse like structure.but some of these structures are connected with rectangular like bodies.how to separate it. erode will eliminate