Questions tagged [connected-components]

Connected-component labeling (alternatively connected-component analysis, blob extraction, region labeling, blob discovery, or region extra

Connected-component labeling (alternatively connected-component analysis, blob extraction, region labeling, blob discovery, or region extra

327 questions
-1
votes
1 answer

how to interpret 8 neighbors as follows

i would like to find 8 neighbors. In an algorithm it is written as int Nx[] = {-1, 1, 0, 0, -1, -1, 1, 1}; //8-neighbors int Ny[] = {0, 0, -1, 1, 1, -1, 1, -1}; how 3*3 matrix is interpreted like this?
-2
votes
1 answer

How can you get the first and last pixels of a connected component in OpenCV with Python, to decouple unsevered blobs?

I'm having the following problem: I cannot find a way to access each connected component's first and last pixels which were obtained through cv2.connectedComponentsWithStats function of OpenCV in Python. What i want to do, is to suppress the…
-2
votes
1 answer

Why this code is not working on hackerrank?

I am solving a problem on Hackerrank,you can read that on-https://www.hackerrank.com/challenges/journey-to-the-moon Output is not correct using following code I have implemented all required data structures in that code and tried to create array of…
-2
votes
2 answers

connected components in undirected graphs in c++

I wanted to count the number of groups in an undirected graphs in c++.I was trying using bfs but was unsuccessful.I have been given a range of numbers [L,R] (or think of these ranges as number of vertices) and i have to find the number of groups.How…
wen_dy
  • 31
  • 7
-3
votes
1 answer

Implement custom algorithm In Graphframes

I want to run the biconnected graph algorithm on a graph using GraphFrames running with pyspark 2.3. I reaized that all the built in algorithms are running under the hood with GraphX in Scala. Does there is a way that I can implement the biconnected…
-4
votes
1 answer

How to get connected components label in a binary image?

I've a binary image where removing green dot gets me separate line segments. I've tried using label_components() function from Julia but it labels only verticall joined pixels as one label. I'm using using…
h612
  • 544
  • 2
  • 11
-4
votes
1 answer

Connected Component Labeling Algorithm in Python

My work requires applying Local Binary Operator on Images. For that I have already converted the images in Gray then implemented a Connected Components analysis on the image also. Here is the Code: Adding Libraries import numpy as np import…
Akash Chakraborty
  • 57
  • 1
  • 2
  • 13
-4
votes
2 answers

Connected Components in OpenCV 3.4.0 with with cuda (on GPU)

I wrote a program with c++ and OpenCV 3.4.0 for connected components labeling. I used ConnectedComponentsWithStats function for it. Now I can write same program with OpenCV + cuda. But OpenCV does not have ConnectedComponentsWithStats function for…
abdorreza
  • 29
  • 1
  • 4
-4
votes
1 answer

How to obtain the number of curves in a binary image using Python/OpenCV?

I'm working in a method of counting the number of hats in a image. I slice a binary image vertically in multiple sections, around 250/200, and then the counting of white elements (hats edges) is done in each os these sections. In the end of this…
-4
votes
1 answer

How to lable connected components in a 2D array?

I have 2d array like this: 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 0 0 1 1 1 0 1 1 0 1 0 0 0 0 0 1 0 0 1 0 1 0 1 1 0 1 0 1 1 1 0 1 0 0 1 0 1 0 0 0 0 1 0 1 0 1 0 1 0 0 1 0 1 0 0 0 0 1 0 1 0 1 0 1 0 0 1 1 1 0 0 0 0 1 0 1 0 1 0 1 0 0 0 0 0 1 1 1 0 1 0 1 1 1 0…
-5
votes
1 answer

how to find largest connected component from a black and white image

i m trying to extract 360*360 pixels part from an retinal image with center as optical disk's center pixel. please help me with how to find the connected components from an image and then extract the larger one only in matlab.
sanjana
  • 1
  • 2
-7
votes
1 answer

How to do recursion on multidimensional array

I am new to recursion, I am having trouble getting the right solution on how to do recursion on 2D array. Can you please give me idea how to fix my logic on my code. I think my algorithm is not correct. I tried to create recursion on some point but…
1 2 3
21
22