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

Function colorize

dependency/densecrf/examples/common.cpp:39–47  ·  view source on GitHub ↗

Produce a color image from a bunch of labels

Source from the content-addressed store, hash-verified

37}
38// Produce a color image from a bunch of labels
39unsigned char * colorize( const VectorXs & labeling, int W, int H ){
40 unsigned char * r = new unsigned char[ W*H*3 ];
41 for( int k=0; k<W*H; k++ ){
42 int c = colors[ labeling[k] ];
43 putColor( r+3*k, c );
44 }
45 //printf("%d %d %d \n",r[0],r[1],r[2]);
46 return r;
47}
48// Read the labeling from a file
49VectorXs getLabeling( const unsigned char * im, int N, int M ){
50 VectorXs res(N);

Callers 3

mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85

Calls 1

putColorFunction · 0.85

Tested by

no test coverage detected