Measuring waist of a person using Microsoft Kinect [closed] - c#

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.

Related

How to match physical slab dimensions to image dimensions [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 months ago.
This post was edited and submitted for review 8 months ago and failed to reopen the post:
Needs details or clarity Add details and clarify the problem by editing this post.
Improve this question
I need to know how to approach about dimension conversion. I have some physical slabs. I'm taking pictures of them and getting few coordinates of special pixels.
Up to here everything seem well.
The point is I want to convert actual dimensions to pixel.
So the best approach seems to calculate known physical dimension to pixel such as this formula.
var referenceWidth = (double)physicalWidth /image.width ;
What should be the best approach?
The easiest way is to use a reference object of known size, like a coin, or a ruler. Measure how many pixels the reference object is will allow you to compute the size of a pixel
pixelsize = actual size of reference / size of reference in pixels
If you then mark the corners of the slabs you can compute the actual size of them:
actual size of slab = pixelSize * size of slab in pixels
This assumes the photo is fairly "flat", i.e. the objects are more or less two dimensional, the photo is taken perpendicular to the objects, the lens is fairly narrow, the lens distortion is fairly small etc.
Another alternative would be if you know the focal length and camera to object distance, that would allow you to compute the pixel size without a reference.
The dpi value would be more or less useless to compute the actual object size, it refers to the print size of the photo, not the size of any objects in the photo. Unless you have used a flat bed scanner, then the dpi might actually correspond to real life sizes.
A possible alternative would be to use existing photometry software to convert a random set of photos to 3D.

Algorithms to brute force function inputs to find maximum [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 4 years ago.
Improve this question
There is a function like CalculateProfit(decimal a, decimal b, float c, TimeSpan d) and its each input parameter has minimum, maximum and initial value settings.
Its output is smooth but not linear, it has multiple peaks and falls. I want to bruteforce its inputs and find maximum possible output. How to optimize this without trying each possible combination? Maybe some kind of binary search?
I think the algorithm should use big delta steps at start to find most peaks and then tweak values with small deltas. Also I would bruteforce one input until I find best output and then try same for next inputs, then go back to tweaking first input and so on.
Update: the function is a complex algorithm which performs analysis on markets historical data (so it's not just a formula). Therefore I'm asking for some bruteforce optimizations, not trying to "solve" it as an equation.
You need to read about partial differential equations solvers of 2 or more variables.
https://math.oregonstate.edu/home/programs/undergrad/CalculusQuestStudyGuides/vcalc/min_max/min_max.html
Then you need to study one algorithm that can solve it, Finite Volume and Spectral Method are the most commonly used in Simulation.
https://en.wikipedia.org/wiki/Numerical_partial_differential_equations
You can find easy solutions on Matlab if you are interested in just solving your problem. C# can call Matlab functions with some setup.

How to calculate a logical curve along a set of values? [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 4 years ago.
Improve this question
I am trying to take a float value, with an arbitrary minimum and maximum possible value, and convert it to a linear scale, for representation on a bar-shaped indicator. The problem is, I can't just lerp it between the minimum and maximum, because the maximum value will always be dramatically higher than the minimum value. I have an array of arbitrary values that I want to act as intermediate points between the minimum and maximum. Now I just need to calculate a logical best-fit curve through the points. Each value is always larger than the last, and the rate of increase in value accelerates the further up you go, but there is no simple formula for calculating this rate of acceleration.
Here's an example of the values that may be used:
6.0, 13.5, 30.0, 75.0, 375.0
where 6 is the minimum, and 375 is the maximum.
If x is exactly one of these values, I would want a simple value depending on how many total values there are, I.E 0, 0.25, 0.5, 0.75, 1. The issue is calculating the in-between values.
How would I go about achieving this? I apologize if a question like this has already been asked, as it feels like a common problem, although I didn't know what to search for. If this has already been answered before, please just point me in the right direction.
Reposting my comment as an answer, as requested.
If a curve might be y(x) = k^(ax+b), take logs of both sides and you have a linear relation. As pointed out tho, this is maths not programming.
I’d pick k = 2, e or 10 for easier implementation; a & b you work out from data.

C# How to get location of smaller image inside larger image [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 new to image processing so please forgive my ignorance. I am trying the come up with a way to get the co-ordinates of a sub image inside that of its containing larger image. For example, I have a large image of the New York skyline and one of just the Empire State building. The large picture is always a high quality image, the small picture is supplied by a user's camera scanning a printed version of the larger image. There the quality, scale and colors of the smaller image will not perfectly match those of the larger one. What I am looking to get is X, Y coordinates from the top-left corner of the larger image, to the top-left corner of the smaller image as if the smaller image were a puzzle piece placed in the larger image. It would be much appreciated of someone could point me in the right direction. Thanks
EDIT
Thank you for the feedback. I have come to realize that this might be a very difficult task. I ended taking a different approach. I will be embedding recognizable shapes in the aforementioned print media and use OpenCvSharp (a free C# wrapper around OpenCV) to detect them.
to just give you one possible direction,
What you are might be facing here is a flavor of pattern detection and/or recognition (aka machine learning), I suggest look for ready implementations as this is complicated task.
The basic idea is that you train or teach an algorithm about features of objects of interest and then the algorithm searches in images for anything that matches your pattern.
There are many algorithms out there; each will have its own approach. As a starting point, You could try to look at what well known image processing framework can offer - OpenCV:
http://docs.opencv.org/2.4/doc/tutorials/features2d/feature_homography/feature_homography.html
EDIT :
OpenCV wrapper for .NET C# as OpenCV is C++ project
http://www.emgu.com/wiki/index.php/Main_Page
This is a very hard and big project to do.
BTW, You can get color of a pixel by GetPixel() method.
Following code creates a 200x200 image and get color of 100,100 coordination of that image.
Bitmap bmp = new Bitmap(200,200);
Color c = bmp.GetPixel(100,100);
For surfing image efficiently you must use pointer(unsafe code) not GetPixel() method unless the performance will be too slow.

Redrawing only some objects? [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 years ago.
Improve this question
I'm trying to learn C#, so I decided to make a little game where monsters siege you. The problem is, I draw the character by using fillrectangle, and same for the trees. The trees start with a random location. They're supposed to stay at the location they first appeared in, but with the code I'm using, they get a new location every timer tick. Help?
If you want the trees to stay at the same location, you should tell your program to do so.
Because you provided no code samples we can just assume you redraw your scene every timer-tick and you might draw the just random-generated locations of the trees at every tick event, a solution like suggested by others is to generate the random coordinates of the trees before you draw the first time, save those coordinates and then when you redraw in your tick event those coordinates will still be the same coordinates as before so your trees will hold position. You might want to read an article about 2d development that explains the 3 basic steps of:
Setting everything up/Initialize objects etc and draw the first
scene.
Calculate what changes between 2 shown pictures are made.
Draw
the new picture/Update.

Categories