Commit Graph

335 Commits

Author SHA1 Message Date
iabdalkader
fb0a5e26d5 Update to MicroPython 1.13 2020-11-25 02:39:54 +02:00
iabdalkader
c548c336f9 Fix black/top hat.
* Depend on both binary and math ops.
2020-11-22 22:42:15 +02:00
iabdalkader
b46ba79557 Update JPEG frame buffer after loading/creating images.
* With this fix the frame buffer will be updated instantly after loading or creating
new images with the copy_to_fb flag set to true.
* There's no need to flush the framebuffer after loading or creating images anymore,
however the sensor (or image) flush() still needs to be called after drawing to see the updates.
2020-11-16 00:54:29 +02:00
iabdalkader
495a63771a Add function to update the framebuffer from an image 2020-11-15 17:27:15 +02:00
iabdalkader
5145287e1e Add default value to py_helper_keyword_object 2020-11-08 21:46:09 +02:00
Ibrahim Abd Elkader
5660652b1a
Merge pull request #942 from StuartBox/StuartBox/openmv
Added pause parameter to Image_Reader
2020-10-31 22:04:02 +02:00
StuartBox
6e84c06091 Added pause parameter to Image_Reader 2020-10-30 04:14:18 -07:00
Ibrahim Abd Elkader
df156e0746
Merge pull request #940 from kwagyeman/kwabena/remove_shadow_removal_code
Remove shadow removal code
2020-10-30 02:03:17 +02:00
Kwabena W. Agyeman
3173c2bb34 Remove shadow removal code 2020-10-29 09:40:23 -07:00
Kwabena W. Agyeman
f43d6fd5d4 Modify draw row for LCD screen use 2020-10-28 08:25:03 -07:00
Kwabena W. Agyeman
dcf141192e Cleanup RGB565 reversal from image lib 2020-10-22 22:21:21 -07:00
Kwabena W. Agyeman
3439f88241 Add new image scaling pipeline 2020-10-17 14:42:28 -07:00
Kwabena W. Agyeman
124f10bd31 Cleaned up the usage of framebuffer access in py_image/py_fir 2020-06-15 20:46:50 -07:00
iabdalkader
0af2e7c700 Use framebuffer functions instead a FB macros. 2020-06-16 01:38:19 +02:00
Kwabena W. Agyeman
bf16b6a4fa Get pixel now does debayering for bayer rgbtuple mode 2020-05-27 22:52:30 -07:00
Ibrahim Abd Elkader
d81f58569b
Merge pull request #799 from kwagyeman/kwabena/get_histogram_with_diff
Add image diff ability to get_histogram
2020-05-13 21:12:46 +02:00
Matt Dawson
5ec2e7b310
Add offset correction to imlib lens correction. (#791)
* Add x/y correction to lens correction to adjust for lens offsets.
2020-05-13 21:10:58 +02:00
Kwabena W. Agyeman
a2705ae3d1 Add image diff ability to get_histogram 2020-05-12 22:30:16 -07:00
Ibrahim Abd Elkader
1c02cfed33
Merge pull request #783 from matsondawson/draw_image_bilinear_interp_and_alpha_palletes
draw_image bi-linear interpolation, alpha palettes, and center_image
2020-05-12 19:56:36 +02:00
Matt Dawson
c45ab418d4 Allow alpha palettes in grayscale mode. 2020-05-09 17:15:33 -07:00
Matt Dawson
7e83dbb92e Removed negative scaling. Moved texture sample to center of pixel. 2020-05-09 01:13:26 -07:00
Matt Dawson
8f8872537b Changed to use fb_alloc_mark, gb_alloc_free_till_mark. Renamed Image hint type and enums. Formatting fixes 2020-05-08 17:31:13 -07:00
Matt Dawson
a94b16a49d draw_image_bilinear_interp_alpha_palletes_and_center_image 2020-05-03 21:24:51 -07:00
Kwabena W. Agyeman
cdb8b4ec46 Modify compression methods to allow jpeg images 2020-05-03 17:19:52 -07:00
iabdalkader
9a025b60b9 Rename fb functions for consistency. 2020-05-01 14:43:13 +02:00
mattdawson
eb94f153dd Fix formatting. Remove un-needed error check for image format with color palette. 2020-04-24 13:42:05 +12:00
mattdawson
30383d32b6 Fixed not checking that image is grayscale image for custom palette. Made demo simpler. 2020-04-23 21:58:37 +12:00
mattdawson
91efa307e0 Add custom palettes to draw image with demo 2020-04-23 21:33:01 +12:00
Matt Dawson
414c6e1a51
draw_image performance and negative scaling. (#758)
Improve draw_image performance and negative scaling.
2020-04-22 17:43:14 +02:00
mattdawson
e1c667fbc1 Fixes as per P.R. #753 comments 2020-04-14 17:34:53 +12:00
mattdawson
a71c3f9beb Fix DrawImage with alpha and add color palettes for grayscale 2020-04-13 21:18:38 +12:00
Kwabena W. Agyeman
2c3358bc41 Add raw data RD/WR access to the image object.
Do .bytearray() to get an object pointing to the image bytes which
allows you to maninpulate the RAW data of an image.
2020-04-07 19:58:38 -07:00
Kwabena W. Agyeman
2b26ca17b0 Improved the speed of logpolar and linpolar transforms.
* Fixed image quality issues too.
2020-03-08 16:13:25 -07:00
Kwabena W. Agyeman
c5c9770d3a Improve rotation_correction()
* Optimized code to make it run slightly faster.
* Added fov argument to control the zoom effect better.
* Added perspective correction through 4 point correspondence.
2020-03-04 23:00:59 -08:00
Kwabena W. Agyeman
b36460a36a Lens correction cleanup 2020-03-02 09:37:11 -08:00
iabdalkader
9969b9e48d Fix debug build linker errors. 2019-12-02 18:23:43 +02:00
iabdalkader
2381a5ac8b Make images iterable.
* Allow iterating over image objects.
* This is mainly to support creating ulab ndarrays from images.
2019-10-30 01:17:20 +02:00
Kwabena W. Agyeman
7ad61b725e Adds hint system to fb_alloc
With this commit fb_alloc now takes hints to better decide which ram to
give (internal or sdram).

Only fb_alloc_all calls are given any hints right now as some of the
calls need as much ram as possible and will cause failures to happen if
a small amount of fast internal sram is returned.

Anyway, hints can be used to tune where things are placed by fb_alloc.
2019-10-04 21:47:54 -07:00
iabdalkader
54b8132949 License update. 2019-09-05 22:17:50 +02:00
Kwabena W. Agyeman
548a295d81 Enable high res apriltags 2019-09-03 22:30:08 -07:00
Kwabena W. Agyeman
1667345eb4 Fix Quote Location 2019-09-02 22:04:55 -07:00
Kwabena W. Agyeman
5691bb7498 Improve large jpeg image data transfer
This commit fixes the following:

* Adds new methods to allow jpeg images to be encoded for transmission
to the IDE.

* Auomatically calls these methods to send the image to the IDE when
there's not enough space in the JPEG buffer. This isn't the fastest but
is better than help support requests about why it doesn't work at all.
2019-08-16 00:35:55 -07:00
Kwabena W. Agyeman
6e789b1406 Add print statement for bayer. 2019-07-20 23:27:26 -07:00
iabdalkader
75a028f9e9 Remove extra fb_free calls. 2019-03-18 17:37:18 +02:00
Kwabena W. Agyeman
c982617523 Fix exceptions from freeing fb_alloc_mark
This fix creates a flag that prevents fb_alloc_free_till_mark() from
doing anything unless there was a previous fb_alloc_mark(). Once
fb_alloc_free_till_mark() is called it will no longer do anything until
there's another fb_alloc_mark().

This means that if an exception is triggered while in code that
previously did fb_alloc_mark() the stack will be cleaned up.

If the fb_alloc_mark() method is not called then the stack will not be
cleaned up and that memory fb_alloc()'ed will remain until a soft reset.

All OpenMV Cam library code is designed to fb_alloc_mark() before using
the fb stack and then fb_alloc_free_till_mark() when complete. However,
in the case of py_sensor_alloc_extra_fb() it doesn't mark first such
that the RAM it allocates stays across exceptions and is only free'd via
py_sensor_dealloc_extra_fb() or via a soft reset.

...

Summary of changes:

fb_alloc.c -> Added a semaphore lock to prevent
fb_alloc_free_till_mark() from doing anything unless fb_alloc_mark() was
called first.

py_sensor.c -> Removed calling fb_alloc_mark() and
fb_alloc_free_till_mark() and re-arranged code calls to prevent a trival
leak sitatuion on heap exhaustion.

py_image.c, py_fir.c, py_lcd.c py_tv.c -> Added fb_alloc_mark() and
fb_alloc_free_till_mark() to methods originally coded without using it.

...

Note - I coded the mark semaphore lock in such a way things work even if
fb_alloc_mark() and fb_alloc_free_till_mark() calls are nested. This
allows the find_blobs() call-back methods to call py_image.c methods
still and also allows us to add more call-backs in the future without
worry if we need to.

...

Finally, if you have an exception in an interrupt handler all this above
breaks terribly. Given MP already breaks if you try to allocate memory
in an exception this is a "won't fix problem". Don't call code that can
have exceptions or needs memory in an interrupt handler.
2019-03-17 19:20:09 -04:00
Kwabena W. Agyeman
a47f4120af Add color palette conversion to to_rainbow() 2019-03-11 19:57:46 +02:00
iabdalkader
e4ead239be Add ironbow table. 2019-03-05 16:56:52 +02:00
Kwabena W. Agyeman
b230de3b42 Add binary format to sensor.
* This format is for use in the Image Lib module since sensor is where
we put the image types.

Will work on the lepton and global shutter drivers next.
2019-02-20 01:59:47 -05:00
Kwabena W. Agyeman
cd586f66bc Upgrade text drawing to support rotations of the character and string. 2019-02-16 21:19:05 -05:00
Kwabena W. Agyeman
5b3cd7c9db Make rotation not an optional argument for ellipses. 2019-02-16 21:19:05 -05:00