Sensor Analysis for DSLR

FearL0rd
Posts: 28
Joined: Sun May 24, 2020 11:05 pm

Sensor Analysis for DSLR

#1

Post by FearL0rd »

Hello,

I have forked a old project for DSLR and we made fully functional and added the official Nikon API in the code. Right now it is fully operational for Canon, Nikon and Pentax. (32bits and 64Bits) and also new CR3 format

Project: https://github.com/FearL0rd/ASCOM.DSLR/ ... /README.md
Wiki Page: https://github.com/FearL0rd/ASCOM.DSLR/ ... stallation

I would like to see if it is possible to run the sensor analysis using the driver. It uses a dropdown list for the GAIN (ISO) but I made a modification in my code to show as a slider and it fails during the GAIN adjustment.

How hard to make the sensor analysis work with a ISO dropdown list? Could you please implement this?

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

Re: Sensor Analysis for DSLR

#2

Post by admin »

Hi,

probably not too hard actually – the main reason that I hadn't bothered to do it was that there were no cameras out there (or practically no cameras out there) that will using that method of gain control in their Ascom driver.

Out of interest, are the gain values in your list the ISO numbers?

Thanks, Robin
FearL0rd
Posts: 28
Joined: Sun May 24, 2020 11:05 pm

Re: Sensor Analysis for DSLR

#3

Post by FearL0rd »

Yes the Gain is the ISO for the driver. this is a sample from my Canon

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

Re: Sensor Analysis for DSLR

#4

Post by admin »

Okay, that will be fine – I can make the code work through each of the options without too much problem.

In another thread I just saw a post where someone said that they tried the analysis with a DSLR and had an error message about not being able to complete in this the camera was in RAW mode. This could be a problem – SharpCap cannot analyse the sensor if the image arrives in RGB format – it has to be able to see the raw pixel values in RGGB/BGGR/etc .

Thanks, Robin
FearL0rd
Posts: 28
Joined: Sun May 24, 2020 11:05 pm

Re: Sensor Analysis for DSLR

#5

Post by FearL0rd »

admin wrote: Wed Jun 24, 2020 10:07 pm Okay, that will be fine – I can make the code work through each of the options without too much problem.

In another thread I just saw a post where someone said that they tried the analysis with a DSLR and had an error message about not being able to complete in this the camera was in RAW mode. This could be a problem – SharpCap cannot analyse the sensor if the image arrives in RGB format – it has to be able to see the raw pixel values in RGGB/BGGR/etc .

Thanks, Robin
I believe he is trying to run the sensor analysis in LiveView mode. He sent me a personal message. LV returns a JPG and shutter mode return a RGGB for example.

It is working for me but it complains about the iso be a select list.

Image
Last edited by FearL0rd on Wed Jun 24, 2020 11:12 pm, edited 1 time in total.
User avatar
admin
Site Admin
Posts: 13173
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Sensor Analysis for DSLR

#6

Post by admin »

Ok,

Next update will have a first go at analysis for discrete gains. I think the analysis has a good chance of working, but I will still need to do more work on the smart histogram as that expects the gain to be continuously variable.

I'm collecting some crash reports from people who are testing - some of the crashes are in the DSLR driver, so I will include the stack traces here for you

Code: Select all

 <Message>Object reference not set to an instance of an object.</Message>
  <Source>ASCOM.DSLR.Camera</Source>
  <StackTrace>   at ASCOM.DSLR.Classes.NikonSDKCamera.<>c__DisplayClass35_0.<liveViewTimer_Tick>b__0(Object o)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()</StackTrace>
  <TargetSite>Void <liveViewTimer_Tick>b__0(System.Object) @ ASCOM.DSLR.Classes.NikonSDKCamera+<>c__DisplayClass35_0</TargetSite>
  <Type>System.NullReferenceException</Type>
another one - looks like it might just be a port in use

Code: Select all

    <ExtendedInformation>
      <HResult>-2146233088</HResult>
    </ExtendedInformation>
    <InnerException>
      <ExtendedInformation>
        <Error>COMM_PORT_IS_IN_USE</Error>
        <HResult>-2146233088</HResult>
      </ExtendedInformation>
      <Message>COMM_PORT_IS_IN_USE</Message>
      <Source>EDSDKLib</Source>
      <StackTrace>   at EOSDigital.API.ErrorHandler.CheckError(Object sender, ErrorCode errorCode)
   at EOSDigital.API.Camera.<OpenSession>b__71_0()
   at EOSDigital.API.STAThread.ExecutionLoop()</StackTrace>
      <TargetSite>Void CheckError(System.Object, EOSDigital.SDK.ErrorCode) @ EOSDigital.API.ErrorHandler</TargetSite>
      <Type>EOSDigital.API.SDKException</Type>
    </InnerException>
    <Message>COMM_PORT_IS_IN_USE</Message>
    <Source>EDSDKLib</Source>
    <StackTrace>   at EOSDigital.API.STAThread.Invoke(Action action)
   at EOSDigital.API.Camera.OpenSession()
   at ASCOM.DSLR.Classes.CanonSdkCamera.OpenSession()
   at ASCOM.DSLR.Classes.CanonSdkCamera.ConnectCamera()
   at ASCOM.DSLR.Camera.set_Connected(Boolean value)</StackTrace>
    <TargetSite>Void Invoke(System.Action) @ EOSDigital.API.STAThread</TargetSite>
    <Type>EOSDigital.API.ExecutionException</Type>
  </InnerException>
  <Message>CheckDotNetExceptions ASCOM.DSLR.Camera ConnectedSet EOSDigital.API.ExecutionException: COMM_PORT_IS_IN_USE ---> EOSDigital.API.SDKException: COMM_PORT_IS_IN_USE
   場所 EOSDigital.API.ErrorHandler.CheckError(Object sender, ErrorCode errorCode)
   場所 EOSDigital.API.Camera.<OpenSession>b__71_0()
   場所 EOSDigital.API.STAThread.ExecutionLoop()
   --- 内部例外スタック トレースの終わり ---
   場所 EOSDigital.API.STAThread.Invoke(Action action)
   場所 EOSDigital.API.Camera.OpenSession()
   場所 ASCOM.DSLR.Classes.CanonSdkCamera.OpenSession()
   場所 ASCOM.DSLR.Classes.CanonSdkCamera.ConnectCamera()
   場所 ASCOM.DSLR.Camera.set_Connected(Boolean value) (See Inner Exception for details)</Message>
  <Source>ASCOM.DriverAccess</Source>
  <StackTrace>   at ASCOM.DriverAccess.MemberFactory.CheckDotNetExceptions(String memberName, Exception e) in C:\ASCOM Build\Export\ASCOM.DriverAccess\MemberFactory.cs:line 630
   at ASCOM.DriverAccess.MemberFactory.SetTargetInvocationExceptionHandler(String memberName, Exception e) in C:\ASCOM Build\Export\ASCOM.DriverAccess\MemberFactory.cs:line 647
   at ASCOM.DriverAccess.MemberFactory.CallMember(Int32 memberCode, String memberName, Type[] parameterTypes, Object[] parms) in C:\ASCOM Build\Export\ASCOM.DriverAccess\MemberFactory.cs:line 315
cheers, Robin
FearL0rd
Posts: 28
Joined: Sun May 24, 2020 11:05 pm

Re: Sensor Analysis for DSLR

#7

Post by FearL0rd »

admin wrote: Thu Jun 25, 2020 7:48 pm Ok,

Next update will have a first go at analysis for discrete gains. I think the analysis has a good chance of working, but I will still need to do more work on the smart histogram as that expects the gain to be continuously variable.

I'm collecting some crash reports from people who are testing - some of the crashes are in the DSLR driver, so I will include the stack traces here for you

Code: Select all

 <Message>Object reference not set to an instance of an object.</Message>
  <Source>ASCOM.DSLR.Camera</Source>
  <StackTrace>   at ASCOM.DSLR.Classes.NikonSDKCamera.<>c__DisplayClass35_0.<liveViewTimer_Tick>b__0(Object o)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()</StackTrace>
  <TargetSite>Void <liveViewTimer_Tick>b__0(System.Object) @ ASCOM.DSLR.Classes.NikonSDKCamera+<>c__DisplayClass35_0</TargetSite>
  <Type>System.NullReferenceException</Type>
another one - looks like it might just be a port in use

Code: Select all

    <ExtendedInformation>
      <HResult>-2146233088</HResult>
    </ExtendedInformation>
    <InnerException>
      <ExtendedInformation>
        <Error>COMM_PORT_IS_IN_USE</Error>
        <HResult>-2146233088</HResult>
      </ExtendedInformation>
      <Message>COMM_PORT_IS_IN_USE</Message>
      <Source>EDSDKLib</Source>
      <StackTrace>   at EOSDigital.API.ErrorHandler.CheckError(Object sender, ErrorCode errorCode)
   at EOSDigital.API.Camera.<OpenSession>b__71_0()
   at EOSDigital.API.STAThread.ExecutionLoop()</StackTrace>
      <TargetSite>Void CheckError(System.Object, EOSDigital.SDK.ErrorCode) @ EOSDigital.API.ErrorHandler</TargetSite>
      <Type>EOSDigital.API.SDKException</Type>
    </InnerException>
    <Message>COMM_PORT_IS_IN_USE</Message>
    <Source>EDSDKLib</Source>
    <StackTrace>   at EOSDigital.API.STAThread.Invoke(Action action)
   at EOSDigital.API.Camera.OpenSession()
   at ASCOM.DSLR.Classes.CanonSdkCamera.OpenSession()
   at ASCOM.DSLR.Classes.CanonSdkCamera.ConnectCamera()
   at ASCOM.DSLR.Camera.set_Connected(Boolean value)</StackTrace>
    <TargetSite>Void Invoke(System.Action) @ EOSDigital.API.STAThread</TargetSite>
    <Type>EOSDigital.API.ExecutionException</Type>
  </InnerException>
  <Message>CheckDotNetExceptions ASCOM.DSLR.Camera ConnectedSet EOSDigital.API.ExecutionException: COMM_PORT_IS_IN_USE ---> EOSDigital.API.SDKException: COMM_PORT_IS_IN_USE
   場所 EOSDigital.API.ErrorHandler.CheckError(Object sender, ErrorCode errorCode)
   場所 EOSDigital.API.Camera.<OpenSession>b__71_0()
   場所 EOSDigital.API.STAThread.ExecutionLoop()
   --- 内部例外スタック トレースの終わり ---
   場所 EOSDigital.API.STAThread.Invoke(Action action)
   場所 EOSDigital.API.Camera.OpenSession()
   場所 ASCOM.DSLR.Classes.CanonSdkCamera.OpenSession()
   場所 ASCOM.DSLR.Classes.CanonSdkCamera.ConnectCamera()
   場所 ASCOM.DSLR.Camera.set_Connected(Boolean value) (See Inner Exception for details)</Message>
  <Source>ASCOM.DriverAccess</Source>
  <StackTrace>   at ASCOM.DriverAccess.MemberFactory.CheckDotNetExceptions(String memberName, Exception e) in C:\ASCOM Build\Export\ASCOM.DriverAccess\MemberFactory.cs:line 630
   at ASCOM.DriverAccess.MemberFactory.SetTargetInvocationExceptionHandler(String memberName, Exception e) in C:\ASCOM Build\Export\ASCOM.DriverAccess\MemberFactory.cs:line 647
   at ASCOM.DriverAccess.MemberFactory.CallMember(Int32 memberCode, String memberName, Type[] parameterTypes, Object[] parms) in C:\ASCOM Build\Export\ASCOM.DriverAccess\MemberFactory.cs:line 315
cheers, Robin
Robin,

they are trying to use the liveview for sensor analisys it will not work. they need to look the project wiki page. they are switching back and foward liveview while sharpcap is working. the software gets lost because keep flipping resolution and RGB(liveview) <> RGGB. I rold them to close everything and start sharpcap in the mode dont switch while it is taking exposures.


wiki page that nobody reads https://github.com/FearL0rd/ASCOM.DSLR/ ... stallation
felipeleon_fotos
Posts: 1
Joined: Wed Jan 27, 2021 3:50 am

Re: Sensor Analysis for DSLR

#8

Post by felipeleon_fotos »

Hello Everyone. I recently purchased Sharpcap license, for many reasons and one of them was the sensor analysis feature. I've been trying with my Canon DSLR (EOS 90D) but the usual outcome is Sharpcap saying that is not possible to perform the analysis in cameras with drop down menu for gain.

Have you had new results in this subject? I wish I could help, but I'm not a programmer. But if you need testers, here I am.
(I'm not using LV mode)

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

Re: Sensor Analysis for DSLR

#9

Post by admin »

Hi,

please try the new beta of SharpCap 3.3 - that should at the very least get past the problem you are currently seeing.

https://www.sharpcap.co.uk/sharpcap/sha ... s/3-3-beta

Robin
blavenn
Posts: 6
Joined: Wed Apr 06, 2022 9:41 pm

Re: Sensor Analysis for DSLR

#10

Post by blavenn »

Hi Robin,

Resurrecting a bit of an old thread here but ran a sensor analysis for my Canon R5 DSLR using the ASCOM Camera Driver, took quite a while since the raw files are quite large. Used a fairly new iPad with a diffuser to get the right exposure for a consistent light source, also didn't have any issues with flickering at different shutter speeds.

My question is do these results seem a bit abnormal in the attached spreadsheet? The numbers kind of jump around all over the place in a non-linear fashion.

Also with this particular camera, ISO800 is supposed to have the largest dynamic range (when shooting video). Probably is not the same for long exposure stills though.
Sharpcap Sensor Analysis - Sheet1.csv
(1.05 KiB) Downloaded 120 times
Post Reply