Commit graph

43 commits

Author SHA1 Message Date
Richard Bowman
82eba1e99a fixed typing error 2021-04-27 20:17:07 +01:00
Richard Bowman
87f636ecc0 Code format and linting 2021-04-27 19:56:54 +01:00
Richard Bowman
bb303d4766 Simplified auto gain/exposure algorithm
adjust_shutter_and_gain_from_raw now uses a simpler algorithm.
The code is longer overall but hides some details in fuctions.
I've also split the loop into one for shutter speed and one for gain.
This isn't the algorithm that I originally wrote, but it seems to
work and is more readable.
2021-04-27 18:54:21 +01:00
Richard Bowman
79b0d48cf4 Swap Generator annotation for Iterator 2021-04-27 17:13:40 +01:00
Richard Bowman
88de3089ea Fixed linter errors 2021-04-21 13:38:14 +01:00
Richard Bowman
8c50f73b34 Fixed type of context manager 2021-04-21 12:54:53 +01:00
Richard Bowman
fd32c22e30 Fixed formatting 2021-04-21 12:40:10 +01:00
Richard Bowman
1f1a75c02a Merge branch 'master' into auto-exposure-gain-awb 2021-04-21 12:10:47 +01:00
Richard Bowman
cd5e32b843 Removed deprecated np.float
numpy 1.20 deprecates np.float, which was only ever an alias for
``float``.  I've replaced all occurrences of np.float with float, as
recommended.  There should be no change in functionality.
2021-03-30 17:40:19 +01:00
Richard Bowman
a373afd955 swap print for logging in old function 2021-03-16 11:01:57 +00:00
Richard Bowman
3b435ab2ee Deleted obsolete functions 2021-02-18 15:56:11 +00:00
Richard Bowman
b06dd187ec Fixed args in endpoints 2021-02-15 20:18:34 +00:00
Richard Bowman
069d27bf15 Lock access to picamera
The picamera object isn't thread safe; I have now wrapped all access
in context managers that acquire the BaseCamera.lock

I also added an endpoint to reset the LST without auto-gain.
2021-02-15 20:15:55 +00:00
Richard Bowman
a9709b14ea Added locking to recalibrate functions
When testing the UI I noticed that the different recalibrate routines
don't use locks properly, so they try to run
concurrently.

This commit isn't tested yet...
2021-02-15 19:21:27 +00:00
Richard Bowman
0f1a400979 Fixed type hint 2021-02-15 17:04:44 +00:00
Richard Bowman
4c27d88b37 Fixed description and linted 2021-02-11 15:54:58 +00:00
Richard Bowman
5527c4eb7b Fix auto-exposure and AWB
The previous "auto calibrate" button for the camera relied on a
combination of the built-in autoexposure/AWB and
some JPEG-based tweaks to get the exposure settings right.
This often led to confusing results, e.g. oscillating between green and
 pink images.

 I have rewritten the auto-exposure code to adjust gain and shutter
 speed based on the raw image.  This seems to be
 very reliable, at the expense of being quite slow.  That's a price I'm
 happy to pay.

 I have replaced both the camera's auto white balance and my
 JPEG-based AWB hack with a single-shot AWB method that
 looks at the raw image.
2021-02-11 14:30:20 +00:00
Joel Collins
7ba3f447e1 Added extra type hints 2020-12-04 15:23:03 +00:00
Joel Collins
63b633ba44 2.9 dev numpy types 2020-12-04 13:35:11 +00:00
Joel Collins
8d0759e9e0 Updated default extensions to subclass structure 2020-11-30 16:41:39 +00:00
Joel Collins
7866ec0f47 Static type analysis 2020-11-30 13:36:45 +00:00
Joel Collins
6fb61e1e3f Reverted logging style 2020-11-12 15:45:58 +00:00
Joel Collins
9f5252194a Updated all log strings to new format 2020-11-12 15:12:17 +00:00
Joel Collins
9310deeeff Fixed pylint line ignores 2020-10-16 09:35:41 +00:00
Joel Collins
994e83dbeb Code cleanup 2020-10-14 14:56:29 +00:00
Joel Collins
2bfb988460 Code formatting 2020-10-13 15:02:19 +01:00
Joel Collins
893e8e9357 Calibrate with greyworld AWB if available 2020-09-09 17:25:31 +01:00
Joel Collins
54c342bbbb Switch to picamerax 2020-09-07 16:31:59 +01:00
Joel Collins
24398ba7dc Updated tasks nomenclature 2020-07-21 12:54:42 +01:00
Joel Collins
2e9fb72f98 Removed old decorators import 2020-06-29 15:38:19 +01:00
Joel Collins
bf3b141ec4 Fixed logging message 2020-05-27 13:19:32 +01:00
Joel Collins
e9c1fe0507 Fixed logging import 2020-05-27 12:56:57 +01:00
Joel Collins
1819ca6a9c Switched to ActionView and PropertyView from decorators 2020-05-26 10:54:21 +01:00
Joel Collins
4a553040d3 Fixed logging and split access and root file handlers 2020-05-20 17:46:44 +01:00
Joel Collins
3a16a48d54 Fixed LST calibration endpoints 2020-05-12 14:29:11 +01:00
Joel Collins
eaf4cf09f5 Updated to new Action tasks 2020-05-12 11:29:53 +01:00
Joel Collins
9646058c37 Code format 2020-04-28 13:20:38 +01:00
Richard Bowman
e6ad52f107 Added an option to reset LST to None
This doesn't seem to work until you restart - probably an issue in my
picamera fork.
2020-03-24 17:42:49 +00:00
Richard Bowman
b9bb7d5dca Added a route to flatten the lens shading table
NB this is NOT the same as reverting to no lens shading table, as
there's a certain amount of auto-stuff that happens in that case.
2020-03-24 17:24:03 +00:00
Joel Collins
265eed7bfa Fixed picamera setup 2020-01-29 16:16:09 +00:00
jtc42
6df7fe9405 Blackened 2020-01-24 15:41:33 +00:00
jtc42
36334ed743 Moved to a LabThings dependency for server 2020-01-17 15:13:32 +00:00
Joel Collins
bd7cea0fdf Added draft PiCamera LST extension 2020-01-14 16:36:37 +00:00