Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //3. show the resulting 2D Gaussian probability distribution
- float[][] gaussian_distribution = new float[256][256];
- for (double[] hxhy_value : hxhy_values)
- {
- int[] rg = new int[2];
- rg[0] = (int) ((hxhy_value[0]+1)*127);
- rg[1] = (int) ((hxhy_value[1]+1)*127);
- double distance = md.distance(hxhy_value);
- double prob = Math.exp(-(Math.pow(distance, 2)/2.0));
- gaussian_distribution[rg[0]][rg[1]] += (float) prob;
- }
- FloatProcessor fp_Gaussian_Prob = new FloatProcessor(gaussian_distribution);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement