Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #6926 > unrolled thread

Re: Delete close, but not identical elements in an array

Started byBob Hanlon <hanlonr357@gmail.com>
First post2011-12-04 08:00 +0000
Last post2011-12-04 08:00 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Delete close, but not identical elements in an array Bob Hanlon <hanlonr357@gmail.com> - 2011-12-04 08:00 +0000

#6926 — Re: Delete close, but not identical elements in an array

FromBob Hanlon <hanlonr357@gmail.com>
Date2011-12-04 08:00 +0000
SubjectRe: Delete close, but not identical elements in an array
Message-ID<jbf9bk$l65$1@smc.vnet.net>
Peaks = {{229, 170}, {119, 265}, {331, 202}, {118, 264}, {314, 245}};

First /@ Gather[Peaks, Norm[#1 - #2] <= 10 &]

{{229, 170}, {119, 265}, {331, 202}, {314, 245}}


Bob Hanlon


On Sat, Dec 3, 2011 at 4:12 AM, Peter Rodenbach
<peter.rodenbach@googlemail.com> wrote:
> Hi,
>
> I have the problem that I have to indentify peaks in an 2D array. I
> can do this by Ordering[] the entries in the Flatten[] list. Then I
> indentify the positions of the peaks in the array and write them into
> a list. An example I work on in an 512 x 512 Pixel array:
>
> Peaks={{229,170},{119,265},{331,202},{118,264},{314,245}}
>
> As you can see from those 5 peaks, Number 2 and 4 belong to the same
> peak. As I have to count the data at that positions and compare them,
> I have to get rid of the peak postions that neighbor each other, as
> they actually belong to the same peak.
>
> What I want now is: have Mathem. evaluate the positions in the list
> and delete those which are +-10 pixels around any other.
> So the list would look like Peaks={{229,170},{119,265},{331,202},
> {314,245}} afterwards.
>
> Thanks for the help!!
>

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web