7 Replies Latest reply on Apr 10, 2017 3:37 AM by Cengiz_SENSIVAS

    How can I set the SHARPNESS and other settings of SR300 during runtime ?

    Cengiz_SENSIVAS

      Hi Guys,

       

      I would like to knw how I can reach the Camera Settings of SR300 ? When I use DirectShow.lib to achieve and modify the settings of SR300, it does imply on the camera but after I close and reconnect via SDK SR300 always starts with default values...so..my question is HOW CAN I set the values of SR300 ( such *** brightness..focus..sharpness..etc.. ) during runtime..???

       

      Thank you for your kind helps and comments in advance...

       

      Best,


      C.

        • 1. Re: How can I set the SHARPNESS and other settings of SR300 during runtime ?
          MartyG

          I'm guessing that you're using the open-source Librealsense SDK rather than the official Intel RealSense SDK?  If so, there is a plugin called  rqt_reconfigure that can be used to dynamically change parameters on the fly

           

          Here's the website for info about it, though unfortunately it seems to be down right now.

           

          http://wiki.ros.org/rqt_reconfigure

          • 2. Re: How can I set the SHARPNESS and other settings of SR300 during runtime ?
            Cengiz_SENSIVAS

            Dear Marty

             

            Thank you for your prompt answer.

             

            Infact, I am using the official Intel realSense SDK...By way, inthe meantime I managed to succeed to set the camera CameraControlProperties and also the VideoProcAmpProperties using DirectShowLib....

             

            However  I will also check the website you suggested as well

             

            Wish you a nice day/night ahead,

             

            Best

            C.

            • 3. Re: How can I set the SHARPNESS and other settings of SR300 during runtime ?
              MartyG

              I'm glad you found a solution with DirectShow.  Have a great week ahead too! 

              • 4. Re: How can I set the SHARPNESS and other settings of SR300 during runtime ?
                jb455

                Cengiz_SENSIVAS Can you post how you did this please? Sounds like it'd be useful for others (myself included!)

                • 5. Re: How can I set the SHARPNESS and other settings of SR300 during runtime ?
                  Cengiz_SENSIVAS

                  Hi JB

                   

                  Well, first of all I have to mention that it was not easy at all... As I have a bit of a coding background on DirectShow from my previous works, I used DirectShowLib-2005.dll to create this workaround...Second, I am a VB.NET guy and therefore had to convert all the SDK C# sample into VB.NET... ...was not easy either...

                   

                  What you must do is to create a WEBCAM class  implementing DirectShowLib-2005.dll and then use the IAMVideoProcAmp ( in my code snippet below the m_icp is the reference created when the WEBCLASS is created ) interface to retrieve the Brightness,Gain etc..properties of the camera using VideoProcAmpProperty... my code snippet for this is as follows :

                   

                  Public Function GET_CAMERA_VideoProcAmpProperty_Values(prop As VideoProcAmpProperty) As Integer()
                          On Error GoTo errh

                          Dim p_Min, p_Max, p_STD, p_DEF, propVALUES(1) As Integer
                          Dim p_CAPS As DirectShowLib.VideoProcAmpFlags
                          Dim retval As Integer

                          If m_icp IsNot Nothing Then
                              Dim reto As Integer = m_icp.GetRange(prop, propVALUES(0), propVALUES(1), p_STD, p_DEF, p_CAPS)

                              Return propVALUES
                          Else
                              propVALUES(0) = -1
                              propVALUES(1) = -1
                              Return propVALUES
                          End If
                          Exit Function
                  errh:
                          Err.Clear()
                          propVALUES(0) = -2
                          propVALUES(1) = -2
                          Return propVALUES
                      End Function

                   

                   

                      Public Function SET_CAMERA_VideoProcAmpProperty(prop As VideoProcAmpProperty, value As Integer) As Integer
                          On Error GoTo errh

                          Dim p_Min, p_Max, p_STD, p_DEF, afterSET As Integer
                          Dim p_CAPS As DirectShowLib.VideoProcAmpFlags
                          Dim retval As Integer
                          Dim reto As Integer = m_icp.GetRange(prop, p_Min, p_Max, p_STD, p_DEF, p_CAPS)
                          If m_icp IsNot Nothing Then
                              If p_Max >= value And value >= p_Min Then
                                  retval = m_icp.Set(prop, value, VideoProcAmpFlags.None)
                              End If
                              retval = m_icp.Get(prop, afterSET, DirectShowLib.VideoProcAmpFlags.Manual)
                              Return afterSET
                          Else
                              Return -1
                          End If
                          Exit Function
                  errh:
                          Err.Clear()
                          Return -2
                      End Function

                   

                  When I start the TRACKING loop of SR300 I at the same time start my WEBCAM Class and set the values of the properties of the camera to the desired values....:

                   

                              myCAM = New clsWEBCAM(pictureBox1.Handle)

                              here the integer value 2 below is the index of the SR300 RGB camera  in my device list....

                              myCAM.CONNECT(2, 30, 1920, 1080, "")

                              myCAM.set_camera_Properties()

                   

                  Then just place a Button, 2 Horizontal ScrollBars  and put this code :

                   

                              Dim reto(1) As Integer
                              reto = myCAM.GET_CAMERA_VideoProcAmpProperty_Values(DirectShowLib.VideoProcAmpProperty.Brightness)
                              HScrollBar1.Minimum = reto(0)
                              HScrollBar1.Maximum = reto(1)

                              reto = myCAM.GET_CAMERA_VideoProcAmpProperty_Values(DirectShowLib.VideoProcAmpProperty.Sharpness)
                              HScrollBar2.Minimum = reto(0)
                              HScrollBar2.Maximum = reto(1)

                   

                  Of course, to the SCROLLL events of the HBars :

                   

                             Private Sub HScrollBar1_Scroll(sender As Object, e As ScrollEventArgs) Handles HScrollBar1.Scroll

                              myCAM.SET_CAMERA_VideoProcAmpProperty(DirectShowLib.VideoProcAmpProperty.Brightness, HScrollBar1.Value)

                          End Sub

                   

                        Private Sub HScrollBar2_Scroll(sender As Object, e As ScrollEventArgs) Handles HScrollBar2.Scroll

                              myCAM.SET_CAMERA_VideoProcAmpProperty(DirectShowLib.VideoProcAmpProperty.Sharpness, HScrollBar2.Value)

                          End Sub

                   

                  And BINGO...!... Now I am sure you may think what the heck is that  myCAM = New clsWEBCAM is...

                   

                  I can mail the source code of the clsWEBCAM class I created to you if you want...as it is too long to copy & paste here...

                   

                  Hope this will be helpful to any1 who needs ...

                   

                  Cheers

                  1 of 1 people found this helpful
                  • 6. Re: How can I set the SHARPNESS and other settings of SR300 during runtime ?
                    jb455

                    That's great, thanks! So, you're calling the colour stream as a generic webcam using DirectShow, while at the same time using the depth stream in the SDK for tracking? Or are you able to use the colour stream in both DirectShow and the SDK simultaneously?

                    • 7. Re: How can I set the SHARPNESS and other settings of SR300 during runtime ?
                      Cengiz_SENSIVAS

                      Colour Stream in both SDK and DirectShow...weird right? But it works