Commit Graph

1031 Commits

Author SHA1 Message Date
iabdalkader
3e41450d97 Add support for OpenMV3 2016-11-27 19:32:09 +02:00
iabdalkader
b4aeb32e1b Add build option to enable stack protection. 2016-11-15 19:07:50 +02:00
iabdalkader
daf2527c0f Remove IDE/FS interrupt enable in pyexec. 2016-11-15 19:05:18 +02:00
iabdalkader
890d27d1dd Cleanup USBDBG code. 2016-11-15 18:53:34 +02:00
iabdalkader
a3a1f0cfb9 Disable line interrupt.
* saves the overhead and fixes the additional line generated at the end of the frame.
2016-11-14 23:42:51 +02:00
iabdalkader
b421022ef9 Bump firmware version. 2016-11-04 00:17:18 +02:00
iabdalkader
ae10b0a40e Switch to FAST-12 2016-11-03 23:57:16 +02:00
iabdalkader
615364101f Fix template ROI when T and F have the same size. 2016-10-17 21:56:09 +02:00
iabdalkader
199a0d0f63 Make functions return arg image to string operations. 2016-10-17 21:33:47 +02:00
iabdalkader
dfde3f4c71 Use socket->timeout for functions that can block. 2016-10-11 00:09:58 +02:00
iabdalkader
fdf0b96270 Add clear image function.
* Sets image pixels to 0's.
2016-10-10 17:22:26 +02:00
iabdalkader
ef6e6303c7 Add HoG. 2016-10-10 17:22:04 +02:00
iabdalkader
60dc3f7e91 Remove ToF module. 2016-10-10 16:53:02 +02:00
iabdalkader
b6c4f9b873 Fix ToF module SPI code.
* Note the module will be removed in the following commit,
  I'm committing fixes anyway, if the module is needed later it can be restored.
2016-10-10 16:41:45 +02:00
iabdalkader
2faa9d9bcf Fix socket_recv bug.
* recv returned the call status not the sent bytes.
2016-10-09 23:13:15 +02:00
iabdalkader
fedd1f2fe4 Add missing lens_corr prototype 2016-09-24 01:57:57 +02:00
iabdalkader
14b6330b67 Add simple lens correction function. 2016-09-23 18:46:11 +02:00
iabdalkader
af24644f87 Remove match pointer from keypoint struct. 2016-09-23 18:44:23 +02:00
iabdalkader
6beb89c6e6 Fix image.gaussian return object. 2016-09-23 18:25:19 +02:00
iabdalkader
926be29c43 Bump firmware version. 2016-09-20 01:17:53 +02:00
iabdalkader
f55c9b48eb Add gaussian function. 2016-09-20 01:03:22 +02:00
iabdalkader
7b3d2d931e Move image kernels to imlib.c 2016-09-20 01:02:51 +02:00
iabdalkader
91bc9af3ec Allow FREAK keypoints to be clustered using kmeans. 2016-09-20 00:08:59 +02:00
iabdalkader
0950d6e52a Update Kmeans.
* Small fixes with arrays handling.
* Add generic distance function.
2016-09-16 03:31:34 +02:00
iabdalkader
6591558af4 Init RNG when calling randint. 2016-09-16 03:30:08 +02:00
iabdalkader
e81f228796 Add simple edge function. 2016-09-14 20:54:53 +02:00
iabdalkader
51f1605aee More fixes to Canny edge.
* Clear output border
2016-09-13 17:53:53 +02:00
iabdalkader
0be9e958a1 Small fix to Canny.
* Threshold gradients before nonmaximal suppression.
2016-09-13 13:15:01 +02:00
iabdalkader
e104be63df Implement Canny edge detector. 2016-09-13 02:37:43 +02:00
iabdalkader
49124b4e8c Add py_helper_lookup_int_array. 2016-09-13 01:59:32 +02:00
iabdalkader
83451de050 Add Hough Transform. 2016-09-12 22:16:58 +02:00
iabdalkader
217b3a8dd4 Rename FFT sin/cos table to avoid conflict with generic tables. 2016-09-11 17:05:35 +02:00
iabdalkader
f5e1028786 Add sin/cos tables. 2016-09-11 17:01:53 +02:00
iabdalkader
f908da8d5a Make FFT sin/cos tables static. 2016-09-11 16:59:42 +02:00
iabdalkader
627d81f569 Add imlib mask_ellipse. 2016-09-08 03:12:14 +02:00
iabdalkader
9153325c06 Fix LBP for face recognition.
* Rollback to 7x7 windows.
* Use chi square for distance with weights optimized for facerec.
2016-09-08 01:29:17 +02:00
iabdalkader
8cdf53d3fb Return arg image in histeq. 2016-09-04 21:33:41 +02:00
iabdalkader
21920eaa06 Bump firmware version. 2016-08-31 02:45:06 +02:00
iabdalkader
0653f49bde Set max FPS reduction to 1/2 FPS (30FPS).
* A compromise between FPS reduction and noise level (in night mode).
2016-08-31 01:41:34 +02:00
iabdalkader
bdafca5a78 Set default gain ceiling to 8x 2016-08-31 01:37:43 +02:00
iabdalkader
2fa4a67a96 Cleanup debug log. 2016-08-30 22:46:08 +02:00
iabdalkader
bb93be6da0 Use debug_printf in winc module. 2016-08-30 22:43:35 +02:00
iabdalkader
2877225003 Remove mdefs.h 2016-08-30 22:43:06 +02:00
iabdalkader
faf79007c9 Add DEBUG_PRINTF flag 2016-08-30 22:37:22 +02:00
iabdalkader
b665c65ed6 Rename mdefs.h to common.h 2016-08-30 22:37:04 +02:00
iabdalkader
f200f2e0b8 Set WINC SPI baudrate. 2016-08-30 01:09:49 +02:00
iabdalkader
f4907e6603 Up WINC SPI speed 2016-08-30 01:02:26 +02:00
iabdalkader
ed9133e447 Cleanup sockets error handling. 2016-08-30 00:55:51 +02:00
iabdalkader
60714b339c Clean up async request code. 2016-08-29 21:49:16 +02:00
iabdalkader
8541c3c2ca Fix WINC accept info. 2016-08-28 18:22:05 +02:00
iabdalkader
5d92001f75 Cleanup WINC line endings. 2016-08-28 17:52:07 +02:00
iabdalkader
813a2e6e6a Fix WINC socket_send.
* Check sent bytes returned from async request.
2016-08-28 17:51:42 +02:00
iabdalkader
014847da5d Bump firmware version. 2016-08-25 19:26:20 +02:00
iabdalkader
fa65054815 Update firmware version. 2016-08-25 19:08:41 +02:00
iabdalkader
3cde9f9260 Revert to old FS caching. 2016-08-24 22:31:46 +02:00
iabdalkader
4b07286284 Update colorbars test.
* Invert colorbars for OV7725.
* Increase colorbars thresholds.
2016-08-23 22:37:47 +02:00
iabdalkader
2ad2418d61 Enable DSP colorbar for OV7725.
* Enabling DSP colorbar outputs solid colorbars without an image,
  which makes the colorbars test run better.
2016-08-23 22:30:18 +02:00
iabdalkader
e88c344028 Use the same serial number used in bootloader. 2016-08-22 23:03:58 +02:00
iabdalkader
d93661aa03 Set heap back to 54K. 2016-08-22 23:03:42 +02:00
iabdalkader
2a6e30de98 Reuse SPI handle for WINC. 2016-08-22 23:03:24 +02:00
iabdalkader
5238d55042 Use JPEG_SUBSAMPLE_1x1 for 60 quality. 2016-08-22 21:16:28 +02:00
iabdalkader
ebf9a93294 Increase OMV2 FB_ALLOC and JPEG buffer size. 2016-08-22 21:15:44 +02:00
iabdalkader
fd46db4143 Use new FS block caching. 2016-08-22 21:15:13 +02:00
iabdalkader
0e60cb39ec Reduce AGC/AEC Fast Mode Operating Region.
* Increasing VPT causes more motion blur.
2016-08-22 21:04:37 +02:00
iabdalkader
a998acbe22 Return 0 if FB is not ready.
* Fix bug introduced in last commit.
2016-08-21 03:01:21 +02:00
iabdalkader
5b8de6f867 Clean USBDBG_FRAME_SIZE code. 2016-08-19 19:17:22 +02:00
iabdalkader
1142940b88 Add MLX qstrs. 2016-08-19 19:09:47 +02:00
iabdalkader
a6953e8757 Invalidate frame after IDE reads it. 2016-08-19 19:09:17 +02:00
iabdalkader
958c5b7f78 Use keyword args for MLX refresh rate and adc resolution.
* Issue #148 PR #149
2016-08-19 13:23:47 +02:00
William Minarik
18975dfb85 changes fir_init() to take specified refresh rate and ADC resolution 2016-08-18 14:36:05 -04:00
iabdalkader
4cd4b1f902 Optimize haar
* Skip homogeneous regions based on STD.
2016-08-18 00:29:45 +02:00
iabdalkader
b655a54885 Remove frame size assertion in snapshot()
* Frame gets automatically cropped if it's bigger than the max raw frame.
2016-08-18 00:26:01 +02:00
iabdalkader
c6181cc7f5 Increase AEC/AGC operating region. 2016-08-17 21:19:07 +02:00
iabdalkader
56438bc079 Add cpufreq module.
* Add CPU frequency scaling module and example script.
2016-08-17 19:42:05 +02:00
iabdalkader
7a7fcf73e7 Add OMV_XCLK_SOURCE to board config
* Use MCO output to drive sensor clock on OMV2
2016-08-17 19:40:29 +02:00
iabdalkader
3a39a6fce0 Set default PLL settings to 192MHz 2016-08-17 19:09:48 +02:00
iabdalkader
c371893a60 Remove old RCC code. 2016-08-17 18:59:14 +02:00
iabdalkader
f8747cb60b Re-enable DMA2 Stream 3 and 4 for uSD
* Fix issue #148
2016-08-16 21:24:56 +02:00
iabdalkader
6722710329 Make IDE interrupt static. 2016-08-16 13:00:12 +02:00
iabdalkader
3a5b82c1b0 Add comment to linker script 2016-08-16 12:59:58 +02:00
iabdalkader
abace9e4fe Crop resolutions higher than OMV_MAX_RAW_FRAME. 2016-08-16 12:48:47 +02:00
iabdalkader
2affb38a22 Fix DCMI/DMA transfer size overflow. 2016-08-16 12:47:20 +02:00
iabdalkader
839523bd90 Fix DCMI init struct for OMV7. 2016-08-16 12:46:40 +02:00
iabdalkader
7499062bda Fix OMV2 max frames. 2016-08-16 12:45:49 +02:00
iabdalkader
d9c8b1535d Reduce IDE JPEG quality. 2016-08-15 01:11:10 +02:00
iabdalkader
bcac8731b2 Add ARCH_STR to board files. 2016-08-14 15:14:43 +02:00
iabdalkader
6d6ad783b7 Add ARCH_STR command. 2016-08-14 15:12:43 +02:00
iabdalkader
26909490c7 Fix adaptive JPEG quality. 2016-08-14 14:26:30 +02:00
iabdalkader
4211e37c53 Remove JPEG enable/disable USBDBG command. 2016-08-14 00:45:34 +02:00
iabdalkader
37ec0095fc Enable OS module. 2016-08-13 22:08:15 +02:00
iabdalkader
dcdb3e5e8d Remove old comments. 2016-08-13 22:07:50 +02:00
iabdalkader
2821690a35 Update MP branch with M7 support. 2016-08-12 23:27:20 +02:00
iabdalkader
53df7fed4f Update bootloader to support M7. 2016-08-12 23:03:11 +02:00
iabdalkader
d0ae48d3a6 Update OV7725 regs 2016-08-12 22:46:04 +02:00
iabdalkader
56ef404919 Add realloc arg to JPEG encoder.
* If realloc is set to false, JPEG encoder won't try to realloc JPEG buffer and will fail gracefully.
2016-08-12 22:44:39 +02:00
iabdalkader
1cbcb7e434 Add M7 support 2016-08-12 22:43:50 +02:00
iabdalkader
21c693f968 Update CMSIS 2016-08-06 00:25:04 +02:00
iabdalkader
e44d86b483 Update CMSIS 2016-07-29 12:28:42 +03:00
iabdalkader
11c44d11e2 Update DSP lib 2016-07-29 12:28:10 +03:00
iabdalkader
7d99357e25 Add F4 and F7 HAL 2016-07-28 16:38:45 +03:00
iabdalkader
e4ee55eefb Update firmware version. 2016-07-27 22:18:43 +03:00
iabdalkader
0da4951e62 Fix integral image lookup 2016-07-27 22:00:51 +03:00
iabdalkader
0363fa8758 Add ToF module. 2016-07-27 15:21:33 +03:00
iabdalkader
f7aa217f39 Use scaled DCT. 2016-07-06 21:19:14 +02:00
iabdalkader
9db7b8113c Set JPEG quality based on frame size.
* Use higher quality/subsampling for small resolutions.
2016-07-03 21:33:19 +02:00
iabdalkader
b5486fc2a3 Set JPEG chroma subsampling based on quality. 2016-07-03 21:27:44 +02:00
iabdalkader
9e592d45bf Add JPEG subsampling enum. 2016-07-03 21:27:28 +02:00
iabdalkader
0575314ab3 Make image pool work on arg image without changing FB. 2016-06-20 22:25:25 +02:00
iabdalkader
02088a14e1 Rename set_binning to set_windowing. 2016-06-20 22:24:00 +02:00
iabdalkader
968bfde8f2 Add new smaller resolutions.
* Add 40x30, 64x32 and 64x64
2016-06-19 21:27:09 +02:00
Kwabena W. Agyeman
7af818c4d8 Finished up optical flow code.
* Added pooling functions to make getting small images easy. set_binning
works too... but, it zooms in way to much. pooling functions aout you to
shrink the image while not zooming in.

* To make the pooling functions easy to use I created a version that
pools the image out of place and one that pools the image in place. The
inplace pooling function can work on the frame buffer (see edits to
sensor.c)

* I added the code to do hann windowing to the FFT lib. However, I
commented it out after it improved performance by basically zero.
Specialized windowing stuff will only come in handy for folks trying to
tune their algorithm... not in general for everything.

* I added subpixel resolution for the phase correlation code. You can
now track the image movement really precisely. Additionally, I fixed up
the displacement outputs to give expected results. I also added a QoR
output for the displacement code so that you can know when the results
are bad.

* Finally, an example script has been added to show off the features.
2016-06-18 23:05:44 -04:00
iabdalkader
6adb46e1fa Make copy_to_fb accept (x,y) offset 2016-06-17 00:31:56 +02:00
iabdalkader
2594a1e320 Add py_helper_lookup_offset. 2016-06-17 00:30:02 +02:00
iabdalkader
76e3a77869 Reduce DS search step by one. 2016-06-15 23:41:08 +02:00
iabdalkader
7a977b5568 Reduce step size in DS search.
* Reduce DS step size instead of switching to smaller pattern.
* Makes it slower but more accurate, close to EX search.
2016-06-15 23:33:33 +02:00
iabdalkader
e40c50f739 Add diamond search for fast template matching. 2016-06-15 22:59:17 +02:00
iabdalkader
d9b03641f7 Add copy to framebuffer function and example script. 2016-06-15 21:59:36 +02:00
iabdalkader
86b038df33 Fix typo in Haar. 2016-06-15 21:04:25 +02:00
Kwabena W. Agyeman
15aed91efd Fixed FFT and Phase Correlation!
There were some mistakes, they are fixed now. FFT 1D and 2D work
flawlessly. No problems with that code anymore.

As for phase correlation I need to study how to interpret the output
better. The function generates noisy results once you move the image too
far and I'm not quite sure if I have the code right for detecting
positive and negative displacements.
2016-06-14 00:00:27 -04:00
iabdalkader
2767791aae Add loop step argument to template matching. 2016-06-14 00:14:22 +02:00
iabdalkader
a25e0c162e Make template matching use ROIs. 2016-06-14 00:07:54 +02:00
Kwabena W. Agyeman
45fdcc973e Add FFT Code and Phase Correlation Code
The heart of the 1D FFT works. I tested this on the PC. However, 2D FFTs
may have issues and the phase correlation algorithm does not generate
the expected results. That said, most of the work is done. Stuff just
needs to be deubgged.

The FFT lib is designed to handle up to 1024 point real FFTs and 512
complex FFTs. As for 2D FFTs, we can do up to 64x64 pixels. After which,
we don't have enough RAM to handle them because they use up about 128KB
each.

Things to do... the 2D FFT needs to be verified. So, we need to run an
image through it and then back again to verify that there are no
problems. Then we need to compare the 2D FFT output with another 2D FFT
algorithm on the PC...

Once the FFTs are known to be good we then need to make sure the phase
corelation algorithm outs the correct results. We need to test that with
multiple shifted images, etc.
2016-06-12 19:55:45 -04:00
iabdalkader
f0a6892475 Cleanup template matching code. 2016-06-11 02:00:27 +02:00
iabdalkader
8fac08e29e Fix integral_image_sq bug in calculating first row. 2016-06-10 00:14:41 +02:00
iabdalkader
15ba6a4927 Enable binning when resolution is higher VGA. 2016-06-03 23:05:51 +02:00
iabdalkader
ee2995115f Disable auto zoom/scale factors for VGA resolution.
* Disable auto zoom/scale factors for VGA resolution on OV7725.
2016-06-03 23:04:11 +02:00
iabdalkader
440c9dc8bc Implement binning. 2016-06-03 23:01:28 +02:00
iabdalkader
318b67da42 Fix typo. 2016-05-25 03:42:57 +02:00
iabdalkader
39f439cda5 Fix the base priority when doing a soft-reset 2016-05-16 14:26:48 +02:00
iabdalkader
8f35a14ad8 Update USBDBG patch version. 2016-05-16 14:22:59 +02:00
iabdalkader
2e2c563227 Re-implement line filters with Python callbacks. 2016-05-16 14:22:30 +02:00
iabdalkader
5265211cc4 Remove USBDBG FRAME_UPDATE command. 2016-05-16 13:40:09 +02:00
iabdalkader
5d9fbf729c Enable some MP optimizations. 2016-05-16 13:37:27 +02:00
iabdalkader
fea0b45eaa Update MP branch.
* Fix ADC channels.
* Add 427 AF file.
2016-05-12 18:25:06 +02:00
iabdalkader
a865075e85 Fix Makefile dependencies.
* Fixes issue with parallel builds (make -jn)
2016-05-12 14:28:27 +02:00
iabdalkader
959d3e5410 Disable STM-HAL build in MicroPython. 2016-05-12 14:02:45 +02:00
iabdalkader
f61d89e0a4 Fix Makefile Verbosity.
* Make build more quite.
2016-05-12 14:01:14 +02:00
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
8e503f4145 Update to MP v1.8 2016-05-09 21:46:41 +02:00
iabdalkader
9a5992c03e Update code for MP v1.8 2016-05-09 21:46:29 +02:00
iabdalkader
2803a8f483 Update MP branch. 2016-05-04 21:37:15 +02:00
iabdalkader
c10fc56f44 MLX fixes.
* Alloc variables using xalloc.
* Change ADC resolution to 18 bits.
2016-05-04 21:37:10 +02:00
iabdalkader
e5cde106fb Remove MLX variables from linker script 2016-05-04 20:14:52 +02:00
iabdalkader
2b26d46f1e Fix py_fir memory issues. 2016-05-04 20:14:38 +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
a0d7c69cb7 Remove old CC3K code. 2016-05-02 23:11:11 +02:00
iabdalkader
d8359a99e1 Define MAIN_FW_ADDR. 2016-05-01 15:51:20 +02:00
iabdalkader
c7c3ddce63 Add DAC init in main.c
* Fix issue #121
2016-05-01 15:50:10 +02:00