Dobson / ROI stabilization

Discussions on extending SharpCap using the built in Python scripting functionality
aquariusCZ
Posts: 61
Joined: Wed Apr 15, 2020 1:02 pm
Location: Ostrava

Dobson / ROI stabilization

#1

Post by aquariusCZ »

Hi,
ROI shift goes nicely in the script.
But the script does not want to run Cupture.
I have to start the upload before running the script manually.
By manual control, I am able to run the script after 100 saved images at the earliest.
I have to go to the script window.

A "run script" button would be useful.
Regards
Tomas



pan=0
dec=1
SharpCap.SelectedCamera.Controls.Pan.Value = pan
SharpCap.SelectedCamera.RunCapture
while pan< 1024:
SharpCap.SelectedCamera.Controls.Pan.Value = pan
pan=pan+dec
# print (pan)
SharpCap.SelectedCamera.StopCapture
SharpCap.SelectedCamera.Controls.Pan.Value = 0
User avatar
admin
Site Admin
Posts: 13267
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Dobson / ROI stabilization

#2

Post by admin »

Hi,

you have to call 'PrepareToCapture' before calling RunCapture.

You can already add custom buttons to the toolbar to run scripts - for instance see the script in this thread : viewtopic.php?t=3431

cheers,

Robin
aquariusCZ
Posts: 61
Joined: Wed Apr 15, 2020 1:02 pm
Location: Ostrava

Re: Dobson / ROI stabilization

#3

Post by aquariusCZ »

HI,
Thanks.
I'm close to a solution. :)
What to write to ()?
I want the script to work with preset values.

SharpCap.SelectedCamera.PrepareToCapture ()
SharpCap.SelectedCamera.RunCapture ()
SharpCap.SelectedCamera.StopCapture ()

Regards
Tomas
ROI posun (2).txt
(340 Bytes) Downloaded 67 times
start=0
end=1112
dec=1
pan=start
SharpCap.SelectedCamera.PrepareToCapture
SharpCap.SelectedCamera.RunCapture
SharpCap.SelectedCamera.Controls.Pan.Value = start
while pan< end:
--SharpCap.SelectedCamera.Controls.Pan.Value = pan
--pan=pan+dec
SharpCap.SelectedCamera.StopCapture
SharpCap.SelectedCamera.Controls.Pan.Value = start

- = space
aquariusCZ
Posts: 61
Joined: Wed Apr 15, 2020 1:02 pm
Location: Ostrava

Re: Dobson / ROI stabilization

#4

Post by aquariusCZ »

It works. :o :o :o :o :o :o
Thanks for inspiring the thread "Can Scripting to this?" by GregMcKay.

import time
import clr
clr.AddReference ("SharpCap")
from SharpCap.UI import CaptureLimitType
SharpCap.SelectedCamera.CaptureConfig.CaptureLimitType = CaptureLimitType.FrameLimited
start = 0
end = 1120
dec = 0.45 #speed
pan = start
SharpCap.SelectedCamera.PrepareToCapture ()
SharpCap.SelectedCamera.RunCapture ()
SharpCap.SelectedCamera.Controls.Pan.Value = start
while pan <end:
--SharpCap.SelectedCamera.Controls.Pan.Value = pan
--pan = pan + dec
SharpCap.SelectedCamera.StopCapture ()
SharpCap.SelectedCamera.Controls.Pan.Value = start

PS.
- = space
aquariusCZ
Posts: 61
Joined: Wed Apr 15, 2020 1:02 pm
Location: Ostrava

Re: Dobson / ROI stabilization

#5

Post by aquariusCZ »

Hello friends,
this script is for Dobson planetary sensing (non-powered holders).
Allows you to take more than 1000 pictures at a focal length of 7m.
Of course, you need an HD camera that can handle 100 fps.

Using a script:
1 / First set the full resolution and rotate the camera so that the image moves from left to right parallel to the longer side of the chip.
2 / You call the script console and load the script.
3 / Select the ROI and move it to the right manually.
Pan = end value in the script. In the script, override: end = Pan
4 / Move the ROI manually to the left edge. Move Dobson to the object to be scanned into the ROI and run the script (green triangle).
5 / The image starts scrolling and saving starts. Monitor the ROI speed and make sure the image is stable (does not shift).
6 / The speed of movement is affected by the speed value. The smaller the value, this makes the movement slower.

ATTENTION. Because there is interference between the scan cycles and the ROI shift cycle
offset, the speed value is not bound linearly to the ROI shift and precise speed setting requires some experience.
In some speed intervals, even a direct ratio does not apply.
Failed sequences can be deleted during speed testing "Delete last capture" command.

I will look for a better way to set the speed. :)


import time
import clr
start = 0
end = 1072
speed = 0.0005
pan = start
SharpCap.SelectedCamera.PrepareToCapture ()
SharpCap.SelectedCamera.RunCapture ()
SharpCap.SelectedCamera.Controls.Pan.Value = start
while pan <end:
--SharpCap.SelectedCamera.Controls.Pan.Value = pan
--pan = pan + speed
SharpCap.SelectedCamera.StopCapture ()
SharpCap.SelectedCamera.Controls.Pan.Value = start

After copying to the console, replace the characters -- with a space
aquariusCZ
Posts: 61
Joined: Wed Apr 15, 2020 1:02 pm
Location: Ostrava

Re: Dobson / ROI stabilization

#6

Post by aquariusCZ »

Hi,
the script works well with ASI482MC and QHY5III178.
QHY HD cameras (462, 290) damage the image when the ROI is shifted.
Tomas
User avatar
admin
Site Admin
Posts: 13267
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Dobson / ROI stabilization

#7

Post by admin »

Hi,

one thing that the ZWO cameras are very good at is changing the ROI without any glitching of the images. As you've noticed other brands tend to do less well at this (which doesn't often matter, but does in this case).

cheers,

Robin
aquariusCZ
Posts: 61
Joined: Wed Apr 15, 2020 1:02 pm
Location: Ostrava

Re: Dobson / ROI stabilization

#8

Post by aquariusCZ »

Hi,
I wrote to QHY, we'll see ... ;)
Tomas
aquariusCZ
Posts: 61
Joined: Wed Apr 15, 2020 1:02 pm
Location: Ostrava

Re: Dobson / ROI stabilization

#9

Post by aquariusCZ »

I'm optimistic, QHY is trying to simulate the error with my script. :)
aquariusCZ
Posts: 61
Joined: Wed Apr 15, 2020 1:02 pm
Location: Ostrava

Re: Dobson / ROI stabilization

#10

Post by aquariusCZ »

Hi,
I want to improve the script algorithm: shift by x by y frames.
I need help, please.

I can't write the command to find out the number of saved images correctly: :?

picture = SharpCap.SelectedCamera.Controls. GetStatus (?,?)

Tomáš
Post Reply