views:

510

answers:

5

Hi all.

I want to create an application using which I can measure waist of any human being.

But I am not able to identify how to perform such kind of thing. I may can use ACCELEROMETER but how to use it or else if any kind of another logic any one can suggest me so that I can create such kind of application.

thanks in advance

+4  A: 

Use a tape measure?

I really think you're using the wrong tool for the job.

Mr. Matt
I know tape measure but with iPhone even we should be able to identify... so if any suggestion???
iPhone Fun
+9  A: 

The height of an iPhone is 115.2mm.

Place the iPhone horizontally on the waist in question so that one end lines up with the belly button.

Mark the position of the other end with your finger and then move the iphone horizontally so that the first end now lines up with your finger.

Repeat until the iPhone has circumnavigated the waist.

Multiply the number of times you moved the iPhone by 115.2mm to get the waist measurement with a possible maximum error of 115.2mm

Edit in response to comment:

-(double) measureWaist: (Waist*) waistToBeMeasured iPhone: (IPhone*) iPhone
{
    Finger* finger = [[Finger alloc] init];
    [iphone setOrientation: horizontal];
    [iphone placeOnWaist: waistToBeMeasured alignBottomWith: [waistToBeMeasured bellyButton]];
    size_t i = 0;
    while (![iPhone overlaps: [waistToBeMeasured bellyButton]])
    {
        i++;
        [finger placeOnWaist: waistToBeMeasured alignLeftEdgeWith: [iPhone topEdge]];
        [iphone placeOnWaist: waistToBeMeasured alignBottomWith: [finger leftEdge]];
    }
    [finger release];
    return [iPhone height] * i;
}
JeremyP
Can you give me a technical answer with some sample code???
iPhone Fun
@JeremyP: the actual error may vary by as much as the width of the user's finger, a systematic contribution from the way the measurement is performed and a random contribution from parallax effects in addition to the coarseness of the measuring device.
Graham Lee
@Graham Lee - depending on how the measurer interprets the instructions, a finger width's worth of error could be induced on every iteration of moving the iphone. in that case, a better estimate of waist size would be (115.2 + fingerWidth) * i
Peter Recore
@Peter: I would suggest that there are only (i - 1) contributions to the error from the finger factor.
Graham Lee
@Graham Lee: Yes, you'd have to use the edge of the finger as the reference point to reduce the error. I also toyed with the idea of displaying a scale in mm on the iPhone display to reduce the error more. However, a tape measure might be better.
JeremyP
I've amended the code to take into account the width of the finger.
JeremyP
Perhaps rolling the iPhone along the person’s circumference would give more accurate results with a similar amount of effort?
Rob Rix
@Rob Rix: in theory yes, in practice we'd need to coat the edge of the iPhone with some high friction substance to stop it slipping as you turned it over.
JeremyP
This answer is now number 4 in the list of 381 answers I have answered sorted by rep earned.
JeremyP
+13  A: 

Preconditions: user has iPhone.

  1. Find a tailor.
  2. Say to the tailor: "I will give you this shiny iPhone in return for you telling me my waist measurement."
  3. Receive waist measurement.
  4. Give iPhone to tailor.

Postconditions: user has waist measurement. Tailor has iPhone.

Alternative scenarios:

1a. User cannot find a tailor. 3a. Tailor already has enough iPhones. 4a. User mugs tailor and re-acquires iPhone.

Request for code:

NSError *error = nil;
Tailor *myTailor = [[StaffLocator defaultLocator] locateStaff: GLStaffKindTailor error: &error];
if (!myTailor) {
  //handle error
}
BOOL acceptsOffer = [myTailor makeOffer: [UIDevice currentDevice] forService: @selector(measureWaist:) error: &error];
if (!acceptsOffer) {
  // handle rejection
}
CGFloat waistSize = [myTailor measureWaist: self];
myTailor.iPhone = [UIDevice currentDevice];
return waistSize;
Graham Lee
if you don't have answer then don't post such rubbish. please.
iPhone Fun
I do have an answer. Apparently, it isn't the answer you wanted.
Graham Lee
fine but do you have technical answer in mode of OBJECTIVE C language???
iPhone Fun
+7  A: 

Since humour clearly isn't doing the job, here is another answer:

Using the three-axis accelerometer and gyroscopes on the iPhone 4 you can in theory describe the path in space that the iPhone moves, and then integrate that path to find its length. If the user stands still while moving the iPhone around his/her waist then the waist circumference could be measured. Note that I write 'in theory', because the implementation of such navigation is complicated. Estimate a few weeks to do it, rather than the 5-10 minutes most people are willing to part with to post a reply on Stack Overflow.

If you are determined to go ahead with it, here are a few tips: a. require that the user end up with the iPhone in the same place. Should be obvious of course, but this also gives you a bound on the path that the iPhone took. b. noise from the sensors will be a problem, since you are integrating the response once (for the gyros) or twice (for the accelerometers). I have no idea how the iPhone performs. Point (a) above will alleviate the problem but not get rid of it completely.

Aderstedt
+1 for being serious
willcodejavaforfood
Since measurements are usually given in 1" increments and the gyroscope is not at one end of the device, the device's angle itself matters a whole lot. Since the gyro could move likely an inch or so depending on the tilt of the phone, the margin for error exceeds the literal comfort zone of pants. Mission: impossible.
Joshua Nozzi
In other news, do we really need a "logic" tag? It seems to be heavily abused by illogical posters and good developer topics imply logic ...
Joshua Nozzi
@Joshua Nozzi: Combining the gyro with a level might alleviate this concern, at the cost of either needing another human to read it, or having an annoying audible level.
Rob Rix
You might be right. Perhaps a digital level you can plug into the data port.
Joshua Nozzi
Yanks for your only SERIOUS answer. thank you very much.
iPhone Fun
You really think this is a serious response?
JeremyP
It also occurs to me the tailor may not want to hold the phone to their face after measuring clients' waists. Then again, they might ...
Joshua Nozzi
I must admit I'm surprised that a serious answer earns yanks. Usually one has to pay for that (or talk someone into it). iPhone Fun indeed.
Joshua Nozzi
+8  A: 

You can do this using the camera.

Ensure that the human waist is next to some object of known length, such as a tape measure laid out straight, and that they are both equidistant from the camera lens.

Take a photo of the two together and use image recognition to pick out both objects. Determine how many pixels long the tape measure is, and how many the waist is. Use the following code:

CGFloat diameterOfWaistInCentimetres = lengthOfTapeMeasureInCentimetres / lengthOfTapeMeasureInPixels * diameterOfWaistInPixels;
CGFloat approxCircumferenceOfWaistInCentimetres = 2 * PI * diameterOfWaistInCentimetres;

Good luck with your app! Don't forget to mention in the App Store description that a tape measure will also be required.

hatfinch