00001 /************************************************************************************************** 00002 Software License Agreement (BSD License) 00003 00004 Copyright (c) 2011-2013, LAR toolkit developers - University of Aveiro - http://lars.mec.ua.pt 00005 All rights reserved. 00006 00007 Redistribution and use in source and binary forms, with or without modification, are permitted 00008 provided that the following conditions are met: 00009 00010 *Redistributions of source code must retain the above copyright notice, this list of 00011 conditions and the following disclaimer. 00012 *Redistributions in binary form must reproduce the above copyright notice, this list of 00013 conditions and the following disclaimer in the documentation and/or other materials provided 00014 with the distribution. 00015 *Neither the name of the University of Aveiro nor the names of its contributors may be used to 00016 endorse or promote products derived from this software without specific prior written permission. 00017 00018 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR 00019 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 00020 FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 00021 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00022 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 00023 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 00024 IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 00025 OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00026 ***************************************************************************************************/ 00032 //============================================================================= 00033 // Copyright � 2004 Point Grey Research, Inc. All Rights Reserved. 00034 // 00035 // This software is the confidential and proprietary information of Point 00036 // Grey Research, Inc. ("Confidential Information"). You shall not 00037 // disclose such Confidential Information and shall use it only in 00038 // accordance with the terms of the license agreement you entered into 00039 // with Point Grey Research, Inc. (PGR). 00040 // 00041 // PGR MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE 00042 // SOFTWARE, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE 00043 // IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 00044 // PURPOSE, OR NON-INFRINGEMENT. PGR SHALL NOT BE LIABLE FOR ANY DAMAGES 00045 // SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING 00046 // THIS SOFTWARE OR ITS DERIVATIVES. 00047 // 00048 //============================================================================= 00049 //============================================================================= 00050 // $Id: triclops.h,v 2.94 2010/06/25 00:35:21 arturp Exp $ 00051 //============================================================================= 00052 #ifndef TRICLOPS_H 00053 #define TRICLOPS_H 00054 00055 //============================================================================= 00056 // 00057 // This file defines the the API for the Triclops Stereo Vision SDK. 00058 // 00059 //============================================================================= 00060 00061 00062 //============================================================================= 00063 // Defines 00064 //============================================================================= 00065 00066 // 00067 // The version of the library. 00068 // 00069 #define TRICLOPS_VERSION 3302 00070 00071 //============================================================================= 00072 // System Includes 00073 //============================================================================= 00074 00075 #ifdef __cplusplus 00076 extern "C" 00077 { 00078 #endif 00079 00080 //============================================================================= 00081 // Macros 00082 //============================================================================= 00083 00084 00085 //============================================================================= 00086 // Enumerations 00087 //============================================================================= 00088 // 00089 // Group = Enumerations 00090 00091 // 00092 // Name: TriclopsError 00093 // 00094 // Description: 00095 // All Triclops functions return an error value that indicates whether 00096 // an error occurred, and if so what error. The following enumerated 00097 // type lists the kinds of errors that may be returned. 00098 // 00099 typedef enum TriclopsError 00100 { 00101 // Function succeeded. 00102 TriclopsErrorOk = 0, 00103 // User requested an option that is not yet implemented. 00104 TriclopsErrorNotImplemented, 00105 // User specified input to the function that was not a valid value for 00106 // this function. 00107 TriclopsErrorInvalidSetting, 00108 // The TriclopsContext passed in was corrupt or invalid. 00109 TriclopsErrorInvalidContext, 00110 // The specified camera is not valid for this camera configuration. 00111 TriclopsErrorInvalidCamera, 00112 // An impossible Region Of Interest was specified. 00113 // For example, a region of interest with negative height or width. 00114 TriclopsErrorInvalidROI, 00115 // Given the current specified options, the request is not valid. 00116 // For example, requesting the disparity image from a context that has 00117 // not executed 'triclopsStereo()'. 00118 TriclopsErrorInvalidRequest, 00119 // Some options are illegal or contradictory. 00120 TriclopsErrorBadOptions, 00121 // The configuration file is corrupted, missing mandatory fields, 00122 // or is for the wrong Triclops version. 00123 TriclopsErrorCorruptConfigFile, 00124 // Can not find the configuration file. 00125 TriclopsErrorNoConfigFile, 00126 // An indeterminable error occurred. 00127 TriclopsErrorUnknown, 00128 // A function that requires MMX was called on a non-MMX enabled CPU. 00129 TriclopsErrorNonMMXCpu, 00130 // An invalid parameter has been passed. 00131 TriclopsErrorInvalidParameter, 00132 // A call to TriclopsSetSurfaceValidation has caused an overflow. 00133 TriclopsErrorSurfaceValidationOverflow, 00134 // An error has occurred during a system call. Check 'errno' to 00135 // determine the reason. 00136 // This includes the system running out of memory. 00137 TriclopsErrorCorruptTransformFile, 00138 // Can not find the transform file or its contents is invalid 00139 TriclopsErrorSystemError, 00140 // Error reading in a file. 00141 TriclopsErrorFileRead, 00142 // The PGR comment in a PGM header was corrupted 00143 TriclopsErrorCorruptPGRComment, 00144 // This Triclops functionality has been deprecated 00145 TriclopsErrorDeprecated 00146 00147 } TriclopsError; 00148 00149 // 00150 // Name: TriclopsImageType 00151 // 00152 // Description: 00153 // The enumerated type TriclopsImageType indicates what kind of image 00154 // is either being requested or returned. It also indicates the size 00155 // of each pixel in the image. 00156 // 00157 typedef enum TriclopsImageType 00158 { 00159 // Disparity image: This is the resultant depth image after stereo 00160 // processing. 00161 TriImg_DISPARITY = 0, 00162 // Raw unrectified image: This is an image with the aspect ratio 00163 // that was supplied by the input. There is no correction for lens 00164 // distortion or camera misalignment. 00165 TriImg_RAW, 00166 // Rectified image: This is an image that has been corrected for lens 00167 // distortion and camera misalignment to fit a pinhole camera model. 00168 TriImg_RECTIFIED, 00169 // Edge image: A Bandpass filter has been applied to this image. 00170 // This image has values that range about 128. A value of 128 00171 // indicates no edge. Values greater and less than 128 indicate 00172 // an edge with strength relative to the difference between 128 and 00173 // the pixel value. 00174 TriImg_EDGE, 00175 00176 } TriclopsImageType; 00177 00178 // 00179 // Name: TriclopsImage16Type 00180 // 00181 // Description: 00182 // This enumerated type defines the various 16bit image types. 00183 // 00184 typedef enum TriclopsImage16Type 00185 { 00186 // Disparity Image: This is the 16-bit resultant depth image after 00187 // stereo processing with subpixel on. 00188 TriImg16_DISPARITY = 0 00189 00190 } TriclopsImage16Type; 00191 00192 00193 // 00194 // Name: TriclopsCamera 00195 // 00196 // Description: 00197 // This enumerated type identifies individual cameras given a specific 00198 // camera configuration. 00199 // 00200 // Remarks: 00201 // TriCam_COLOR is only for use with the Color Triclops. It is not 00202 // used for any Bumblebee product (TriCam_COLOR may be phased 00203 // out in future releases of Triclops SDK). 00204 // 00205 typedef enum TriclopsCamera 00206 { 00207 TriCam_REFERENCE, 00208 TriCam_RIGHT, 00209 TriCam_TOP, 00210 TriCam_LEFT, 00211 00212 // These are kept here as legacy code for now... should be replaced in user 00213 // code to not include the configuration specific "_L_" 00214 // These values may be phased out in future releases of Triclops SDK 00215 TriCam_L_RIGHT = TriCam_RIGHT, 00216 TriCam_L_TOP = TriCam_TOP, 00217 TriCam_L_LEFT = TriCam_LEFT, 00218 00219 TriCam_COLOR, 00220 TriCam_L_COLOR = TriCam_COLOR 00221 00222 } TriclopsCamera; 00223 00224 // 00225 // Name: TriclopsInputType 00226 // 00227 // Description: 00228 // This enumerated type identifies the format of the input to the 00229 // Triclops library. This input has generally either been read from 00230 // a set of files (for off line processing) or has just been delivered 00231 // by a frame grabber. There are two formats of input data that are 00232 // currently being supported. RGB format indicates that the data is 00233 // supplied with a separate buffer for each R, G and B channel. RGB 00234 // packed indicates that the 3 channels are interleaved. 00235 // 00236 typedef enum TriclopsInputType 00237 { 00238 // This is used to mark that the input has not yet been set. 00239 TriInp_NONE, 00240 // An array of pixels with color bands interleaved in the 00241 // following order: [B G R U] [B G R U]. 00242 TriInp_RGB_32BIT_PACKED, 00243 // An array of separated bands with the following ordering: 00244 // [R R R....][G G G...][B B B...]. 00245 TriInp_RGB 00246 00247 } TriclopsInputType; 00248 00249 00250 //============================================================================= 00251 // Types 00252 //============================================================================= 00253 // 00254 // Group = Types 00255 00256 // 00257 // Name: TriclopsBool 00258 // 00259 // Description: 00260 // Definition for Boolean variables. 00261 // 00262 typedef int TriclopsBool; 00263 00264 // 00265 // Name: TriclopsContext 00266 // 00267 // Description: 00268 // Triclops context is a pointer to an internal structure that maintains 00269 // all image and bookkeeping information necessary to the Triclops library. 00270 // It is the container for all parameters 00271 // 00272 typedef void* TriclopsContext; 00273 00274 // 00275 // Name: TriclopsTimestamp 00276 // 00277 // Description: 00278 // This structure describes the format by which time is represented in the 00279 // Triclops Stereo Vision SDK. 00280 // 00281 typedef struct TriclopsTimestamp 00282 { 00283 // The number of seconds since the epoch. 00284 long sec; 00285 // The number of microseconds within the second. 00286 long u_sec; 00287 00288 } TriclopsTimestamp; 00289 00290 // 00291 // Name: TriclopsImage 00292 // 00293 // Description: 00294 // This structure is used both for image input and output from the 00295 // Triclops system. 00296 // 00297 typedef struct TriclopsImage 00298 { 00299 // The number of rows in the image. 00300 int nrows; 00301 // The number of columns in the image. 00302 int ncols; 00303 // This is the pitch, or row increment for the image. Data must be 00304 // contiguous within each row, and the rows must be equally spaced. 00305 // Rowinc indicates the number of bytes between the beginning of a 00306 // row and the beginning of the following row. 00307 int rowinc; 00308 // The area for the pixel data. This must be numRows * numCols bytes 00309 // large. 00310 unsigned char* data; 00311 00312 } TriclopsImage; 00313 00314 // 00315 // Name: TriclopsImage16 00316 // 00317 // Description: This structure is used for image output from the Triclops 00318 // system for image types that require 16-bits per pixel. This is the format 00319 // for subpixel interpolated images. The structure is identical to the 00320 // TriclopsImage structure except that the data contains unsigned shorts 00321 // rather than unsigned chars. Rowinc is still the number of bytes between 00322 // the beginning of a row and the beginning of the following row 00323 // (NOT number of pixels). 00324 // 00325 typedef struct TriclopsImage16 00326 { 00327 // The number of rows in the image. 00328 int nrows; 00329 // The number of columns in the image. 00330 int ncols; 00331 // The number row increment of the image. 00332 int rowinc; 00333 // The pixel data of the image. 00334 unsigned short* data; 00335 00336 } TriclopsImage16; 00337 00338 // 00339 // Name: TriclopsColorImage 00340 // 00341 // Description: 00342 // This structure is used for image output from the Triclops system for color 00343 // images. The structure is the same as TriclopsImage except that the data 00344 // field is replaced by three color bands; 'red', 'green' and 'blue'. Each 00345 // band is a complete image for that particular color band. In this case, 00346 // rowinc is the row increment for each color band. 00347 // 00348 typedef struct TriclopsColorImage 00349 { 00350 // The number of rows in the image. 00351 int nrows; 00352 // The number of columns in the image. 00353 int ncols; 00354 // The row increment of the image. 00355 int rowinc; 00356 // The pixel data for red band of the image. 00357 unsigned char* red; 00358 // The pixel data for green band of the image. 00359 unsigned char* green; 00360 // The pixel data for blue band of the image. 00361 unsigned char* blue; 00362 00363 } TriclopsColorImage; 00364 00365 // 00366 // Name: TriclopsPackedColorPixel 00367 // 00368 // Description: 00369 // This structure defines the format for a 32bit color pixel. 00370 // 00371 typedef struct TriclopsPackedColorPixel 00372 { 00373 // The 32 bit pixel data. 00374 unsigned char value[4]; 00375 00376 } TriclopsPackedColorPixel; 00377 00378 // 00379 // Name: TriclopsPackedColorImage 00380 // 00381 // Description: 00382 // This structure defines the format of a 32bit packed color image. 00383 // 00384 typedef struct TriclopsPackedColorImage 00385 { 00386 // The number of rows in the image. 00387 int nrows; 00388 // The number of columns in the image. 00389 int ncols; 00390 // The number of bytes in each row of the image. 00391 int rowinc; 00392 // A pointer to the pixel data. 00393 TriclopsPackedColorPixel* data; 00394 00395 } TriclopsPackedColorImage; 00396 00397 // 00398 // Name: TriclopsInputRGB32BitPacked 00399 // 00400 // Description: 00401 // This structure contains RGB packed data. 00402 // 00403 typedef struct TriclopsInputRGB32BitPacked 00404 { 00405 // a pointer to an array of nrows*ncols*4 pixels. The pixels are 00406 // organized in the following fashion [RGBU][RGBU] ... 00407 void* data; 00408 00409 } TriclopsInputRGB32BitPacked; 00410 00411 // 00412 // Name: TriclopsInputRGB 00413 // 00414 // Description: 00415 // This structure consists of three separate buffers, 00416 // each containing nrows * ncols pixels for each of the RGB bands. 00417 typedef struct TriclopsInputRGB 00418 { 00419 // The red band. 00420 void* red; 00421 // The green band. 00422 void* green; 00423 // The blue band. 00424 void* blue; 00425 00426 } TriclopsInputRGB; 00427 00428 // 00429 // Name: TriclopsInput 00430 // 00431 // Description: 00432 // TriclopsInput structure contains image input to the Triclops library. 00433 // The library accepts two formats: 32-bit packed, and RGB separate buffer 00434 // inputs. Field u contains a pointer to one of the two typed structures 00435 // that contain the image data. The inputType field indicates which type of 00436 // input is actually present in the structure. 00437 // 00438 typedef struct TriclopsInput 00439 { 00440 // The input type indicating packed or unpacked data. 00441 TriclopsInputType inputType; 00442 // The timestamp on the image data (generated by the camera.) 00443 TriclopsTimestamp timeStamp; 00444 // The number of rows in the input images. 00445 int nrows; 00446 // The number of columns in the input images. 00447 int ncols; 00448 // The row increment of the input images. 00449 int rowinc; 00450 00451 // The actual image data is either packed or unpacked and can be accessed 00452 // with either TriclopsinputRGB or TriclopsInputRGB32BitPacked. 00453 union 00454 { 00455 TriclopsInputRGB rgb; 00456 TriclopsInputRGB32BitPacked rgb32BitPacked; 00457 } u; 00458 00459 } TriclopsInput; 00460 00461 00462 00463 //============================================================================= 00464 // Function Prototypes 00465 //============================================================================= 00466 00467 //============================================================================= 00468 // Debugging and Error Reporting 00469 //============================================================================= 00470 // 00471 // Group = Debugging and Error Reporting 00472 00473 // 00474 // Name: triclopsErrorToString 00475 // 00476 // Synopsis: 00477 // Converts a Triclops error into a meaningful string. 00478 // 00479 // Input: 00480 // error - The value of a TriclopsError variable. 00481 // 00482 // Returns: 00483 // char* - A string describing the nature of the TriclopsError. 00484 // 00485 // Description: 00486 // This function returns a string that describes the given TriclopsError. 00487 // This allows error reporting software to report meaningful error messages 00488 // to the user. 00489 // 00490 // See Also: 00491 // TriclopsError 00492 // 00493 char* 00494 triclopsErrorToString( TriclopsError error ); 00495 00496 //============================================================================= 00497 // General 00498 //============================================================================= 00499 // 00500 // Group = General 00501 00502 // 00503 // Name: triclopsVersion 00504 // 00505 // Synopsis: 00506 // Returns a string with the Triclops library version. 00507 // 00508 // Input: 00509 // 00510 // 00511 // Returns: 00512 // char* - A string containing the version information for the context. 00513 // 00514 // Description: 00515 // This function returns internally-handled memory. The caller should not 00516 // free the returned pointer. 00517 // 00518 // 00519 const char* 00520 triclopsVersion(); 00521 00522 00523 00524 // 00525 // Name: triclopsGetImage 00526 // 00527 // Synopsis: 00528 // Retrieves a specified type of image associated with the specified camera. 00529 // 00530 // Input: 00531 // context - The context. 00532 // imageType - The image type requested. 00533 // camera - The camera that generated the requested image. 00534 // 00535 // Output: 00536 // image - A TriclopsImage with the image data. 00537 // 00538 // Returns: 00539 // TriclopsErrorOk - The operation succeeded. 00540 // InvalidContext - The input context was invalid. 00541 // InvalidCamera - The camera does not match a camera in this configuration. 00542 // InvalidRequest - The image type does not match the camera or is not being 00543 // generated by this system with the current context options. 00544 // 00545 // Description: 00546 // This function supplies the data to a TriclopsImage. The user is 00547 // responsible for allocating the TriclopsImage structure. The data 00548 // value of the structure will point to memory within the stereo kernel 00549 // working space. Therefore, if a permanent copy of this image is desired, 00550 // the user must copy it out. 00551 // 00552 // See Also: 00553 // triclopsSetImageBuffer() 00554 // 00555 TriclopsError 00556 triclopsGetImage( const TriclopsContext context, 00557 TriclopsImageType imageType, 00558 TriclopsCamera camera, 00559 TriclopsImage* image ); 00560 00561 // 00562 // Name: triclopsBuildRGBTriclopsInput 00563 // 00564 // Synopsis: 00565 // Uses the parameters passed in to build up a Triclops Input 00566 // 00567 // Input: 00568 // iCols - The number of columns in the image 00569 // iRows - The number of rows in the image 00570 // iRowInc - The number of bytes in each row of the image 00571 // ulSeconds - The second value of the image timestamp 00572 // ulMicroSeconds - The microsecond value of the image timestamp 00573 // 00574 // Output: 00575 // pDataR - A buffer to hold the R data 00576 // pDataG - A buffer to hold the G data 00577 // pDataB - A buffer to hold the B data 00578 // triclopsInput - A TriclopsInput created by the FlyCapture image passed in. 00579 // 00580 // Returns: 00581 // TriclopsErrorOk - The operation succeeded. 00582 // TriclopsErrorFailed - The operation failed. 00583 // 00584 // Description: 00585 // This function takes a FlyCapture image and converts it to a triclops input. 00586 // Depending on the camera (BB, BB2, XB3), it will deinterleave the images 00587 // and create a Triclops Input of RGB type. 00588 // 00589 // 00590 TriclopsError 00591 triclopsBuildRGBTriclopsInput (int iCols, 00592 int iRows, 00593 int iRowInc, 00594 unsigned long ulSeconds, 00595 unsigned long ulMicroSeconds, 00596 unsigned char* pDataR, 00597 unsigned char* pDataG, 00598 unsigned char* pDataB, 00599 TriclopsInput* triclopsInput); 00600 00601 // 00602 // Name: triclopsBuildRGBTriclopsInput 00603 // 00604 // Synopsis: 00605 // Uses the parameters passed in to build up a Triclops Input 00606 // 00607 // Input: 00608 // iCols - The number of columns in the image 00609 // iRows - The number of rows in the image 00610 // iRowInc - The number of bytes in each row of the image 00611 // ulSeconds - The second value of the image timestamp 00612 // ulMicroSeconds - The microsecond value of the image timestamp 00613 // 00614 // Output: 00615 // pDataPacked - An array to hold the packed data 00616 // triclopsInput - A TriclopsInput created by the FlyCapture image passed in. 00617 // 00618 // Returns: 00619 // TriclopsErrorOk - The operation succeeded. 00620 // TriclopsErrorFailed - The operation failed. 00621 // 00622 // Description: 00623 // This function takes a FlyCapture image and converts it to a triclops input. 00624 // Depending on the camera (BB, BB2, XB3), it will deinterleave the images 00625 // and create a Triclops Input of RGB type. 00626 // 00627 // 00628 TriclopsError 00629 triclopsBuildPackedTriclopsInput (int iCols, 00630 int iRows, 00631 int iRowInc, 00632 unsigned long ulSeconds, 00633 unsigned long ulMicroSeconds, 00634 unsigned char* pDataPacked, 00635 TriclopsInput* triclopsInput); 00636 00637 // 00638 // Name: triclopsSaveImage 00639 // 00640 // Synopsis: 00641 // Saves an image to the specified filename. The file format currently 00642 // supported is PGM format. 00643 // 00644 // Input: 00645 // image - The TriclopsImage to be saved. 00646 // filename - The file name in which to save the image. 00647 // 00648 // Returns: 00649 // SystemError - The file could not be opened 00650 // TriclopsErrorOk - The operation succeeded. 00651 // 00652 // Description: 00653 // This function saves the input image to the requested file. Currently, this 00654 // function will not detect if the file could not be opened, and will always 00655 // show successful return. 00656 // 00657 TriclopsError 00658 triclopsSaveImage( TriclopsImage* image, 00659 char* filename ); 00660 00661 00662 // 00663 // Name: triclopsGetImage16 00664 // 00665 // Synopsis: 00666 // Retrieves a specified 16-bit image associated with the specified camera. 00667 // 00668 // Input: 00669 // context - The context. 00670 // imageType - The image type requested. 00671 // camera - The camera that generated the requested image. 00672 // 00673 // Output: 00674 // image - A TriclospImage16 with the image data. 00675 // 00676 // Returns: 00677 // TriclopsErrorOk - The operation succeeded. 00678 // InvalidContext - The input context was invalid. 00679 // InvalidCamera - The camera does not match a camera in this configuration. 00680 // InvalidRequest - The image type does not match the camera or is not being 00681 // generated by this system with the current context options. 00682 // 00683 // Description: 00684 // This function performs the same action as triclopsGetImage(), except that 00685 // it retrieves a 16-bit image type. Currently the only supported 16-bit 00686 // image is the resultant disparity image from subpixel interpolation. 00687 // 00688 // See Also: 00689 // triclopsGetImage() 00690 // 00691 TriclopsError 00692 triclopsGetImage16( const TriclopsContext context, 00693 TriclopsImage16Type imageType, 00694 TriclopsCamera camera, 00695 TriclopsImage16* image ); 00696 00697 00698 // 00699 // Name: triclopsSaveImage16 00700 // 00701 // Synopsis: 00702 // Saves an image to the specified filename. The file format currently 00703 // supported is PGM format. 00704 // 00705 // Input: 00706 // image - The TriclopsImage16 to be saved. 00707 // filename - The file name in which to save the image. 00708 // 00709 // Returns: 00710 // SystemError - The file could not be opened 00711 // TriclopsErrorOk - The operation succeeded. 00712 // 00713 // Description: 00714 // This function saves the input image to the requested file. Currently, 00715 // this function will not detect if the file could not be opened, and will 00716 // always return successful. 00717 // 00718 // See Also: 00719 // triclopsSaveImage() 00720 // 00721 TriclopsError 00722 triclopsSaveImage16( TriclopsImage16* image, 00723 char* filename ); 00724 00725 00726 00727 //============================================================================= 00728 // Rectification 00729 //============================================================================= 00730 // 00731 // Group = Rectification 00732 00733 // 00734 // Name: triclopsRectify 00735 // 00736 // Synopsis: 00737 // Does image unpacking, smoothing, rectification and edge detection, 00738 // as specified by parameters. 00739 // 00740 // Input: 00741 // context - The context. 00742 // input - The image to be processed. 00743 // 00744 // Returns: 00745 // TriclopsErrorOk - The operation succeeded. 00746 // InvalidContext - The input context was invalid. 00747 // NotImplemented - TriclopsInput has rowinc < ncols*pixelsize 00748 // 00749 // Description: 00750 // This function does all necessary preprocessing on the input data. It 00751 // unpacks the data, which strips individual channels from 32-bit packed 00752 // data and puts them into 3 TriImg_RAW channels. It applies a low-pass 00753 // filter on these channels if requested, and corrects for lens distortion 00754 // and camera misalignment, saving these images into TriImg_RECTIFIED. 00755 // Finally it performs 2nd derivative Gaussian edge processing on the 00756 // rectified images and saves them into TriImg_EDGE internal images. 00757 // 00758 // See Also: 00759 // triclopsStereo(), triclopsSetResolution(), triclopsSetEdgeCorrelation(), 00760 // triclopsSetRectify(), triclopsSetLowpass() 00761 // 00762 TriclopsError 00763 triclopsRectify( TriclopsContext context, 00764 TriclopsInput* input ); 00765 00766 00767 // 00768 // Name: triclopsPreprocess 00769 // 00770 // Synopsis: 00771 // Does image unpacking, smoothing, rectification and edge detection, 00772 // as specified by parameters. 00773 // 00774 // Input: 00775 // context - The context. 00776 // input - The image to be processed. 00777 // 00778 // Returns: 00779 // TriclopsErrorOk - The operation succeeded. 00780 // InvalidContext - The input context was invalid. 00781 // NotImplemented - TriclopsInput has rowinc < ncols*pixelsize 00782 // 00783 // Description: 00784 // This function does all necessary preprocessing on the input data. It 00785 // unpacks the data, which strips individual channels from 32-bit packed 00786 // data and puts them into 3 TriImg_RAW channels. It applies a low-pass 00787 // filter on these channels if requested, and corrects for lens distortion 00788 // and camera misalignment, saving these images into TriImg_RECTIFIED. 00789 // Finally it performs 2nd derivative Gaussian edge processing on the 00790 // rectified images and saves them into TriImg_EDGE internal images. 00791 // 00792 // Remarks: 00793 // This function has been renamed as "triclopsRectify()", which is a 00794 // more descriptive name. "triclopsPreprocess()" will be deprecated in 00795 // the future. 00796 // 00797 // See Also: 00798 // triclopsStereo(), triclopsSetResolution(), triclopsSetEdgeCorrelation(), 00799 // triclopsSetRectify(), triclopsSetLowpass() 00800 // 00801 TriclopsError 00802 triclopsPreprocess( TriclopsContext context, 00803 TriclopsInput* input ); 00804 00805 00806 //============================================================================= 00807 // Stereo 00808 //============================================================================= 00809 // 00810 // Group = Stereo 00811 00812 00813 // 00814 // Name: triclopsStereo 00815 // 00816 // Synopsis: 00817 // Does stereo processing, validation, and subpixel interpolation, as 00818 // specified by parameters. 00819 // 00820 // Input: 00821 // context - The context. 00822 // 00823 // Returns: 00824 // TriclopsErrorOk - The operation succeeded. 00825 // BadOptions - There are some contradictory options set. 00826 // NotImplemented - The context camera configuration is not supported. 00827 // InvalidROI - ROI has negative dimensions or illegal starting position. 00828 // InvalidRequest - triclopsStereo called before triclopsPreprocess was 00829 // called. 00830 // 00831 // Description: 00832 // This function performs the stereo processing and validation, and generates 00833 // the internal image TriImg_DISPARITY. 00834 // 00835 // Remarks: 00836 // An illegal starting position is a upper/left corner that is closer to the 00837 // right/bottom edge of the image than the stereo mask size. 00838 // 00839 // See Also: 00840 // triclopsPreprocessing(), triclopsSetDoStereo(), triclopsEdgeCorrelation(), 00841 // triclopsSetTextureValidation(), triclopsSetUniquenessValidation(), 00842 // triclopsGetROIs(), triclopsSetSubpixelInterpolation() 00843 // 00844 TriclopsError 00845 triclopsStereo( TriclopsContext context ); 00846 00847 #include <triclops3d.h> 00848 #include <triclopsbuffer.h> 00849 #include <triclopscontext.h> 00850 #include <triclopsvalidation.h> 00851 #include <triclopsrectify.h> 00852 #include <triclopsstereo.h> 00853 #include <triclopsimageio.h> 00854 00855 00856 00857 #ifdef __cplusplus 00858 } 00859 #endif 00860 00861 #endif // #ifndef TRICLOPS_H