You'll need a sewing machine and some embroidery floss in a color that complements your pants, and regular sewing thread (in whatever color you want, this will show somewhat). You can also use appliques (pre-made or by using stitch witchery). I used some pre-made iron-on flowers I happened to have.
In this Instructable I will assume familiarity with sewing, and with your own sewing machine. If something is confusing, please comment and I'll do my best to clarify.
Step 1: Open the pants seam
Many commercial pants are stitched with two seams: a chain stitch to hold the pieces together, and an overlock stitch to keep the edges from fraying. The overlock has to be cut pretty much all along its length, but a chain stitch, if you mess with it a little, will come completely unraveled from one end to the other. It's hard to tell which end to pull, though, so try each leg.
Open out your pants and draw a pattern on the inside, remembering that it will be mirror-image on the outside of the leg.