gaussian

Smoothing Mat of float with mask

牧云@^-^@ 提交于 2019-12-04 14:40:07
Is there a way to apply a Gaussianblur or median smoothing filter to a mat of floating points while supplying a mask of pixels that should be ignored? could you please help me? ty. You can do this by: Zeroing out the regions outside the mask Smooth the image and the mask Divide each pixel in the smoothed image with the value of the smoothed mask The division in step 3 compensates for the black pixels introduced by masking. This works because the smoothed mask is darkened in the same way as the smoothed masked image. Yeah, so i figured it out. I had to define my own gaussian smoothing procedure

Optimal sigma for Gaussian filtering of an image?

流过昼夜 提交于 2019-12-04 11:06:28
问题 When applying a Gaussian blur to an image, typically the sigma is a parameter (examples include Matlab and ImageJ). How does one know what sigma should be? Is there a mathematical way to figure out an optimal sigma? In my case, i have some objects in images that are bright compared to the background, and I need to find them computationally. I am going to apply a Gaussian filter to make the center of these objects even brighter, which hopefully facilitates finding them. How can I determine the

Generating means from a bivariate gaussian distribution

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-04 09:25:49
I am reading Elements of Statistical Learning ESLII and in chapter 2, they have a gaussian mixture data set to illustrate some learning algorithms. To generate this data set, they first generate 10 means from a bivariate gaussian distribution N((1,0)', I). I am not sure what they mean? How can you generate 10 means from a bivariate distribution having mean(1,0)? Each of the means that are generated from the bivariate Gaussian distribution are simply single points sampled in exactly the same way as any other random points that could be generated from the distribution. The fact that they use

Random number within a range based on a normal distribution

你离开我真会死。 提交于 2019-12-04 07:46:22
问题 I want to generate random numbers with a range (n to m, eg 100 to 150), but instead of purely random I want the results to be based on the normal distribution. By this I mean that in general I want the numbers "clustered" around 125. I've found this random number package that seems to have a lot of what I need: http://codeproject.com/KB/recipes/Random.aspx It supports a variety of random generators (include mersiene twister) and can apply the generator to a distribution. But I'm confused, if

iOS Gaussian distribution of random numbers [duplicate]

允我心安 提交于 2019-12-04 07:28:29
This question already has an answer here : Closed 7 years ago . Possible Duplicate: Generating a random Gaussian double in Objective-C/C Is there any way of getting a random number not from a uniform distribution, but from a Gaussian (Normal, Bell Curve) distribution in iOS? All the random number generators I have found are basically uniform and I want to make the numbers cluster around a certain point. Thanks! Just use a uniform distribution generator and apply the Box-Muller Transform : double u1 = (double)arc4random() / UINT32_MAX; // uniform distribution double u2 = (double)arc4random() /

Normal(Gaussian) Distribution Function in C++

故事扮演 提交于 2019-12-04 06:57:58
问题 I need to know a way to have Gaussian Distribution of 50 numbers. I know of the Boost library which generates random numbers. In my case i don't need random, i need the normal distribution of 50 numbers. Any way to have that? thanks. 回答1: I think the OP was asking for a random number generator, in which the random numbers are not uniformly distributed (as is typical e.g. rand() in C) but are Gaussian distributed. This short routine adapted from "Numerical Recipes in C" (Press et al, 1992) may

How to implement the Gaussian mutation operator for a genetic algorithm in Java

99封情书 提交于 2019-12-04 00:25:53
I try to learn and implement a simple genetic algorithm library for my project. At this time, evolution, selection of population is ready, and I'm trying to implement a simple good mutation operator like the Gaussian mutation operator (GMO) for my genetic evolution engine in Java and Scala. I find some information on Gaussian mutation operator (GMO) into the paper A mutation operator based on a Pareto ranking for multi-objective evolutionary algorithms (P.M. Mateo, I. Alberto), page 6 and 7. But I have some problem to find other information on how to implement this Gaussian mutation operator

How to force larger steps on scipy.optimize functions?

血红的双手。 提交于 2019-12-03 20:51:57
问题 I have a function compare_images(k, a, b) that compares two 2d-arrays a and b Inside the funcion, I apply a gaussian_filter with sigma=k to a My idea is to estimate how much I must to smooth image a in order for it to be similar to image b The problem is my function compare_images will only return different values if k variation is over 0.5 , and if I do fmin(compare_images, init_guess, (a, b) it usually get stuck to the init_guess value. I believe the problem is fmin (and minimize ) tends to

Gaussian fit in C#

亡梦爱人 提交于 2019-12-03 17:37:55
In a project I'm working on I need to obtain a Gaussian fit from a set of points - needing mean and variance for some processing, and possibly an error degree (or accuracy level) to let me figure out if the set of points really have a normal distribution. I've found this question but it is limited to 3 points only - whereas I need a fit that can work with any number of points. What I need is similar to the labview Gaussian Peak Fit I have looked at mathdotnet and aforge.net (using both in the same project), but I haven't found anything. Does anybody know any C# or (easily convertible) C/C++ or

Gaussian Blur Over Image - iOS 8

大城市里の小女人 提交于 2019-12-03 17:34:11
I have a moving background image and I want to blur the bottom part of it out. I would do it with just photoshop but since the image moves, it wouldn't work very well. Here is what I mean (look at the bottom of the image) : So basically like the effect the dock has on the iPhone. I'm using iOS 8 but not Swift. I have done a small example based on the photo you have there. My algorithm is as follows: Extract a portion of image from bottom. Apply gaussian filter to it and blur it. Then, create a new image context, draw original image on it. Then, draw the blurred portion of the image to place it