Closed henrik1g closed 7 years ago
Sorry. The website messed up the patch formatting... :-( If you are interested let me know. I will send it some other way then.
Hi, Henrik1g; Yes, I can definitely take a look and patch it up. Could you try again to post the diff file? I believe enclosing the text in three backtick quotes (see 'codefencing' in the 'markdown supported' link at the top of the comment box) will help with the formatting:
this is a code example.
Look how
well formatted
it seems to be.
Removed most of the metering code, and replaced it with better overall image metering.
Thank you for providing this awesome piece of code! :-)
Found a bug in the metering right side. Maybe consider (parts of) my patch.
Greets henrik
From 611b8fd7ae3908960212fa0ab76f3c89cea94cb5 Mon Sep 17 00:00:00 2001 From: Henrik Bieler Henrik.Bieler@nospam.de Date: Wed, 5 Nov 2014 11:01:16 +0100 Subject: [PATCH 1/5] Fix bug in metering right side. Enable metering other than c. New meter modes bottom and top.
timelapse.py | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-)
diff --git a/timelapse.py b/timelapse.py index a9786f5..cb922ec 100644 --- a/timelapse.py +++ b/timelapse.py @@ -39,7 +39,7 @@ class timelapse: T=timelapse() T.listen() """
def init(self,w=1296,h=972,interval=15,maxtime=0,maxshots=0,targetBrightness=70,maxdelta=256,metering='a'):
@@ -51,7 +51,7 @@ class timelapse:
@@ -84,6 +84,7 @@ class timelapse: print "\tinterval:\t", self.interval print "\tBrightns:\t", self.targetBrightness print "\tSize :\t", self.w, 'x', self.h
def repr(self): return 'A timelapse instance.' @@ -109,9 +110,19 @@ class timelapse: right=int(.3_w)+2 elif meter=='r': top=int(1.0_h/2-.15*h)+1
parser.add_argument( '-m', '--metering', default='a', type=str, choices=['a','c','l','r','t','b'], help='Where to average brightness for brightness calculations.\n"a" measures the whole image, "c" uses a window at the center,\n"l" meters a strip at the left, "r" uses a strip at the right, "t" at top, "b" at bottom' ) parser.add_argument( '-L', '--listen', action='store_true', help='Sets the timelapser to listen mode; listens for a master timelapser to tell it when to shoot.' )
args=parser.parse_args()
TL = timelapse(w=args.width, h=args.height, interval=args.interval, maxshots=args.maxshots, maxtime=args.maxtime, targetBrightness=args.brightness, maxdelta=args.delta, metering=args.metering)
try:
os.listdir('/home/pi/pictures')
1.9.1