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[] rg_value : rg_values)
- {
- int[] rg = new int[2];
- rg[0] = (int) (rg_value[0]*255);
- rg[1] = (int) (rg_value[1]*255);
- double distance = md.distance(rg_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);
- //fp_Gaussian_Prob.setMinAndMax(0.0, 100);
- new ImagePlus("Gaussian probability distribution", fp_Gaussian_Prob).show();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement