Advertisement
Guest User

Untitled

a guest
Apr 26th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. //3. show the resulting 2D Gaussian probability distribution
  2. float[][] gaussian_distribution = new float[256][256];
  3. for (double[] hxhy_value : hxhy_values)
  4. {
  5. int[] rg = new int[2];
  6. rg[0] = (int) ((hxhy_value[0]+1)*127);
  7. rg[1] = (int) ((hxhy_value[1]+1)*127);
  8. double distance = md.distance(hxhy_value);
  9. double prob = Math.exp(-(Math.pow(distance, 2)/2.0));
  10. gaussian_distribution[rg[0]][rg[1]] += (float) prob;
  11. }
  12.  
  13. FloatProcessor fp_Gaussian_Prob = new FloatProcessor(gaussian_distribution);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement