Commit Graph

243 Commits

Author SHA1 Message Date
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
Kwabena W. Agyeman
d19d2aca15 Add user example 2018-05-07 20:23:17 -07:00
Kwabena W. Agyeman
bc7e09f379 Fix pin names 2018-04-22 12:57:43 -07:00
Kwabena W. Agyeman
da84e0baa3 Add time lapse script 2018-04-22 10:27:24 -07:00
Kwabena W. Agyeman
1fb5493603 Add motor shield examples 2018-04-22 09:59:16 -07: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
Kwabena W. Agyeman
63eec63e79 Add in a demo for embossing. 2018-04-07 23:37:05 -04:00
Kwabena W. Agyeman
60881b534c No one should use this... 2018-04-07 23:36:43 -04: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
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
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
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
Kwabena W. Agyeman
45b319dc84 Add the ability to pull higher scaled text kerning in... 2018-03-16 01:27:51 -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
2feed8b291 Add CNN example script. 2018-03-05 03:25:23 +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
Konrad Becker
4f606a15c0
type correction 2018-01-25 13:15:40 +01: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
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
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
b2d584fe95 Add MQTT library and example. 2018-01-09 20:15:13 +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
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
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
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
Ibrahim Abd Elkader
57b8ba2cda
Merge pull request #290 from kwagyeman/frame_difference_scripts
Add frame differencing example scripts.
2017-12-28 00:29:51 +02:00
Kwabena W. Agyeman
a6b659131d Add frame differencing example scripts.
Better ones that can work in memory now.
2017-12-27 14:43:36 -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
iabdalkader
d1c15610bb Add low power example scripts. 2017-12-17 16:15:05 +02:00
iabdalkader
c94eb8f12a Update WINC firmware script 2017-12-06 20:45:48 +02:00
iabdalkader
16f7e96434 Fix WINC fw update script. 2017-12-06 15:30:58 +02:00
iabdalkader
2f32dad550 Add sensor sleep mode example. 2017-11-04 17:45:37 +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
3fd020e848 Remove old example. 2017-10-13 16:54:06 +02:00
Ibrahim Abd Elkader
0cf13e8777 Merge pull request #263 from kwagyeman/lsd
Lsd
2017-09-13 18:09:50 +02:00
Kwabena W. Agyeman
5a3153c8b9 Find line segments more stable
Switched the find line segments algorithm to something more stable using
the standard LSD algorithm that's used by OpenCV.
2017-09-13 00:33:31 -04:00
Kwabena W. Agyeman
7dff089e6f Removed QRCodes from the OpenMV Cam M4.
They don't really work that well on it anyway due to having to use a low
res. This makes room for more basic CV features on the M4 which it can
run.
2017-09-03 14:39:14 -04:00
iabdalkader
8557d55745 Update unit-tests script. 2017-08-08 00:22:12 +02:00