Page 1 of 1

get histogram of captured image

Posted: Mon Oct 29, 2018 3:44 pm
by yifei
I'd like to get the histogram of my captured image so I can adjust the exposure time automatically. Is there a lib/function to do so?

I have two more questions

- I also see there is a function SharpCap.ImageProcessing.SkyCoordConverter.ConvertAltAzToRaDec, what's the params types of this and how to use it? how can I learn the param myself?
- I'm trying to import numpy but directly adding it to path seems not working.
What I did is use site.addsitedir(r'my\anaconda2\lib\site-packages')
import numpy
then it syas: ImportError, cannot import nultiarray from numpy.core
What's the correct way if I want to use numpy here?

Thanks!

Re: get histogram of captured image

Posted: Mon Oct 29, 2018 9:58 pm
by admin
Hi,

see this thread - viewtopic.php?f=14&t=1141 - for details on how to get notification of each frame being captured and in particular get the frame object itself. When you have the frame object, frame.GetStats() will give you back the mean and standard deviation of the frame pixel values. Not quite the histogram, but probably enough for a first attempt at this.

I don't think you will be able to import numpy - SharpCap uses IronPython and is only able to import pure python code, where I think numpy uses C code.

I'm not sure why you don't see more help in the UI at the moment for things like the parameters on the SkyCoordConverter - I will investigate if something has broken there.

cheers,

Robin

Re: get histogram of captured image

Posted: Tue Oct 30, 2018 12:01 am
by yifei
Thank you Robin, this is very useful!
Could you please also tell me the params for SkyCoordConverter?

Re: get histogram of captured image

Posted: Tue Oct 30, 2018 6:40 pm
by admin
Hi,

actually I've fixed the bug in SharpCap that stopped the intellisense from showing the parameters - I will upload a new build later today that will let you find that info (and other functions) yourself.

cheers,

Robin

Re: get histogram of captured image

Posted: Tue Oct 30, 2018 7:15 pm
by admin
New build uploaded - you should now see parameter lists like this
Capture.JPG
Capture.JPG (36.05 KiB) Viewed 1279 times
To see parameters on a type constructor, enter the name of the type followed by a '.', then use the down arrow key to go down to the method '__new__' in the suggestion list and ignore the first parameter of 'cls: type'.

cheers,

Robin

Re: get histogram of captured image

Posted: Wed Oct 31, 2018 2:41 pm
by yifei
wow. awesome! Thank you!