crackrec(crackrec) | R Documentation |
Finds cracks (darker areas) in an image.
crackrec(x, threshold=NULL, alpha=1, beta=1, size=0)
x |
matrix representation of an image, which can be obtained by the function rbmp . |
threshold |
threshold value. The default value is threshold=min (140,mean (x)*4/5). |
alpha |
parameter for weight function with values in [0, 1]. This parameter is optional. The default value is alpha=1. |
beta |
parameter for weight function with values in [0, 1]. This parameter is optional. The default value is beta=1. |
size |
only crackclusters greater than size=n will be considered. The default value is size=0, which means that every crackcluster is considered. |
Here each pixel of the image with grey scale value less than the threshold value are treated as vertices of a graph. If vertice u is a direct neighbor of vertice v they are connected by an undirected edge with weight dist*(1 + alpha*(greyValue_u+greyValue_v) + beta*abs(greyValue_u-greyValue_v)). Where dist is equal to 1 if u and v coincide in one component and sqrt(2) else, alpha and beta as described above and greyValue_u means the grey scale value of u. Respectively for vertice v.
a list containing:
cracks |
matrix containing crack length, crack size, start and endpoint of cracks |
crackpaths |
list of crack paths |
crackclusters |
list of connected components (maximal connected subgraphs) |
Arne Mueller, Alexander Stepper stepper@mathematik.uni-kassel.de
rbmp
, threshold.msi
, shadow.remove
, medianfilter
, crackplot
## Not run: x<-rbmp("image.bmp") crackrec(x, threshold=123, alpha=0, beta=0) ## End(Not run)