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
0 answers

Improve PySpark implementation for finding connected components in a graph

I am currently working on the implementation of this paper describing Map Reduce Algorithm to fing connected component : https://www.cse.unr.edu/~hkardes/pdfs/ccf.pdf As a beginner in Big Data world , I started the implementation of CCF-Iterate (w.…
2JA
  • 1
  • 1
0
votes
1 answer

Is this connected-component labeling algorithm new?

A long time ago, I made a game in which a sort of connected-component labeling is required to implement AI part. I used the two-pass algorithm unknowingly at that time. Recently, I got to know that I can make them faster using bit-scan based method…
Antel
  • 26
  • 1
  • 9
0
votes
1 answer

Connected Components with even size kernel

I researched a bit about connected components. In either MATLAB or the OpenCV library, they always indicate that the kernel can be a 3x3 array and it can be either 4-connected or 8-connected. I did quite a bit of research but am unable to find an…
Masmm
  • 27
  • 8
0
votes
1 answer

How can I traverse a 3D matrix on a thread per row basis in Numba?

I’m trying to implement a runs-based kernel using Numba CUDA where I need to traverse the elements of a 3D matrix on a row per thread basis i.e. each thread is assigned a row that iterates over all elements of that row. For example, if, for…
0
votes
1 answer

Strange behaviour of connectedComponenentsWithStat in opencv 4.4.0

This is my 8bit image: I try to load it with cv2 and split into connected components: seg_r=cv2.imread("seg_r.png",0) seg_num_labels, seg_labels, seg_stats, seg_centroids = cv2.connectedComponentsWithStats(seg_r) print(seg_stats) I get only 2 huge…
Stepan Yakovenko
  • 8,670
  • 28
  • 113
  • 206
0
votes
1 answer

Calculate complexity of algorithm and approach

I have written a code to count group of 1's in binary matrix. Referring to my question link here code def groupcheck(i, j, matrix): if 0 <= i < len(matrix) and 0 <= j < len(matrix): if matrix[i][j]: matrix[i][j] = 0 …
0
votes
0 answers

Connected Components Equivalency List

I'm writing some Python code to label different objects in my image using connected components. I'm using 4-neighbors to evaluate each pixel's label in my logic and I'm not using unionfind to create an equevalency list of the labels because I had…
0
votes
1 answer

Python 3: Geopandas dataframe with CRS coordinates into Graph to find connected components and other graph properties?

I have a geopandas dataframe where I find to use some graph theory package to find graph properties such as connected components. How can I find graph-theoretic properties conveniently with Geopandas dataframe?
hhh
  • 50,788
  • 62
  • 179
  • 282
0
votes
0 answers

Given edges and vertices, how to separate these into connected components?

Given edges and vertices, how can we separate these into connected components? A situation where I need this is when I extract vertices and edges by using an algorithm like the marching cube method, I want to then obtain multiple connected…
orematasaburo
  • 1,207
  • 10
  • 20
0
votes
1 answer

Output of connected-components different between ImageMagick and Wand?

I'm trying to get the coordinates of colors using connected-components feature under Windows10 with Python 3.8.5 ImageMagick 7.0.10-29 Q8 x64 2020-09-05 Using ImageMagick with the following command I get the coordinates correctly. >convert…
Ger Cas
  • 2,188
  • 2
  • 18
  • 45
0
votes
1 answer

Weakly connected graph: If there is a single vertex without incoming edges, is it a mother vertex?

This is just a request for confirmation. I have a simple directed graph which is weakly connected. When I require there to be exactly one vertex with indegree == 0, does it follow that all nodes in the graph are reachable from that vertex? I think…
Sebastian
  • 315
  • 2
  • 12
0
votes
1 answer

Forest vertex removal while tracking number of components

Given a tree with n vertices and q queries (n, q <= 5*10^5), where for each query you either remove or bring back a previously deleted vertex, output the number of connected components after each operation. I've tried using this formula components =…
rambo42
  • 1
  • 3
0
votes
2 answers

How do I solve the following graph problem

The problem statement Given a directed graph of N nodes where each node is pointing to any one of the N nodes (can possibly point to itself). Ishu, the coder, is bored and he has discovered a problem out of it to keep himself busy. Problem is as…
95_96
  • 341
  • 2
  • 12
0
votes
1 answer

How to get connectedComponents with stats in android java using opencv and how to use these stats to get left point, right pint, centroid, area etc

Please clear I am new at android and java I have used this code but don't know what is meaning of these four variables Imgproc.connectedComponentsWithStats(binarized, labeled, rectComponents, centComponents); Mat tmp = new…
0
votes
1 answer

Python: Counting number of connected components in adj. list representation of graph

I am trying to write a program in python that counts the number of cycles (connected components) in a graph represented using an adjacency list (dict() in python). Basically, I run DFS and check if an adjacent vertex is already visited and that…