I am processing the data coming out of a laser scanner. I set the scanner
for let's say 512 lines x 500 points/line, so I should get the coordinates
of 256,000 points. For reasons known only to my laser scanner, the number of
points actually returned is much smaller, for instance approx. 93,000 on my
latest attempt, and the data is returned to me without "place holders" for
the missing points. However, for the data to be useful to my overall
application, I do need to reconstruct the 256,000 points array with NaN's as
place holders.
Somehow I was able to figure out the exact sequence and location of the
valid 93,000 points (you don't really want to know the details of that
algorithm), so then what I do is:
-initialise a SGL 2D array of 256,000 rows x 4 columns, where the first
column is the laser scan index (0 for the first 512 rows, 1 for the next 512
rows and so on), and the remaining 3 columns are NaN's for the x,y,z
coordinates of the points.
- then, inside a FOR loop, 93,000 times I replace one row at a time with the
appropriate coordinates as returned by the scanner. I have to do it one row
at a time as the points are missing in totally random order. Of course I use
a shift register (or feed-back node to be trendy) and the Replace Array
Subset function.
It's all very nice, except it takes 20 minutes (Pentium III 800MHz Win2K
LV7.1)!
I then replace the FOR loop with a formula node and inside that a workmate
of mine writes the corresponding C code to do exactly the same job.
Now it takes 10 seconds!
Is LabVIEW really worthwhile, or do we all need to go back to basics and
learn C?

Mihai Costache
Senior Research & Development Engineer
Industrial Research Ltd.
Brooke House
24 Balfour Rd., Parnell
PO Box 2225
Auckland, New Zealand
DDI: +64  - 9 - 920 3645
Fax: +64 - 9 - 920 3106
www.irl.cri.nz
****************************************************************************
****
Men stumble over the truth from time to time, but most pick themselves up
and hurry off as if nothing happened. 
Sir Winston Churchill (1874-1965)
****************************************************************************
****


Reply via email to