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

Function computeUnary

dependency/densecrf/examples/my_dense_inference.cpp:41–56  ·  view source on GitHub ↗

Simple classifier that is 50% certain that the annotation is correct

Source from the content-addressed store, hash-verified

39
40// Simple classifier that is 50% certain that the annotation is correct
41MatrixXf computeUnary( const VectorXs & lbl, int M ){
42 const float u_energy = -log( 1.0 / M );
43 const float n_energy = -log( (1.0 - GT_PROB) / (M-1) );
44 const float p_energy = -log( GT_PROB );
45 MatrixXf r( M, lbl.rows() );
46 r.fill(u_energy);
47 //printf("%d %d %d \n",im[0],im[1],im[2]);
48 for( int k=0; k<lbl.rows(); k++ ){
49 // Set the energy
50 if (lbl[k]>=0){
51 r.col(k).fill( n_energy );
52 r(lbl[k],k) = p_energy;
53 }
54 }
55 return r;
56}
57
58MatrixXf computeUnary( unsigned char *prob, int W, int H){
59 const float u_energy = -log( 1.0 / 2 );

Callers 1

mainFunction · 0.70

Calls 4

logFunction · 0.50
rowsMethod · 0.45
fillMethod · 0.45
colMethod · 0.45

Tested by

no test coverage detected