|
Author |
Topic: pixel sort algorithm (Read 229 times) |
|
matthias
|
pixel sort algorithm
« on: Nov 28th, 2004, 2:08am » |
|
Hi, I try to sort the pixels of each frame of a webcam imput. And I'm using this sort algorith: void mysort(int[] a) { int n = a.length; for (int i=0; i<n-1; i++) { for (int j=0; j<n-1-i; j++) if (green(a[j+1]) < green(a[j])) { int tmp = a[j]; a[j] = a[j+1]; a[j+1] = tmp; } } } but that's too slow. And the sort() of processing is not "clean" enough for what I'm trying to do. Is there somebody who has a faster one? Or any ideas? Thanks a lot. best M.
|
|
|
|
|