Search found 14 matches

by furrysocks2
Tue Sep 25, 2018 10:05 pm
Forum: Scripting
Topic: Custom frame transform?
Replies: 15
Views: 2903

Re: Custom frame transform?

admin wrote:
Sun Sep 23, 2018 7:53 pm
events on the Camera class (FrameCaptured, BeforeFrameDisplay)
I'm assuming dark subtraction and other things happen between these two events?
by furrysocks2
Tue Sep 25, 2018 9:54 pm
Forum: Scripting
Topic: Custom frame transform?
Replies: 15
Views: 2903

Re: Custom frame transform?

Thanks!

I've instrumented the C++ and return the execution time to Python - approximately 160ms per frame (1280x960 MONO8).
by furrysocks2
Tue Sep 25, 2018 8:34 pm
Forum: Scripting
Topic: Custom frame transform?
Replies: 15
Views: 2903

Re: Custom frame transform?

I added a button to the toolbar to open a dialog and allow me to vary the parameters to the C++ routine. Currently only MONO8, but I'll see about MONO16 and perhaps RGB. The approach you suggested certainly works. I don't know to what extent ADPB suits astro images, but I've something to play with n...
by furrysocks2
Tue Sep 25, 2018 11:22 am
Forum: Scripting
Topic: Custom frame transform?
Replies: 15
Views: 2903

Re: Custom frame transform?

Got something working now from Python->C++... it's not fast, but yet to work out why. [Edit - it was a debug build - release is somewhat faster] dll=ctypes.CDLL(dllfile) def handler( sender, eventArgs): frame = eventArgs.Frame info = frame.Info bufsize = int(frame.BufferSize) lease = frame.GetBuffer...
by furrysocks2
Tue Sep 25, 2018 9:39 am
Forum: Scripting
Topic: Custom frame transform?
Replies: 15
Views: 2903

Re: Custom frame transform?

No, not yet.
by furrysocks2
Tue Sep 25, 2018 8:03 am
Forum: Scripting
Topic: Custom frame transform?
Replies: 15
Views: 2903

Re: Custom frame transform?

This works for me... def handler( sender, eventArgs): frame = eventArgs.Frame; bufsize = int(frame.BufferSize) lease = frame.GetBufferLease() frameData_addr = lease.Buffer.ToInt64() frameData_BUF = (ctypes.c_char * bufsize).from_address(frameData_addr) # ... modify frameData_BUF[N] lease.Dispose() P...
by furrysocks2
Mon Sep 24, 2018 10:09 am
Forum: Scripting
Topic: Custom frame transform?
Replies: 15
Views: 2903

Re: Custom frame transform?

I'm uncertain how to interact with the <System.Reflection.Pointer> object that I get from lease.Buffer.ToPointer(). dir(frameData) give me the following: ['Box', 'Equals', 'GetHashCode', 'GetObjectData', 'GetType', 'MemberwiseClone', 'ReferenceEquals', 'ToString', 'Unbox', '__class__', '__delattr__'...
by furrysocks2
Mon Sep 24, 2018 7:21 am
Forum: Scripting
Topic: Custom frame transform?
Replies: 15
Views: 2903

Re: Custom frame transform?

Thanks, Robin. Yes, calling out to native code was a thought. Hooking the event works, I'll try accessing and modifying the frame data. >>> def handler(sender, args): ... print "got frame"; ... >>> SharpCap.SelectedCamera.FrameCaptured += handler; >>> got frame got frame got frame I did get an "Ope...
by furrysocks2
Sun Sep 23, 2018 10:43 pm
Forum: Scripting
Topic: Custom frame transform?
Replies: 15
Views: 2903

Re: Custom frame transform?

:)

Conveniently, ADPB maintains spatial resolution - there is no change in image size, just pixel values.

https://stargazerslounge.com/topic/3022 ... l-binning/


I'd be interested to see what's possible in SharpCap. It may be scripted performance that prevents it.
by furrysocks2
Sun Sep 23, 2018 10:40 am
Forum: Scripting
Topic: Custom frame transform?
Replies: 15
Views: 2903

Custom frame transform?

I have implemented Adaptive Digital Pixel Binning in C++ and wondered whether I am able to port to Python and have SharpCap apply to the previewed image?