Questions tagged [image-morphology]

Used exclusively to perform operations related to the shape or morphology of objects present in an image.

Reference LINK

112 questions
8
votes
2 answers

Gap Filling Contours / Lines

I have the following image: and I would like to fill in its contours (i.e. I would like to gap fill the lines in this image). I have tried a morphological closing, but using a rectangular kernel of size 3x3 with 10 iterations does not fill in the…
Alex Rothberg
  • 10,243
  • 13
  • 60
  • 120
7
votes
2 answers

Tensorflow dilation behave differently than morphological dilation

As the following piece of code shows, the tensorflow tf.nn.dilation2D function doesn't behave as a conventional dilation operator. import tensorflow as tf tf.InteractiveSession() A = [[0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 1, 0, 0], [0, 0,…
6
votes
2 answers

How to find shortest path in skeletonized maze image?

I am working on maze solving using Image Processing and NetworkX search algroithm and need to find the shortest connecting path between two points on those lines. #Solving Maze Using Image Processing and NetWorkx search #Open Maze image …
5
votes
2 answers

Using dilation in only one direction?

This is my first post on Stack Overflow, so I am sorry if the problem isn't defined enough. I am currently working on extracting table data from images and I need a way to dilate the text only in a vertical direction so that I can get clear column…
5
votes
1 answer

How to convert Imagemagick's -morphology Erode Square into Rmagick?

I have tried the following code in imagemagick: convert input.jpg -morphology Erode Square output.jpg I need to convert it into RMagick so that I can use in rails application
Sanjay Sharma
  • 232
  • 1
  • 9
4
votes
1 answer

Custom erosion results do not match with OpenCV erosion

I am new to image processing and was trying to write a custom method for erosion and dilation. I then tried to compare my results with OpenCV erosion and dilation function results. I give one padding of zeros to the input image and then overlap the…
Anil Yadav
  • 149
  • 1
  • 14
4
votes
2 answers

Remove small blood vessels in retina image with morphological erosion using OpenCV

I have fundus images which are pictures of the retina which have already been processed, and I am looking at and am trying to remove the smaller blood vessels using morphological erosion. This appears to have worked in several of the papers I have…
4
votes
1 answer

Getting an error when trying to do morphological transformations on an 8x8 matrix

I'm trying to do morphological transformations on a 8x8 matrix with a 3x3 cross shaped kernel. I want to apply erosion, dilation,open and close to A1 with the kernel B1. I am getting an error and I don't know how to solve the issue. This is what I…
4
votes
1 answer

matlab function strel("line") to python

I want to use the matlab function strel("line") in python I found python library like scikit-learn / opencv / mahotas but I can't find it. finally, I found similar function in pymorph 'seline' but it is different to matlab strel…
4
votes
1 answer

Why is the structuring element asymmetric in OpenCV?

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,…
MWB
  • 11,740
  • 6
  • 46
  • 91
4
votes
2 answers

Segment out those objects that have holes in it

I have a binary image, that has circles and squares in it. imA = imread('blocks1.png'); A = im2bw(imA); figure,imshow(A);title('Input Image - Blocks'); imBinInv = ~A; figure(2); imshow(imBinInv); title('Inverted Binarized Original Image'); Some…
sana
  • 410
  • 2
  • 6
  • 24
4
votes
0 answers

OpenCV - Is there an implementation of marker based reconstruction in opencv

Morphological reconstruction by opening is similar to basic morphological opening. However in contrast, reconstruction uses two images: a “seed” image, which specifies the values that spread, and a “mask” image. Skimage has an implementation of it…
Bharath S
  • 161
  • 1
  • 12
3
votes
1 answer

OpenCV counting overlapping circles using morphological operation

Here is an image which I am trying to get the circles from. I used difference of gray image and erosion to get the boundaries. img_path= 'input_data/coins.jpg' img =…
addcolor
  • 455
  • 8
  • 23
3
votes
1 answer

How to remove white pixels that are not connected to a loop in binary image

I have a image which I have binarized and the problem is I want to remove the white spots in that image which are not connected in a loop i.e. small white dots. The reason is I want to take a measurement of that section like shown here. I have tried…
3
votes
1 answer

Failed to remove noise by remove_small_objects

I have a white and black image. I try to remove noise by remove_small_objects. import cv2 as cv import numpy as np from skimage import morphology img = np.array([[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, …
Hongbo Miao
  • 45,290
  • 60
  • 174
  • 267
1
2 3 4 5 6 7 8