Hello Mathworks team,
This is a follow up on @Zoran Popovic's comment here: Does Image Acquisition Toolbox support FLIR (Point Grey) Blackfly S model camera?
Aim: To interface the BlackFly S camera (Model # BFS-U3-04S2M-CS) with Matlab such that I can control the camera through it.
I would like to try loading the Spinnaker drivers into Matlab and use the corresponding register read/write functions. Following are my questions:
1. I would like to know which DLL should I be adding following the procedure Loadlibrary function in Matlab
2. Once the DLL gets loaded, I would like to have the inbuilt register read/write functions list?
I am writing here as I have already tried contacting the FLIR Integrated Imaging Solutions Inc. (formerly known as Point Grey Research) technical support. The lady there informed me to contact Mathworks for further help on this issue.
I use the Spinnaker 64-bit DLL v140 (install the SDK using VS2015 setting) as recommended by the FLIR support team. In Matlab I use C++ compiler configured to:
MEX configured to use 'Microsoft Visual C++ 2015 Professional' for C++ language compilation.
The following is the code I tried:
function [rawfile] = acquireRawImg32Bit() loadlibrary('C:\Program Files\Point Grey Research\Spinnaker\bin\vs2015\SpinnakerC_v140.dll', 'C:\Program Files\Point Grey Research\Spinnaker\include\spinc\SpinnakerC.h') libfunctions('SpinnakerC_v140') hCam = libpointer('hCam', 'spinCamera'); calllib('SpinnakerC_v140', 'spinCameraBeginAcquisition', hCam); unloadlibrary('SpinnakerC_v140');end
After which I got a huge bunch of errors:
Warning: Warnings messages were produced while parsing. Check thefunctions you intend to use for correctness. Warning text can beviewed using: [notfound,warnings]=loadlibrary(...) > In loadlibrary Error loading library intermediate output follows.The actual error is at the end of this output.*********Bareword found where operator expected at (eval 119) line 1, near "0xffffffffL" (Missing operator before L?)Type 'lconvPtr' was not found. Defaulting to type voidPtr.Found on line 5665 of input from line 2111 of file C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\VC\\INCLUDE\\crtdefs.hEval of const expression 0xffffffffL failed with error syntax error at (eval 119) line 2, near "0xffffffffL".Found on line 14010 of input from line 201 of file c:\\program files\\point grey research\\spinnaker\\include\\spinc\\SpinnakerGenApiDefsC.hType ')' was not found. Defaulting to type error.Found on line 18701 of input from line 2176 of file C:\\Program Files\\Point Grey Research\\Spinnaker\\include\\spinc\\SpinnakerC.hFailed to parse type 'dllimport ) spinError spinAVIRecorderClose ( spinAVIRecorder hRecorder' original input 'dllimport ) spinError spinAVIRecorderClose ( spinAVIRecorder hRecorder 'Found on line 18701 of input from line 2176 of file C:\\Program Files\\Point Grey Research\\Spinnaker\\include\\spinc\\SpinnakerC.hError parsing argument for function __declspec function may be invalid.*********Error using loadlibraryBuilding SpinnakerC_v140_thunk_pcwin64 failed. Compiler output is:cl -I"C:\MATLAB\R2016a\extern\include" /Zp8 /W3 /nologo-I"C:\Users\******\Documents\MATLAB" -I"C:\Program Files\Point GreyResearch\Spinnaker\include\spinc" "SpinnakerC_v140_thunk_pcwin64.c" -LD-Fe"SpinnakerC_v140_thunk_pcwin64.dll"SpinnakerC_v140_thunk_pcwin64.cSpinnakerC_v140_thunk_pcwin64.c(444) : error C2059: syntax error : ')'SpinnakerC_v140_thunk_pcwin64.c(444) : error C2061: syntax error :identifier 'spinErrorspinAVIRecorderClose'SpinnakerC_v140_thunk_pcwin64.c(444) : error C2059: syntax error : ';'SpinnakerC_v140_thunk_pcwin64.c(445) : error C2143: syntax error :missing ')' before '{'SpinnakerC_v140_thunk_pcwin64.c(446) : error C2059: syntax error : ')'SpinnakerC_v140_thunk_pcwin64.c(446) : error C2065: 'dllimport' :undeclared identifierSpinnakerC_v140_thunk_pcwin64.c(446) : error C2146: syntax error :missing ';' before identifier 'spinError'SpinnakerC_v140_thunk_pcwin64.c(446) : error C2275: 'spinError' :illegal use of this type as an expression c:\program files\point grey research\spinnaker\include\spinc\SpinnakerDefsC.h(273) : see declaration of 'spinError'SpinnakerC_v140_thunk_pcwin64.c(446) : error C2146: syntax error :missing ';' before identifier 'spinAVIRecorderClose'SpinnakerC_v140_thunk_pcwin64.c(446) : error C2143: syntax error :missing ')' before 'type'SpinnakerC_v140_thunk_pcwin64.c(446) : error C2198:'spinAVIRecorderClose' : too few arguments for callSpinnakerC_v140_thunk_pcwin64.c(447) : error C2065: 'p0' : undeclaredidentifierSpinnakerC_v140_thunk_pcwin64.c(447) : error C2065: 'dllimport' :undeclared identifierSpinnakerC_v140_thunk_pcwin64.c(447) : error C2100: illegal indirectionSpinnakerC_v140_thunk_pcwin64.c(447) : error C2146: syntax error :missing ';' before identifier 'spinError'SpinnakerC_v140_thunk_pcwin64.c(447) : error C2275: 'spinError' :illegal use of this type as an expression c:\program files\point grey research\spinnaker\include\spinc\SpinnakerDefsC.h(273) : see declaration of 'spinError'SpinnakerC_v140_thunk_pcwin64.c(447) : error C2146: syntax error :missing ';' before identifier 'spinAVIRecorderClose'SpinnakerC_v140_thunk_pcwin64.c(447) : error C2143: syntax error :missing ')' before 'type'SpinnakerC_v140_thunk_pcwin64.c(447) : error C2198:'spinAVIRecorderClose' : too few arguments for callSpinnakerC_v140_thunk_pcwin64.c(447) : error C2059: syntax error : ')'SpinnakerC_v140_thunk_pcwin64.c(448) : error C2065: 'p0' : undeclaredidentifierSpinnakerC_v140_thunk_pcwin64.c(449) : error C2059: syntax error : ')' end
Do not know how to resolve these errors, although I tried various recommended methods on stackoverflow as well as Mathworks forums. Please help as Mathworks team would know how to resolve this in a timely and efficient manner.
Best Answer