0

From a real time signal adquisition, I'm getting 8400 points and I need to graph them. My problem is that there is a lot of noise in the data, Is there an alghorythm that reduce the noise? I need to know how many "plateaus" are there?

ups/downs

to something like: figures

edu7
  • 3
  • 3
  • Why do you consider 4 ? Please give an objective criterion. (On the filtered image, the "plateau" 4 is completely undetectable.) –  Oct 18 '22 at 21:50
  • Ups/downs is a completely meaningless terminology. –  Oct 18 '22 at 21:52
  • Ignoring the "plateau 4". Lets say that .. for a plateau will be consider the height need to be more than 15 cm. In general therms , i need to identify how many figures are in the point of clouds. Did I explain a bit better? – edu7 Oct 19 '22 at 22:21
  • 4 is slightly higher than 1. But how much is a cm ? –  Oct 20 '22 at 07:11
  • I have edited the post, delete the images, and only add one that not confuse – edu7 Oct 20 '22 at 18:23
  • You are asking two questions: reduce the noise / count the plateaus. In my opinion, the first is an XY question. –  Oct 21 '22 at 07:33

2 Answers2

0

I would:

  1. compute BBOX or OBB of PCL

    in case your PCL can have any orientation use OBB or simply find 2 most distant points in PCL and use that as major direction.

  2. sort the PCL's BBOX major by axis (biggest side of BBOX or OBB)

    In case your data has always the same orientation you can skip #1, for non axis aligned orientation just sot by

    dot(pnt[i]-p0,p1-p0)
    

    where p0,p1 are endpoints of major side of OBB or most distant points in PCL and pnt[i] are the points from your PCL.

  3. use sliding average to filter out noise

    so just a "curve" remains and not that zig-zag pattern your filtered image shows.

  4. threshold slope change

    let call detected changes + (increasing slope) and - (decreasing slope) so you just remember position (index in sorted PCL) of each and then detect these patterns:

    UP   (positive peak): + - (here is your UP) -
    DOWN (negative peak): - + (here is your DOWN) +
    

    to obtain the slope you can simply use atan2 ...

Spektre
  • 49,595
  • 11
  • 110
  • 380
0

You can probably isolate the plateaus by means of a sliding window in which you compute the range (maximum value minus minimum value). Observe the resulting signal and see what threshold will discriminate.

Below is what you obtain by an horizontal morphological erosion, followed by counting the white pixels vertically. The slopes between the plateaus are very distinctive.

enter image description here

After segmenting the cloud, fitting the plateaus is easy.