Commit Graph

1646 Commits

Author SHA1 Message Date
iabdalkader
97518da1df Fix collections list_pop_front bug.
* Thanks to Rocky Song for finding the bug.
2018-05-19 23:42:48 +02:00
iabdalkader
36948fff45 Fix keypoints match list. 2018-05-17 23:55:56 +02:00
iabdalkader
a07fb2f600 WINC: Return bytes from send, recv, sendto and recvfrom. 2018-05-15 02:22:13 +02:00
Kwabena W. Agyeman
ac2d2fc1cd Update find circles with min and max radius to run faster.
This was a user request.
2018-05-13 19:31:32 -04:00
iabdalkader
a1fd72b8c8 MP: Fix docs. 2018-05-07 13:39:57 +02:00
iabdalkader
ffdadcf8df Bump firmware version. 2018-05-07 00:04:54 +02:00
iabdalkader
da7f797429 Disable OMV2 build. 2018-05-06 23:41:51 +02:00
iabdalkader
f264c60664 SD card fixes.
* Fix DMA buffer macros.
* Remove WFI from wait_finished (causes issues on F7).
* Remove buffer alignment code (avoiding m_alloc's).
2018-05-06 23:12:33 +02:00
iabdalkader
2c7049805c Update docs. 2018-05-06 00:33:24 +02:00
iabdalkader
8bc4468d0c Disable USB IRQ for non-DMA SD transfer. 2018-05-06 00:29:49 +02:00
iabdalkader
d8a24caeab Update docs. 2018-05-02 18:19:01 +02:00
iabdalkader
f7e691e390 Remove line_filter function. 2018-04-27 02:01:23 +02:00
iabdalkader
6c208b52c9 Sensor: Check window size. 2018-04-26 01:03:32 +02:00
iabdalkader
4b5338ad8b JPEG: Fix BAYER bounds. 2018-04-26 01:02:15 +02:00
iabdalkader
b8527178f1 JPEG: Move bayer_to_rgb565 to imlib. 2018-04-26 00:43:46 +02:00
iabdalkader
9603870e04 Use software cropping instead of DCMI HW cropping.
* This fixes issues with some DMA transfer sizes.
2018-04-25 23:43:30 +02:00
iabdalkader
8e123e0cfc Add WINC SPI prescaler to OMV board config files. 2018-04-25 15:03:41 +02:00
Kwabena W. Agyeman
167daa3538 Add LEPTON Module ID Support 2018-04-25 14:59:39 +02:00
Kwabena W. Agyeman
60a9c50502 Add support for the lepton module 2018-04-25 14:54:53 +02:00
Kwabena W. Agyeman
a7e442c9ca Add FLIR Lepton Module 2018-04-25 04:18:53 +02:00
iabdalkader
e006e9b249 Allow sensors to override the default snapshot function. 2018-04-25 04:02:50 +02:00
Kwabena W. Agyeman
8fbab69cab Add Lepton SDK 2018-04-24 21:57:49 +02:00
Kwabena W. Agyeman
420d7f7eeb cambus: Support 16-bit register address. 2018-04-24 21:36:09 +02:00
Kwabena W. Agyeman
25d23f113d FLIR: Set SPI1/2/3 clock source to 160MHz. 2018-04-24 21:20:59 +02:00
Kwabena W. Agyeman
45e59006a4 Fix board type. 2018-04-24 21:10:36 +02:00
iabdalkader
af2bfbd6da Bump firmware version. 2018-04-23 22:21:13 +02:00
iabdalkader
22d22fa3f7 NN: Use the same order as caffe model. 2018-04-23 21:46:54 +02:00
iabdalkader
8d3c60267c Fix image save without extension.
* Fix issue #341
2018-04-23 18:59:11 +02:00
iabdalkader
38eb9e59bb Enable math special functions.
* Fix issue #339
2018-04-20 01:44:49 +02:00
iabdalkader
ca5ebbc0ff Fix H7 build.
* CAN is not supported yet for H7.
2018-04-17 14:12:45 +02:00
iabdalkader
16bacb3ca0 Enable I2C4. 2018-04-16 00:52:23 +02:00
Kwabena W. Agyeman
76e9d9fd50 Fix compile issues with the M4 firmware.
Also added a method that will give an error to the user versus not
found.
2018-04-14 02:23:17 -04:00
Kwabena W. Agyeman
93b81fcffc Add image conversion methods.
Requested by customers to make a grayscale image and rainbow image.
2018-04-14 01:01:55 -04:00
iabdalkader
5881e5ef4f H7: Lower sensor external clock to 48MHz.
* Produces better image quality.
* FPS is lower but HW JPEG makes up for it.
2018-04-12 19:33:48 +02:00
iabdalkader
b9ac80997b WINC: Use HAL to init SPI.
* Use plain HAL code to init WINC SPI.
* Add HAL SPI config to board config files.
2018-04-12 19:32:23 +02:00
iabdalkader
7d09e219a2 Set RNG clock source. 2018-04-09 15:18:09 +02:00
Ibrahim Abd Elkader
74664d1962
Merge pull request #335 from kwagyeman/master
Fix gain_db control
2018-04-09 05:14:12 +02:00
Kwabena W. Agyeman
01532ae11d Fix gain_db control
Mapping is correct now.
2018-04-08 20:22:21 -04:00
iabdalkader
3b9148cf9b Make low/high JPEG quality configurable. 2018-04-09 01:07:49 +02:00
Kwabena W. Agyeman
137fd1e89d Add openmv version info module.
Lets you print out and access a few key strings.
2018-04-08 18:35:38 -04:00
Kwabena W. Agyeman
bbb6a0ae92 Add better text drawing.
Non monospace text drawing.
2018-04-08 17:31:51 -04:00
Kwabena W. Agyeman
31b1273fb6 Add draw image for drawing images.
Can also be used to draw sprites by using the mask image to turn off
drawing some pixels.
2018-04-08 00:45:34 -04:00
Kwabena W. Agyeman
aa7386ac5f Add cartoon filtering
It's not as good as mean shift filtering but can approximate it if you
heavily control the image image lighting conditions. That said, it's a
lot faster and less memory than mean shift filtering.
2018-04-07 23:38:38 -04:00
iabdalkader
cf6225de3a Clean up MP board config file. 2018-04-08 02:03:34 +02:00
Kwabena W. Agyeman
7f798a8282 Add flood fill
The algorithm itself is setup to be used for future filters.
2018-04-06 00:20:19 -04:00
iabdalkader
82ff7a250e Add H7 DAC support. 2018-04-06 01:08:34 +02:00
iabdalkader
6cd715bf96 Reduce HW JPEG timeout.
* Avoid getting stuck when there's an overflow (abort seems useless).
2018-04-04 16:06:58 +02:00
iabdalkader
aa53cf2352 Support H7 hardware JPEG encoder. 2018-04-03 22:08:53 +02:00
Ibrahim Abd Elkader
6877b3afe6
Merge pull request #329 from kwagyeman/master
Random Library Fixes
2018-04-03 22:10:01 +02:00
Kwabena W. Agyeman
7bd8fe45fd Add masking support to replace. 2018-04-01 17:15:28 -04:00
Kwabena W. Agyeman
c4e40f9a36 Fix image pixel access methods to be safer. 2018-04-01 16:56:09 -04:00
Kwabena W. Agyeman
311607f02b Add masking support to binary. 2018-04-01 16:55:42 -04:00
Kwabena W. Agyeman
6436eb15dc Normalize bilteral filter sigma values.
Its easy to pick sigma now and it works great. Features get nice and
smooth.
2018-04-01 15:54:43 -04:00
Kwabena W. Agyeman
6e02030cbc Add contrast limited adaptive histogram equalization.
This method is fast and super useful.
2018-04-01 15:33:30 -04:00
Ibrahim Abd Elkader
11a9610902
Merge pull request #328 from kwagyeman/master
More image filtering stuff
2018-04-01 17:46:02 +02:00
iabdalkader
c14e0e809d Minor fixes to ADC code. 2018-04-01 17:40:12 +02:00
Kwabena W. Agyeman
09c9d97a70 Add bilateral filtering support
Runs faster than median filtering with a large kernel size. That said,
if sigma is set to low for the particular scene you can get corrupted
pixels if there's too much change in a particular kernel area. Tried a
few things to filter this out but was not successful. Not sure how to
fix... but, turning the sigma up hides the issue. It has something to do
with zeros in the luts used to speed the algorithm up causing
instability.
2018-04-01 00:56:41 -04:00
Kwabena W. Agyeman
c3c40680f5 Add missing binary image filtering functionality
Open/Close/TopHat/BlackHat/MorphMethods/Etc.
2018-03-31 15:06:20 -04:00
iabdalkader
2ddb4510e6 Add H7 ADC support. 2018-03-31 20:41:38 +02:00
iabdalkader
fac6f19b75 Increase the JPEG quality threshold for H7. 2018-03-30 14:42:59 +02:00
iabdalkader
fcdeb09283 Update MP. 2018-03-27 20:57:10 +02:00
iabdalkader
e9286f6a85 Fix OMV2 build. 2018-03-27 20:41:54 +02:00
iabdalkader
870ce65c51 Merge H7 SRAM1 and SRAM2. 2018-03-27 20:41:26 +02:00
iabdalkader
965e7e1529 Move JPEG buffer to SRAM3. 2018-03-27 20:40:06 +02:00
iabdalkader
ee2aab62be Add IMLIB_ENABLE_FAST to imlib config. 2018-03-27 03:47:28 +02:00
iabdalkader
ef3faa3df7 Move AprilTags qsort to separate file.
* Needed by F4 build.
2018-03-26 20:50:51 +02:00
iabdalkader
bbb5b8dda0 Update F4 HAL. 2018-03-26 20:39:10 +02:00
iabdalkader
fabe9cf292 Fix H7 HAL strict aliasing errors (patch from MP/stm32lib). 2018-03-26 20:38:45 +02:00
Kwabena W. Agyeman
a05daabf5b Fix bug with sharpen.
Wayyy too much gain before.
2018-03-26 01:24:24 -04:00
iabdalkader
6a3eb2814d Mount FLASH FS if SD card fails to mount. 2018-03-25 01:34:55 +02:00
iabdalkader
eef37ce696 Avoid 64-bit integer division in LPUART. 2018-03-25 01:08:43 +02:00
iabdalkader
e3f08179fb Update MP. 2018-03-25 00:57:38 +02:00
iabdalkader
9e1401add6 Update F7 HAL. 2018-03-25 00:57:23 +02:00
iabdalkader
0a5d4525bc Add H7 DCMI cache maintenance. 2018-03-24 03:31:41 +02:00
iabdalkader
dfe67393dc Move H7 DMA buffers to AXI memory.
* SD can only access AXI memory.
2018-03-24 03:30:44 +02:00
iabdalkader
39373f2950 Update linker script. 2018-03-24 03:30:32 +02:00
iabdalkader
014942a75b Fix bootloader version. 2018-03-24 00:45:32 +02:00
iabdalkader
f5a30c5301 Implement bootloader V2 flash layout command. 2018-03-23 00:14:55 +02:00
iabdalkader
34010c62a8 Merge F7 SRAM1 and SRAM2. 2018-03-22 23:54:10 +02:00
iabdalkader
006225c2f3 Fix USB issues on Windows. 2018-03-21 21:30:46 +02:00
Kwabena W. Agyeman
efe69c961d Add support for scalar operations
This brings all our basic operations code up to spec with other image
library offers.

Anyway, you can now pass a "color" value as the parameter to a basic op
method and it will apply that value to all pixels in the image.
2018-03-20 03:31:24 -04:00
Kwabena W. Agyeman
ed795c4fce Fix possible stack smashing issue.
User could pass too large a kernel size and crash their camera without a
nice error messages.
2018-03-20 00:52:55 -04:00
iabdalkader
e7dff016f6 Enable MDMA driver. 2018-03-19 14:58:23 +02:00
iabdalkader
88826bb414 Disable H7 SD transceiver. 2018-03-19 14:51:18 +02:00
Kwabena W. Agyeman
74c892abd6 Fixed morph edge methods.
Redcued noise being injected. Looks a lot better now.
2018-03-19 02:41:23 -04:00
Kwabena W. Agyeman
3342f68ca2 Fixed Divide by zero
Saw this floating around.
2018-03-18 22:10:57 -04:00
Kwabena W. Agyeman
d7159fba3e Upate filtering operations
Binary images are now handled. Cleaned up and optimized code. Some speed
gains after shifting to multiplies and not using int8_t.

Added a sharp and unsharp mask feature. Fixed up guassian. Added a
laplacian operation for edge detection.
2018-03-18 22:06:03 -04:00
iabdalkader
93f82440f2 Enable MDMA clock. 2018-03-17 01:25:15 +02:00
Ibrahim Abd Elkader
be6de2e467
Merge pull request #324 from kwagyeman/master
Add the ability to pull higher scaled text kerning in...
2018-03-17 00:04:01 +02:00
iabdalkader
97b2bb8bb2 Enable delayblock. 2018-03-16 20:48:35 +02:00
Kwabena W. Agyeman
45b319dc84 Add the ability to pull higher scaled text kerning in... 2018-03-16 01:27:51 -04:00
iabdalkader
00b9a99f44 Set DFU gap-fill to 0xFF.
* Makes it easier to diff hexdumps from flash.
2018-03-15 23:55:06 +02:00
iabdalkader
6cfcc8d784 Update MP H7 support. 2018-03-15 20:46:51 +02:00
iabdalkader
60ee2ecfe9 Move H7 main memory to SRAM1.
* We can't use the CCM for main memory because it's only accessible by MDMA.
2018-03-15 17:50:11 +02:00
iabdalkader
1d6defa15b Use volatile flash_offset. 2018-03-14 16:49:28 +02:00
iabdalkader
2f194aa877 Fix bootloader flash bug. 2018-03-14 16:48:48 +02:00
iabdalkader
e429386620 Make bootloader flash index volatile. 2018-03-14 16:32:01 +02:00
iabdalkader
4eaa875208 Fix formatting. 2018-03-14 14:10:28 +02:00
iabdalkader
dff902a4fa Use uint32_t for fb_w and fb_h. 2018-03-14 14:09:58 +02:00
iabdalkader
d4fde23096 Set DCMI byte select mode for H7. 2018-03-14 00:36:36 +02:00
iabdalkader
f3dba04591 Add H7 dma descriptors. 2018-03-13 21:48:48 +02:00
iabdalkader
53723e3e08 Disable caching of H7 DMA memory using the MPU. 2018-03-13 20:46:33 +02:00
iabdalkader
32e1b522e2 Update imlib config. 2018-03-13 20:46:12 +02:00
iabdalkader
294018378a Fix cpufreq RCC_PLLP_DIV2. 2018-03-13 19:14:31 +02:00
iabdalkader
3318909925 Add HAL_DCMI_Start_DMA_MB to H7 HAL. 2018-03-13 19:06:03 +02:00
iabdalkader
66ddae84b1 Update OMV4 board config file. 2018-03-13 19:04:48 +02:00
iabdalkader
a1b7d19007 Move JPEG buffer to main memory region.
* Note on the F7 this is the same memory region (CCM).
* On the H7, the DMA buffers where moved to SRAM3.
2018-03-13 19:03:00 +02:00
iabdalkader
d31fc84f60 Minor cleanups. 2018-03-13 03:24:51 +02:00
iabdalkader
69f62740a7 Update sensor to support H7. 2018-03-13 03:21:12 +02:00
iabdalkader
7cc601e7d2 Enable SRAM1/2/3 early in startup code. 2018-03-13 03:07:39 +02:00
iabdalkader
83cab47b27 Set cambus timing for H7. 2018-03-13 02:57:33 +02:00
iabdalkader
6edd70587c Fix linker script typo. 2018-03-12 20:34:20 +02:00
iabdalkader
5218aad02d Fix H7 flash file system cache memory. 2018-03-12 20:30:29 +02:00
iabdalkader
1fa990b96a Update the bootloader to support the H7 flash. 2018-03-12 20:10:27 +02:00
iabdalkader
74c035ca8a Update OMV4 board config.
* Note keeping everything in DTCM for now.
2018-03-12 16:45:42 +02:00
iabdalkader
aca7b9e8a8 Move the USB voltage level detector after all init code. 2018-03-12 16:45:03 +02:00
iabdalkader
85f06771d3 Include legacy header 2018-03-12 16:42:50 +02:00
iabdalkader
6a303f3d94 Update H7 legacy header. 2018-03-12 16:42:33 +02:00
iabdalkader
0d59d7584e Disable SRAM1/2/3 in bootloader.
* Not actually used
2018-03-12 16:39:19 +02:00
iabdalkader
793c451437 Add Makefile targets using dfu-util. 2018-03-12 16:38:22 +02:00
Ibrahim Abd Elkader
0a5146e393
Merge pull request #322 from kwagyeman/master
Upgrade Drawing Features
2018-03-12 16:38:24 +02:00
Kwabena W. Agyeman
0d63aa52df Fix minor numerical issues.
Couldn't sleep. Needed to make sure this got fixed.

On a side note. We should use a better font. It doesn't really scale
well. Not going to fix now.
2018-03-12 08:51:56 -04:00
Kwabena W. Agyeman
fc74e70c32 Upgrade Drawing Features
Heavily upgraded the drawing features onboard the OpenMV Cam. We now
have all the basic drawing methods folks expect along with all the
parameters you need. Finally! You can make big text fonts.

* Added line thickness support
* Added shape fills
* Added text scaling
* Added draw arrow.
2018-03-12 01:14:03 -04:00
iabdalkader
f27f94b76d Define new memory regions. 2018-03-12 02:40:17 +02:00
iabdalkader
6880482afd Enable D2 SRAM1/2/3 clocks. 2018-03-12 01:36:45 +02:00
iabdalkader
50d27dacee Enable USB clock during sleep. 2018-03-12 01:35:50 +02:00
iabdalkader
6339815ae3 Comment SDMMC definition. 2018-03-10 22:51:33 +02:00
iabdalkader
99dc3365b6 Update H7 CMSIS headers. 2018-03-10 20:17:36 +02:00
iabdalkader
453b41a6ec Update to latest MP. 2018-03-10 20:14:49 +02:00
iabdalkader
2f9da92e12 Fix H7 HSE_VALUE. 2018-03-10 18:58:14 +02:00
iabdalkader
4af7bb4b57 Update H7 ST HAL. 2018-03-10 17:30:03 +02:00
iabdalkader
93ba0a51bb Update to MP 1.9.3 2018-03-09 20:22:29 +02:00
iabdalkader
92b617877c Move USB headers to usbdev to avoid including MP USB headers. 2018-03-09 20:21:18 +02:00
iabdalkader
68e761d55a Fix typo in comment. 2018-03-05 19:18:45 +02:00
Kwabena W. Agyeman
e0e112468e Argument Parsing Done Correctly
All of our argument parsing code has now been updated to handle
positional as well as keyword arguments in our python libraries.

Basically, python allows you to pass some number of positional arguments
to functions/methods followed by keyword arguments (you cannot have more
positional arguments after keyword arguments). Previously, our code
would only look for keyword arguments. Now, it works better and will
grab as many positional arguments as it can followed by processing
keyword arguments. Note: If the case of a positional argument value for
a parameter being passed followed by a keyword for that same parameter
the keyword value is taken (since it comes aftward).

Because arguments were passed in keyword form before this update has no
affect on current code. However, moving forward, argument positions are
now locked and cannot be moved around.
2018-03-05 00:49:36 -05:00
iabdalkader
75d89f7172 Add CMSIS CNN. 2018-03-05 03:10:10 +02:00
iabdalkader
28cc88845c Fix system init. 2018-03-04 17:18:14 +02:00
iabdalkader
11040db094 Update imlib_image_mean to handle RGB images. 2018-03-04 03:29:11 +02:00
iabdalkader
789496e13a Fix OMV2 imlib_config.h 2018-03-04 01:31:06 +02:00
iabdalkader
c0efb0884a Revert c1e5daf6fd.
* FPU_USED is already defined.
2018-03-04 01:08:17 +02:00
iabdalkader
c1e5daf6fd Add FPU_USED to CFLAGS. 2018-03-04 01:07:19 +02:00
iabdalkader
1c91b1dcb1 Update SystemInit. 2018-03-04 01:06:31 +02:00
iabdalkader
bc3807ed30 Fix py_cpufreq. 2018-03-03 22:58:12 +02:00
iabdalkader
de1c6427a6 Wait for PWR_FLAG_VOSRDY 2018-03-02 17:38:35 +02:00
iabdalkader
659abe0225 Clean up system clockconfig function. 2018-03-02 17:37:03 +02:00
iabdalkader
e028215be5 Remove unused functions in system.c 2018-03-02 17:32:00 +02:00
Kwabena W. Agyeman
397abe4746 Cleanup Math Operations
Add binary image support to the math operations and updated them to
support masks. Replace now also support mirroring operations. Finally,
adding missing basic math ops like add/sub/mul/div. The operations are
designed to work as image blending operations so they take care of
scaling their output accordingly.
2018-02-25 22:03:31 -05:00
Kwabena W. Agyeman
fb3d0776f0 Overhaul Binary Functions
Binary() can noew zero things so you can remove bright lights. All the
line ops (and/or/xor/etc) accept masks. Erode and dilate now accept
masks. And finally, you can now pass arguments versus keywords for folks
who don't read the documentation. Also, the binary image type is now
supported for these methods.

I'm putting in all this work because I saw the need for it when I was
doing shadow removal.

Note: Some effort needs to be put into optimizing the py_image.c code
soon. This is on the todo list before the next release.
2018-02-25 00:15:02 -05:00
Kwabena W. Agyeman
646425b2a6 Add color thresholding support to get_histogram/stats.
You can now pass a color threshold list to get histogram and get stats
(along with an invert arg) to control what gets put into the histogram.
2018-02-21 01:27:13 -05:00
iabdalkader
5027e0162e Protect VCP buffer pointer with atomic section.
* Fix issue #313
2018-02-17 00:22:21 +02:00
iabdalkader
7c6ee56862 Move wifi driver to separate files.
* This will enable using wifi from C code.
2018-02-12 23:53:43 +02:00
iabdalkader
eaaf391ec8 Enable threading. 2018-02-12 23:53:00 +02:00
Ibrahim Abd Elkader
43a17f2890
Merge pull request #312 from kwagyeman/wifi_dbg
Add wifi_dbg stub.
2018-02-12 22:21:42 +02:00
iabdalkader
ff75b760f7 Update MP docs. 2018-02-12 00:41:26 +02:00
Kwabena W. Agyeman
11983a0228 Add wifi_dbg stub.
All the notes about how to implement wifi programming are in the code.
Steps:

1. Get wifi_apply_settings() working first and make sure you can turn
the wifi shield on in the right mode. Then add the necessary hooks into
the network code to make it such that previous user wifi code still
works. Also, make sure to handle start and shutdown gracefully.

Basically, get all the lifecycle code working first before moving to the
next step so notning gets in a weird state and bugs creep in...

2. Get the beacon method working. Once this works OpenMV IDE should see
the camera when you hit the connect button.

3. Do the code to turn off the regular usbdbg interface and swtich to
having the data come from wifi_dbg. This isn't a lot of code... but,
will be tricky since you no longer will have USB frames to work with.
All bytes are just going to come randomly and in bursts so you have to
handle the serial stream yourself... (Kwabena can help writing a
statemachine for dealing with this type of stuff if you want. I do it
all the time).
2018-02-08 01:49:29 -05:00
iabdalkader
7ef6bf0e5c Disable unused functions in imlib_config. 2018-02-06 02:26:09 +02:00
iabdalkader
333e5417b1 Disable qrcodes if not used. 2018-02-06 02:17:46 +02:00
iabdalkader
291b06db13 Disable find_rects if not used. 2018-02-06 02:17:01 +02:00
iabdalkader
45dd265d51 Update imlib config. 2018-02-06 02:11:11 +02:00
iabdalkader
9a2bf08c50 Move line functions to line.c 2018-02-06 02:07:36 +02:00
iabdalkader
3010a47930 Disable imlib similarity if not used. 2018-02-05 02:17:48 +02:00
iabdalkader
6d396b809a Enable auto dependency generation. 2018-02-04 18:31:39 +02:00
iabdalkader
2f6c18d286 Update imlib config files. 2018-02-04 16:19:21 +02:00
iabdalkader
581e1ab2d2 Disable rotation correction if not used. 2018-02-04 16:14:04 +02:00
iabdalkader
1935c34f4f Disable phase corr if not used. 2018-02-04 16:08:20 +02:00
iabdalkader
7cb0133bc9 Disable logpolar if not used 2018-02-04 16:01:39 +02:00
iabdalkader
ba2539f09e Add imlib macros to shadow removal. 2018-02-02 16:44:41 +02:00
iabdalkader
45dba499ad Add missing imlib macro. 2018-02-02 16:41:24 +02:00
iabdalkader
c8741f5cc1 Rename OMV_ENABLE to IMLIB_ENABLE. 2018-02-02 01:35:13 +02:00
iabdalkader
5e47520a48 Add imlib config file. 2018-02-02 01:26:21 +02:00
Kwabena W. Agyeman
5377f6f575 Add single image shadow remover code.
Calling remove_shadows() on an image without a background source of
truth image now works. However, that said, the shadow remover isn't
suitable for anything other than removing shadow on an image of concrete
flow or somthing of the like. In general, it can only remove shadows
from a scene that has nothing else in it except for a hard edge shadow.

Improving this to work for anything is about a month of work. I've
researched enough about shadow removal to now know the optimal way to do
it. However, it requires many steps and a large amount of RAM. On the H7
I may revist this as being possible.

...

In order to get the shadow remover working well I had to add a few
features to the image library and fix some of the convolution code.
These fixes will likely be more useful than the shadow removal code.

Note the addition of the new get_threshold() method. This computes
otsu's threshold on a histogram allowing you to pick the optimal color
bounds.
2018-01-28 19:33:04 -05:00
iabdalkader
f608150b02 Bump firmware version. 2018-01-24 15:05:04 +02:00
iabdalkader
a245e5fb14 Update OMV2 stack and heap 2018-01-24 14:51:32 +02:00
Kwabena W. Agyeman
e0ef7d5bcc Add more ifdefs to remove OpenMV Cam M4 features since we're flash
exhausted.
2018-01-24 01:33:45 -05:00
Kwabena W. Agyeman
bfcdcd4793 Add REPL Uart Ini File Setting Support
OpenMV IDE includes an ini file generator which will let you set board
settings easily from the IDE. Currently, the IDE has support for setting
the WiFi shield up along with adding a REPL Uart.

Anyway, this commit adds support for the OpenMV Cam to parse an ini file
on startup to configure things before starting main.py. WiFi support is
not yet implmented. However, we now have the ability to turn the UART
and put the REPL terminal on it on startup given a setting in the ini
file.

(Why not use boot.py like normal MP? While that is more flxible it's
much harder for the IDE to easily write out settings for you which is
what most users will want to do versus coding this up).

...

The movitation for adding REPL UART support in particular is so that the
OpenMV Cam can be used as a slave processor to IoT type processors like
the ESP32/ESP8266/ParticlePhoton/ElectricImp. In particular, a processor
like the ParticlePhoton can control the OpenMV Cam's reset wire. Wake
the camera up by releasing reset, then send a script to it after it
powers on over the UART. The camera will then run the script, do
computer vision, and report results back over the UART to the
ParticlePhoton. Users can then push new scripts to the OpenMV Cam from
the cloud allowing for semi-flexible firmware fixes for the OpenMV Cam
over low data rate networks.

By setting this feature up the need for OpenMV to offer a WiFi IoT
system is reduced as we can now just be the best camera for everything.

...

Due to... I don't know... ctrl-c doesn't work on the duplicated UART.

https://github.com/micropython/micropython/issues/1568

Not sure how to handle this. I don't want to fix it since it needs to be
fixed by MP upstream. Right now the work around is for the mastering MCU
to just reset the OpenMV Cam when it's done with the system.

That said, this does mean that once you start a script using the Open
Terminal command line system you won't be able to stop the script.
2018-01-23 00:22:23 -05:00
Kwabena W. Agyeman
fc9c416a21 Frame Differencing with Shadow Removal
Add in support for shadow removal from the current image using a shadow
free background image. Test results show the algorithm works similar to
max() while still keeping dark objects around. The preformance impact of
the algorithm is not too high. An in memory example can achieve 30 FPS.
2018-01-21 16:41:04 -05:00
Kwabena W. Agyeman
38f2c41877 Add pixel and area threshold settings to get_regression()
You can now make it not return anything for images with a low pixel
count.
2018-01-20 01:57:17 -05:00
Kwabena W. Agyeman
432b39bc17 Add min()/max() for frame differencing.
These have cool ghost image like affects and are useful for frame
differencing.
2018-01-17 02:13:55 -05:00
iabdalkader
abf836519f Support bayer pixel access. 2018-01-16 22:59:01 +02:00
Ibrahim Abd Elkader
633be51050
Merge pull request #304 from kwagyeman/better_phase_correlation
Phase Corr Redo 2
2018-01-16 12:38:42 +02:00
Kwabena W. Agyeman
c78f91b421 Phase Corr Redo 2
Redid the phase correlation code again so it's one method call now. This
method call can either do logpolar phase correlation to get rotation/
scale or translation(x/y). Additionally, it will be able to also do both
at once. However, I don't have that quite working yet.

I've updated the example scripts to reflect the new code too.

Finally, I had to fix a bug in the rotation correction code.

...

Once I've got the full pipeline working I will post scripts for that. I
have all the code in there and it's been somewhat debugged... However, I
can't get a useful phase correlation lock out of the log polar fft mag.
I plan to look into noise filtering and spectral whitening solutions for
this.
2018-01-15 23:29:04 -05:00
Kwabena W. Agyeman
9eba59c6c1 Update to full invariant image.
This commit updates the shadow free invariant image to 2 colors from
just grayscale.

If we need to save ROM room in the future we'll just disable the LUT and
have the algorithm run with the regular C code. Right now this is not an
issue.
2018-01-14 20:05:49 -05:00
iabdalkader
09c38e7c31 Fix find_template bug. 2018-01-13 19:08:35 +02:00
iabdalkader
4d09a13f30 Use ROI for lenet. 2018-01-12 01:23:03 +02:00
Kwabena W. Agyeman
3da3c60e12 Fixed bugs with logpolar/linpolar.
Images look great now.
2018-01-09 01:25:10 -05:00
Kwabena W. Agyeman
7516d7699f Add Advanced Optical Flow scripts
Someone asked me about doing a field of receptors before. These scripts
show how to do that. Also, added example scripts for calling the linear
polar and log polar methods added previously which power
find_rotscale().
2018-01-08 00:10:55 -05:00
Kwabena W. Agyeman
213396d090 Complete Overhaul of phasecorrelation
Just doing one big commit/PR here since I noticed that breaking it up
causes issues.

Anyway, these fixes give us GOOD/WORKING/FAST optical flow now on the
OpenMV Cam M7. A number of changes were made to the optical flow
scripts. You have have absolute and differential estimation example
scripts. Additionally, you also have the ability to measure rotation and
scale changes too. Linear/Log Polar conversion was added for this. Users
may use the new code for generic image manipulation too. Finally, I
updated the power of 2 resolutions since you actually HAVE to use them
with optical flow for the phasecorrelation code to work correctly.

I have some more advanced scripts coming after this. But, This commit is
already getting kinda large so I'm stopping it here.
2018-01-07 17:48:07 -05:00
Ibrahim Abd Elkader
075cfbc0de
Merge pull request #298 from kwagyeman/sensor_fixes
Update invariant table.
2018-01-06 18:42:35 +02:00
Kwabena W. Agyeman
edffa55873 Update invariant table.
Boosted gain by 3X.
2018-01-06 11:07:16 -05:00
iabdalkader
e3872b4c22 Increase gethostbyname timeout. 2018-01-06 00:12:00 +02:00
Kwabena W. Agyeman
30ecbdc4f8 Add white balance control.
You can now get white balance gains from the camera chip and set the
camera to then use these gains again in a new enviorment.
2017-12-31 19:56:02 -05:00
Kwabena W. Agyeman
1cf5211efb Fix bugs with sensor auto gain control. 2017-12-31 17:28:27 -05:00
iabdalkader
b1e84d9955 Fix formatting. 2017-12-31 16:12:17 +02:00
Kwabena W. Agyeman
139cdbdbc9 Add auto gain control ceiling value to be settable by the auto gain
method.

Things are in dB now too. Need to remove the previous settable method.
2017-12-30 23:54:19 -05:00
Kwabena W. Agyeman
aeb0238040 Added hmirror and vflip support to the MT9V034 and example scripts (#294)
* Added hmirror and vflip support to the MT9V034 and example scripts.

* Moved sensor example scripts to one place.

* Add delay to these script for register settling time.
2017-12-31 00:32:01 +02:00
Kwabena W. Agyeman
b906c5f192 Add auto gain control setting support (#293)
You can now get the auto gain setting in dBs and set the value in dBs.
Example scripts are included. Code was tested on the OV7725.
2017-12-30 23:18:35 +02:00
Kwabena W. Agyeman
7be0a7a182 Add exposure control for all sensors (#292)
* Textual register cleanup.

No functional changes.

* Add exposure control support.

You can now set the exposure for the camera in microseconds (versus an
opaque unknown value previously). First, we have a new method called
get_exposure_us() which will get the expsoure time in microseconds. This
let's you determine what the auto exposure algorithm set the exposure
time to. Second, the previously implmented set_auto_exposure() method
which allows you to turn aec off and on accepts a exposure_us keyword
argument when you turn aec off to manually control the exposure.

The next commit will add support for other sensor types.

* Cleanup register formatting.

No functional changes.

* Add exposure control support for the OV2640.

Register access for this chip is a PITA.

* Formatting Cleanup.

No functional changes.

* Add exposure control for ov9650.

Just doing it for all sensors.

* Add missing 2 factor.

* Added exposure control for the MT9V034.

* Add exposure control example.

Works well on the OV7725.
2017-12-30 15:56:11 +02:00
Kwabena W. Agyeman
cbbead0785 Add adaptive thresholding to filters.
I still need to go back and optimizing and cleanup the code. I just
wanted to get the feature in first.
2017-12-27 19:23:48 -05:00
iabdalkader
7cec96a9db Fix H7 build. 2017-12-28 01:04:51 +02:00
Ibrahim Abd Elkader
ece149d8d2
Merge pull request #288 from kwagyeman/sensor_fb_fix
Restore MAIN_FB() size on snapshot()
2017-12-26 21:24:00 +02:00
Ibrahim Abd Elkader
d5721a4f39
Merge pull request #289 from kwagyeman/histeq_update
Refactor histeq()
2017-12-26 13:48:10 +02:00
Kwabena W. Agyeman
dcc31ec37d Refactor histeq()
Just updating the code with the same style as other methods. I have
another new sister method for histeq() comming up next which I'll push
as soon as this PR is done. Didn't want to merge the two into one PR.
2017-12-26 00:02:51 -05:00
Kwabena W. Agyeman
046a2e1825 Restore MAIN_FB() size on snapshot()
This fix allows "copy_to_fb" with a different resolution than the
current frame buffer to work. It also allows the frame buffer to be
resized, etc. In particular, the pooling methods I added for optical
flow work again... you'll also be able to scale the frame buffer too.
2017-12-25 18:00:58 -05:00
Ibrahim Abd Elkader
e0fc302dda
Merge pull request #287 from kwagyeman/compare_methods
Add extra frame buffer.
2017-12-25 19:14:47 +02:00
Kwabena W. Agyeman
27f5110ab7 Add extra frame buffer.
You can now allocate an extra frame buffer for storing images. However,
this takes memory from the main frame buffer. In particular this reduces
the RAM for many methods that do image processing making memory errors
more likely to happen. Note that you may allocate as many extra fb's as
you like. Dealloc happens in reverse order.

Anyway, you can use this method to now storage things like difference
images in RAM allowing for MUCH faster frame difference image
processing.

Moving on, to keep memory management sane... the second fb looks just
like an image and you can use all the image methods to load and update
it, etc. That said, if users deallocate the second FB they need to *NOT*
use the image pointer anymore. There's no way for me to delete the image
pointer in python right now so this is just something that has to be
manually managed (even if I did setup a deconstructor the second FB is
on a stack... so, things wouldn't work so easily with that).
2017-12-24 22:40:26 -05:00
iabdalkader
e1fa2371bb Add missing H7 flash constants. 2017-12-24 22:14:02 +02:00
iabdalkader
a9c8cdb752 Update system.c to support H7. 2017-12-24 22:13:38 +02:00
iabdalkader
f8ba3e4e10 Use MCU_SERIES 2017-12-24 22:11:57 +02:00
iabdalkader
04ce644f55 Add H7 headers and startup. 2017-12-24 22:10:30 +02:00
iabdalkader
a51e0de410 Copy USB code to bootloader.
* The bootloader will be more self-contained.
2017-12-24 21:24:25 +02:00
iabdalkader
e0779b685c Add H7 HAL 2017-12-24 21:23:01 +02:00
iabdalkader
ed761075e4 Update OMV4 board files. 2017-12-24 21:07:50 +02:00
Ibrahim Abd Elkader
6753b93842
Merge pull request #286 from kwagyeman/compare_methods
Add a LUT for illuminvar()
2017-12-24 17:24:31 +02:00
iabdalkader
9cb0ca0b9a Add no-strict-aliasing to STHAL CFLAGS. 2017-12-24 17:21:08 +02:00
Kwabena W. Agyeman
f2c36e780a Add a LUT for illuminvar()
It's now faster to be more useful.

Need to work on HDR for the sensor and making the sensor output better.
I fixed some issues with the illuminvar() method going crazy when it
gets colors with values near 0... but, the shot noise from the sensor
adds a lot of noise to everything. Fixing this will likely solve a lot
of algorithm problems.
2017-12-23 21:16:55 -05:00
Ibrahim Abd Elkader
7346efbf0d
Merge pull request #285 from kwagyeman/compare_methods
Compare methods
2017-12-23 22:22:22 +02:00
Kwabena W. Agyeman
e2025e8d1e SSIM Code
Image comparison using SSIM. It can be used to detect image
differences... but, the algorithm was designed to compare image quality
and look at compression artifacts. Anyway, it works kinda okay for
detecting frame differences.
2017-12-23 15:01:13 -05:00
Kwabena W. Agyeman
e5eb7185fb Line ops can now accept a parameter value. 2017-12-21 22:22:12 -05:00
iabdalkader
f2431de175 Add a list of matching keypoints to keypoints match object. 2017-12-21 21:07:01 +02:00
iabdalkader
eabdcbbbca Add unary_op and subscr to keypoints object. 2017-12-21 19:53:20 +02:00
iabdalkader
ed7cb98b86 Fix bootloader linker script. 2017-12-18 23:38:23 +02:00
Ibrahim Abd Elkader
9b652606dd
Merge pull request #284 from kwagyeman/illuminvar
Add chrominace and illuminace invariant image generators.
2017-12-18 15:36:35 +02:00
Kwabena W. Agyeman
937aa1fa22 Add chrominace and illuminace invariant image generators.
Both algorithms were tested on the OpenMV Cam using images loaded from a
file and work correctly. However, shot noise from the sensor.snapshot()
makes the output value somewhat worthless except in a situation unless
you've controlled for it. Anyway, the illuminvar work best when the
image is constrained to a very particular view point looking at a flat
scene without shadow and then a shadow enters.

(Not adding demo's for these methods since the output looks like crap
unless you've put some work into constraining the scene... need to add
HDR code and other stuff to the sensor module to get better images).
2017-12-17 21:57:08 -05:00
iabdalkader
dca8f3781d Fix low-power modes. 2017-12-17 01:58:37 +02:00
iabdalkader
2fb155aff3 Update docs. 2017-12-10 04:34:51 +02:00
Ibrahim Abd Elkader
f77284e38a
Merge pull request #283 from falkoschindler/master
changing sign of z_rotation() to follow conventions of a right-handed coordinate system...
2017-12-07 11:26:40 +02:00
iabdalkader
9cc209d128 Add WINC BSP mode.
* For programming FW via WINC's debug UART.
2017-12-06 20:33:26 +02:00
iabdalkader
fcc3b0b9c6 Make WINC programmer accept firmware file path. 2017-12-06 17:08:45 +02:00
iabdalkader
475c083c75 Move ffs_strerror declaration to header. 2017-12-06 16:44:57 +02:00
iabdalkader
278fb1c797 Update docs. 2017-12-06 15:30:30 +02:00
iabdalkader
64c2d1a535 Revert "Update docs."
This reverts commit 3eca75774f.
2017-12-06 15:29:23 +02:00
iabdalkader
3eca75774f Update docs. 2017-12-06 14:12:16 +02:00
Falko Schindler
7673aaf742 changing sign of z_rotation() to follow conventions of a right-handed coordinate system with yaw, pitch and roll defined as right-handed rotations about z-, y- and x-axis (http://nghiaho.com/?page_id=846, http://planning.cs.uiuc.edu/node102.html);
partly reverts pull request #200 (https://github.com/openmv/openmv/pull/200/files);
relates to discussion in openmv forum (http://forums.openmv.io/viewtopic.php?f=6&t=538);
note that rotation() is probably effected by this change (but it should not!)
2017-12-06 09:11:52 +01:00
iabdalkader
f79c6ba8d2 Move linker script variables to board config files. 2017-12-04 20:43:49 +02:00
iabdalkader
606cb08d1e Update docs 2017-12-01 13:54:52 +02:00
Kwabena W. Agyeman
7388a3c7be Improved the performance of the get_regression() robust linear
regression code for racing.

No more memcpys all over the place. Not sure why I was doing that.

... code must have been written by an idiot before :) (me).
2017-11-18 22:27:17 -08:00
iabdalkader
a8f74d5f88 Move WINC1500 firmware to top firmware dir. 2017-11-17 15:53:20 +02:00
iabdalkader
7a33f94df9 Bump firmware version. 2017-11-04 18:13:32 +02:00
iabdalkader
b6608cc754 Fix servo pins. 2017-11-01 19:07:29 +02:00
Kwabena W. Agyeman
8d63f6d84b Fix up lens_correction and add example script. 2017-10-28 00:31:01 -04:00
Kwabena W. Agyeman
5e3cf92ac4 Add perspective rotation correction code.
This code will help you undo image rotation issues in the X/Y/Z
direction. The demo shows off the frame buffer spinning around.
2017-10-27 01:21:13 -04:00
iabdalkader
8160e9120e Add MT9V034 initial support. 2017-10-24 03:07:17 +02:00
iabdalkader
9104ef3437 Swap read/write word data. 2017-10-21 23:40:56 +02:00
iabdalkader
d860361fcd Fix cambus read/write-w register width. 2017-10-21 14:18:42 +02:00
iabdalkader
fecf856169 Revert "Add generic cam bus read/write."
This reverts commit d2ebe6f7e2.
2017-10-21 14:17:53 +02:00
iabdalkader
d2ebe6f7e2 Add generic cam bus read/write. 2017-10-19 00:53:43 +02:00
iabdalkader
ff8cf16169 Rename data to reg_data. 2017-10-18 23:19:12 +02:00
iabdalkader
04a14a290f Rename SCCB/I2C driver to cambus. 2017-10-18 23:14:14 +02:00
iabdalkader
d1a5f72a95 Add new cam support files. 2017-10-17 14:14:08 +02:00
Kwabena W. Agyeman
1748000e4d Use special version of nlr_raise again. 2017-10-17 01:14:57 -04:00