title: How to sort my paws?
body: <p>In <a href="https://stackoverflow.com/questions/4087919/how-can-i-improve-my-paw-detection/4092160#4092160">my previous question I got an excellent answer</a> that helped me detect where a paw hit a pressure plate, but now I'm struggling to link these results to their corresponding paws:</p>
  
  <p><img src="https://i.stack.imgur.com/1KbIz.png" alt="alt text"></p>
  
  <p>I manually annotated the paws (RF=right front, RH= right hind, LF=left front, LH=left hind).</p>
  
  <p>As you can see there's clearly a repeating pattern and it comes back in almost every measurement. <a href="https://docs.google.com/viewer?a=v&amp;pid=explorer&amp;chrome=true&amp;srcid=0B1W3cjBV_DpNYjNhYjFjYzctZjJjNi00ODVkLWExMjctYmQ5YWJhOWU3ZDg0&amp;hl=en&amp;authkey=CO6_lbIE" rel="noreferrer">Here's a link to a presentation of 6 trials that were manually annotated.</a></p>
  
  <p>My initial thought was to use heuristics to do the sorting, like:</p>
  
  <ul>
  <li>There's a ~60-40% ratio in weight bearing between the front and hind paws;</li>
  <li>The hind paws are generally smaller in surface;</li>
  <li>The paws are (often) spatially divided in left and right.</li>
  </ul>
  
  <p>However, I’m a bit skeptical about my heuristics, as they would fail on me as soon as I encounter a variation I hadn’t thought off. They also won’t be able to cope with measurements from lame dogs, whom probably have rules of their own. </p>
  
  <p>Furthermore, the annotation suggested by Joe sometimes get's messed up and doesn't take into account what the paw actually looks like.</p>
  
  <p>Based on the answers I received <a href="https://stackoverflow.com/questions/3684484">on my question about peak detection within the paw</a>, I’m hoping there are more advanced solutions to sort the paws. Especially because the pressure distribution and the progression thereof are different for each separate paw, almost like a fingerprint. I hope there's a method that can use this to cluster my paws, rather than just sorting them in order of occurrence. </p>
  
  <p><img src="https://i.stack.imgur.com/hFmOn.png" alt="alt text"></p>
  
  <p><strong>So I'm looking for a better way to sort the results with their corresponding paw.</strong> </p>
  
  <p>For anyone up to the challenge, <a href="https://stackoverflow.com/questions/3685265/how-to-write-a-multidimensional-array-to-a-text-file/3685295#3685295">I have pickled a dictionary</a> with <a href="http://dl.dropbox.com/u/5207386/walk_sliced_data" rel="noreferrer">all the sliced arrays that contain the pressure data of each paw</a> (bundled by measurement) and <a href="http://dl.dropbox.com/u/5207386/walk_data_slices" rel="noreferrer">the slice that describes their location</a> (location on the plate and in time). </p>
  
  <p>To clarfiy: walk_sliced_data is a dictionary that contains ['ser_3', 'ser_2', 'sel_1', 'sel_2', 'ser_1', 'sel_3'], which are the names of the measurements. Each measurement contains another dictionary, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] (example from 'sel_1') which represent the impacts that were extracted. </p>
  
  <p>Also note that 'false' impacts, such as where the paw is partially measured (in space or time) can be ignored. They are only useful because they can help recognizing a pattern, but 
  won't be analyzed. </p>
  
  <p>And for anyone interested, <a href="http://www.flipserd.com/blog" rel="noreferrer">I’m keeping a blog with all the updates regarding the project!</a></p>