Commit Graph

185 Commits

Author SHA1 Message Date
iabdalkader
23f1935924 Enable modmachine. 2016-05-12 12:53:55 +02:00
iabdalkader
ba73787c8a Use MicroPython's SD Card Module. 2016-05-11 18:46:38 +02:00
iabdalkader
9a5992c03e Update code for MP v1.8 2016-05-09 21:46:29 +02:00
iabdalkader
1f150c1847 Cleanup Makefile.
* Rename binary files.
* Misc cleanups
2016-05-03 19:16:43 +02:00
iabdalkader
a314b59d1a Generate a combined binary for the programming jig. 2016-05-03 16:12:52 +02:00
iabdalkader
6b581af1b1 Add mass erase to make flash. 2016-04-29 20:32:14 +02:00
iabdalkader
cadb73eb5e Fix Makefile build order. 2016-04-26 22:58:07 +02:00
iabdalkader
3d38908f2a Update main Makefile
* Add bootloader sources.
* Generate main FW image dfu, bootloader dfu and combined dfu image.
2016-04-25 18:20:20 +02:00
Kwabena W. Agyeman
401b7b72a8 Added mean, median, and mode filters.
Mean filter -> Fast and easy to use. This will likely be the only filter
that gets alot of action on the M4.

Median filter -> Works really well, but, slow. On grayscale at 160x120
you can get also 10 FPS with it for a 3x3 kernel. That said, it's still
slow. Also, the code only works for 3x3 and 5x5 kernels.

About the previous histogram filter... technically, that filter should be
better. However, it suffers from a startup cost. The operation of finding
the median point in the histogram costs too much to compute. This is
what causes it to be slow. On very large kernels it will be faster than
the sorting median alrogithm I put up... but, large kernels will be too
slow for anyone to use anyway. The paper Ibrahim linked to about it
showed it being used for like 7x7 kernels and up... so, I think the
researcher who thought of the idea was really thinking about the
algorithm for large kernels.

Mode filter -> Works great on grayscale. Not so much on color. I think it
needs to be run on the LAB color space instead of the RGB color space. I
say this because it causes pretty strong artifacts around edges. When we
get more flash we'll be able to have a reverse lookup table for LAB to
make the mode filter better. Until then...
2016-04-04 20:04:50 -04:00
iabdalkader
4e31f25db8 Additional qstr definitions for OpenMV. 2016-03-29 02:26:39 +02:00
Kwabena W. Agyeman
978b4c12df Add Midpoint filter.
Has a bias value that allows you to control if its really a midpoint,
min, max filter, or something inbetween. Run at 160x120 or lower. 320x240
is slow (seems to be the case for all convoltions at that res).
2016-03-25 21:26:20 -04:00
iabdalkader
b92f146323 Add initial WINC1500 WiFi module driver.
* Note: partial implemented, based on CC3000 module (only scan, connect, ifconfig work)
2016-03-26 01:52:29 +02:00
Kwabena W. Agyeman
88907c438c Redid MLX Code
First, a few things:

The MLX 16x4 sensor has just too low of a resolution for mass appeal for
the price. The product is not going to sell very well. We need to look
into supporting sensors with a better res. Like the FLIR 1. The MLX
module was renamed to the "flir" module with this idea in mind.

The flir code now takes care of doing scaling and blending itself. I did
this to get rid of the user having to scale the image themselves and
blend themselves. Its too easy to run out of memory given our current
ultra small heap. In general, anything that requires multiple images in
RAM has got to go. When we do another OpenMV Cam with external RAM in
the MB range then maybe such functions will be safe. But, right now they
are definately not.

Anyway, moving on, I fixed a few bugs with the MLX math code. But, for
the most part was correct. I also added reconmended polling code for
brownouts as required by the datasheet.

Last, I designed this code like the LCD code to support a type value
when inited. This will allow the system to user a different sensor in the
future without any API changes to the user.

I will add test scripts for this next. Basic usage follows:

import flir
flir.init()
flir.display_ir(sensor.snapshot())

And that's it. Super easy. If the user wants the raw temp values they
can use flir.read_ir() to get the ta and to values. The display function
has a hidden alpha and scale argument for controling blending and the
min/max scaling.

The previous way we worked out scaling kinda sucked... it was a good
shot, but, controllable min and maxes that autoscale by default just
work better. If the user knows the temp range then they can just set the
min and max.'

Anyway, longest commit ever done.
2016-03-24 18:04:05 -04:00
Kwabena W. Agyeman
94910c8ed7 Move LCD code into module. It's now ultra fast, safe and friendly. I
tested everything too and added an example script (very simple).
2016-03-17 20:01:03 -04:00
Kwabena W. Agyeman
5316b26d83 Added a new mjpeg module for Mjpeg support.
The built-in mjpeg module allows you to record videos seamlessly. It
will automatically compress the frame buffer using the extra space in the
main ram. So... you don't have to pass it jpeg images. Gets 7 FPS at
320x240 while connected to the computer too (it has to compress the
frame twice in this situation).

Anyway, the module work like Gif.
2016-03-05 20:03:48 -05:00
Kwabena W. Agyeman
488253a8b0 Add statistics function.
You can now get the color stats for an area in the image. The stats
function returns the mean, median, mode, min, max, st_dev,
lower_quartile, and upper_quartile.

This function allows you to automate binary and threshold functions
based on what's in the iamge.
2016-03-01 21:43:52 -05:00
Kwabena W. Agyeman
98f4dde21f Add new morph function.
The morph function lets you convolve the image with a kernel. It's
decently fast right now. But, in the future we'll have to optimize it by
a lot (unrolling loops, using SIMD instructions, etc.).

Anyway, along with morph I added an edge detection test script showing
how you can use a high pass filter on an image to get all the edges in
it. This is not as good as canny edge dection... but, it's about the
same and fast enough.

We'll need a Hough Transform system in the future to make edge dection
useful. Not sure how that will be implemented... so, that's going to be
far away for now.
2016-02-29 18:04:45 -05:00
iabdalkader
2e7ded5dd4 Add GIF module 2016-02-28 21:34:47 +02:00
iabdalkader
5860695f5d Move helper functions to new files. 2016-02-22 18:41:50 +02:00
Kwabena W. Agyeman
ccd6078c04 Add BMP and P2/3/5/6 file format support.
Added BMP file format reading and writing support code and modified the
ppm code to match. Upper level glue code has been left intact to be
altered in future commits.

Tested save() and ppm writing functionality still works. More
comprehensive tests coming soon.

... Kinda concerend that standard image file formats might not cut it for
the speed we'd like to have when using image files in function calls. I
think only grayscale is going to be fast. All other formats require a
lot of prep work.

I think I may modify some of this low level stuff in the future to
autodetect if an entire grayscale image can be read in or written out
in one go to speed that stuff up.
2016-02-21 17:24:32 -05:00
iabdalkader
a4ea3e0e20 Add filter functions
* Filter functions bypass the default line processing in sensor.c, and pre-process lines.
* Processing is done on the fly, i.e. filters are called from after each line is received.
2016-02-20 03:58:40 +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
db667c061f Rename fb_stack to fb_alloc and call init0 in main 2016-02-17 05:24:17 +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
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
iabdalkader
7fff65dbd2 Add boards dir to Makefile 2016-02-06 19:32:35 +02:00
iabdalkader
726e3a8e21 Add RGB565 to YUV lookup table 2016-02-03 23:45:20 +02:00
iabdalkader
756c5965d4 Add initial OV7725 driver 2016-01-28 12:40:55 +02:00
iabdalkader
47ae5a7669 Add ATWINC1500 driver 2015-09-15 02:41:36 +02:00
iabdalkader
99bedb06b6 Move firmware files to board directories. 2015-08-01 11:16:59 +02:00
iabdalkader
4174eaf029 Generate binaries in firmware dir 2015-07-28 20:33:05 +02:00
iabdalkader
39b40526d3 Update Makefile for MP 1.4.4 2015-07-18 06:58:47 +02:00
iabdalkader
57cccca3f3 Add support for OpenMV2 2015-05-01 04:44:31 +03:00
iabdalkader
fa7ab8f70a Rename lab.c to lab_tab.c 2015-04-29 04:11:37 +03:00
iabdalkader
6231d528d2 Use pydfu.py instead of dfu-util
* Latest libusb broke dfu-util
* See https://github.com/walac/pyusb/issues/94
2015-04-29 04:08:39 +03:00
iabdalkader
6886c7b531 Update top Makefile
* Remove old modules
* Add MP modules
* Update for new MP code
2015-04-29 04:07:29 +03:00
iabdalkader
d48a7ef1e9 Update Makefiles to use DfuSe files. 2014-11-15 04:21:00 +02:00
iabdalkader
f524650881 Add DFU image
* Generate dfu image
2014-11-11 01:33:16 +02:00
iabdalkader
ef9bf26981 Add Eye Detector 2014-10-25 15:33:02 +02:00
iabdalkader
17d3e73f86 Update MP branch 2014-10-01 01:41:38 +02:00
iabdalkader
5f51438029 Add LBP 2014-09-20 02:02:22 +02:00
iabdalkader
8854f0a9d5 Add JPEG encoder 2014-09-17 21:39:19 +02:00
iabdalkader
b8d989be57 Update MP branch 2014-09-10 23:16:37 +02:00
iabdalkader
2f5b82ec77 Update UART code 2014-09-05 18:09:07 +02:00
iabdalkader
5fdd6e09a3 Add font rendering 2014-09-01 23:43:06 +02:00
iabdalkader
22323eb1a3 Remove dead object files 2014-08-29 19:36:49 +02:00
iabdalkader
0aeab28640 Update MP Modules
* Update all modules for new API
* Move modules to built-in
2014-08-26 20:32:43 +02:00
iabdalkader
f1d1aa5c67 Cleanup all Makefiles
* Add verbose option
* Fix link dependencies
2014-08-26 17:17:59 +02:00
iabdalkader
dac7beadc6 Add mutex 2014-08-20 21:10:43 +02:00
iabdalkader
074557265d Add rainbow filter 2014-08-18 10:33:46 +02:00
iabdalkader
5722436a63 Add MLX90620 driver 2014-08-18 10:26:32 +02:00
iabdalkader
563ab52eca Add Soft I2C 2014-08-18 10:21:48 +02:00
iabdalkader
a0e99939ad Pass Target to CPP 2014-08-18 10:12:03 +02:00
iabdalkader
02999f2432 Rename stm32f407_hal_msp 2014-08-10 19:42:14 +02:00
iabdalkader
12d062d1bc Enable GPIO and SPI
* Fix GPIO/SPI code
* Use buffers in SPI read/write
* Add pin qstrs OMV2
* remove old led files
* Update LCD user examples
2014-08-10 19:39:19 +02:00
iabdalkader
a93cd7fd7a Use CPP to generate linker scripts 2014-07-31 06:26:19 +02:00
iabdalkader
b67ee0e5f3 Add SD SDIO driver 2014-07-23 08:06:56 +02:00
iabdalkader
381e24d315 Add support for STM32F429 2014-07-17 09:16:04 +02:00
iabdalkader
dfab091f25 Add select 2014-07-14 03:43:21 +02:00
iabdalkader
dcb4f34520 Remove old patch programmer 2014-07-06 23:38:29 +02:00
iabdalkader
2d3abcf2f4 Add wlan and socket python modules 2014-07-05 03:41:43 +02:00
iabdalkader
e2ef1a568f Use MP's file module 2014-06-30 03:45:52 +02:00
iabdalkader
92563b6190 Add SDCARD SPI driver 2014-06-28 01:26:32 +02:00
iabdalkader
1c7f8d7bdf Move GPIO configuration to MSP 2014-06-27 22:21:59 +02:00
iabdalkader
18e62155b0 Cleanup Makefile 2014-06-22 12:31:19 +02:00
iabdalkader
c1dab26fca Fix more sources to use HAL 2014-06-18 21:20:22 +02:00
iabdalkader
1e4b6fa8fd Update sources to new HAL 2014-06-18 17:28:46 +02:00
iabdalkader
dd2933a200 Add top Makefile 2014-06-15 21:12:44 +02:00
iabdalkader
c3a2d8ac0f re-enable CC3K 2014-04-10 17:09:58 +02:00
iabdalkader
d6f66bc2f9 Remove short-enums 2014-04-10 16:56:47 +02:00
iabdalkader
669a9effb4 Add CC3000 library 2014-03-13 02:10:18 +02:00
iabdalkader
70a5e45129 Remove libc dependency 2014-03-03 16:24:50 +02:00
iabdalkader
90dc4e448d Fix -O flag 2014-03-01 17:32:16 +02:00
iabdalkader
f5b91439b2 Restructure Image Library
* Split image library into multiple source files
* Add new img/ to src
* Add median, kmeans, median, blob, SURF.
2014-03-01 15:27:37 +02:00
iabdalkader
42be54aa72 Fix Makefile CFLAGS 2014-02-23 23:29:40 +02:00
iabdalkader
4e1306244a Add OSC definition 2014-02-09 22:41:07 +02:00
iabdalkader
d175c69d19 Remove libusbcore and libusbdevcore from Makefile
* Remove USB libraries and use MP's stack for now.
2014-02-03 17:48:08 +02:00
iabdalkader
a44540f793 Add Initial Support for MicroPython
* Add pre-compiled MicroPython library and headers.
* Change Makefile to link libmp.a remove libusbgeneric
* Change linker script to support MicroPython memory layout.
* Change OTG handle name in stm32f4xx_it.c
* Change main to init libmp and export Python functions.
* Add MicroPython bindings to src
2014-02-01 21:56:45 +02:00
iabdalkader
41c5fb117f Move linker script to src/ 2014-01-21 16:34:30 +02:00
iabdalkader
5ec44f4fb5 Add libfatfs to Makefile 2014-01-15 16:03:21 +02:00
iabdalkader
5a259bbcf1 Fixed linker script to load haar cascade into CCM
Fixed issue with SCCB delay and optimization
Recompiled all libraries with optimization enabled (-O2)
Some more tweaks to the Sensor's registers
Added function to load CCM data into .ccm section in runtime
2013-12-02 22:17:45 +02:00
iabdalkader
b0c4f8e844 Added USB OTG FS support
Added userspace libusb driver
Fixed some registers now QCIF/QQCIF resoultions are working
Updated CMSIS and STM32F4xx standard peripheral libraries
2013-11-30 04:23:22 +02:00
iabdalkader
773e24e566 added stm32f4xx_std compiled library and header 2013-11-25 10:30:55 +02:00
iabdalkader
c6f7ed40d1 systick timer module 2013-11-19 04:34:41 +02:00
iabdalkader
b439bdae91 Initial commit 2013-11-13 12:24:56 +02:00