Commit Graph

111 Commits

Author SHA1 Message Date
iabdalkader
ad812b410a Update iris detection example to use binning. 2016-06-03 23:10:47 +02:00
iabdalkader
34ee346846 Add timer callback example. 2016-05-18 18:53:18 +02:00
iabdalkader
b0f4ebf0cd Update PWM example. 2016-05-18 18:45:25 +02:00
iabdalkader
203b60cd36 Remove old skin_filter.py 2016-05-16 14:29:41 +02:00
iabdalkader
2e2c563227 Re-implement line filters with Python callbacks. 2016-05-16 14:22:30 +02:00
iabdalkader
a165c67132 Set sharpness on OV7725 for edge detection. 2016-05-01 16:01:35 +02:00
iabdalkader
e53d8f874f Add second iris detection example 2016-05-01 15:07:27 +02:00
Kwabena W. Agyeman
7a01a9bede Final Imlib Cleanup
Finished going through imlib.c.
-> Histeq uses fb_alloc now and has hook for RGB histeq when reserve YUV
LUT is added (coming soon in next PR).

Cleanuped py_helper.c/h
-> No functional changes. Just added some header info.

Finished going through py_image.c
* 1 - Finished general code cleanup and updating everything to using new
library functions. In particular, I updated the remaining find_*
functions with the new roi clipping code when they accept rois.
* 2 - Made blob stuff return a list when nothing is found so you don't
have to do an if on the returned value anymore.
* 3 - img subscr is more powerful now allowing image reading and
writing. I updated this because I had to use it to find a previous bug
with socket.send() for the WINC driver.
* 4 - Renamed find_eyes to find_eye. Because it just finds one eye.
* 5 - Other than that just general code cleanup to make functions look
consistent.

And yes, changes have been test. Face tracking, eye tracking, keypoints,
etc. all work still.

Future things todo before release:
1 - Change all LAB stuff to YUV.
2 - Add in reverse YUV->RGB LUT and update functions like Mode() to use
this so they don't generate messed up outputs, also histeq() too.
3 - Add any remaining sensor control functions like agc control.
2016-04-25 21:55:49 -04:00
Kwabena W. Agyeman
367e5fdd3d Improved JPEG capabilities.
* Added the ability to control the quality on JPEG functions... However,
due to our JPEG implementation this doesn't seem to help. 90% JPEG
quality images and regular images should be about equal. But, you can
see heavy degredation with 90% still. E.g. text is unreabable. Not
exactly sure why this is happening but it can be fixed later.

* Changed the compress() function to compressed(). Also, it now
compresses using FB_Alloc to prevent realloc issues when compressing.

* Added new compress() function. This function compresses an image in
place and if that image is the frame bufffer then it will update the
frame buffer bpp value to reflect the image was compressed. Users can use
this function to basically finalize the frame buffer and then pass the FB
to functions that need to send image bytes. The benefit of using this
function is that it should allow higher quality JPEGs and let everything
run at a faster speed while connected to the IDE.

I made this function to speed up WiFi. However, I encountered a bug with
the winc.send() method. It appears to zero the bytes it sends. I didn't
debug further except to verify that the image data became zero after
calling send.
2016-04-23 16:37:21 -04:00
Kwabena W. Agyeman
4c88c110cf 60 Scripts.
Everything except the DAC script works. That has to be fixed. Anyway, we
have a ton of example for launch. So, hopefully, comments about how to
do stuff should be limited.

That said, the PYB module is in a poor state still. Stuff kinda works and
kinda doesn't from it.

One day... There won't be any fires to put out on this project and I can
stop working so hard.
2016-04-21 20:01:17 -04:00
Kwabena W. Agyeman
2006cf9746 Example Work
* Filled in all the board control examples. Everything works except for
DAC.

* Moved test drawing scripts to drawing dir and renamed them and added
comments.

* Filled in all the image filter stuff. There are still some tests that
can be renamed, commented, and added to this folder. But, I will do that
later.

* Fixed motion detection thresholds.

* Fixed LCD script comments.

* Fixed BLE return value.
2016-04-20 17:10:44 -04:00
Kwabena W. Agyeman
16daeb83a2 Fixed blob code.
Removed micropython code from the image libary. Also, blobs are now 10
tuple values by default now. The multilist thing has been removed from
blobs and it will return just a list of blobs instead of a tree of
lists.

Filter functions still work too.
2016-04-13 23:16:51 -04:00
Kwabena W. Agyeman
9e5d379c18 Remove old code.
Pixels, centroid, and orientation are calculated in the blob code now.
As for threshold, it is no longer needed (plus, it required storing a
secondary image in RAM which isn't really something we can handle).
2016-04-09 19:32:14 -04:00
Kwabena W. Agyeman
d1ff36602a New blob code.
Blob tracking has now been updated to work without requiring prior
segmentation of the image. You can still run it on a segmented image,
but, that is not needed anymore.

Use the copy color feature of the OpenMV IDE to get a color in the
image. Once you have that you can then pass the color to find_blobs which
will output a tuple of lists of blobs for each color. By default, all
blobs less than 1/1000th of the image are filtered out, however, you can
add a custom filter function which gets the image and the blob about to
be added to the list and you can decide to filter it or not.

For marker tracking, we now have a function called find markers which
basically merges all the blobs found by find blobs into one list of
blobs. Each new blob will have a color code value which will tell you
what colors are part of that blob. We support tracking up to 30 unique
colors this way.
2016-04-09 11:43:35 -04:00
iabdalkader
50fe3e96bc Don't add Ta to To_min and To_max.
* Fixes issue #113.
2016-04-09 15:27:53 +02:00
iabdalkader
39495a1fd7 Update WiFi streaming scripts. 2016-04-06 02:58:42 +02:00
iabdalkader
270fd4437d Update WiFi streaming script. 2016-04-06 02:57:11 +02:00
iabdalkader
838ffb4fd7 Add WiFi MJPEG streamer + FIR. 2016-04-05 22:37:06 +02:00
iabdalkader
2cbf6f08de Update WiFi scan script 2016-04-05 22:36:03 +02:00
iabdalkader
ea63340282 Add WINC1500 fw update script. 2016-04-05 22:35:38 +02:00
Kwabena W. Agyeman
0abd5d3688 Working on scripts...
Moved feature detection scripts into their own folders and added explict
frame_skip value per Ibrahim's request.

Finished working on snapshot and video recording scripts for next
release.

... From CMUcam4 work I learned that people will just want examples that
do "X" thing. So, in general, our examples should include a simple
script showing off a feature and then a more complex script that does "X"
where "X" is some app that a person would want. For example, we'll get
reuqests for face tracking with servos, and movement detection with
servos. So, instead of answering this question a million times with an
example script we'll just have examples for all kinds of things people
will want.

Gotta automate dealing with help support at the end of the day...
2016-04-02 11:18:20 -04:00
iabdalkader
fab730aeeb Update MJPEG streaming examples. 2016-03-31 22:36:41 +02:00
Kwabena W. Agyeman
94bc225542 Moved examples arround.
Tried to emulate Arduino's 11 folders... I'd perfer to have all the
shield scripts in one folder... but, that might not make sense. I don't
really want one script per folder however. So, I might merge some more
stuff in the future. I have a grand idea here that will become evident as
I work though the examples.

Anyway, the current structure is not final. It will be in flux for a
little while.

As for Git History, folder history is the best we're going to get. Git
and GitHub don't seem to deal with moves too well.
2016-03-30 21:30:11 -04:00
iabdalkader
20dcb16e9f Add NTP example. 2016-03-31 02:47:12 +02:00
iabdalkader
4d21a0b732 Add tcp_client and DNS examples. 2016-03-31 01:07:40 +02:00
iabdalkader
bd7eed6b54 Move Python scripts to separate directories. 2016-03-28 23:19:09 +02:00
Kwabena W. Agyeman
a6c2efcebe Renamed Display to Draw
And fixed type in blend. Per Ibrahim's suggestion.
2016-03-26 10:26:19 -04:00
iabdalkader
b2e77e9dce Add wifi scan and connect examples. 2016-03-26 01:55:16 +02:00
iabdalkader
7109748146 Update FIR Python examples. 2016-03-25 14:03:56 +02:00
Kwabena W. Agyeman
a74dd50eaf Improved IR code.
Return min and max from read_ir now. Also, made drawing functions take
IR values.

Example scripts have been updated to work with the new module code.
2016-03-24 19:52:00 -04:00
Kwabena W. Agyeman
2ef24cec0f Add BLE Driver
This a python module driver for the BLE module. It puts the module into
a mode that's good for machine interfacing and handles parsing commands
for you. Additionally, it lets you get access to the low level serial
port.

Users who want to use this driver will need to read and understand the
TruConnect API for what commands they can execute. This driver simply
makes executing commands easy. The user simply needs to call the
"command()" function with the strings listed on the TruConnect API and
they will get the response from the command back as a byte object.

Once the user has executed the nessary commands to setup the BLE
connection they can then do:

ble.command("str")

To put the BLE module into streaming mode and then they can just
directly access the serial port via:

ble.uart().write(<data>)

And etc.
2016-03-20 12:58:32 -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
iabdalkader
819027f525 Use pin aliases in scripts. 2016-03-15 00:15:32 +02:00
Kwabena W. Agyeman
66248c444b Update Gif to use fb_alloc_all.
And tested it along with mjpeg to make sure all this stuff is good. I
also see the issue with QQVGA now. That just appeared.
2016-03-05 22:29:21 -05: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
9325029675 Add support for color gif.
Color gifs look very good for how bad you'd expect them to be with just
7 bits of color (rgb232) - quite amazing. Also, I  hardened the gif
module to make it "user ready".
2016-03-04 23:30:01 -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
052d64e79c Set frame size to QQVGA in gif script. 2016-02-28 21:37:23 +02:00
iabdalkader
2e7ded5dd4 Add GIF module 2016-02-28 21:34:47 +02:00
iabdalkader
b40c07c75d Add BLE example. 2016-02-28 04:12:56 +02:00
iabdalkader
0aed3f4961 Add image filters example. 2016-02-28 04:07:28 +02:00
iabdalkader
c050509b9d Update descriptor scripts.
* Use the new match_descriptor.
* Add commented line that loads descriptor from file
2016-02-28 03:56:02 +02:00
iabdalkader
08f7cb8832 Add LBP descriptor example script 2016-02-28 03:51:57 +02:00
Kwabena W. Agyeman
4ed49082a1 Background Subtraction is working!!!
Woot, all the effort to make it so you can manipulate the image buffer
with an image off disk works!

Try out the motion_detection script.
2016-02-27 11:58:37 -05:00
iabdalkader
8b87656241 Update kpts script.
* Draw FPS on framebuffer
2016-02-26 23:14:32 +02:00
iabdalkader
84e2e1fa0d Update keypoints scripts. 2016-02-26 03:03:08 +02:00
iabdalkader
9f7b370b0e Update face_tracking script.
* Search for new keypoints within a detected face.
* Draw based on matching percentage of keypoints.
2016-02-22 03:32:32 +02:00
iabdalkader
8d4131426d Update face, eye and iris detection scripts. 2016-02-21 23:04:31 +02:00
iabdalkader
baee885cd4 Update eye detection Python script. 2016-02-21 20:39:48 +02:00
Kwabena W. Agyeman
b01adfee26 Fixed up drawing code and scripts along with drawing code.
Set pixel works too now.
2016-02-19 22:55:50 -05:00