How to create a normal distribution over a finite set of points knowing max and min value of the...












0












$begingroup$


I need to build a model for camera lens deformation for a project I'm working on right now.



Do do this, I'm trying to get a gaussian distribution of multiplicative coefficients over a finite array, and what I would like to do would be to have the max (1 in my case) and min of these coefficients set, and then "gaussianly" take points between these two for the other cells of the array.



So far I got to distributing the coefficients by setting the "right" mean and deviation values, but this is definitely not the way I'd like this to work.



Also, since it's a camera lens, I then will need to translate this in 2d. My understanding is that if I do this vertically and horizzontally, if I multiply the two values I should get the right 2d-gaussian value, right? Since I'm assuming there should be no correlation between the two.



For reference, I'm leaving here the dummy code (c#) I did just so that I could continue with the rest of the project while having something remotely resembling this kind of distribution (a truncated cone).



private float DeformCameraLens(int index1, int index2, Vector3[,] projectedRaysArray)
{
int max1 = projectedRaysArray.GetLength(0);
int max2 = projectedRaysArray.GetLength(1);

float percentPerIndexPoint1 = (1 - maxQOVPercentDeformation) / (max1 / 2f);
float percentPerIndexPoint2 = (1 - maxQOVPercentDeformation) / (max2 / 2f);

float percent1 = 1 - percentPerIndexPoint1 * Mathf.Abs(index1 - (max1) / 2f);
float percent2 = 1 - percentPerIndexPoint2 * Mathf.Abs(index2 - (max2) / 2f);

return (percent1 + percent2) / 2f;
}









share|cite|improve this question









$endgroup$












  • $begingroup$
    A normal distribution has no minimum or maximum. The result can be any real number.
    $endgroup$
    – Matt Samuel
    Jan 13 at 21:00










  • $begingroup$
    @MattSamuel I am sorry if I was not clear enough throughout the rest of my question. This is quite an obvious observation, but that's the whole point of the question; another way to put it: picture a gaussian bell, I need to intersect it with a horizontal line at a known value (Y axis) and then distribute the included portion of the distribution over a finite amount of uniformly distributed points (X axis). I hope this is clearer.
    $endgroup$
    – Nimwe
    Jan 13 at 22:26


















0












$begingroup$


I need to build a model for camera lens deformation for a project I'm working on right now.



Do do this, I'm trying to get a gaussian distribution of multiplicative coefficients over a finite array, and what I would like to do would be to have the max (1 in my case) and min of these coefficients set, and then "gaussianly" take points between these two for the other cells of the array.



So far I got to distributing the coefficients by setting the "right" mean and deviation values, but this is definitely not the way I'd like this to work.



Also, since it's a camera lens, I then will need to translate this in 2d. My understanding is that if I do this vertically and horizzontally, if I multiply the two values I should get the right 2d-gaussian value, right? Since I'm assuming there should be no correlation between the two.



For reference, I'm leaving here the dummy code (c#) I did just so that I could continue with the rest of the project while having something remotely resembling this kind of distribution (a truncated cone).



private float DeformCameraLens(int index1, int index2, Vector3[,] projectedRaysArray)
{
int max1 = projectedRaysArray.GetLength(0);
int max2 = projectedRaysArray.GetLength(1);

float percentPerIndexPoint1 = (1 - maxQOVPercentDeformation) / (max1 / 2f);
float percentPerIndexPoint2 = (1 - maxQOVPercentDeformation) / (max2 / 2f);

float percent1 = 1 - percentPerIndexPoint1 * Mathf.Abs(index1 - (max1) / 2f);
float percent2 = 1 - percentPerIndexPoint2 * Mathf.Abs(index2 - (max2) / 2f);

return (percent1 + percent2) / 2f;
}









share|cite|improve this question









$endgroup$












  • $begingroup$
    A normal distribution has no minimum or maximum. The result can be any real number.
    $endgroup$
    – Matt Samuel
    Jan 13 at 21:00










  • $begingroup$
    @MattSamuel I am sorry if I was not clear enough throughout the rest of my question. This is quite an obvious observation, but that's the whole point of the question; another way to put it: picture a gaussian bell, I need to intersect it with a horizontal line at a known value (Y axis) and then distribute the included portion of the distribution over a finite amount of uniformly distributed points (X axis). I hope this is clearer.
    $endgroup$
    – Nimwe
    Jan 13 at 22:26
















0












0








0





$begingroup$


I need to build a model for camera lens deformation for a project I'm working on right now.



Do do this, I'm trying to get a gaussian distribution of multiplicative coefficients over a finite array, and what I would like to do would be to have the max (1 in my case) and min of these coefficients set, and then "gaussianly" take points between these two for the other cells of the array.



So far I got to distributing the coefficients by setting the "right" mean and deviation values, but this is definitely not the way I'd like this to work.



Also, since it's a camera lens, I then will need to translate this in 2d. My understanding is that if I do this vertically and horizzontally, if I multiply the two values I should get the right 2d-gaussian value, right? Since I'm assuming there should be no correlation between the two.



For reference, I'm leaving here the dummy code (c#) I did just so that I could continue with the rest of the project while having something remotely resembling this kind of distribution (a truncated cone).



private float DeformCameraLens(int index1, int index2, Vector3[,] projectedRaysArray)
{
int max1 = projectedRaysArray.GetLength(0);
int max2 = projectedRaysArray.GetLength(1);

float percentPerIndexPoint1 = (1 - maxQOVPercentDeformation) / (max1 / 2f);
float percentPerIndexPoint2 = (1 - maxQOVPercentDeformation) / (max2 / 2f);

float percent1 = 1 - percentPerIndexPoint1 * Mathf.Abs(index1 - (max1) / 2f);
float percent2 = 1 - percentPerIndexPoint2 * Mathf.Abs(index2 - (max2) / 2f);

return (percent1 + percent2) / 2f;
}









share|cite|improve this question









$endgroup$




I need to build a model for camera lens deformation for a project I'm working on right now.



Do do this, I'm trying to get a gaussian distribution of multiplicative coefficients over a finite array, and what I would like to do would be to have the max (1 in my case) and min of these coefficients set, and then "gaussianly" take points between these two for the other cells of the array.



So far I got to distributing the coefficients by setting the "right" mean and deviation values, but this is definitely not the way I'd like this to work.



Also, since it's a camera lens, I then will need to translate this in 2d. My understanding is that if I do this vertically and horizzontally, if I multiply the two values I should get the right 2d-gaussian value, right? Since I'm assuming there should be no correlation between the two.



For reference, I'm leaving here the dummy code (c#) I did just so that I could continue with the rest of the project while having something remotely resembling this kind of distribution (a truncated cone).



private float DeformCameraLens(int index1, int index2, Vector3[,] projectedRaysArray)
{
int max1 = projectedRaysArray.GetLength(0);
int max2 = projectedRaysArray.GetLength(1);

float percentPerIndexPoint1 = (1 - maxQOVPercentDeformation) / (max1 / 2f);
float percentPerIndexPoint2 = (1 - maxQOVPercentDeformation) / (max2 / 2f);

float percent1 = 1 - percentPerIndexPoint1 * Mathf.Abs(index1 - (max1) / 2f);
float percent2 = 1 - percentPerIndexPoint2 * Mathf.Abs(index2 - (max2) / 2f);

return (percent1 + percent2) / 2f;
}






algorithms normal-distribution






share|cite|improve this question













share|cite|improve this question











share|cite|improve this question




share|cite|improve this question










asked Jan 13 at 17:07









NimweNimwe

1




1












  • $begingroup$
    A normal distribution has no minimum or maximum. The result can be any real number.
    $endgroup$
    – Matt Samuel
    Jan 13 at 21:00










  • $begingroup$
    @MattSamuel I am sorry if I was not clear enough throughout the rest of my question. This is quite an obvious observation, but that's the whole point of the question; another way to put it: picture a gaussian bell, I need to intersect it with a horizontal line at a known value (Y axis) and then distribute the included portion of the distribution over a finite amount of uniformly distributed points (X axis). I hope this is clearer.
    $endgroup$
    – Nimwe
    Jan 13 at 22:26




















  • $begingroup$
    A normal distribution has no minimum or maximum. The result can be any real number.
    $endgroup$
    – Matt Samuel
    Jan 13 at 21:00










  • $begingroup$
    @MattSamuel I am sorry if I was not clear enough throughout the rest of my question. This is quite an obvious observation, but that's the whole point of the question; another way to put it: picture a gaussian bell, I need to intersect it with a horizontal line at a known value (Y axis) and then distribute the included portion of the distribution over a finite amount of uniformly distributed points (X axis). I hope this is clearer.
    $endgroup$
    – Nimwe
    Jan 13 at 22:26


















$begingroup$
A normal distribution has no minimum or maximum. The result can be any real number.
$endgroup$
– Matt Samuel
Jan 13 at 21:00




$begingroup$
A normal distribution has no minimum or maximum. The result can be any real number.
$endgroup$
– Matt Samuel
Jan 13 at 21:00












$begingroup$
@MattSamuel I am sorry if I was not clear enough throughout the rest of my question. This is quite an obvious observation, but that's the whole point of the question; another way to put it: picture a gaussian bell, I need to intersect it with a horizontal line at a known value (Y axis) and then distribute the included portion of the distribution over a finite amount of uniformly distributed points (X axis). I hope this is clearer.
$endgroup$
– Nimwe
Jan 13 at 22:26






$begingroup$
@MattSamuel I am sorry if I was not clear enough throughout the rest of my question. This is quite an obvious observation, but that's the whole point of the question; another way to put it: picture a gaussian bell, I need to intersect it with a horizontal line at a known value (Y axis) and then distribute the included portion of the distribution over a finite amount of uniformly distributed points (X axis). I hope this is clearer.
$endgroup$
– Nimwe
Jan 13 at 22:26












0






active

oldest

votes











Your Answer





StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
});
});
}, "mathjax-editing");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "69"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3072247%2fhow-to-create-a-normal-distribution-over-a-finite-set-of-points-knowing-max-and%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Mathematics Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


Use MathJax to format equations. MathJax reference.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3072247%2fhow-to-create-a-normal-distribution-over-a-finite-set-of-points-knowing-max-and%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Human spaceflight

Can not write log (Is /dev/pts mounted?) - openpty in Ubuntu-on-Windows?

張江高科駅