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

Function computeUnary

densecrf_python/densecrf_core.cpp:5–19  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3
4
5MatrixXf computeUnary( const float *prob, int H, int W, int C){
6 MatrixXf r(C, H*W );
7 for(int k=0; k<H*W; k++ )
8 {
9 for(int c = 0; c < C; c++)
10 {
11 // Set the energy
12 float p = prob[k*C + c];
13 if(p<0.01)p=0.01;
14 if(p>0.99)p=0.99;
15 r(c,k) = -log(p);
16 }
17 }
18 return r;
19}
20
21VectorXs dense_crf_inference(const unsigned char * img, const float * prob, int H, int W, int C, CRFParam param)
22{

Callers 1

dense_crf_inferenceFunction · 0.70

Calls 1

logFunction · 0.50

Tested by

no test coverage detected