[Solved] Random sequence with large arrays


hi,

i'm working on contraption build depth map images: pan-tilt head turns distance sensor specific positions.
this simple lidar system, instead of using capture surroundings in 3d model, i'd have image result . while scanning, measurements logged onto sd card turned image later on computer. every logged position has distance next it. piece of software distances can mapped greyscale pixels.

i successful in building hd image (that 1920x1080 measuring positions) going left top (0,0) right bottom (1919,1079) increasing pan , tilt position numbers. downside of approach measuring errors , changes in time result in horizontal pixel line patterns. more distribution of measurements, pan-tilt head move randomly on 1920x1080 grid, without forgetting pixels, or measuring pixels more once.

i tried creating 2 arrays, 1 pan- , 1 tilt positions , shuffling these arrays prior reading them in simple sequence. planned use fisher-yates shuffle, demonstrated here john leehey: http://stackoverflow.com/questions/6127503/shuffle-array-in-c, having integer array 1920 elements, , 1 1080 seemed ram memory (the arduino ide serial monitor became unresponsive).

code: [select]

// arduino mega 2560
int panposition[1920];
int tiltposition[1080];


i'm bit lost how can random position sequence in such large grid.
am missing obvious?

thank you!
elias


what intend store in arrays? need int? if storing bit (0=not scanned, 1 =scanned), wasting 15/16ths of memory allocating.

in case, 2 arrays should fit on mega. in total use 6000 of 8000+ bytes of sram.


Arduino Forum > Using Arduino > Programming Questions > [Solved] Random sequence with large arrays


arduino

Comments

Popular posts from this blog

Connecting Raspberry Pi 2 to P10(1R)-V706 LED Dot Matrix - Raspberry Pi Forums

TypeError: <unknown> is not a numpy array - Raspberry Pi Forums

datso and removing imagetitle - Joomla! Forum - community, help and support