/[opencvs]/eyes/analyze_fast_image_filter16.c
ViewVC logotype

Contents of /eyes/analyze_fast_image_filter16.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations)
Thu Mar 8 15:49:21 2012 UTC (6 years, 7 months ago) by hib
Branch: MAIN
CVS Tags: HEAD
File MIME type: text/plain
more cleanup for girl3 (Jenni) and cyclone is still in process
1 #include <stdio.h>
2 /* Convert the 8 bit byte data format from stream for faster processing
3 it is faster because stream should work quicker than the more powerful but slow onvert program
4 of imagemagick*/
5 #include <stdio.h>
6 #include <stdlib.h>
7
8 int main (int argc,char *argv[]) {
9 if (argc != 3) {
10 fprintf(stderr,"usage: analyze_fast_image_filter <file xsize ysize");
11 exit(-1);
12 }
13 int xsize,ysize;
14 xsize = 0;
15 ysize = 0;
16 sscanf(argv[1],"%d",&xsize);
17 sscanf(argv[2],"%d",&ysize);
18 if (xsize <=0) xsize=1;
19 int x,y;
20 x=0;
21 y=ysize-1;
22 unsigned short buf[10000];
23
24 while (fread(buf,3,2,stdin)) {
25 unsigned int r=buf[0];
26 unsigned int g=buf[1];
27 unsigned int b=buf[2];
28
29 printf("%5.5d|%5.5d|%d|%d|%d\n",y,x,r,g,b);
30 x = x+1;
31 if (x>=xsize) {
32 x=0;
33 y--;
34 }
35 }
36 }

  ViewVC Help
Powered by ViewVC 1.1.5