How can i remove preprocessing from captured images?

Somewhere to ask questions about the best way to use SharpCap
Forum rules


If you have a problem or question, please check the FAQ to see if it already has an answer : https://www.sharpcap.co.uk/sharpcap-faqs
Post Reply
dk101
Posts: 5
Joined: Mon May 09, 2022 9:42 am

How can i remove preprocessing from captured images?

#1

Post by dk101 »

Last night we had a lovely clear night first time in ages so i took some six hours of images. Unfortunately i forgot to turn off preprocessing so all captured images now appear to have had old flats/darks applied. Am i right in assuming that old flats/darks had been applied? Is there a process i could use to reverse this?

It would be nice not to have to throw away a whole night's worth of captures...
User avatar
Menno555
Posts: 1053
Joined: Mon Apr 20, 2020 2:19 pm
Location: The Netherlands
Contact:

Re: How can i remove preprocessing from captured images?

#2

Post by Menno555 »

Hi and welcome

The way you describe it, the calibration files are indeed applied to your captures. And that's a definitive step.
But it depends on how much effect it has on your captures. If it's not too much, you could try the program SiriL for example. It has a function called Background Extraction which equalizes the background.

Menno
User avatar
oopfan
Posts: 1321
Joined: Sat Jul 08, 2017 2:37 pm
Location: New York
Contact:

Re: How can i remove preprocessing from captured images?

#3

Post by oopfan »

Hi dk101,

To be certain, check your Camera Settings file. There should be two lines in there. Here are mine for an imaging run I made last week:

Apply Flat=None
Subtract Dark=None

Your post had me worried that the same had happened to me. My full file below:

[ALTAIRGP290M]
Output Format=FITS files (*.fits)
Capture Area=1920x1080
Pan=0
Tilt=0
Colour Space=MONO12
Black Level=50
USB Speed=1
Auto Exp Target=120
Frame Rate Limit=Maximum
Analogue Gain=200
Exposure=3000
Timestamp Frames=Off
Apply Flat=None
Subtract Dark=None
#Black Point
Display Black Point=0.01171875
#MidTone Point
Display MidTone Point=0.02171875
#White Point
Display White Point=0.138671875
ZWO EFW=W12
TimeStamp=2022-04-29T03:45:22.7094263Z
SharpCapVersion=3.1.5193.0

Good luck!
Brian
dk101
Posts: 5
Joined: Mon May 09, 2022 9:42 am

Re: How can i remove preprocessing from captured images?

#4

Post by dk101 »

Thanks Menno!
Thanks Brian!

Brian - yes, flats/darks had been applied. doh! i can't believe i made such a schoolboy error!
Menno - I'll have a look at SiriL, i have not used it before, I only have PI (and python, of course :D)

Since flat/dark application is a linear transformation of the image and since all the data should be there, i thought that it would be possible to easily reverse the process. Is SharpCap just doing (raw-dark)*gain where gain is ((raw-dark)*m/(flat-dark)) as in https://en.wikipedia.org/wiki/Flat-field_correction? Since dark and flat are known and if SharpCap uses the above formula i guess all i need to do is dark+savedimage(flat-dark)/m to get the raw as it should have been, right?

So, i guess my question really should have been - what formula does SharpCap uses to apply flats and darks?


daniel
User avatar
admin
Site Admin
Posts: 13173
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: How can i remove preprocessing from captured images?

#5

Post by admin »

Hi Daniel,

as the others have pointed out, you *have* saved the images with darks/flats applied.

The processing in SharpCap in this situation will be

saved data = (raw - dark) * constant / (flat - dark flat or bias)

The constant is (roughly) the maximum value in the flat frame - not exactly as unusually high pixel values are ignored - take the value in the flat that 99.99% of pixels are below and you won't be far wrong.

If you have saved a master flat after creating it in SharpCap then the dark flat / bias correction is already included in that saved file.

The one thing that you will be unable to undo is the hot pixel correction that occurs as part of the dark subtraction. SharpCap flags hot pixels as pixels where the dark frame brightness is above 95% of maximum or above 7 sigma above the dark frame mean brightness. In those pixels, SharpCap steals a pixel value from an adacent pixel (of the same colour in the case of RGGB sensors).

cheers,

Robin
User avatar
oopfan
Posts: 1321
Joined: Sat Jul 08, 2017 2:37 pm
Location: New York
Contact:

Re: How can i remove preprocessing from captured images?

#6

Post by oopfan »

Hi Daniel,

Robin can help you with that, I imagine. He'll be posting replies to questions soon.

Brian
dk101
Posts: 5
Joined: Mon May 09, 2022 9:42 am

Re: How can i remove preprocessing from captured images?

#7

Post by dk101 »

Thanks Robin! I think i can live with corrected hot pixels.
Over to pixelmath for me :D
Post Reply