2 Replies Latest reply on Jul 7, 2006 10:30 PM by Jan_Carlo

    Noise removal in Motion capture data

    Jan_Carlo
      Hello to you.

      I am currently trying to remove noise in image sequences containing motion capture data. As a part of this project I am clustering pixels into groups and want to remove pixel groups with less than 4 members as these groups are regarded as noise.

      The problem is that when I have a nested list with e.g 3 sub lists/clusters (as indicated below) and I use a repeat loop to remove the sub lists with less than 4 pixel coordinates, but my code does not seem me to do this correctly (There are three sub lists where 2 of these should be removed, but only 1 of these 2 are deleted while I am unable to remove the last one).

      Does anyone have any suggestions on how I can modify the current code so that it does the job correctly?

      The code is attached below.

      on exitFrame me
      dataPointMembersInIndividualClusters = [#ClusterDatapointMembers: [point(477, 453), point(477, 459), point(477, 460), point(478, 454), point(478, 456)], #ClusterDatapointMembers: [], #ClusterDatapointMembers: [point(462, 405),point(462, 405),point(462, 405)]]

      MinimumNumberOfDataPointsInClusters = 4

      repeat with analyzeCluster = 1 to dataPointMembersInIndividualClusters.count

      if dataPointMembersInIndividualClusters [analyzeCluster].count < MinimumNumberOfDataPointsInClusters then
      dataPointMembersInIndividualClusters.deleteAt(analyzeCluster)
      end if

      end repeat

      put dataPointMembersInIndividualClusters

      halt
      end

      Suggestions will be happily appreciated

      Have a glittering day

        • 1. Re: Noise removal in Motion capture data
          Level 7
          Jan Carlo wrote:
          > Hello to you.
          >
          > I am currently trying to remove noise in image sequences containing
          > motion capture data. As a part of this project I am clustering pixels
          > into groups and want to remove pixel groups with less than 4 members
          > as these groups are regarded as noise.
          >
          > The problem is that when I have a nested list with e.g 3 sub
          > lists/clusters (as indicated below) and I use a repeat loop to remove
          > the sub lists with less than 4 pixel coordinates, but my code does
          > not seem me to do this correctly (There are three sub lists where 2
          > of these should be removed, but only 1 of these 2 are deleted while I
          > am unable to remove the last one).
          >
          > Does anyone have any suggestions on how I can modify the current code
          > so that it does the job correctly?
          >

          The problem is that you're deleting things from the list you're looking at
          and things get moved towards the start, thus skipping an iteration you
          wanted to examine. If you start at the end, you won't get that problem.

          on test
          clusters = [ [point(477, 453), point(477, 459), point(477, 460),
          point(478, 454), point(478, 456)], [], [point(462, 405),point(462,
          405),point(462, 405)]]
          nMin = 4
          nClusters=count(clusters)
          repeat with i = nClusters down to 1
          if clusters [ i ].count < nMin then
          clusters.deleteAt(i)
          end if
          end repeat
          put clusters
          end test

          Andrew


          • 2. Re: Noise removal in Motion capture data
            Jan_Carlo Level 1
            Thank you for your help:)