Flat and image histogram

A place to report problems and bugs in 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

Please also read about Troubleshooting USB Issues before posting.

*** Please do not post license keys - please report any problems with licensing to 'admin' by private message ***

Please include the following details in any bug report:

* Version of SharpCap
* Camera and other hardware being user
* Operating system version
* Contents of the SharpCap log after the problem has occurred.
[If SharpCap crashes, please send the bug report when prompted instead of including the log]
Post Reply
cyo
Posts: 14
Joined: Fri Jun 07, 2024 8:25 pm

Flat and image histogram

#1

Post by cyo »

Hi,

I have a long standing question that I couldn't find the answer about flat in SharpCap. Suppose I have taken a flat with the correct settings (histogram within 30-60% range), and I checked apply flat to my capture. I noticed the histogram of my captured image shifted to the right and the brightness of the preview image also changed.

I suppose that's because the histogram is calculated based on the flat corrected image and the correction scales some pixels up. So comparing the unscaled image vs the scaled image under the same exp/gain settings, if the scaled image is taking the full width of the histogram, the unscaled image must not be occupying the full range of the 255 data range. And AFAIK this is not desirable, and we'd be better off if we adjust the settings to take the exposure to the right and apply flat in post.

Side note: I noticed there is a 30-50% frame drop with the flat correction on when my CPU usage is >60%. Same with dark but the penalty seems more severe.

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

Re: Flat and image histogram

#2

Post by admin »

Hi,

yes, the way that flats correct in SharpCap is to apply no corrections to the areas that are brightest in the flat frame and to boost the brgihtness of other areas that are darker in the flat frame to bring them up to a consistent level.

That means that if you then set the exposure/gain so that the flat corrected image is taking pretty much the whole range of the histogram then those brightest areas that are not being boosted by the flat will be using the whole range in the raw image, while other areas that are being boosted will use a smaller range. This is fine - or rather, the alternative is worse! The thing you want to avoid at all costs is overexposed regions (since in those regions all detail is wiped out as the pixels are all 255). If you try to set the camera up so that the darker areas being boosted by the flat are up to 255 then you will have overexposure, and that's not good.

The flat correction does use a significant amount of CPU power, so it can slow things down, particularly if you have a high resolution camera and an old CPU or one that is of the 'low power usage' types like Intel Celerons. SharpCap will also cut back on the update rate of the display when the CPU usage becomes high. Do make sure that you have the latest update version of SharpCap 4.1 from our download page, as there have been fixes relatively recently to how the reduction in display update rate works.

cheers,

Robin
cyo
Posts: 14
Joined: Fri Jun 07, 2024 8:25 pm

Re: Flat and image histogram

#3

Post by cyo »

Pardon me if I'm not following. Is the "yes" confirming my statement about "we'd be better off if we adjust the settings to take the exposure to the right and apply flat in post."?

What I don't understand is why flat corrected image contains brighter pixels than the raw image.

My PC is powerful enough to run SharpCap and AS3 in parallel and the frame drop seems a recent issue since last month (IIRC 4.1.2333. Or maybe the PC is just feeling old.
Screenshot 2025-07-07 at 9.36.21 AM Large.jpeg
Screenshot 2025-07-07 at 9.36.21 AM Large.jpeg (134.98 KiB) Viewed 1745 times
Screenshot 2025-07-07 at 9.36.26 AM Large.jpeg
Screenshot 2025-07-07 at 9.36.26 AM Large.jpeg (133.65 KiB) Viewed 1745 times
User avatar
admin
Site Admin
Posts: 17524
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Flat and image histogram

#4

Post by admin »

Hi,

I was agreeing that flat correction in SharpCap naturally brightens the image in areas that have reduced illumination levels due to vignetting or dust shadows. This is expected and correct behaviour.

Please can you try the very latest version 4.1.13447 to see if you are still seeing any issues with reduced frame rates. If it is still an issue, let me know, along with details of your CPU and camera and I can investigate further to see if I see anything similar.

thanks,

Robin
Post Reply