title: Loading c++ dll into c# with opencv
body: <p>I have build .sln code from below <a href="https://github.com/usnistgov/NFIQ2" rel="nofollow noreferrer">github</a> , I have import dll and try to call the initNfiq() method. when i run the build it showing below error</p>
  
  <pre><code>OpenCV Error: Null pointer (Invalid pointer to file storage) in cvRead, file 
      C:\Users\test\Desktop\nfiq\gitrepo\NFIQ2\opencv\download\opencv-2.4.13.6\modules\core\src\persistence.cpp, line 5002
      C:\Users\test\Desktop\nfiq\gitrepo\NFIQ2\opencv\download\opencv-2.4.13.6\modules\core\src\persistence.cpp:5002: error: (-27) Invalid pointer to file storage in function cvRead
  
  NFIQ2 ERROR =&gt; C:\Users\test\Desktop\nfiq\gitrepo\NFIQ2\opencv\download\opencv-2.4.13.6\modules\core\src\persistence.cpp:5002: error: (-27) Invalid pointer to file storage in function cvRead
  </code></pre>
  
  <p>I have searched "NFIQ2 ERROR" github code i found that throwing exception on below code</p>
  
  <pre><code> DLLEXPORT const char* STDCALL InitNfiq2()
    {
      try
      {
        if( g_nfiq2.get() == nullptr )
        {
  #       ifdef EMBED_RANDOMFOREST_PARAMETERS
          g_nfiq2 = std::unique_ptr&lt;NFIQ::NFIQ2Algorithm&gt;( new NFIQ::NFIQ2Algorithm() );
  #       else
          g_nfiq2 = std::unique_ptr&lt;NFIQ::NFIQ2Algorithm&gt;( new NFIQ::NFIQ2Algorithm("nfiq2rf.yaml", "0xccd75820b48c19f1645ef5e9c481c592") );
  #       endif
          return g_nfiq2-&gt;getParameterHash().c_str();
        }
      }
      catch( std::exception&amp; exc )
      {
        std::cerr &lt;&lt; "NFIQ2 ERROR =&gt; " &lt;&lt; exc.what() &lt;&lt; std::endl;
      }
      return nullptr;
    }
  </code></pre>
  
  <p>Later i have added nfiq2rf.yaml file along with .exe in build folder and run the .exe That time i only got a different error like below pic</p>
  
  <pre><code>Initializing NFIQ2 ...
  NFIQ2 ERROR =&gt; The trained network could not be initialized!
  NFIQ2 is ready
  </code></pre>
  
  <p>Need some help to understand this error pls</p>