A Couple of small feature requests

Got an idea for something that SharpCap should do? Share it here.
Forum rules
'+1' posts are welcome in this area of the forums to indicate your support for a particular feature suggestion. Suggestions that get the most +1's will be seriously considered for inclusion in future versions of SharpCap.
Borodog
Posts: 487
Joined: Fri Jan 01, 2021 7:25 pm

Re: A Couple of small feature requests

#51

Post by Borodog »

Ok.
Borodog
Posts: 487
Joined: Fri Jan 01, 2021 7:25 pm

Re: A Couple of small feature requests

#52

Post by Borodog »

An update on this.

First, this was in the next-to-latest 4.1 beta (so, not the one that dropped today). Once I got feature tracking (via the mount) working, and planet stabilization working, I put the focus ROI box within the confines of the planet, and turned off brightness compensation . . . it worked. For the most part, it just worked. This was Edge Detection, by the way. A couple of times the seeing got really squirrelly right in the middle of the focus sweep, but that wasn't SharpCap's fault.

If anything, the only thing that bothered me was that it seemed like SharpCap was being a little too eager to declare victory and move to the best score it had calculated perhaps prematurely, leaving the parabola appearing very one-sided to my eyes. I can't say that it didn't actually find the best score, but I know that if I were doing it manually, I would want more samples from outside focus than it was taking to make sure I got the best fit.
User avatar
admin
Site Admin
Posts: 17539
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: A Couple of small feature requests

#53

Post by admin »

Hi,

thanks for the feedback - glad that we are making some progress.

The decision on when to stop and 'declare victory' is based on a range of factors, including needing at least 3 points in the data each side of the computed maximum/minima.

Additionally, in SC 4.1, there must be 3 points on each side of the computed best position that give worse focus scores than the calculated best score by at least 1.5 times the amount of residual standard deviation of the data (after the best fit curve is subtracted out). The chance of a single point being more than 1.5SD lower due to random variation (single sided test) is about 1 in 14, so the chances of all 3 being worse just at random is about one in 2800. Essentially it should mean that SharpCap will want to go further past the best point (more points, further drop from best fit) if the data is noisier than if it is good quality.

cheers,

Robin
Borodog
Posts: 487
Joined: Fri Jan 01, 2021 7:25 pm

Re: A Couple of small feature requests

#54

Post by Borodog »

I think it may mean that now that it is working I don’t need to start so far inside of critical focus.
Borodog
Posts: 487
Joined: Fri Jan 01, 2021 7:25 pm

Re: A Couple of small feature requests

#55

Post by Borodog »

Well, I installed the latest 4.1 beta, and the contrast/edge detection focus method is now completely broken. Perfect upside-down parabolas. Over and over and over. I did exactly what I did the other night in the previous beta that worked so well. Eventually I tried the Fourier Detail method instead and that gave maxima instead of minima and found a fit and focused.

If you have 23 minutes, or less if you speed up playback, you can watch my frustrations, as I recorded the whole thing:

https://youtu.be/6mZYhTCOi28
User avatar
admin
Site Admin
Posts: 17539
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: A Couple of small feature requests

#56

Post by admin »

Hi,

now that is a really interesting result... The reason is that between the inital 4.1 beta (4.1.9730) and the current one (4.1.9767) there have been no changes that impact on the way that the focus score is calculated.

That at least confirms that it is something in the input image data that is causing the issue and that different conditions cause it to either happen or not happen. Things that might have an effect include the brightness of the image, the placement of the selection area relative to the target, the amount of seeing related shimmer and probably a whole lot of other things.

At this point I don't have a solution, so I am going to have to think about capturing more data to understand what is going on. Perhaps if I make more info go into the log (like the ROI area when starting a scan, the camera settings and info about frame numbers), then by combining the log with a video I could reproduce the focus run and also try variations on it to see if I can work out what is going on.

cheers,

Robin
Borodog
Posts: 487
Joined: Fri Jan 01, 2021 7:25 pm

Re: A Couple of small feature requests

#57

Post by Borodog »

Happy to help however I can. I really need this to work.
User avatar
admin
Site Admin
Posts: 17539
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: A Couple of small feature requests

#58

Post by admin »

Hi,

ok, so I have been experimenting with my indoor focus rig (solid cloud here). I have a motor focus driving a small lens focus ring pointing at a printed picture of Jupiter :) With the aperture ring of the lens I can reduce the light level to allow me to set realistic gain/exposure and get a typical level of noise, etc.

I can sort of get similar inverted results if I set up a noisy image and have the noise reduction setting in the focus tool set to a small value. There is often still a small peak at best focus, but it is superimposed on top of a much larger signal from noise, and the noise signal might have a dip or have a steady trend as focus changes. If I set a bigger noise reduction (typically 2 or more) then the problem resolves itself as the noise background is much reduced, meaning the 'in focus' signal stands out and is detected. Another thing that worked was setting 2x2 binning on the camera - in that case I didn't need the noise reduction setting turned up.

Could you try more noise reduction and/or camera binning the next time you get a chance to see if that helps you too - that would confirm whether I'm on the right track at all or not.

thanks,

Robin
Borodog
Posts: 487
Joined: Fri Jan 01, 2021 7:25 pm

Re: A Couple of small feature requests

#59

Post by Borodog »

I will definitely try upping the noise reduction, although it may be have been on 2 when the problem occurred; I'm not sure.

Swapping in and out of binning seems like just one more thing on top of changing the ROI for focusing, although I suppose I could set up different capture profiles, a feature I don't make any use of right now.

As you know, my opinion is that all focus methods should probably be binned 2x2 automatically, at least for OSC cameras, whether in hardware or software.

It's not all doom and gloom, either. After last night, I skipped edge detection and went back to Fourier Detail tonight, and I have to say, it worked great. I put the planet in the box rather than the box in the planet, but otherwise left all settings the same, and it was mostly very robust except when the seeing got highly variable right in the middle of a focus sweep. I do still get the feeling it is often declaring victory one score too soon, though.
User avatar
admin
Site Admin
Posts: 17539
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: A Couple of small feature requests

#60

Post by admin »

Hi,

I'm starting to come to the same conclusion on noise reduction/binning/etc, but I do want to be sure to understand the problem as much as possible before taking steps that make it harder to test different scenarios. I have some code written to do super-pixel debayer and also 2x2 binning - still trying to understand whether this should be always-on or perhaps an option.

cheers,

Robin
Post Reply