MCPcopy Create free account
hub / github.com/HiLab-git/SimpleCRF / getLabeling

Function getLabeling

dependency/densecrf/examples/common.cpp:49–66  ·  view source on GitHub ↗

Read the labeling from a file

Source from the content-addressed store, hash-verified

47}
48// Read the labeling from a file
49VectorXs getLabeling( const unsigned char * im, int N, int M ){
50 VectorXs res(N);
51 //printf("%d %d %d \n",im[0],im[1],im[2]);
52 for( int k=0; k<N; k++ ){
53 // Map the color to a label
54 int c = getColor( im + 3*k );
55 int i;
56 for( i=0;i<nColors && c!=colors[i]; i++ );
57 if (c && i==nColors){
58 if (i<M)
59 colors[nColors++] = c;
60 else
61 c=0;
62 }
63 res[k] = c?i:-1;
64 }
65 return res;
66}

Callers 2

mainFunction · 0.85
mainFunction · 0.85

Calls 1

getColorFunction · 0.85

Tested by

no test coverage detected