Azzera filtri
Azzera filtri

find foreground pixels in each segments in grid

2 visualizzazioni (ultimi 30 giorni)
Raghu Rao
Raghu Rao il 22 Feb 2017
Commentato: Raghu Rao il 22 Feb 2017
i want to find the foreground pixels in each segments in grid after finding the foreground pixel i want to find center of mass in each segments and i want to add nodes based on center of mass.

Risposte (1)

Image Analyst
Image Analyst il 22 Feb 2017
Like we've told you in some of your prior posts, extract each tile/block. Then use find() to get the rows and columns, then take the mean of those numbers to get the centroid.
[y, x] = find(yourImage(row1:row2, col1:col2));
centroidX = mean(x);
centroidY = mean(y);
  1 Commento
Raghu Rao
Raghu Rao il 22 Feb 2017
A word image B is divided into C × R segments of equal size. For each segment sij (i = 1, . . . , C; j = 1, . . . , R) a node is inserted into the resulting graph and labelled by the (x, y)-coordinates of the centre of mass (xm, ym) Formally, we compute (please refer image for formula to compute centre of mass) where n denotes the number of foreground pixel in segment sij, while xw and yw denote the x- and y-coordinates of the foreground pixels in sij. If a segment does not contain any foreground pixel, no centre of mass can be determined and thus no node is created for this segment. i know the values of C and R c =
45
r =
45

Accedi per commentare.

Categorie

Scopri di più su Convert Image Type in Help Center e File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by