Exposure time ramp

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.
User avatar
admin
Site Admin
Posts: 13420
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Exposure time ramp

#11

Post by admin »

Hi Jean-Francois,

on the events,

SharpCap.CaptureEvent will get notifications of things like opening camera, starting capture, ending capture, etc

SharpCap.SelectedCamera.FrameCaptured gets notifications for each frame

you should do the -= to unsubscribe from the event for each one that you have subscribed to.

For the calculation of the maximum value, I have an internal function to calculate the histogram of an ROI of the frame that I could make available. This would work something like

Code: Select all

histogram = Frame.CalculateHistogram(rectangle)
lumArray = histogram.Values[0]
The lumArray is then an array of counts at each brightness level - find the last non-zero element in that array and you have the brightest pixel.

Would that do?

cheers,

Robin
Jean-Francois
Posts: 411
Joined: Sun Oct 13, 2019 10:52 am
Location: Germany

Re: Exposure time ramp

#12

Post by Jean-Francois »

Hello Robin,

I have a function for the maximum now ... but a function for the histogram is better.
So, yes, please make it available ... and I can analyse the image with the histogram.

About the histogram window ... I guess you already say me that it is not possible to show the red rectangle ROI without the histogram.
If it is now possible, please say me.

OK for the -= to unsubscribe. In the past days I had no more significant error or crash on this topic.
But I had a lot with the Python statistics module and with the standard deviation function.
In my script, I have now my own std() function ... and now without a crash (it was an AssertError).

Regards,
Jean-Francois
User avatar
admin
Site Admin
Posts: 13420
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Exposure time ramp

#13

Post by admin »

Hi Jean-Francois,

it's still not possible to activate the selection rectangle without some other SharpCap tool active which supports the selection area, sorry.

cheers,

Robin
Jean-Francois
Posts: 411
Joined: Sun Oct 13, 2019 10:52 am
Location: Germany

Re: Exposure time ramp

#14

Post by Jean-Francois »

Hello Robin,

OK, thanks. Which tools activate the selection rectangle ?
Histogram, focus, ... ?

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

Re: Exposure time ramp

#15

Post by admin »

Hi Jean-Francois,

Histogram, Focus, Photometry, ADC Align and Sensor analysis from the tools. Also Highlight Over Exposed, Boost and Frame stacking from the FX menu.

There is actually also a hidden transform that the 'Select ROI' function uses when choosing a new camera ROI are. I had forgotten about that.

Code: Select all

SharpCap.Transforms.SelectTransform("ROI Selection")


cheers,

Robin
Jean-Francois
Posts: 411
Joined: Sun Oct 13, 2019 10:52 am
Location: Germany

Re: Exposure time ramp

#16

Post by Jean-Francois »

Hello Robin,

Very good ... it is exactly what I needed.

SharpCap.Transforms.SelectTransform("ROI Selection") activate the view of the red rectangle.

Now ... how to hide the red rectangle after use ?
(I can open manually a tool and then close the tool so that the rectangle disappear, but it is not so nice from a script)

In addition, I have very often a script function with an error.
Is it possible to have more information on the parameter(s) of the function ?

If I do simply SharpCap.Transforms.SelectTransform(), then I have an error that "TypeError: SelectTransform() takes exactly 1 argument (0 given)".
I can find that the function need a string (with only "SharpCap.Transforms." in the console and then move the mouse on the "SelectTransform" ... but no detail of the possible strings.

Regards,
Jean-Francois
User avatar
admin
Site Admin
Posts: 13420
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Exposure time ramp

#17

Post by admin »

Hi Jean-Francois,

the strings to use are the names of the available transforms - ie

Code: Select all

print (SharpCap.Transforms[2].Name)
will display the name of the 3rd transform (zero based, but actually index zero is the null transform which does nothing).

To clear the transform,

Code: Select all

SharpCap.Transforms.SelectTransform(None)
or

Code: Select all

SharpCap.Transforms.SelectedTransform = SharpCap.Transforms[0]
cheers,

Robin
Post Reply