Commit Graph

998 Commits

Author SHA1 Message Date
iabdalkader
6b5cdce4aa Update face detection example 2016-02-17 22:09:02 +02:00
iabdalkader
61f98e6c21 Cleanup old integral image code. 2016-02-17 20:34:21 +02:00
iabdalkader
dc86780578 Use FB_PIXELS() to get a pointer to fb pixels. 2016-02-17 20:32:50 +02:00
iabdalkader
6460fefa15 Fix old integral image lookup 2016-02-17 20:32:33 +02:00
iabdalkader
d658608061 Fix FB_PIXELS() macro.
* If bpp > 2 (means JPEG image) return pixels + bpp (bpp stores image size in JPEG mode)
* If bpp <= 2 (means GS or RGB image) return pixels + w * h * bpp.
2016-02-17 20:27:58 +02:00
iabdalkader
d2ac2c63a8 Use fb_alloc to alloc/free integral images. 2016-02-17 20:06:31 +02:00
iabdalkader
c2e6d96c27 Remove unused xalloc include 2016-02-17 20:01:05 +02:00
iabdalkader
d3d7e5dc39 Use typdef's for sensor enum and structs. 2016-02-17 19:46:45 +02:00
iabdalkader
d639df0bfe Cleanup sensor.h comments. 2016-02-17 19:08:56 +02:00
iabdalkader
c809ec1b53 Add comment about cropping. 2016-02-17 18:49:51 +02:00
iabdalkader
33e552b276 Add DMA2D to sthal's Makefile 2016-02-17 18:48:20 +02:00
iabdalkader
5fdaf08cac Increase heap size by 256 bytes. 2016-02-17 18:47:33 +02:00
iabdalkader
c1bf4ad33d Add one pass standard deviation function. 2016-02-17 18:46:46 +02:00
iabdalkader
027641e51e Improved Haar detector.
* Use a scanning factor proportional to the current scale.
* Use the new integral moving window to allow two integral images
  (sum and sum squared) for fast mean, variance and standard deviation.
* Higher FPS and more accurate detection.
2016-02-17 18:43:47 +02:00
iabdalkader
b7b4153367 Add integral moving window.
* A new integral image implementation that uses a moving window.
* Integral image is computed in steps, each shift computes n new lines.
* This only requires (image_width * (feature_height+1) * 4) bytes.
* Allows Haar detector to run on QVGA, and allows a second squared
  integral image for standard deviation calculations.
2016-02-17 18:43:09 +02:00
iabdalkader
c043ebc233 Update qstrs 2016-02-17 18:16:15 +02:00
iabdalkader
0904f0bb6b Fix FB_PIXELS()
* Return fb->pixels+fb->bpp when JPEG is enabled.
2016-02-17 05:28:28 +02:00
iabdalkader
db667c061f Rename fb_stack to fb_alloc and call init0 in main 2016-02-17 05:24:17 +02:00
Ibrahim Abd Elkader
cfa9b6e440 Merge pull request #67 from kwagyeman/master
Add framebuffer alloc functions.
2016-02-17 05:07:34 +02:00
Kwabena W. Agyeman
024b16d475 Added some helper stuff.
The alloc functions allow you to use the framebuffer as a storage space.
It's very simple but effective. You can alloc which puts some memory on a
stack... and then when you're done you can free which pops the stack.
Pops (frees) must be done in reverse order of pushes (allocs).

In general, functions should call the init code before using the stack.
It could be in a bad state.

Also, I added some wrappers for file system functions to make that stuff
easier. This will be used in the future.
2016-02-16 21:31:35 -05:00
Ibrahim Abd Elkader
983f1783e3 Merge pull request #66 from kwagyeman/master
Update lookup tables and scripts.
2016-02-17 03:57:51 +02:00
Kwabena W. Agyeman
88f37014f1 Finished updating tables.
With new RGB565<->RGB888 scaling. This included redoing the LAB/YUV/XYZ
tables. I translated the table gen code to python also and added
comments as to where the math came from.

And yes, I tested and compared the tables to make sure they weren't
borken. The tables are slightly different... but, if look at the
progression of values loosely you'll see the triplets are very close to
each other when doing a compare. This is to be expected given I used a
slightly better scaling algo.
2016-02-16 19:37:19 -05:00
Ibrahim Abd Elkader
e3b76ebabb Merge pull request #65 from kwagyeman/master
* Move image macros to imlib.c.
* Add prefix to image macros.
* Add RGB LUT, and gen_rgb2rgb.py  script.
2016-02-16 17:24:48 +02:00
Kwabena W. Agyeman
6699ea4d0e Added RGB LUT.
And modified the rainbow table so that the RGB888 to RGB565 translation
is done using a rounding technique versus hard floor. This is also used
for the RGB565<->RGB888 LUTs.

Additionally, I added a bunch of stuff to the image library to make
working with images easier. I will using these helpers in the future.

Finally, I cleaned up trailing space in the font stuff (pet peeve).
2016-02-15 22:12:25 -05:00
Ibrahim Abd Elkader
42db630564 Merge pull request #64 from kwagyeman/master
Fixed up point and rect.
2016-02-15 04:58:46 +02:00
Kwabena W. Agyeman
67b9a815b3 Switch int to int16_t. 2016-02-14 21:54:55 -05:00
Kwabena W. Agyeman
0384d43304 Fixed up point and rect.
Point didn't need many changes. However, for rect I made the merge
function alot better so it won't alloc while merging, just free.
Additionally, I added a function to get the intersecting rectangle of an
image. This will be used for all functions that accept a subimg
argument. This function allows the user to basically pass any wild and
crazy rect they want and the function will find the intersecting area (if
it exists) and return just that to operate on. This is good for "do what
I mean" functionality versus "do what I say".
2016-02-14 21:13:55 -05:00
Ibrahim Abd Elkader
020ed9369a Merge pull request #63 from kwagyeman/master
Fixed up array functions.
2016-02-15 02:45:11 +02:00
Kwabena W. Agyeman
84a964f930 Fixed up array functions.
There were a lot of missing features in the array module. I added
quicksort based on the MP sort function and I expanded the array code so
you can do stuff like take() which lets you get an object from an array
and easily put it into another array.

I also fixed the "struct array" problems in the code. Anonymous structs
have to go.
2016-02-14 19:29:34 -05:00
iabdalkader
46d91cc95a VJ: Use a scanning step proportional to scale. 2016-02-15 00:58:17 +02:00
Ibrahim Abd Elkader
d850325de4 Merge pull request #60 from kwagyeman/master
Cleaned up some whitespace and unnecessary header.
2016-02-14 17:02:18 +02:00
Kwabena W. Agyeman
ffaea46159 Removed unneeded headers.
And... added a comment about the implementation being standard.
2016-02-14 09:38:42 -05:00
Kwabena W. Agyeman
c622e05b58 Re-added timeout.
Given how the SCCB won't fail it should really be 0... but, then the
rountines wouldn't return if there was a failure.
2016-02-14 09:27:04 -05:00
iabdalkader
5deaf38a34 Switch to 2x2 (4:2:0) Chroma Subsampling. 2016-02-14 11:20:04 +02:00
iabdalkader
77239a5891 Support 2x1(4:2:2) Chroma subsampling. 2016-02-14 07:34:43 +02:00
Kwabena W. Agyeman
b6eb26d324 Lowered timeout.
It was previous set to 10 seconds... since the timeout is in ms. Now
it's at 1 second. This represents 100 clocks at 100KHz I2c. Also, I
noticed general call mode was being set for the I2C which is not at all
something we want (the ability to address multiple devices at once).

I tested the changes with all my cameras. No problems. This was 4 units
(2 being the original protos).
2016-02-13 23:05:27 -05:00
Kwabena W. Agyeman
abac52534c Reviewed code. No errors. Cleaned up some whitespace and unncessary
header.
2016-02-13 21:55:10 -05:00
iabdalkader
597b9aeba4 Emit proper JPEG headers for grayscale images. 2016-02-14 01:54:19 +02:00
Ibrahim Abd Elkader
21eabc63bf Merge pull request #59 from kwagyeman/master
Made XALLOC better.
2016-02-14 00:59:50 +02:00
Kwabena W. Agyeman
456c4ab757 Made XALLOC better. Now the functions detect if you are trying to alloc
0 bytes and don't fail if you do that. Additionally, I added some
comments on behavior. (I studied what the gc functions did extensively
to know the behavior of this stuff). All changes have been tested with
code that does memory allocs.
2016-02-13 13:56:33 -05:00
iabdalkader
ee6192aeba Use a faster BinDCT.
* A slightly faster BinDCT.
* JPEG time: GS:22ms RGB:62ms (tested on color-bar images).
2016-02-13 04:28:26 +02:00
Ibrahim Abd Elkader
2e9f25515b Merge pull request #57 from kwagyeman/master
Made Soft I2C Pretty
2016-02-12 18:05:03 +02:00
Kwabena W. Agyeman
095c95a998 Made Soft I2C Pretty 2016-02-12 00:31:26 -05:00
iabdalkader
9685cbb727 Small JPEG optimizations. 2016-02-12 07:08:22 +02:00
iabdalkader
3acb5903a2 Optimize Grayscale JPEG.
* Skip UV tables for Grayscale images.
2016-02-12 04:40:36 +02:00
iabdalkader
a7874b8651 Update shields silk-screen. 2016-02-11 02:37:31 +02:00
iabdalkader
f8bfbfabe9 Add sensor.get_id function to return PID. 2016-02-10 19:00:05 +02:00
iabdalkader
4ed583380e Remove mp.h include 2016-02-10 18:24:30 +02:00
iabdalkader
dd7c8809a3 Update MLX Python script. 2016-02-10 17:35:40 +02:00
iabdalkader
584e1ca58a Update silkscreen 2016-02-10 01:25:01 +02:00