triclopscontext.h
Go to the documentation of this file.
1 /**************************************************************************************************
2  Software License Agreement (BSD License)
3 
4  Copyright (c) 2011-2013, LAR toolkit developers - University of Aveiro - http://lars.mec.ua.pt
5  All rights reserved.
6 
7  Redistribution and use in source and binary forms, with or without modification, are permitted
8  provided that the following conditions are met:
9 
10  *Redistributions of source code must retain the above copyright notice, this list of
11  conditions and the following disclaimer.
12  *Redistributions in binary form must reproduce the above copyright notice, this list of
13  conditions and the following disclaimer in the documentation and/or other materials provided
14  with the distribution.
15  *Neither the name of the University of Aveiro nor the names of its contributors may be used to
16  endorse or promote products derived from this software without specific prior written permission.
17 
18  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
19  IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20  FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
21  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
24  IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
25  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 ***************************************************************************************************/
32 //=============================================================================
33 // Copyright © 2004 Point Grey Research, Inc. All Rights Reserved.
34 //
35 // This software is the confidential and proprietary information of Point
36 // Grey Research, Inc. ("Confidential Information"). You shall not
37 // disclose such Confidential Information and shall use it only in
38 // accordance with the terms of the license agreement you entered into
39 // with Point Grey Research, Inc. (PGR).
40 //
41 // PGR MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
42 // SOFTWARE, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
43 // IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
44 // PURPOSE, OR NON-INFRINGEMENT. PGR SHALL NOT BE LIABLE FOR ANY DAMAGES
45 // SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
46 // THIS SOFTWARE OR ITS DERIVATIVES.
47 //
48 //=============================================================================
49 //=============================================================================
50 // $Id: triclopscontext.h,v 2.6 2010/06/24 22:04:18 arturp Exp $
51 //=============================================================================
52 #ifndef TRICLOPSCONTEXT_H
53 #define TRICLOPSCONTEXT_H
54 
55 //=============================================================================
56 //
57 // This file defines the the API for TriclopsContext management functions
58 // within the Triclops Stereo Vision SDK.
59 //
60 //=============================================================================
61 
62 
63 //=============================================================================
64 // Defines
65 //=============================================================================
66 
67 //=============================================================================
68 // System Includes
69 //=============================================================================
70 
71 #include <triclops.h>
72 
73 #ifdef __cplusplus
74 extern "C"
75 {
76 #endif
77 
78 //=============================================================================
79 // Macros
80 //=============================================================================
81 
82 
83 //=============================================================================
84 // Enumerations
85 //=============================================================================
86 //
87 // Group = Enumerations
88 
89 //
90 // Name: TriclopsCameraConfiguration
91 //
92 // Description:
93 // This enumerated type defines the camera configuration. The symbols in
94 // the table represent the cameras as they would be seen when the camera
95 // module is viewed from the front. This type is either read from the camera
96 // or is set manually to indicate 2-Camera mode.
97 //
99 {
100  // L shaped three camera system ** obsolete **.
101  TriCfg_L = 0,
102  // 2 Camera Unit or 3 Camera Unit in 2 camera stereo mode.
104  TriCfg_2CAM_HORIZONTAL_NARROW = 1, // 12cm baseline for BB2 or XB3
105  // 2 Camera Vertical Unit or 3 Camera Unit in 2 camera vertical mode.
107  TriCfg_2CAM_HORIZONTAL_WIDE = 3, // 24cm baseline for XB3
109 
111 
112 
113 //=============================================================================
114 // Types
115 //=============================================================================
116 
117 //=============================================================================
118 // Function Prototypes
119 //=============================================================================
120 
121 //=============================================================================
122 // Triclops Context Manipulation
123 //=============================================================================
124 //
125 //Group = Triclops Context Manipulation
126 
127 //
128 // Name: triclopsGetDefaultContextFromFile
129 //
130 // Synopsis:
131 // Setup the initial context with data obtained from a file.
132 //
133 // Input:
134 // filename - The configuration file name.
135 //
136 // Output:
137 // defaultContext - The default context.
138 //
139 // Returns:
140 // TriclopsErrorOk - The operation succeeded.
141 // CorruptConfigFile - The specified file was corrupt, or was for the
142 // wrong Triclops version.
143 //
144 // Description:
145 // This function reads in the default option list and the camera
146 // calibration data from a file. If the specified file is not found,
147 // contains invalid fields, or is for the wrong product, the value of
148 // CorruptConfigFile will be returned.
149 //
150 // See Also:
151 // triclopsWriteDefaultContextToFile(), triclopsWriteCurrentContextToFile()
152 //
155  char* filename );
156 
157 //
158 // Name: triclopsWriteDefaultContextToFile
159 //
160 // Synopsis:
161 // This writes the default calibration file from the TriclopsContext
162 // to a file.
163 //
164 // Input:
165 // context - The TriclopsContext
166 // filename - The name of the file to be written
167 //
168 // Output:
169 // none
170 //
171 // Returns:
172 // TriclopsErrorOk - The operation succeeded.
173 // InvalidContext - The context provided was invalid
174 // SystemError - Could not open the specified file
175 //
176 // Description:
177 // This function writes the default context parameters and calibration
178 // data to a file. It does not write the current configuration, rather the
179 // original configuration that would obtained when getting the default
180 // from either a file or a device.
181 //
182 // See Also:
183 // TriclopsGetDefaultContextFromFile(), triclopsWriteCurrentContextToFile()
184 //
187  char* filename );
188 
189 
190 //
191 // Name: triclopsWriteCurrentContextToFile
192 //
193 // Synopsis:
194 // This writes the calibration and parameter file from the TriclopsContext
195 // to a file. It is the "current" context, so it uses the parameters
196 // that are currently active in the TriclopsContext. Any parameter changes
197 // that have been made through the API will be reflected in this
198 // calibration file.
199 //
200 // Input:
201 // context - The TriclopsContext
202 // filename - The name of the file to be written
203 //
204 // Output:
205 // none
206 //
207 // Returns:
208 // TriclopsErrorOk - The operation succeeded.
209 // InvalidContext - The context provided was invalid
210 // SystemError - Could not open the specified file
211 //
212 // Description:
213 // This function writes the current context parameters and calibration
214 // data to a file.
215 //
216 // See Also:
217 // TriclopsGetDefaultContextFromFile(), triclopsWriteDefaultContextToFile()
218 //
221  char* filename );
222 
223 
224 //
225 // Name: triclopsCopyContext
226 //
227 // Synopsis:
228 // Copies the context parameters and images. Care must be taken when
229 // using triclopsCopyContext() as contexts will share image buffers.
230 //
231 // Input:
232 // contextIn - A context that has already been constructed.
233 //
234 // Output:
235 // contextOut - A copy of the input context.
236 //
237 // Returns:
238 // TriclopsErrorOk - The operation succeeded.
239 // InvalidContext - The input context is invalid.
240 //
241 // Description:
242 // This function creates a copy of the input context. This allows
243 // the user to have two contexts with the same options and also to
244 // share the same image buffers. Care must be taken with this function.
245 // The ensuing contexts will share image buffers. This allows them to
246 // share some of the previous processing, however, any changes in resolution
247 // or calls to set image buffers will create new buffers to be used. These
248 // buffers will no longer be shared and thus programs may not operate as
249 // expected at this time. The recommendation is to use this operation when
250 // one wants to run stereo with different stereo options. After the
251 // preprocessing step, the context can be copied and different stereo options
252 // set before the call to triclopsStereo().
253 //
254 // Note: This only copies the options, not the images
255 //
256 // See Also:
257 // triclopsGetDefaultContext(), triclopsDestroyContext()
258 //
260 triclopsCopyContext( const TriclopsContext contextIn,
261  TriclopsContext* contextOut );
262 
263 //
264 // Name: triclopsDestroyContext
265 //
266 // Synopsis:
267 // Destroys the given context.
268 //
269 // Input:
270 // Context - The context to be destroyed.
271 //
272 // Returns:
273 // TriclopsErrorOk - The operation succeeded.
274 // InvalidContext - The context was invalid.
275 //
276 // Description:
277 // This function destroys a context and frees all associated memory.
278 //
281 
282 //=============================================================================
283 // Configuration
284 //=============================================================================
285 //
286 // Group = Configuration
287 
288 //
289 // Name: triclopsGetCameraConfiguration
290 //
291 // Synopsis:
292 // Retrieves the current configuration of the stereo camera. This
293 // configuration is the configuration that specifies the stereo
294 // algorithm used. For example, 2CAM_HORIZONTAL configuration can be
295 // used to do 2 camera stereo on a 3 camera device.
296 //
297 // Input:
298 // context - The context.
299 //
300 // Output:
301 // config - A pointer that will hold the result.
302 //
303 // Returns:
304 // TriclopsErrorOk - The operation succeeded.
305 // InvalidContext - The input context was invalid.
306 //
307 // See Also:
308 // TriclopsCameraConfiguration, TriclopsSetCameraConfiguration(),
309 // TriclopsGetDeviceConfiguration()
310 //
313  TriclopsCameraConfiguration* config );
314 
315 //
316 // Name: triclopsSetCameraConfiguration
317 //
318 // Synopsis:
319 // Sets the configuration of the cameras. This configuration determines
320 // the configuration for the stereo algorithm. For example, a three camera
321 // stereo device may be set into "2 camera horizontal" mode for faster
322 // stereo processing.
323 //
324 // Input:
325 // context - The context.
326 // config - The new CameraConfiguration.
327 //
328 // Returns:
329 // TriclopsErrorOk - The operation succeeded.
330 // InvalidContext - The input context was invalid.
331 // InvalidParameter - 'config' is not a valid camera configuration
332 //
333 // See Also:
334 // TriclopsCameraConfiguration, TriclopsGetCameraConfiguration(),
335 // TriclopsGetDeviceConfiguration()
336 //
340 
341 //
342 // Name: triclopsGetDeviceConfiguration
343 //
344 // Synopsis:
345 // This function returns the physical configuration of the stereo device.
346 // This allows the user to determine what algorithms they have available
347 // on the current device.
348 //
349 // Input:
350 // context - The context.
351 //
352 // Output:
353 // config - The physical CameraConfiguration.
354 //
355 // Returns:
356 // TriclopsErrorOk - The operation succeeded.
357 // InvalidContext - The input context was invalid.
358 //
359 // See Also:
360 // TriclopsCameraConfiguration, TriclopsGetCameraConfiguration(),
361 // TriclopsSetCameraConfiguration()
362 //
365  TriclopsCameraConfiguration* config );
366 
367 //
368 // Name: triclopsGetSerialNumber
369 //
370 // Description:
371 // This function returns the serial number of the stereo camera
372 // product associated with the given TriclopsContext.
373 //
374 // Input:
375 // context - The context to extract the serial number from.
376 //
377 // Output:
378 // serialNumber - The serial number of the stereo camera product
379 // associated with the given context.
380 //
381 // Returns:
382 // TriclopsErrorOk - Upon the successful completion of the operation.
383 //
386  int* serialNumber );
387 
388 #ifdef __cplusplus
389 }
390 #endif
391 
392 #endif // #ifndef TRICLOPSCONTEXT_H
TriclopsError triclopsCopyContext(const TriclopsContext contextIn, TriclopsContext *contextOut)
TriclopsError triclopsGetSerialNumber(const TriclopsContext context, int *serialNumber)
TriclopsError triclopsDestroyContext(TriclopsContext context)
TriclopsError triclopsWriteCurrentContextToFile(TriclopsContext context, char *filename)
TriclopsError triclopsGetDeviceConfiguration(const TriclopsContext context, TriclopsCameraConfiguration *config)
TriclopsError triclopsSetCameraConfiguration(const TriclopsContext context, TriclopsCameraConfiguration config)
This is from point grey. Check the manual for instructions.
TriclopsCameraConfiguration
void * TriclopsContext
Definition: triclops.h:272
TriclopsError
Definition: triclops.h:99
TriclopsError triclopsWriteDefaultContextToFile(TriclopsContext context, char *filename)
TriclopsError triclopsGetCameraConfiguration(const TriclopsContext context, TriclopsCameraConfiguration *config)
TriclopsError triclopsGetDefaultContextFromFile(TriclopsContext *defaultContext, char *filename)


xb3
Author(s): Miguel Oliveira, Tiago Talhada
autogenerated on Mon Mar 2 2015 01:33:02