triclopsimageio.h
Go to the documentation of this file.
1 
6 //=============================================================================
7 // Copyright © 2004 Point Grey Research, Inc. All Rights Reserved.
8 //
9 // This software is the confidential and proprietary information of Point
10 // Grey Research, Inc. ("Confidential Information"). You shall not
11 // disclose such Confidential Information and shall use it only in
12 // accordance with the terms of the license agreement you entered into
13 // with Point Grey Research, Inc. (PGR).
14 //
15 // PGR MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
16 // SOFTWARE, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
17 // IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
18 // PURPOSE, OR NON-INFRINGEMENT. PGR SHALL NOT BE LIABLE FOR ANY DAMAGES
19 // SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
20 // THIS SOFTWARE OR ITS DERIVATIVES.
21 //
22 //=============================================================================
23 //=============================================================================
24 // $Id: triclopsimageio.h,v 2.6 2007/11/30 00:43:03 soowei Exp $
25 //=============================================================================
26 #ifndef TRICLOPSIMAGEIO_H
27 #define TRICLOPSIMAGEIO_H
28 
29 //=============================================================================
30 //
31 // This file defines the API for the Triclops Stereo Vision SDK
32 // for functions that deal with saving and loading images
33 //
34 //=============================================================================
35 
36 
37 //=============================================================================
38 // Defines
39 //=============================================================================
40 
41 //=============================================================================
42 // System Includes
43 //=============================================================================
44 
45 #include <triclops.h>
46 
47 #ifdef __cplusplus
48 extern "C"
49 {
50 #endif
51 
52 //=============================================================================
53 // Macros
54 //=============================================================================
55 
56 //=============================================================================
57 // Enumerations
58 //=============================================================================
59 
60 //=============================================================================
61 // Types
62 //=============================================================================
63 //
64 // Group = Types
65 
66 //
67 // Name: RectifiedImageInfo
68 //
69 // Description:
70 // Information that is stored in a Pgm file created using
71 // triclopsSaveImageExtra when passed the TriclopsImageType TriImg_RECTIFIED
72 // as the second parameter.
73 //
74 typedef struct
75 {
78 
79 //
80 // Name: EdgeImageInfo
81 //
82 // Description:
83 // Information that is stored in a Pgm file created using
84 // triclopsSaveImageExtra when passed the TriclopsImageType TriImg_EDGE
85 // as the second parameter.
86 //
87 typedef struct
88 {
91  bool lowpassOn;
93 
94 //
95 // Name: DisparityImageInfo
96 //
97 // Description:
98 // Information that is stored in a Pgm file created using
99 // triclopsSaveImageExtra when passed the TriclopsImageType TriImg_DISPARITY
100 // as the second parameter.
101 //
102 typedef struct
103 {
107  bool lowpassOn;
119  unsigned char textureValidMapping;
122  unsigned char uniqueValidMapping;
124  unsigned char backForthValidMapping;
128  unsigned char surfaceValidMapping;
130 
131 //
132 // Name: TriclopsImageInfo
133 //
134 // Description:
135 // This structure is used to hold any image information available when an
136 // image is read in to the triclopsLibrary. It currently works with the
137 // function calls triclopsReadImage[16]Extra. Different information is available
138 // depending on the TriclopsImageType of the image -- that is the function
139 // of the union. The information will be available if the image was created
140 // using the triclopsSaveImage[16]Extra function.
141 typedef struct
142 {
144  char product[100];
147  union
148  {
151  } type;
152  union
153  {
157  } info;
158 
160 
161 
162 //=============================================================================
163 // Image I/O Operations
164 //=============================================================================
165 // Group = Image I/O Operations
166 
167 //
168 // Name: triclopsSaveImageExtra
169 //
170 // Synopsis:
171 // Saves the specified type of image associated with the specified camera to a
172 // file named "filename". Currently, the only output file format supported is PGM.
173 //
174 // Input:
175 // context - The context.
176 // imageType - The image type requested.
177 // camera - The camera that generated the requested image.
178 // filename - The file name in which to save the image.
179 //
180 // Returns:
181 // TriclopsErrorOk - The operation succeeded.
182 // SystemError - The file could not be opened
183 // InvalidContext - The input context was invalid.
184 // InvalidCamera - The camera does not match a camera in this configuration.
185 // InvalidRequest - The image type does not match the camera or is not being
186 // generated by this system with the current context options.
187 // ErrorUnknown - The image was unable to be written properly for an unknown
188 // reason.
189 //
190 // Description:
191 // Saves the specified type of image associated with the specified camera to a
192 // file named "filename". Depending on the image type, certain useful
193 // comments are filled in to the header.
194 // For all images, the camera type and serial number are filled in. For each
195 // image type, only relevant parameters are filled in. E.g., for the
196 // TriImg_RECTIFIED type, the only additional comment is the rectification
197 // quality.
198 //
201  TriclopsImageType imageType,
202  TriclopsCamera camera,
203  char* filename);
204 
205 //
206 // Name: triclopsSaveImage16Extra
207 //
208 // Synopsis:
209 // Saves the specified type of 16-bit image associated with the specified
210 // camera to a file named "filename". Currently, the only output file format
211 // supported is PGM.
212 //
213 // Input:
214 // context - The context.
215 // image16Type - The 16-bit image type requested.
216 // camera - The camera that generated the requested image.
217 // filename - The file name in which to save the image.
218 //
219 // Returns:
220 // TriclopsErrorOk - The operation succeeded.
221 // SystemError - The file could not be opened
222 // InvalidContext - The input context was invalid.
223 // InvalidCamera - The camera does not match a camera in this configuration.
224 // InvalidRequest - The image type does not match the camera or is not being
225 // generated by this system with the current context options.
226 // ErrorUnknown - The image was unable to be written properly for an unknown
227 // reason.
228 //
229 // Description:
230 // Saves the specified type of 16-bit image associated with the specified camera
231 // to a file named "filename". Depending on the image type, certain useful
232 // comments are filled in to the header.
233 // For all images, the camera type and serial number are filled in.
234 //
235 // See Also:
236 // triclopsSaveImageExtra()
237 //
240  TriclopsImage16Type image16Type,
241  TriclopsCamera camera,
242  char* filename );
243 
244 //
245 // Name: triclopsReadImageExtra
246 //
247 // Synopsis:
248 // Reads an image from a file named "filename" into a triclopsImage,
249 // filling in as much of the imageInfo structure as possible from the input
250 // file's header. Currently, the only input file format supported is PGM.
251 //
252 // Input:
253 // filename - The name of the file from which the image is read.
254 // triclopsImage - The image that gets read.
255 // imageInfo - Relevant information about the image that is read.
256 //
257 // Returns:
258 // TriclopsErrorOk - The operation succeeded.
259 // TriclopsErrorFileRead - Could not read in the specified file (not
260 // found, or corrupted).
261 // TriclopsErrorCorruptPGRComment - The PGR comment in the header was
262 // corrupted. The imageInfo is invalid, but the file body ("the image")
263 // was read in successfully.
264 //
265 // Description:
266 // Reads an image from a file named "filename" into a triclopsImage. If
267 // the image was created using the triclopsSaveImageExtra function, it should
268 // contain information about the image, depending on the image type. This
269 // information is parsed from the header and placed into the imageInfo
270 // structure. If the image is a rectified, edge, or disparity image, the
271 // appropriate parameter in the TriclopsImageInfo union will be filled in.
272 // ** NOTE: Even if the function returns triclopsErrorOk, you still need to
273 // check the TriclopsImageInfo "commentFound" boolean field, in case there
274 // was no PGRComment associated with the input file.
275 //
276 // See Also:
277 // triclopsReadImage16Extra()
278 //
280 triclopsReadImageExtra( char* filename,
281  TriclopsImage* triclopsImage,
282  TriclopsImageInfo* imageInfo);
283 
284 //
285 // Name: triclopsReadImage16Extra
286 //
287 // Synopsis:
288 // Reads an image from a file named "filename" into a TriclopsImage16,
289 // filling in as much of the imageInfo structure as possible from the input
290 // file's header. Currently, the only input file format supported is PGM.
291 //
292 // Input:
293 // filename - The name of the file from which the image is read.
294 // triclopsImage16 - The 16-bit image that gets read.
295 // imageInfo - Relevant information about the image that is read.
296 //
297 // Returns:
298 // TriclopsErrorOk - The operation succeeded.
299 // TriclopsErrorFileRead - Could not read in the specified file
300 // (not found, or corrupted).
301 // TriclopsErrorCorruptPGRComment - The PGR comment in the header was
302 // corrupted. The imageInfo is invalid, but the file body ("the image")
303 // was read in successfully.
304 //
305 // Description:
306 // Reads a 16-bit image from a file named "filename" into a triclopsImage.
307 // If the image was created using the triclopsSaveImage16Extra function, it should
308 // contain information about the image, depending on the image type. This
309 // information is parsed from the header and placed into the imageInfo
310 // structure. If the image is a rectified, edge, or disparity image, the
311 // appropriate parameter in the TriclopsImageInfo union will be filled in.
312 // ** NOTE: Even if the function returns triclopsErrorOk, you still need to
313 // check the TriclopsImageInfo "commentFound" boolean field, in case there
314 // was no PGRComment associated with the input file.
315 //
316 // See Also:
317 // triclopsReadImageExtra()
318 //
320 triclopsReadImage16Extra( char* filename,
321  TriclopsImage16* triclopsImage16,
322  TriclopsImageInfo* imageInfo);
323 
324 
325 //
326 // Name: triclopsSaveColorImage
327 //
328 // Synopsis:
329 // Saves an image to the specified filename. The file format currently
330 // supported is PGM format.
331 //
332 // Input:
333 // image - The TriclopsColorImage to be saved.
334 // filename - The file name in which to save the image.
335 //
336 // Returns:
337 // SystemError - The file could not be opened
338 // TriclopsErrorOk - The operation succeeded.
339 //
340 // Description:
341 // This function saves the input image to the requested file. Currently, this
342 // function will not detect if the file could not be opened, and will always
343 // return successful. Color images are saved in PPM format.
344 //
345 // See Also:
346 // triclopsSaveImage()
347 //
350  char* filename );
351 
352 //
353 // Name: triclopsSavePackedColorImage
354 //
355 // Description:
356 // Allows the user to save a packed color image to the given file.
357 //
358 // Input:
359 // image - A pointer to the buffer containing the image.
360 // filename - The name of the file to be written to.
361 //
362 // Returns:
363 // SystemError - The file could not be opened
364 // TriclopsErrorOk - Upon the successful completion of the operation.
365 //
368  char* filename );
369 
370 
371 
372 
373 
374 #ifdef __cplusplus
375 }
376 #endif
377 
378 #endif // #ifndef TRICLOPSIMAGEIO_H
379 
TriclopsError triclopsReadImageExtra(char *filename, TriclopsImage *triclopsImage, TriclopsImageInfo *imageInfo)
TriclopsError triclopsSavePackedColorImage(TriclopsPackedColorImage *image, char *filename)
TriclopsImage16Type
Definition: triclops.h:184
TriclopsRectImgQuality
TriclopsCamera
Definition: triclops.h:205
TriclopsRectImgQuality rectQuality
TriclopsError triclopsSaveColorImage(TriclopsColorImage *image, char *filename)
TriclopsImageType
Definition: triclops.h:157
TriclopsError triclopsSaveImage16Extra(const TriclopsContext context, TriclopsImage16Type image16Type, TriclopsCamera camera, char *filename)
EdgeImageInfo edge
TriclopsStereoQuality stereoQuality
unsigned char surfaceValidMapping
DisparityImageInfo disparity
TriclopsImage16Type image16Type
TriclopsRectImgQuality rectQuality
TriclopsError triclopsSaveImageExtra(const TriclopsContext context, TriclopsImageType imageType, TriclopsCamera camera, char *filename)
TriclopsStereoQuality
TriclopsRectImgQuality rectQuality
RectifiedImageInfo rectified
This is from point grey. Check the manual for instructions.
TriclopsCameraConfiguration
void * TriclopsContext
Definition: triclops.h:272
TriclopsCamera nCamera
unsigned char uniqueValidMapping
TriclopsError
Definition: triclops.h:99
TriclopsImageType imageType
TriclopsCameraConfiguration camConfig
unsigned char backForthValidMapping
unsigned char textureValidMapping
TriclopsError triclopsReadImage16Extra(char *filename, TriclopsImage16 *triclopsImage16, TriclopsImageInfo *imageInfo)


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