I am working with morphological operations.I have a Matlab script which generate the Structuring Element using the function strel('form', w) where the form of the SE can be a line, disk, diamond, square, or other form (I need at least the function to be able to generate this 4 forms), and w is the size of the matrix (w*w) generated for the SE.
I want to know if there is a function in Python similar to Matlab "strel()" that automatically generates the Structuring Element.
I´ve search for this kind of function, but none of them seems to be able to generate all this 4 different Structuring Element forms.
Create Structuring Element for Image Morphology Python
2k Views Asked by Charles At
2
There are 2 best solutions below
0
Cris Luengo
On
Scikit-image has functions to generate square, rectangle, disk, diamond, octagon and star shaped structuring elements.
They are separate functions, not a single function, but I can’t imagine that being a problem.
Call them as skimage.morphology.<shape>(). See this documentation page for demos.
Horizontal and vertical lines are rectangle shapes, of course. Lines at arbitrary angles can be generated by drawing a line in an all-zeros array with skimage.draw.line.
Related Questions in PYTHON-3.X
- SQLAlchemy 2 Can't add additional column when specifying __table__
- Writes to child subprocess.Popen.stdin don't work from within process group?
- Platform Generation for a Sky Hop clone
- What's the best way to breakup a large test in pytest
- chess endgame engine in Python doesn't work perfectly
- Function to create matrix of zeros and ones, with a certain density of ones
- how to create a polars dataframe giving the colum-names from a list
- Django socketio process
- How to decode audio stream using tornado websocket?
- Getting website metadata (Excel VBA/Python)
- How to get text and other elements to display over the Video in Tkinter?
- Tkinter App - My Toplevel window is not appearing. App is stuck in mainloop
- Can I use local resources for mp4 playback?
- How to pass the value of a function of one class to a function of another with the @property decorator
- Python ModuleNotFoundError for command line tools built with setup.py
Related Questions in MATLAB
- Convert Cell Array of Symbolic Functions to Double Array of Symbolic Functions MATLAB
- How to restrict vpasolve() to only integer solutions (MATLAB)
- "Error in port widths or dimensions" while producting 27
- matlab has encountered an internal problem needs to close
- Minimize the sum of squared errors between the experimental and predicted data in order to estimate two optimum parameters by using matlab
- Solve equation with Crank Nicolson and Newton iterative method in Matlab
- Why options are not available in EEGLAB menu options?
- ash: ./MathWorksProductInstaller: not found, but file exists
- iterative GA optimization algorithm
- Create Symbolic Function from Double Vector MATLAB
- Fixing FEA Model loading with correct units and stress results
- loading variables from a python script in matlab
- Why cannot I set font of `xlabel` in `plotmf` in MATLAB?
- How would I go about filtering non-standardly formatted serial data which contains some junk binary between data entries?
- Cyclic Voltammetry Simmulation in MATLAB, I am running into issues with my data points returning as NaN values, i am a beginner, any help wanted
Related Questions in OPENCV
- Creating multiple instances of a class with different initializing values in Flutter
- OpenCV2 on CLion
- How to Draw Chinese Characters on a Picture with OpenCV
- Python cv2 imwrite() - RGB or BGR
- AttributeError: 'Sequential' object has no attribute 'predict_classes'. Did you mean: 'predict_step'?
- Search for an icon on an image OpenCV
- DJI Tello won't follow me
- Python OpenCV and PyGame threading issue
- Need help in Converting Python script (Uses Yolo's pose estimation) to an android app
- Line Segmentation Problem: How to detect lines and draw bounding box of that line on handwritten letters Using CV2
- Configure CmakeLists.txt to avoid manually copying dlls
- How to detect the exact boundary of a Sudoku using OpenCV when there are multiple external boundaries?
- AttributeError: 'Results' object has no attribute 'box'. can anyone explain this?
- How to generate a VPI warpmap for polynomial distortion correction?
- I am trying to make a project of object detection on kaggle notebook using yolo. and i am facing this error. here is my code and my error
Related Questions in COMPUTER-VISION
- Trained ML model with the camera module is not giving predictions
- what's the difference between "nn layout" and "nt layout"
- Sketch Guided Text to Image Generation
- Pneumonia detection, using transfer learning
- Search for an icon on an image OpenCV
- DJI Tello won't follow me
- Unable to open shape_predictor_68_face_landmarks.dat
- Line Segmentation Problem: How to detect lines and draw bounding box of that line on handwritten letters Using CV2
- The regression problem of predicting multiple outputs from two-dimensional inputs
- Detecting Circles and Ellipses from Point Arrays in Java
- How to generate a VPI warpmap for polynomial distortion correction?
- Finding 3D camera location from a known 2D symbol inside an image
- How can I overlay a 3D model onto a detected object in real-time using computer vision?
- CUDA driver initialization failed, you might not have a CUDA gpu
- Implementing Image Processing for Dimension Measurement in Arduino-based Packaging System
Related Questions in IMAGE-MORPHOLOGY
- Image Erosion manual implementation not doing anything Python
- Create Structuring Element for Image Morphology Python
- Separate correctly blobs in image
- Emphasize handwritten text with OpenCV
- Why does imclose(Image,nhood) in MATLAB give different output than MORP.CLOSE in OpenCV?
- How to get rid of points in bw image and be left with connected pixels?
- Hough circles on edges
- Morphological closing by reconstructions in Matlab
- Scanned text blurred characters correction
- How to deduce automatically if the processed image needs morphological post-processing or not?
- Keep the biggest cluster/object inside an array
- How to calculate the internal area(count of pixels) inside a ring-like shape?
- How to smoothen blood vessels image and fill unwanted holes
- Set Dilation Kernel Anchor
- Iterations in morphology closing
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Unfortunately the built-in OpenCV functions appear to provide only rectangles, ellipses, and crosses. So you'll have to write your own function for that.
Alternatively, you could try to get MATLAB and python to interact with each other, and call MATLAB from python. Refer to the various documentation pages on how to do this: