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
0
votes
1 answer

how to add random edges to an empty graph untill it becomes connected in python?

I am new to programming and I'm trying to solve a problem which says "find the average number of edges that an empty undirected graph needs to become connected"....it also asks to "keep track of isolated components along the way"... I can add nodes…
0
votes
1 answer

Connected components of bipartite graphs

I'd like to extract connected components (as bipartite graphs) from a bipartite graph using networkx. But connected components in networkx is not for bipartite graphs but general undirected and direct graphs. Is there an example of bipartite graphs?…
user1424739
  • 11,937
  • 17
  • 63
  • 152
0
votes
1 answer

How to access individual labels in OpenCV connected component labelling

I am trying to access individual labels of objects with OpenCV's connectedComponentsWithStats in Python. However, when I run the connectedComponentsWithStats function, a labelled array is returned that has each object with different pixel values.…
Sibh
  • 393
  • 1
  • 4
  • 12
0
votes
0 answers

Best way to store very large weighted DAG on disk?

Assume a graph database to store a very large DAG on disk: There are many things that are not required, which allows for optimization. Basically what I do need is: store a directed acyclic graph, no cycles, at most one edge per node-pair fromID,…
0
votes
0 answers

How OpenCV's ConnectedComponent algorithm works?

I would like to find the connected components in this image (the image is binary) and for that, I use the OpenCV cv2.connectedComponentsWithStats algorithm. But the latter gives me a result that I can't understand. Indeed, if we take the first…
0
votes
1 answer

How to iterate over each connected components label pixels

What's the best way to iterate over labels pixel positions in relation to source image retrieved from opencv connectedComponentsWithStats? Currently, I'm putting the labels over a blank background the size of the source image like the following and…
Yasin
  • 609
  • 1
  • 10
  • 22
0
votes
0 answers

Get stats from specific Connected Components with opencv (with mask)

I am new to opencv (python) and don't really know how to tackle my new task. I have several images (binarized) and masks for them. I want to extract all Connected Components of the original image that are masked and see their shapes (bounding…
0
votes
0 answers

NetworkXNotImplemented error : connected_components() method - undirected graph

As I understand connected_components() method in NetworkX should generate components in a given undirected graph (There are strongly_connected_components() and weakly_connected_components() for directed graph). I have generated an undirected graph G…
0
votes
1 answer

How to circle moving objects using opencv?

I have a video file and I need to circle all moving objects in a certain frame I select. My idea of a solution to this problem is: Circle all moving objects (white areas) on a video on which was applied motion detector and circle the same areas on…
0
votes
0 answers

recursion error while using dfs to find connected components in image

As the title says I am trying to find all connected components in an image using recursive dfs. I based the principle algorithm on the pseudo over here https://www.programiz.com/dsa/graph-dfs What I get is a recursion depth exceedet error. Usually I…
user10695266
0
votes
1 answer

Assigning indexes to each node in a connected component of a networkx graph

I have some connected components displayed. One of the components have five nodes in which the middle node is a common node. How can I obtain the index of each node in that component so that I can merge the other nodes along with a conjunction. for…
0
votes
1 answer

Getting the connected components in networkx in the order of which edges are added

Each sentence in doc2 is displayed as a graph. Now the edges were added in the form s-o-v from the respective subject_list, object_list and verb_list. I have tried to display the connected components. But the order in which it displays the sentence…
0
votes
2 answers

Removing nodes (but keeping graph strongly connected)

I'm trying to simulate a rectangular room with some rectilinear obstacles within it, and so I formulated the problem as a graph in networkx. To add the obstacles, I'll choose nodes and then delete all of its edges. In order to prevent the graph from…
0
votes
1 answer

How to find connected components in graph efficiently without adjacency matrix?

I want to find the connected components in an undirected graph. However, I don't have an adjacency matrix. Instead I have a set of vertices as well as a function telling me whether two vertices are adjacent. What is the most efficient way to find…
0
votes
0 answers

Connected components to detect text

I'am reading an article about Layout analysis, and I want to code the method using Python and Opencv. In the article, he used a the connected components method to detect letters of text after that doing some traitements to extract all layouts. …
zaki
  • 127
  • 1
  • 10