Denoising a chart (array of points) [closed] - c#

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I wanted to ask what do you think would be the best way to denoise an array of coordinate points.
I've got something like on the bottom drawing and need to convert it into what's on the top drawing.
Thanks :)

Median filter
A typical way of doing signal noise removal is a median filter.
If you have a noisy signal f(x), you can get a denoised signal g(x) by the following:
g(x) = medianz in R(x)(f(z))
where R(x) = [x-w/2, x+w/2] and w is some window width.
Example
Wikipedia has a concrete example.
Here's an example of denoising using a median filter. The first image is the source, the second image is the noisy version, the third image is the denoised version, and the fourth image is the difference between the source and the denoised versions. Notice that most of the error is near boundaries, whereas error in regions without sudden jumps is very low.
For a broader look at the topic, look at Noise reduction.

Related

Measuring waist of a person using Microsoft Kinect [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I am trying to create an application which is able to accurately measure the body parameters of a person like height, shoulder width and waist.
Currently I have been able to determine the height and the shoulder width of a person using skeletal tracking.
Can anybody help me out regarding how to measure the waist of a person using a Kinect!
I am coding in C# in Visual Studio.
Thanks a lot in advance!
It is hard to give you the exact code, right now, but the recipe:
First you need to understand what it entails. Every person has different proportions. Someone has a wide waist, but fit (athletic), someone has a wide waist, but has also big belly (fat figure), another has a wasp waist. Such variations are many and many...
So, you have to shoot waist in time during rotation around its axis. Then the measured width values convert to a model. After that you will read circumference of the waist plan (like from a blueprint).
EDIT:
Detailed:
If a person turns around (you know it, because the waist witdh values changes...front-left-back-rigth-front and many samples between each part of rotation) gives you the measures in time for the pattern.
Split whole time of rotation to number of samples. Each sample will determine the proportional angle of the turn. (8 samples per rotation means one sample is 45° [360°/8=45°]). Now imagine the circle. Split it into 8 circle chords. Each chord have length of the value measured during the rotation.
If the sample count is good enough, now you can reckon the circumference of the polygon. If the count of samples is too low, you can interpolate (or use another solution) the "missing" samples. The more samples you have, the more accurate result you have.

big array array of array of ints - out of memory [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Closed 8 years ago.
Improve this question
I'm lookng for all partitions of a set. For set that contains 12 number it's ok, but for 13 I'm getting out of memory exception.
I'm sure of my algorithm. It gives me good result and good number of subsets. For 1, 2, 3... 12.. and then i try to get a 13 and there's a problem.
That's how many is them: WOLPHRAM STRILING
Is there any way to increase memory? Or at least write a method that will gives me with keyword out dynamicly alocated number of parameters?
I'm using the code from the second post:
Code of partitioning
If I assume correctly what you are trying to do:
Are trying to allocate rougly 630 MB on the LOH! If you are running a 32 bit application you have no chance that whis will work - as .net can use in total up to somewhat 1.4 GB!
On a 64 bit process you should get further: .Net Why can't I get more than 11GB of allocated memory in a x64 process?
Hope that makes things a little clearer!
EDIT
What you are dealing with is called "Curse of Dimensionality"
http://en.wikipedia.org/wiki/Curse_of_dimensionality

how to use StreamReader in C# to read only entries over a specific length to a list? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
when using StreamReader in C# to load a txt file into a list, i assume that using a simple "If" the string's length is over a particular length, it will add it to the list. can anyone provide C# code for this? this IS homework, but it's NOT a C# class. the instructor would gladly provide this if i asked this specifically. thx.
the txt file is a dictionary of ~280,000 words, one per line. very simple move to turn into a list, but i'm wondering about getting words at least 2 characters long.
Just use LINQ to give you a subset.
List<string> lines = File.ReadLines(filename)
.Where(l => l.Length > specifiedWordLength)
.ToList();

how to convert or display emf image in c#? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
this is a part of the documentation for a device I'm working on.
any idea how to interpret this to an image or bitmap or anything usable?
this definition below is xml definitions
3.2.13. IMAGE
properties: content complex
children: IMAGE_DATA
used by: complexType Cbc_Result
attributes: Name Type Use Default Fixed Annotation
ImageType Type_Image required
DataSize xs:long required
This node gathers information on an images files calculated by the software(Image_Data represents entire content of an emf file representing an image)
sample data :
< IMAGE DataSize="6676" ImageType="3">< IMAGE_DATA>AQAAAGwAAAAAAAAAAAAAAMcAAABjAAAAA
AAAAAAAAABNEgAANQwAACBFTUYAAAEAFBoAAI0AAAAF
AAAAAAAAAAAAAAAAAAAAVgUAAAADAABAAQAA8AAAAAAAAAAAAAAAAAAAAADiBACAqQMAEQAAAAwA
AAAIAAAAEgAAAAwAAAACAAAAFAAAAAwAAAANAAAACQAAABAAAADIMgAAjBwAAAkAAAAQAAAAyDIA
AIwcAAALAAAAEAAAAMgAAABkAAAASwAAAEAAAAAwAAAABQAAACAAAAABAAAAAQAAABAAAAAAAAAA
AAAAADB1AAAwdQAAAA< /IMAGE_DATA>< /IMAGE>
Looks like Base64 encoded (with stripped == signes at the end) content of file in EMF format - http://en.wikipedia.org/wiki/Windows_Metafile.
Make sure to add needed number of = at the end (http://en.wikipedia.org/wiki/Base64 for details) to successfully use Conver.FromBase64 function to get byte array.
I don't know if regular rendering methods support EMF... But Check Drawing namespace and Image class in particular.

Where can I find an unsharp mask for C#? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
I have been trying to find a code snippet to do an unsharp mask in C# but cant find one that works or is complete. I found a PHP version but I would like to find one in C# before I go through all the hard work converting this from PHP.
I am just a beginner. Can anyone point me in the right direction?
The AForge.NET Framework includes many image processing filters and support plugging your own. You can see it in action in their own Image Processing Lab application.
UPDATE: AForge.NET has a convolution-based sharpen filter (see convolution filters), but there's no mention of an unsharp mask filter per se. Then again, you can use the Gaussian blur filter and subtract the result from the original image, which is basically what the unsharp mask filter does. Or maybe the basic sharpen is enough for your needs.
UPDATE: Looked further, and AForge.NET does have a Gaussian sharpen which seems to be an implemenation of an unsharp mask filter, and you can control some parameters.
Would you care to use FFTs? Transform, remove or accentuate high freqs to taste, invert the transform, recombine with the original if desired? Hardly any licensing issues there, as FFT libraries abound.
Alternately, you can make up masks by hand, varying size and constants as you like, then convolve them with your image pixels (nested 'for' loops ...).
Here's a 3x3x1 mask as a text file with its dimensions given before the values:
//3x3x1
// x size
3
// y size
3
//z size
1
//z = 0
2 3 2
3 5 3
2 3 2
//end
This can be extended to 3 dimensions (hence the z size being given).
The latest version of the open source C# Image Library has an unsharp mask filter (as well as gaussian blur, brightness/contrast etc) and is very easy to use.
You'll find a tutorial how to apply an unsharp mask here.
See if this blog entry helps you in the right direction:
http://anand-vinay.blogspot.com/2008/01/unsharp-mask-in-cnet.html
Edit: Okay that blog entry did not work, sorry for the bad link.
I did find a complete application that you can download with source which has the code that I think you are looking for.
http://www.ctyeung.com/Csharp/index.html
Christian Graus's Image Processing for Dummies with C# part 2 contains source code, and an explanation of how you can do unsharpen (assuming you mean smoothing). The whole series is an excellent introduction to image processing with GDI (in C#) and requires no external libraries.

Categories