base64encodeddatawithnolinebreaks
It's important that your base-64 encoded data does not have line breaks in it. The Java class I found for base-64 encoding did this and I had to modify it not to. The data will load in successfully on the iPhone but at the line breaks it seems the data starts to not match. Sometimes it was off by 4 bits, but I couldn't find a consistent pattern to offset it the other way. Using data elements is much more efficient than storing coordinates in their own elements. Property lists may not load at all if they get too big. I'm guessing due to memory restrictions.
Once you have the points loaded on the iPhone platform, you can compare these points to the points of other shapes (perhaps ones drawn by finger?) by measuring the distance (I'm sure you remember this formula from math class?). It's up to you to determine the threshold necessary for your application. Keep the number of points less than in the thousands so that the phone's processor isn't tolled. If comparing against an inaccurate human-drawn shape, you may want to spiral the shape's points around until you maximize accuracy to give the user the best chance at matching the shape.
0 comments:
Post a Comment