Commit Graph

2183 Commits

Author SHA1 Message Date
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
Ibrahim Abd Elkader
b98b24eb9d
Merge pull request #311 from kwagyeman/shadows
Add single image shadow remover code.
2018-01-29 18:03:25 +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
Ibrahim Abd Elkader
9cf6564e28
Merge pull request #310 from Xbaal/Xbaal-patch-1
typo correction
2018-01-25 14:24:17 +02:00
Konrad Becker
4f606a15c0
type correction 2018-01-25 13:15:40 +01:00
iabdalkader
f608150b02 Bump firmware version. 2018-01-24 15:05:04 +02:00
iabdalkader
4183f13687 Update change log. 2018-01-24 15:02:10 +02:00
iabdalkader
897dee5de2 Update firmware images. 2018-01-24 14:57:12 +02:00
iabdalkader
a245e5fb14 Update OMV2 stack and heap 2018-01-24 14:51:32 +02:00
Ibrahim Abd Elkader
dd4bcdad16
Merge pull request #309 from kwagyeman/shadows
Add more ifdefs to remove OpenMV Cam M4 features...
2018-01-24 14:26:35 +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
Ibrahim Abd Elkader
b10bda6379
Merge pull request #308 from kwagyeman/master
Add REPL Uart Ini File Setting Support
2018-01-23 19:00:16 +02: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
Ibrahim Abd Elkader
b7d662330c
Merge pull request #307 from kwagyeman/master
Frame Differencing with Shadow Removal
2018-01-22 00:34:46 +02: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
iabdalkader
ba5e82b5da Add drawing unit test data. 2018-01-21 21:18:17 +02:00
iabdalkader
c1dd027afc Add drawing unit test. 2018-01-21 20:53:47 +02:00
Ibrahim Abd Elkader
414a17afe4
Merge pull request #306 from kwagyeman/master
Add pixel and area threshold settings to get_regression()
2018-01-20 13:54:46 +02: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
Ibrahim Abd Elkader
83fae68533
Merge pull request #305 from kwagyeman/master
Add min()/max() for frame differencing.
2018-01-17 13:03:04 +02: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
Ibrahim Abd Elkader
2bd12f3b28
Merge pull request #303 from kwagyeman/master
Update to full invariant image.
2018-01-16 12:36:36 +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
5c50d9948c Update find numbers script. 2018-01-12 01:30:36 +02:00
iabdalkader
fd989c76dc Update find numbers script. 2018-01-12 01:29:27 +02:00
iabdalkader
4d09a13f30 Use ROI for lenet. 2018-01-12 01:23:03 +02:00
iabdalkader
b2d584fe95 Add MQTT library and example. 2018-01-09 20:15:13 +02:00
Ibrahim Abd Elkader
601d1593cf
Merge pull request #301 from kwagyeman/master
Fixed bugs with logpolar/linpolar.
2018-01-09 14:14:57 +02:00
Kwabena W. Agyeman
3da3c60e12 Fixed bugs with logpolar/linpolar.
Images look great now.
2018-01-09 01:25:10 -05:00
Ibrahim Abd Elkader
ece36d3fef
Merge pull request #300 from kwagyeman/master
Add Advanced Optical Flow scripts
2018-01-08 14:58:35 +02: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
Ibrahim Abd Elkader
8530b26867
Merge pull request #299 from kwagyeman/master
Complete Overhaul of phasecorrelation
2018-01-08 01:14:50 +02: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
Ibrahim Abd Elkader
02619af915
Merge pull request #297 from kwagyeman/sensor_fixes
Add white balance control.
2018-01-01 20:28:15 +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
Ibrahim Abd Elkader
92c7900039
Merge pull request #296 from kwagyeman/sensor_fixes
Fix bugs with sensor auto gain control.
2018-01-01 01:55:18 +02: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