http://www.mjmwired.net/kernel/Documentation/video4linux/v4lgrab.c
It was relatively simple to use. The only thing I recommend is to not use the READ_VIDEO_PIXEL function, just address the pointer as an array and use indexing, its faster, and also,
leave out the call to
int get_brightness_adj(unsigned char *image, long size, int *brightness) {
long i, tot = 0;
for (i=0;i tot += image[i];
*brightness = (128 - tot/(size*3))/3;
return !((tot/(size*3)) >= 126 && (tot/(size*3)) <= 130);
}
as in the code it results in a very long lag, and I rather control the brightness on my own.
No comments:
Post a Comment