×

INDI Library v2.0.6 is Released (02 Feb 2024)

Bi-monthly release with minor bug fixes and improvements

Problem with in-sequence autofocus?

  • Posts: 17
  • Thank you received: 2
I did an imaging session today and found an issue that the HFR values in the focus module and FITS viewer are inconsistent.
I usually get a HFR of ~2 in focus module, but ~3 and occasionally 4 in fits viewer. I used an 800mm FL scope and asi1600mm, so my pixel scale is around 1”/pixel (0.98 to be exact). My seeing is okay, estimated between 1-2 arcsec. The exposure time for focusing is 10sec and 120 sec for actual imaging.
My stars are not that bad, and I think a hfr of 3 is acceptable to my eyes, so I set the “autofocus if HFR >” field to 4 pixels. But the value is not kept after an autofocus routine, so they went back to ~2 arcsec, which is impossible for me to get. Are there any other ways to solve this except changing the value to 50%? (I would definitely not want it to keep imaging until reaches a very lager hfr if the autofocus is terrible due to clouds or something. The field is intended to let you input a fixed value, right? If I want a value based on current hfr, I would just go to the option page and change the percentage value...)

So, in short, why my hfr value in the focus module and fits value differ by a significant amount? How can I set a specific value for the “autofocus if HFR >” field that will be kept after a focusing routine?

I was using the latest version of start-bleeding 3.50 on a raspberry pi 4 if this helps.

I apologize for my broken English :)
The following user(s) said Thank You: Jasem Mutlaq
3 years 4 months ago #62537

Please Log in or Create an account to join the conversation.

  • Posts: 163
  • Thank you received: 26
I'm sorry, I can't really give you a solution or an answer, but this raises a good point...

I saw this value before and think it makes a lot of sense to enter a relative threshold there, i.e., a ratio or maybe percentage compared to the HFR of the first image after the latest refocus. That way you enter simply 1,3 or 130%, for example, and when the HFR of the new image is above this value, issue a refocus.
The advantage is, it doesn't depend any more on some absolute scaling, but can still be really accurate.

Cheers!
3 years 4 months ago #62538

Please Log in or Create an account to join the conversation.

  • Posts: 1208
  • Thank you received: 559
Roy, Bart,

I have contributed several things to the focus algorithms and to the HFR calculations in
KStars over the past year, and have actually given this issue some thought, though have
not tried to make any changes ti this particular issue, nor do I have a clear idea about what
should be done. However, here are some thoughts:

Background

Note: I have never used the 'Autofocus if HFR > X' check, but I just looked at the code, and,
as I thought, it doesn't appear to work as Roy describes.

How (I believe) things currently work.

Before every light-image (sub) capture, if the 'Autofocus if HFR > X pixels' checkbox is enabled,
the capture module asks the focus module to take a new single image (using the focus tab's
parameters -- though I assume with the capture frame's filter) and to run the focus tab's HFR
calculation. If the "focus HFR" computed is worse than the threshold X, then the focus module
will initiate a full autofocus sequence. Otherwise control goes back to the Capture module which
starts the capture for the light frame.

WHAT IT DOES NOT DO: It doesn't use the previously captured light images's HFR value to make any decisions.

So, I imagine that the design intended the user to be aware of HFR values that focus was
calculating, come up with a threshold, and ask for refocus if the threshold is exceeded.

My thoughts on the above.

HFR is tricky. Ideally its value would be a measurement totally dependent on focus that one
could use to decide if an image was in focus or not. However, in my experience, it is (sometimes
strongly) affected by other non-focus-related variables such as exposure time, sky brightness,
filter used, guiding, .... I haven't (yet) been scientific about the above (it would be nice to really
do an experiment where I make these changes and see their effects on HFR--and I welcome your
data if you want to do it), but this is what I expect. So, I think you would likely not get the same
HFR from a 5-second "focus exposure" as a 5-minute sub exposure. Therefore, to both your points,
I wouldn't expect Focus and Capture to give the same HFR values unless they were using similar
exposure times. That's likely why I don't use the feature--I shoot with a monochrome camera and with
various filters, changing filters every 30-60 minutes, and always autofocus on filter change.
Further, a rise in HFR might be due to guiding, and not to focus at all.

All that said, it really would be nice to perform some check on the light image's HFR.
That's why I added HFR to the Analyze graph. To start to get some better intuition about all this.

In addition to all the above, at this moment in development, with StellarSolver just being integrated into KStars,
I believe that Capture and Focus default to different star extraction parameters (and hence this is more reason
why the HFR values might differ). This is something I intend to look into and hopefully fix, so that at least they
extract stars in the same way by default.

I'm not sure what, if anything, should be done to further improve the situation. Feel free to let me know your thoughts.

Hy
The following user(s) said Thank You: Alfred
3 years 4 months ago #62596

Please Log in or Create an account to join the conversation.

  • Posts: 1309
  • Thank you received: 226
I have never really used the 'Autofocus if HFR > X pixels' feature either. And I am surprised to hear it functions by capturing a focus frame just for that purpose. While that actually does sound like the most reliable method, it would definitely cut into observing time.
So my thought is to add an option to check HFR after X number of frames; and only then refocus if HFR is beyond tolerance. Similar to Refocus every X minutes. But only if determined necessary by an observed loss of focus. This way time is not wasted checking focus more frequently than necessary.
3 years 4 months ago #62649

Please Log in or Create an account to join the conversation.

  • Posts: 163
  • Thank you received: 26
Thanks a lot Hy, Ihoujin,

What I thought would be a good strategy, to calculate the HFR of the first (Light) image that's recorded right after the focusing routine, so a HFR of a long exposure.
Then after capturing a new Light, compare the HFR of that image to the first. Once the ratio of the two > x, refocus, else continue with the subsequent images.
Just keep comparing to the first light that's taken right after focusing.
The advantage is: no time lost, and you're comparing -relative- :)

One drawback I can see is that it doesn't take into account different filters, so that's something to think about.
The following user(s) said Thank You: Alfred
3 years 4 months ago #62663

Please Log in or Create an account to join the conversation.

  • Posts: 1309
  • Thank you received: 226
It doesn't take into account guiding irregularities either. But how about this.
Use your strategy of checking the HFR of incoming light frames, but only as a precondition, if it changes, to then capture a short exposure focus frame to double check focus? Then only if it is still off, begin an autofocus routine.
3 years 4 months ago #62685

Please Log in or Create an account to join the conversation.

  • Posts: 401
  • Thank you received: 41
Last night was a disaster so as I am searching for any hints, I revive this thread. Are there any changes to the algorithm since then?. Right now I refocus every 60'. How about you?

So from this


went to this...



And keep measuring like this all night...
Last edit: 1 year 10 months ago by Euripides.
1 year 10 months ago #82920
Attachments:

Please Log in or Create an account to join the conversation.

Time to create page: 0.429 seconds