Home
TRICLOPS - Computer Science @ UC Davis
Contents
1. e0ososncnonnonononoono on c nn 93 triclopsSetDoSt re Os ren RU oop Mn EN NL ann an rene io E triclopsSetEdgeCorrelation Ri bess ee sess triclopsS etd Se Maske RR triclopsSetlmagel Be da triclopsSetlmageBuffer triclopsSetLowpass triclopsSetNumberOfROIs eee triclopsSetPackedColorImageBuffer triclopsSetReCTIT Yen HN dea triclopsSetResolution triclopsSetResolutionAndP repare ses triclopsSetStereco Mask sio triclopsSetStrictSubpixel Validation triclopsSetSubpixelInterpolation ss triclopsSetSubpixelValidationMapping triclopsSetSurface Validation ee triclopsSetSurfaceValidationDifference triclopsSetSurfaceValidationMapping triclopsSetSurface ValidationSize sienne triclopsSetTexture AU Le RME Ets ne A A RT triclopsSetTextureValidationMapping triclopsSetTexture Validation Threshold triclopsSetTriclopsToWorldTransform seen triclopsSetUniqueness Validation esessenrnnnne triclopsSetUniqueness ValidationMapping triclopsSetUniqueness ValidationThreshold THI CLOPSSTSL EG zrn aces E NON TriclopsTimestamp TriclopsTransform triclopsWnrectify Pixel sais iso OA Triclops StereoVision System Manual Version 3 1 130 Copyright 2003 Point Grey Research Inc triclopsUnsetColorlmageB utter nanninpi a te hh 84 triclopsUnsetlmage GB ii ii 84 triclopsUnsetlmageBuffer oo ccc eeseeeseeceseseseseeseseecsesseseseesesessaesneseseeseeneaeans triclopsU
2. retrieve the depth image from the triclops context iclopsGetImage triclops Trilmg_DISPARITY TriCam_R hlmage retrieve the raw image from the triclops contex iclopsGetImage triclops TrilImg RAW TriCam_REF E amp refImage save the depth and reference images triclopsSavelmage amp depthImage depth pgm triclopsSavelmage amp refImage reference pgm close the digiclops digiclopsStop digiclops digiclopsDestroyContext digiclops destroy the triclops context triclopsDestroyContext triclops return 0 This example is another modification of example 2 It demonstrates the use of Regions of Interest ROIs As before input is retrieved from the Digiclops and stereo processing options are set up Note this time that a larger image 640x480 is used so the stereo mask should also be increased Since a larger image is being used stereo processing time will be longer We can speed this up by specifying Regions of Interest This is done by getting a pointer to an array of TriclopsROI structures with the triclopsGetROIs function call and setting individual elements of this array to specify the ROIs The triclopsSetNumberOfROIs function informs the Triclops library how many Regions of Interest have been set up inside the array Preprocessing and stereo processing then take place as before and the depth and reference images are saved The
3. triclopsSetTriclopsToWorldTransform triclopsGetTriclopsToWorldTransform triclopsGe TransformFromFile triclopsX YZToRCD Converts true 3D points into image coordinates This function takes as input the XYZ position of a point in the Triclops coordinate system and determines what row column and disparity value would result from a sensed point at XYZ Declaration TriclopsError triclopsXYZTORCD TriclopsContext context float x float y Triclops StereoVision System Manual Version 3 1 110 Copyright 2003 Point Grey Research Inc float z float row float col float disp Parameters TriclopsContext set up for desired resolution context X value of a point in the Triclops coordinate system Y value of a point in the Triclops coordinate system Z value of a point in the Triclops coordinate system The row in a disparity image The column in a disparity image The disparity value that would match the point specified in XYZ Ungrouped Objects TRICLOPS_VERSION Declaration define TRICLOPS VERSION 3101 Remarks The version of the library Widebaseline Stereo triclopsCreateImage3d Allocates a TriclopsImage3d to the correct size as specified by the resolution of the TriclopsContext Declaration TriclopsError triclopsCreateImage3d TriclopsContext context TriclopsImage3d ppimage Parameters The current TriclopsContext context Pointer to the address of the TriclopsImage3
4. Example 6 Printing configuration information Example 7 Generating a 3D image point cloud file Example 8 Performs Stereo Using a 2 Camera Kernel Example 9 Using Wide Baseline Stereo Processing CHAPTER 6 TRICLOPS APPLICATION PROGRAMMING INTERFACE API FUNCTION REFERENCE TriclopsInputRGB TriclopsInputRGB32BitP ache dea cisccsscrissvecerdsotesesunsgusovarsassonssdaaierdianeasivsaNpuatdabaensishedetssesegesunasvavcanseseotsacdavetdvoseas 63 SD heats o a sab e SIN ETES 63 LriClopSPACKEACOLOFPIXEL este i a na A aa 64 Triclops StereoVision System Manual Version 3 1 4 Copyright 2003 Point Grey Research Inc TriclopsTimestamp TriclopsTransform DEBUGGING AND ERROR REPORTING EC LOPE NN sov rn EPUCLOPS GOLD CD UG di ss rh ll 65 triclopsSetDebug ss TRICLOPSCONTEXT MANIPULATION triclopsCopyContext ss triclopsDestroy Contexte nm entiere nettes triclopsGetDefaultContextPromFil iii iris triclopsWriteDefaultContextToFile VALIDATION SUPPORT ss triclopsGetStrictSubpixelValidation triclopsGetSubpixelValidationMapping sise triclopsGetSurface Validation ss triclopsGetSurfaceValidationDifference sise triclopsGetSurfaceValidationMapping sine triclopsGetSurfaceValidationSize triclopsGetTextureValidation triclopsGetTextureValidationMapping triclopsGetTextureValidationThreshold triclopsGetUniguene ssValidati01 s010ssstssilai
5. TRICLOPS Software Development Kit SDK Version 3 1 User s guide and command reference Triclops Software License Agreement The Triclops Stereo Vision Software Development Kit the Software is copyrighted by Point Grey Research Inc AlI rights are reserved The purchaser is granted a license to use the Software subject to the following restrictions and limitations 1 THE LICENSE IS TO THE ORIGINAL PURCHASER ONLY AND IS NONTRANSFERABLE UNLESS YOU HAVE RECEIVED WRITTEN PERMISSION OF POINT GREY RESEARCH 2 THE ORIGINAL PURCHASER MAY USE THE SOFTWARE ONLY WITH A TRICLOPS COLOR TRICLOPS OR DIGICLOPS STEREO VISION CAMERA MODULE OWNED BY THE ORIGINAL PURCHASER 3 THE ORIGINAL PURCHASER MAY MAKE BACK UP COPIES OF THE SOFTWARE FOR HIS OR HER OWN USE ONLY SUBJECT TO THE USE LIMITATIONS OF THIS LICENSE 4 THE ORIGINAL PURCHASER MAY NOT ENGAGE IN NOR PERMIT THIRD PARTIES TO ENGAGE IN ANY OF THE FOLLOWING A PROVIDING OR DISCLOSING THE SOFTWARE TO THIRD PARTIES B MAKING ALTERATIONS OR COPIES OF ANY KIND OF THE SOFTWARE EXCEPT AS SPECIFICALLY PERMITTED ABOVE C ATTEMPTING TO DISASSEMBLE DECOMPILE OR REVERSE ENGINEER THE SOFTWARE IN ANY WAY D GRANTING SUBLICENSES LEASES OR OTHER RIGHTS IN THE SOFTWARE TO OTHERS POINT GREY RESEARCH INC RESERVES THE RIGHT TO TERMINATE THIS LICENSE IF THERE ARE ANY VIOLATIONS OF ITS TERMS OR IF THERE IS A DEFAULT COMMITTED BY THE ORIGINAL PURCHASER UPON TERMINATION FOR ANY REASON ALL
6. Triclops StereoVision System Manual Version 3 1 126 Copyright O 2003 Point Grey Research Inc TriCam L LEFT ii nn nn See TriclopsCamera TriCam L LEFT TC ERA nee tem te an See TriclopsCamera TriCam L RIGHT Titam L TOP iii nen See TriclopsCamera TriCam_L_TOP TriCam LEFT EE E EE EEEE See TriclopsCamera TriCam_LEFT TriCam REFERENCE See TriclopsCamera TriCam_REFERENCE TACam RIGA iia See TriclopsCamera TriCam_RIGHT Cam TOP A See TriclopsCamera TriCam_TOP TriCfg 2CAM HORIZONTAL See TriclopsCameraConfiguration TriCfg_2CAM_HORIZONTAL TriCfg 2CAM VERTICAL See TriclopsCameraConfiguration TriCfg 2CAM VERTICAL TACA r nee da See TriclopsCameraConfiguration TriCfg_L TRICLOPS_VERSION 111 SEPICTOPS BO ii TriclopsCamera te U TAC M UA E EO nen ts Jam E COLOR oi Iris TICO LE e E TICA E RIGHTS da O AA A A tete een tee SA NT TriCam REFERENCE susi S RO A Me O de TriCam_RIGHT TaCam A od TriclopsCameraConfiguration inner Lets 2CAM HORIZONTAL 0 asta TrCfe 2CAM_ VERTICAL mood Us SO PR A AR ET Triclops Conte XG zoo A a triclOpsCopy COMER tesco aa ne ailes nee triclopsCreatelmage3d iii HN EISI os v e triclopsCreateWidebaselineContext triclopsCreateWidebaselineInput c s nn triclo psDestroyContext ii NIN ane ones triclopsD stroy Images ne nent nn EEN EEEE S EE EEES ESERE rh TECOS EMO ias TriclopsErrorBadOptions TriclopsErrorCorruptConfigFile TriclopsErrorCorruptTr
7. int ncols int rowinc union TriclopsInputRGB rgb TriclopsInputRGB32BitPacked rgb32BitPacked uj Elements The input type indicating packed or unpacked data The number of columns in the input images The number of rows in the input images The row increment of the input images The timestamp on the image data generated by the camera The actual image data is either packed or unpacked and can be accessed with either TriclopsinputRGB or TriclopsInputRGB32BitPacked TriclopsInputRGB This structure consists of three separate buffers each containing nrows ncols pixels for each of the RGB bands Triclops StereoVision System Manual Version 3 1 62 Copyright 2003 Point Grey Research Inc Declaration struct TriclopsInputRGB void red void green void blue Elements The blue band green The green band The red band TriclopsInputRGB32BitPacked This structure contains RGB packed data Declaration struct TriclopsInputRGB32BitPacked void data Elements a pointer to an array of nrows ncols 4 pixels The pixels are organized in the following fashion RGBU RGBU TriclopsPackedColorImage This structure defines the format of a 32bit packed color image Declaration struct TriclopsPackedColorImage int nrows int ncols int rowinc TriclopsPackedColorPixel data Elements A pointer to the pixel data The number of columns i
8. ok ad images from f aultContextFromFile amp context config intf Can t open calibration file config n ile adToTriclopsInput input ppm amp inputData up some stereo at ct triclopsSetRes disparity rang I a stance measureme not use it when rposes other tha triclopsSe e valida ion iclopsSetTex cessing the parameters to 320x240 output images olution context 240 320 e triclopsSetDisparity context 5 60 the display mapping e disparity mapping corrupts the disparity values so that nts is more difficult and less accurate you intend to actually use disparity values for n display riclopsSetDisparityMapping context 128 255 tDisparityMappingOn context 1 mappings to 0 black iclopsSetUniquenessValidationMapping context 0 tureValidationMapping context 0 images iclopsPreprocess context amp inputData Triclops StereoVision System Manual Version 3 1 24 Copyright 2003 Point Grey Research Inc stereo processing Brr r Brr Brr tri triclopsSte hImage save 1 clean reeInput ve the dep riclopsGetI che depth i return 0 reo context th image from the context age context Trilmg DISPARITY TriCam RE age riclopsSavelmage depthImage depth pgm up memory allocated in co
9. Disparity Mapping Disparity mapping is a method to automatically scale the output disparity image between some fixed mapping values This is a convenience especially for demos when one wants the disparity images to be scaled within the entire display range of brightness values The problem with disparity mapping is that it can cause a lot of trouble when trying to use mapped information to extract 3D information The RCDToXYZ family of functions are designed to extract 3D information from disparity values If these functions have to first correct for disparity mapping a significant performance reduction has incurred To make it easy to simply turn off and ignore disparity mapping we have added a new flag for the TriclopsContext the DisparityMappingOn flag This is accessed through triclopsSet GetDisparityMappingOn functions The default value will be false This means that most 121 Triclops StereoVision System Manual Version 3 1 Copyright 2003 Point Grey Research Inc users of the Triclops SDK can ignore disparity mapping Users who are using disparity mapping must change their programs to call triclopsSetDisparityMappingOn context 1 to enable disparity mapping Disparity mapping does not currently work for subpixel stereo and Point Grey Research Inc PGR currently has no plans to extend disparity mapping to subpixel stereo PGR would like to discourage users from depending on this functionality as this may be removed in later ver
10. Stereo Vision Software Development Kit SDK It also gives the reader pointers to other resources useful for mastering stereo vision technology Triclops StereoVision System Manual Version 3 1 Copyright 2003 Point Grey Research Inc Triclops StereoVision System Manual Version 3 1 Copyright 2003 Point Grey Research Inc Stereo Vision Technology Stereo vision technology allows range measurement using triangulation between slightly offset came ras The DigiclopsTM Stereo Vision System consists of a three camera module and a software system that performs range measurements The camera module generates three gray scale or color images that are digitized and stored in the memory of the computer The software system analyzes the images and establishes correspondence between pixels in each image Based on the camera s geometry and the correspondences between pixels in the images it 1s possible to determine the distance to points in the scene Consider the example in Figure 1 In this example the camera module has simultaneously obtained three images of the scene While the images appear guite similar closer inspection reveals a shift between closer objects and those that are further away Based on the amount of shift the system is able to determine the distance to the objects in the scene Figure 1 also shows a depth image that 1s the result of the Triclops Stereo Vision SDK In this image closer objects are represented with brighter sha
11. The number of microseconds within the second TriclopsTransform Declaration typedef struct double matrix 4 4 TriclopsTransform Debugging and Error Reporting triclopsErrorToString Converts a Triclops error into a meaningful string This function returns a string that describes the given TriclopsError This allows error reporting software to report meaningful error messages to the user Declaration char triclopsErrorToString TriclopsError error See Also TriclopsError triclopsGetDebug Retrieves the state of the debug message printing of the stereo kernel Declaration 65 Triclops StereoVision System Manual Version 3 1 Copyright 2003 Point Grey Research Inc TriclopsError triclopsGetDebug const TriclopsContext context TriclopsBool on Parameters The context context A pointer that contains the current value of the debug flag See Also triclopsSetDebug triclopsSetDebug Controls the debug message printing of the stereo kernel Turning debug on enables the Triclops library to print detailed debugging messages to stderr Declaration TriclopsError triclopsSetDebug TriclopsContext context TriclopsBool on Parameters The context context Flag turning debug on or off See Also triclopsGetDebug TriclopsContext Manipulation triclopsCopyContext Copies the context parameters and images Care must be taken when using triclopsCopyContext as contexts
12. n 1Fi Translation Sf Sf in CT OCT KH H W FH Fh Hh X fpri depth 0 005 Jin fpri ZND u lt FES lt o Ge Fh Cube width 0 005 height 0 005 D Se A END o 13 CE x tu lose pointFile lose vrmlFile retrieve thr rectified images from the triclops context iclopsGetImage triclops TrilImg RECTIFIED TriCam L RIGHT mage iclopsSavelmage srefImage rect right pgm GI bi CN lopsGetImage triclops TrilImg RECTIFIED TriCam L TOP srefImage lopsSavelmage srefImage rect_top pgm r opsGetImage tri ops Trilmg RECTIFIED TriCam L LI Image riclopsSavelmage areflmage rect left pgm close the digiclops igiclopsStop digiclops igiclopsDestroyContext digiclops destroy the triclops context riclopsDestroyContext triclops return 0 Triclops StereoVision System Manual Version 3 1 30 Copyright 2003 Point Grey Research Inc This example demonstrates the use of subpixel interpolation 16 bit images and the calculation of three dimensional XYZ coordinates from stereo images 1 After grabbing the image from the camera the triclopsSetSubpixelInterpolation call turns on subpixel interpolation 2 The relevant stereo options are set and then the images are preprocessed and stereo processed Due to interpolation a 1
13. pimage Remarks Invalid points will be assigned the value of 0 0 0 in the returned image See Also triclopsDestroyImage3d triclopsCreateImage3d triclopsExtractWorldImage3d triclopsExtractWorldImage3d Creates a 3D image given the current disparity result of a TriclopsContext that is transformed to the world coordinate system Declaration TriclopsError triclopsExtractWorldImage3d TriclopsContext context TriclopsImage3d pimage Parameters The current TriclopsContext context 113 Triclops StereoVision System Manual Version 3 1 Copyright O 2003 Point Grey Research Inc Pointer to the TriclopsImage3d structure Remarks Invalid points will be assigned the value of 0 0 0 in the returned image See Also triclopsDestroyImage3d triclopsCreateImage3d triclopsExtractImage3d Triclops StereoVision System Manual Version 3 1 114 Copyright 2003 Point Grey Research Inc Chapter 7 Stereo Vision Details 115 This chapter presents an overview of stereo vision technology After reading this chapter you will have a better understanding of the data flow in the library and all tunable parameters This will allow you to customize the system to particular tasks Triclops StereoVision System Manual Version 3 1 Copyright 2003 Point Grey Research Inc Triclops StereoVision System Manual Version 3 1 116 Copyright 2003 Point Grey Research Inc The purpose of stereo vision is to perform range measureme
14. right rect pgm retrieve and save the left rectified image Note Two camera stereo quires the non reference camera to be named TriCam_L_TOP even though in this case we are refering to the camera that is on the lef e iclopsGetImage wideTriclops Trilmg_RECTIFIED TriCam_L_TOP amp leftRe ified lopsSavelmage aleftRectified left rect pgm rieve and save the resulting disparity image triclopsGetImage wideTriclops Trilmg_DISPARITY TriCam REFERENCE amp image e triclopsSavelmage amp image disp3 pgm clean up memory allocated for the two camera inputs Note the wideInput is just a wrapper around the two camera input and hence it does not occupy any dynamically allocated memory and will not require clean up here nput amp inputl nput amp input2 lean up memory allocated for the contexts triclopsDestroyContext triclopsl triclopsDestroyContext triclops2 triclopsDestroyContext wideTriclops return 0 51 Triclops StereoVision System Manual Version 3 1 Copyright O 2003 Point Grey Research Inc This example creates a widebaseline context based on the context and 3d transformation information of two separate digiclops camera and then perform stereo processing based on the widebaseline input created from the same pair of came
15. COPIES OF THE SOFTWARE MUST BE IMMEDIATELY RETURNED TO POINT GREY RESEARCH INC AND THE ORIGINAL PURCHASER SHALL BE LIABLE TO POINT GREY RESEARCH INC FOR ANY AND ALL DAMAGES SUFFERED AS A RE SULT OF THE VIOLATION OR DEFAULT LIMITED WARRANTY SOFTWARE W ARRANTY POINT GREY RESEARCH WARRANTS TO THE ORIGINAL PURCHASER FOR A PERIOD OF ONE 1 YEAR FROM DATE OF PURCHASE THAT 1 THE DISKETTE ON WHICH THE SOFTWARE IS FURNISHED AND THE ACCOMPANYING DOCUMENTATION ARE NOT DEFECTIVE 2 THE SOFTWARE IS PROPERLY RECORDED UPON THE DISKETTES ENCLOSED 3 THE DOCUMENTATION IS SUBSTANTIALLY COMPLETE AND CONTAINS ALL THE INFORMATION POINT GREY RESEARCH DEEMS NECESSARY TO USE THE SOFTWARE 4 THE SOFTWARE FUNCTIONS SUBSTANTIALLY AS DESCRIBED IN THE DOCUMENTATION POINT GREY RESEARCH INC S ENTIRE LIABILITY AND THE ORIGINAL PURCHASER S EXCLUSIVE REMEDY SHALL BE THE REPLACE MENT OF ANY DISKETTE OR DOCUMENTATION NOT MEETING THESE WARRANTIES ON SUCH AN OCCASION A COPY OF THE PAID RECEIPT ACCOMPANIED WITH THE FAULTY DISKETTE OR DOCUMENTATION MUST BE RETURNED TO POINT GREY RESEARCH INC OR AN AUTHORIZED DEALER POINT GREY RESEARCH INC EXPRESSLY DISCLAIMS AND EXCLUDES ALL OTHER WARRANTIES EXPRESS IMPLIED AND STATUTORY INCLUDING BUT WITHOUT LIMITATION WARRANTY OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR APPLICATION OR PURPOSE IN NO EVENT SHALL POINT GREY RESEARCH INC BE LIABLE TO THE ORIGINAL PURCHASER OR ANY THIRD PARTY FOR DIRECT INDIRECT I
16. Sd n config the number of cameras riclopsGetNumberOfCameras triclops amp nCameras e ok rintf Error getting number of cameras s n triclopsErrorToString e exit 1 39 Triclops StereoVision System Manual Version 3 1 Copyright 2003 Point Grey Research Inc printf Number of Cameras d n nCameras get the baselin e triclopsGetBaseline triclops amp baseline if e ok printf Error getting baseline s n triclopsErrorToString e it 1 Baseline fin baseline t the focal length riclopsGetFocalLength triclops amp focalLength e ok intf Error getting focal length s n triclopsErrorToString TEC triclopsGetResolution triclops amp nrows ncols printf Focal Length Sf pixels for Sd x Sd imagen focalLength ncols nrows destroy the context triclopsDestroyContext triclops return 0 This example demonstrates how to access Triclops configuration information by printing the Triclops library version the camera configuration the number of cameras the camera baseline and the camera focal length The configuration information is retrieved from a Digiclops device attached to the 1394 bus This example also shows error handling and the use of the triclopsErrorToString function Most Triclops functions return an error value which can be tested The example works
17. as follows The Digiclops is opened and initialized The camera module configuration is retrieved The Digiclops 1s closed The version of Triclops is obtained and printed to screen The number of cameras is obtained and printed to screen The baseline is retrieved and printed to screen The focal length is retrieved and printed to screen IAM BWNHE Triclops StereoVision System Manual Version 3 1 40 Copyright 2003 Point Grey Research Inc Example 7 Generating a 3D image point cloud file incl lt stdio h gt incl lt stdlib h gt incl EXNTCLOPS lt A incl digiclops h incl pnmutils h int main int argc char argv riclopsInput stereoData riclopsInput colorData riclopsImagel6 depthImagel6 riclopsColorImage colorlmage PriclopsContext triclops igiclopsContext digiclops loat RG Vp Zp int r g b pointFile nPoints 0 pixelinc i j k igned short row disparity TU tet re open the Digiclops digiclopsCreateContext amp digiclops digiclopslnitialize digiclops 0 get the camera module configuratio digiclopsGetTriclopsContextFromCamera digiclops amp triclops set the digiclops to deliver the stereo image and right color image digiclopsSetImageTypes digiclops STEREO_IMAGI RIGHT_IMAGE set the Digiclops resolution use HALF resolution when you need faster roughput especially
18. context Si A pointer to a Boolean that will contain the current setting See Also triclopsSetStrictSubpixelValidation triclopsSetSubpixelInterpolation triclopsGetSubpixellnterpolation triclopsGetSubpixelValidationMapping Retrieves the value that appears in the disparity image for pixels that fail subpixel validation Declaration TriclopsError triclopsGetSubpixelValidationMapping const TriclopsContext context unsigned char value Parameters TriclopsContext for the operation context A pointer that will hold the subpixel validation mapping value See Also triclopsSetSubpixel ValidationMapping triclopsGetSurface Validation Gets the current surface validation setting Triclops StereoVision System Manual Version 3 1 68 Copyright 2003 Point Grey Research Inc This function 1s used to obtain the current setting of surface validation Declaration TriclopsError triclopsGetSurfaceValidation const TriclopsContext context TriclopsBool on Parameters TriclopsContext for the operation context A pointer for the returned value of the current setting of the surface validation flag See Also triclopsSetSurface Validation triclopsGetSurfaceValidationDifference Returns the maximum disparity difference between two adjacent pixels that will still allow the two pixels to be considered part of the same surface Declaration TriclopsError triclopsGetSurfaceValidationDifference co
19. depth image will have data in each of the four specified Regions of Interest This example works as follows The Digiclops 1s opened and initialized The camera module configuration is retrieved and the image resolution is set The camera is set to deliver stereo images only The camera begins to grab images The Triclops resolution disparity range and stereo mask is set The display mapping is set up Four regions of interest are mapped out on the image in this case the entire upper left quadrant part of the lower right quadrant centred in the upper right quadrant and a small section of the lower left quadrant 8 The image is preprocessed and stereo processed 9 The image depth is retrieved and saved to the file depth pgm 10 The raw image is retrieved and saved to the file reference pgm for comparison MAM no Triclops StereoVision System Manual Version 3 1 34 Copyright O 2003 Point Grey Research Inc Example 5 Finding the depth of the center of the image include lt stdio h gt include triclops h include digiclops h int main int argc char argv riclopsContext triclops riclopsImage depthImage riclopsInput inputData igiclopsContext digiclops riclopsROI rois int maxRois int disparity int 1 j nPoints float Rj Y Z float avgZ open the Digiclops digiclopsCreateContext amp digiclops digiclopsInitialize digiclops 0 get the camera
20. for color images digiclopsSetImageResolution digiclops DIGICLOPS_HALF digiclopsSetImageResolution digiclops DIGICLOPS_FULL start grabbing digiclopsStart digiclops 41 Triclops StereoVision System Manual Version 3 1 Copyright 2003 Point Grey Research Inc set up some stereo parameters set to 320x240 outpu iclopsSetResolution t images triclops 240 320 set disparity range opsSetDisparity iclops 1 100 lopsSetStereoMask triclops 11 opsSetEdgeCorrelation triclops 1 lopsSetEdgeMask triclops 11 FE AT AT lets turn off all validation except subpixel and surface this works guite well iclopsSetTextureValidation triclops 0 iclopsSetUniguenessValidation triclops 0 turn on sub pixel interpolation iclopsSetSubpixelInterpolation triclops 1 m c ake sure strict subpixel validation is on lopsSetStrictSubpixelValidation triclops 1 turn on surface validation iclopsSetSurfaceValidation triclops 1 LE c h y n lopsSetSurfaceValidationSize triclops 200 opsSetSurfaceValidationDifference triclops 0 5 grab the image set igiclopsGrabImage digiclops grab the stereo data igiclopsExtractTriclopsInput digiclops STE E amp stereoData grab the color image data note if you are using a B amp W Digiclops t
21. iii ir triclopsGetUniqueness ValidationMapping triclopsGetUniguenessValidationThreshold triclopsSetStrictSubpixelValidation triclopsSetSubpixelValidation Mapping ss triclopsSetSurjaceValidationsis site Ad AA RE eso a triclopsSetSurface ValidationDifference triclopsSetSurfaceValidationMapping triclopsSetSurfaceValidationSize triclopsSetTexture Valida linia a EREE isso sins triclopsSetTextureValidationMapping rennes triclopsSetTextureValidationThreshold sine triclopsSetUniguenessValidation iiirerasnznrnnnnonononncnononnncno ohne hennu triclopsSetUniquenessValidation Mapping triclopsSetUniquenessValidationThreshold ses GENERAL sierra triclopsGetROls triclopsGetResolution triclopsSaveColorImage triclopsSetColorlmageBuffer triclopsSetImage 16Buffer triclopsSetIimaseBulter Ni aaa HIGLOPSSCLNUIMDEOTR OLS aras triclopsSetPackedColorImageBuffer triclopsSetResolution triclopsSetResolutionAndPrepare triclopsUnsetColorImageBuffer sine triClopS UO nSetl Mag e1 GO Buffer oi AA Anais ada Triclops StereoVision System Manual Version 3 1 Copyright 2003 Point Grey Research Inc triclopsU1nisetlmageBujjehiiisisisstii zka ls triclopsUnsetPackedColorlmageBuffer tricl ps Versiot serment PREPROCESSING ceccessessesseseesseseens triclopsGetEdgeCorrela
22. module configuratio digiclopsGetTriclopsContextFromCamera digiclops amp triclops set the digiclops to deliver the stereo image only digiclopsSetImageTypes digiclops STEREO IMAGE set the Digiclops resolution use HALF resolution when you need faster throughput especially color images digiclopsSetImageResolution digiclops DIGICLOPS HALF digiclopsSetImageResolution digiclops DIGICLOPS_FULL start grabbing digiclopsStart digiclops set up some stereo parameters set to 320x240 output images triclopsSetResolution triclops 240 320 set disparity range triclopsSetDisparity triclops 5 35 Triclops StereoVision System Manual Version 3 1 Copyright 2003 Point Grey Research Inc set invalid pixel value triclopsSetTextureValidationMapping triclops 0 triclopsSetUniguenessValidationMapping triclops 0 get the pointer to the regions of interest array triclopsGetROIs triclops amp rois amp maxRois if maxRois gt 1 set up a 40x30 region of interest in the center of the image roi row 104 roi col 139 roi nrows 30 roi ncols 40 iclopsSetNumberOfROIs triclops yey printf Center t tAverage n while 1 unsigned char row grab an image digiclopsGrabImage digiclops digiclopsExtractTriclopsInput digiclops STE amp inputData Preproce
23. of columns in the output images ncols ninputRows Number of rows in the input images nInputCols Number of columns in the input images See Also TriclopsGetResolution triclopsSetResolution triclopsSetRectify triclopsUnsetColorImageBuffer This releases the user specified internal color image buffer for the specified camera The next time this buffer is required by the system it will allocate a new one for internal use If the user has already called triclopsSetColorlmageBuffer for a particular camera the stereo kernel will be using that buffer when rectifying a color image If the user no longer wants to have the supplied buffer used by the stereo kernel he she may use this function to inform the stereo kernel that 1t is no longer available A new buffer will be created the next time it is required by the stereo kernel Declaration TriclopsError triclopsUnsetColorImageBuffer TriclopsContext context TriclopsCamera camera Parameters The context context The camera camera See Also triclopsRectifyColorImage triclopsSetColorlmageBuffer triclopsUnsetImage16Buffer This releases the user specified internal image buffer for the specified camera and image type The next time this buffer is required by the system it will allocate a new one for internal use If the user has already called triclopsSetImage16Buffer for a particular camera and image type the stereo kernel will be using that buffer for in
24. pixel image should be increased to a 9x9 mask for a 320x240 pixel image Mask sizes must be odd numbers Valid mask sizes are 3x3 5x5 7x7 and invalid mask sizes are 4x4 6x6 8x8 The Triclops is capable of supporting a maximum 15x15 mask to a 1x1 minimum In addition a new experimental function has been added triclopsSetAnyStereoMask This function allows the user to set any correlation mask size for stereo This function is classified as an experimenta function and care should be taken in its use For more information see the description of triclopsSetAnyStereoMask in the Detailed Experimental Function Descriptions section Validation In some cases such as ocelusions and lack of texture it is not possible to establish correspondence between images If the correspondence is not correct the obtained measurements can not be correct In order to avoid incorrect measurements two validation methods are introduced Texture validation determines whether disparity values are valid based on levels of texture in the correlation mask If the amount of texture 1s not sufficient to produce correct matches the pixel will be declared invalid Unigueness validation determines whether the best match for a particular pixel is significantly better than other matches within the correlation mask Even if the correlation mask has enough texture the correct match may not exist due to an ocelusion If the correlation result is not strong enough the pixel w
25. presents detailed descriptions of the Triclops library functions Enumerations TriclopsCamera This enumerated type identifies individual cameras given a specific camera configuration Declaration enum TriclopsCamera TriCam REFERENCE TriCam RIGHT TriCam TOP TriCam LEFT TriCam L RIGHT TriCam RIGHT TriCam L TOP TriCam TOP TriCam L LEFT TriCam LEFT TriCam COLOR TriCam L COLOR TriCam COLOR Elements TriCam_COLOR note TriCam_COLOR is only for use with the Color Triclops It is not used for any Digiclops or Bumblebee product TriCam COLOR may be phased out in future releases of Triclops SDK TriCam L COLOR TriCam L LEFT TriCam L RIGHT these are kept here as legacy code for now should be replaced in user code to not include the configuration specific _L_ these values may be phased out in future releases of Triclops SDK TriclopsCameraConfiguration This enumerated type defines the camera configuration The symbols in the table represent the cameras as they would be seen when the camera module is viewed from the front This type is either read from the camera or is set manually to indicate 2 Camera mode Declaration enum TriclopsCameraConfiguration Triclops StereoVision System Manual Version 3 1 56 Copyright 2003 Point Grey Research Inc TriCfg L TriCfg 2CAM HORIZONTAL TriCfg 2CAM VERTICAL Elements TriCfg_2CAM_HORIZONTAL 2 Camera Unit or 3 Camera Unit i
26. this noise is difficult to remove with standard filtering techniques as it appears to be a valid signal instead of noise Surface validation is a method to validate regions of a disparity image based on an assumption that they must belong to a likely physical surface in the image The method segments the disparity image into connected regions Any region that is less than a given size is suspect and removed from the disparity image See also in the Detailed Function Descriptions section triclopsSetSurfaceValidation triclopsGetSurfaceValidation triclopsSetSurfaceValidationSize triclopsGetSurfaceValidationSize triclopsSetSurfaceValidationDifference triclopsGetSurfaceValidationDifference triclopsSetSurface ValidationMapping triclopsGetSurfaceValidationMapping Subpixel Validation Mapping In previous versions of the Triclops SDK the validation mapping did not work when the subpixel interpolation flag was on Now validation mapping values are used during subpixel interpolation Pixels which are invalid when performing subpixel validation are marked with values of OxFF00 mv where my is the mapping value for the particular validation check that has failed Region Of Interest and Subpixel Unfortunately although ROI processing does work with subpixel stereo it does not improve the speed of processing Therefore we recommend that users only bother with ROI processing if they are not using the subpixel functionality of the stereo engine
27. will share image buffers This function creates a copy of the input context This allows the user to have two contexts with the same options and also to share the same image buffers Care must be taken with this function The ensuing contexts will share image buffers This allows them to share some of the previous processing however any changes in resolution or calls to set image buffers will create new buffers to be used These buffers will no longer be shared and thus programs may not operate as expected at this time The recommendation is to use this operation when one wants to run stereo with different stereo options After the preprocessing step the context can be copied and different stereo options set before the call to triclopsStereo Note This only copies the options not the images Declaration Triclops StereoVision System Manual Version 3 1 66 Copyright 2003 Point Grey Research Inc TriclopsError triclopsCopyContext const TriclopsContext contextIn TriclopsContext contextOut Parameters A context that has already been constructed contextln A copy of the input context contextOut See Also triclopsGetDefaultContext triclopsDestroyContext triclopsDestroyContext Destroys the given context This function destroys a context and frees all associated memory Declaration TriclopsError triclopsDestroyContext TriclopsContext context triclopsGetDefaultContextFromFile Setup the initial context wit
28. 20x240 output images triclopsSetResolution triclops 240 set disparity range triclopsSetDisparity triclops 10 60 turn on sub pixel interpolation iclopsSetSubpixelInterpolation triclops 1 reprocessing the images lopsPreprocess triclops amp inputData tereo processing lopsStereo triclops trieve the interpolated depth image from the triclops con lopsGetImagel6 triclops TriImgl6_DISPARITY TriCam_REFER agel6 opsSavelmagel6 amp depthImagel6 displ6 pgm save points to disk intFile fopen points txt wt lFile fopen points wrl wt fprintf vrmlFile VRML V1 0 ascii n fprintf vrmlFile Material diffuseColor 0 1 0 n 29 Triclops StereoVision System Manual Version 3 1 Copyright 2003 Point Grey Research Inc determine the number of pixels spacing per row pixelinc depthImagel6 rowinc 2 for 1 1 lt depthImagel6 nrows i unsigned short row depthImagel6 data i pixelinc for j 0 j lt depthImagel6 ncols j int disparity row j filter invalid points if disparity lt OxFFOO convert the 16 bit disparity value to floating point x y z triclopsRCD16ToXYZ triclops i j disparity X amp y 42 look at points within a range if z gt 0 25 amp amp z lt 1 0 fp fp fp pointFile Sf f f 255 255 255 n x y mlFil Separator
29. 3 Point Grey Research Inc This example generates a 3 D point cloud image file This example uses subpixel interpolation for more accurate stereo depth extraction It also introduces the use of surface validation a method for removing noise from depth reconstructions Each valid depth pixel is converted into a 3d XYZ position and output to a point file In addition the color of the point is also written out through the use of a rectified color image The colored point cloud file can be viewed in the PGRVIew program This example generates a 3 dimensional point cloud image file It works as follows 1 Digiclops is opened and initialized Digiclops 1s set to deliver a stereo colour image 3 The resolution for the Digiclops is set for faster throughput i e for colour images the resolution can be set to HALF 4 Digiclops starts to grab images 5 The Triclops settings are configured to the following settings e Set Triclops resolution to 320 x 240 e Set the disparity range to 1 100 Set the stereo mask to 11 Turn the edge correlation on Turn the edge mask on Turn the texture validation off e Turn the uniqueness validation off e Turn subpixel interpolation and strict subpixel validation on e Turn surface validation on and set it to size 200 and differential 0 5 Digiclops grabs the image set as well as the corresponding stereo and colour image data The image is preprocessed and then stereo processed The interpolated de
30. 6 bit depth image can then be retrieved from the context and saved For each pixel the most significant byte is the disparity in whole pixels and the least significant byte is the fractional portion of the disparity 3 To convert from 16 bit disparity values to floating point disparity values one can use the following C code fragment unsigned short disparityl6 lt some value from the depth map gt float disparityFloat convert disparityl6 to disparityFloat disparityFloat float disparityl6 256 0 16 bit disparity data can be accessed for every valid interpolated pixel in this image with invalid pixels having a disparity value greater than OxFFOO and given as a parameter to the triclopsRCD16ToXYZ function which returns the corresponding three dimensional XYZ coordinates Any data within 0 25 to 1 0 meters of the camera is written to a text file points It should be noted that subpixel resolution images do not follow the mapping schemes that regular images do Validation mapping is applied only to the least significant byte Therefore if texture validation mapping is set to 0 and uniqueness validation mapping is set to 1 the 16 bit invalid texture pixel will be OxFFOO and the 16 bit invalid uniqueness pixel will be OxFFO1 4 Finally the three rectified images for each camera are saved to disk and the frame grabber is closed Note that triclopsSetDisparityMapping is not called in this example T
31. NCIDENTAL CONSEQUENTIAL SPECIAL OR ACCIDENTAL DAMAGES INCLUDING WITHOUT LIMITATION DAMAGES FOR BUSINESS INTERRUPTION LOSS OF PROFITS REVENUE DATA OR BODILY INJURY OR DEATH Triclops StereoVision System Manual Version 3 1 2 Copyright 2003 Point Grey Research Inc Triclops StereoVision System Manual Version 3 1 Copyright 2003 Point Grey Research Inc TABLE OF CONTENTS TRICLOPS SOFTWARE LICENSE AGREEMENT CHAPTER 1 INTRODUCTION seen STEREOVVISION TECHNO OGY P P O nr te teeta els oleh a Who Should Read this Manual System REQuare ments ren en Lien D HN NIU N en ee Eee An aE SPV Mrs Online RESOU CES aint in lana rene EN CHAPTER 3 INSTALLIN G THE SOFTWARE sense 12 INSTALLATION OF TRICLO PS ainia To install the Triclops software Image Vi MD A tn ete A es CHAPTER 4 GETTING STARTED seen This chapter is for Microsoft Windows 98 2000 users Running the Demo Program Compiling a Triclops Programs tin i CHAPTER 5 PROGRAMMING WITH THE TRICLOPS APPLICATION PROGRAMMING PROGRAMMING WITH THE TRICLOPS STEREO VISION SDK Triclops Context rene nn meme a rend Triclops Example Source Code ss Important Please check error codes Example 1 Generating a Depth Map Image c ocoicnionnicninncnnnnnnoncannnnnnnanancnnnanns Example 2 Grabbing images and stereo processing Example 3 Subpixel interpolation and depth calculation Example 4Regions of tres biien Example 5 Finding the depth of the center of the image
32. Point Grey Research Inc See Also triclopsRCDFloatToX YZO triclopsRCDSTOXY ZI triclopsRCD16TOXYZ triclopsRCDToWorldX YZ Converts image coordinates and disparity values to world 3D points This function takes a pixel location and matching disparity value and calculates the 3D position that this combination represents The position is calculated in the world coordinate system That is to say the position is calculated in the Triclops coordinate system and then transformed by the TriclopsContext transform to a new coordinate system Declaration TriclopsError triclopsRCDToWorldXYZ TriclopsContext context float row float col float disp tloat x float y float z Parameters The stereo context context The row of the input pixel The column of the input pixel The x coordinate of the corresponding 3D point in the world coordinate system The y coordinate of the corresponding 3D point in the world coordinate system The z coordinate of the corresponding 3D point in the world coordinate system Remarks It is up to the user to supply valid disparity values Values taken from invalid pixels in the disparity Image give negative results See Also triclopsRCDFloatToX YZO triclopsRCDSTOXY ZI triclopsRCD16TOXYZO triclopsRCDFloatToWorldX YZ triclopsRCD8ToWorldXY ZO triclopsRCD16ToWorldXYZ0 triclopsSetTriclopsToWorldTransform triclopsGetTriclopsToWorldTransform triclopsRCDToX YZ Converts imag
33. ROIs The maximum number of ROIs allowed See Also triclopsSetNumberOfROISO triclopsStereo TriclopsROI triclopsGetResolution Retrieves the resolution of the resultant images This includes rectified disparity and edge images This returns the current resolution for output images of the given context Declaration TriclopsError triclopsGetResolution const TriclopsContext context int nrows int ncols Parameters The context context Number of rows in the output images nrows Triclops StereoVision System Manual Version 3 1 78 Copyright 2003 Point Grey Research Inc Number of columns in the output images ncols See Also triclopsSetResolution triclopsSaveColorImage Saves an image to the specified filename The file format currently supported is PGM format This function saves the input image to the requested file Currently this function will not detect if the file could not be opened and will always return successful Color images are saved in PPM format Declaration TriclopsError triclopsSaveColorImage TriclopsColorImage image char filename Parameters The TriclopsColorlmage to be saved image The file name in which to save the image filename See Also triclopsSaveImage triclopsSaveImage Saves an image to the specified filename The file format currently supported is PGM format This function saves the input image to the requested file Currently this fun
34. _HORIZONTAL configuration can be used to do 2 camera stereo on a 3 camera device Declaration TriclopsError triclopsGetCameraConfiguration const TriclopsContext context TriclopsCameraConfiguration config Parameters The context context 95 Triclops StereoVision System Manual Version 3 1 Copyright 2003 Point Grey Research Inc A pointer that will hold the result config See Also TriclopsCameraConfiguration TriclopsSetCameraConfiguration TriclopsGetDeviceConfiguration triclopsGetDeviceConfiguration This function returns the physical configuration of the stereo device This allows the user to determine what algorithms they have available on the current device Declaration TriclopsError triclopsGetDeviceConfiguration const TriclopsContext context TriclopsCameraConfiguration config Parameters The context context config The physical CameraConfiguration See Also TriclopsCameraConfiguration TriclopsGetCameraConfiguration TriclopsSetCameraConfiguration triclopsGetFocalLength Retrieves the focal length of the cameras This function returns the focal length of the system The focal length is in pixels for the current selected output resolution All cameras rectified images have the same focal length The default stereo context must have been read before this call can be made Declaration TriclopsError triclopsGetFocalLength const TriclopsContext context float focalle
35. ageType The image type ee camera See Also TriclopsGetImage triclopsSetlmageBuffer triclopsUnsetPackedColorImageBuffer This releases the user specified internal color image buffer for the specified camera The next time this buffer is required by the system it will allocate a new one for internal use If the user has already called triclopsSetPackedColorImageBuffer for a particular camera the stereo kernel will be using that buffer when rectifying a color image If the user no longer wants to have the supplied buffer used by the stereo kernel he she may use this function to nform the stereo kernel that it is no longer available A new buffer will be created the next time it is required by the stereo kernel Declaration 85 Triclops StereoVision System Manual Version 3 1 Copyright 2003 Point Grey Research Inc TriclopsError triclopsUnsetPackedColorImageBuffer TriclopsContext context TriclopsCamera camera Parameters The context context The camera camera See Also triclopsSetPackedColorlmageB uffer triclopsRectifyPackedColorImage triclopsVersion Returns a string with the Triclops library version This function returns internally handled memory The caller should not free the returned pointer Declaration const char triclopsVersion Remarks Input Returns char A string containing the version information for the context Preprocessing triclopsGetEdgeCorrelation Retriev
36. ages and the geometry of the cameras The position of the matched feature is a function of the displacement the focal length of the lenses resolution of the CCD and the displacement between cameras The Triclops library provides a function that converts depth maps into distance images object col image ae Ehe world row image Z world viewing X world direction A Y world Figure 3 Image and world coordinate systems in the Triclops library Figure 7 illustrates the coordinate system in which the Triclops library represents images and the world measurements The origin of the image is in the top left corner of the upright image The origin of the world measurements is in the pinhole of the reference camera Multiple Cameras Triclops StereoVision System Manual Version 3 1 118 Copyright 2003 Point Grey Research Inc The DigiclopsTM Stereo Vision System consists of three cameras The reason for this is to make matching between images more robust The principle behind using multiple cameras is to combine the matching results in order to establish the most correct match In the case of the Triclops library the results of correlation are added up for the eguivalent displacements in the vertical and horizontal direction By combining the correlation values it is possible to encase the valleys in which the correct match is found Triclops Library Data Flow Figure 4 shows the data flow in the Triclops library The library takes raw
37. ameter An invalid parameter has been passed TriclopsErrorInvalidROI An impossible Region Of Interest was specified For 57 Triclops StereoVision System Manual Version 3 1 Copyright O 2003 Point Grey Research Inc a example a region of interest with negative height or width TriclopsErrorInvalidRequest Given the current specified options the request is not valid For example requesting the disparity image from a context that has not executed triclopsStereo TriclopsErrorInvalidSetting User specified input to the function that was not a valid value for this function TriclopsErrorNoConfigFile Can not find the configuration file TriclopsErrorNotImplemented User requested an option that is not yet implemented TriclopsErrorOk Function succeeded TriclopsErrorSurfaceValidationOverflow A call to TriclopsSetSurface Validation has caused an overflow TriclopsErrorS ystemError Can not find the transform file or its contents is invalid TriclopsErrorUnknown An indeterminable error occurred Depreciated ok Value for downward compatibility TriclopsImagel6Type This enumerated type defines the various 16bit image types TriclopsErrorNonMMXCpu A function that reguires MMX was called on a non MMX enabled CPU Declaration enum TriclopsImagel6Type Trilmgl6 DISPARITY 0 Elements Trilmg16 DISPARITY Disparity Image This is the 16 bit resultant depth image after stereo processing with subpixel on Tric
38. ansformFile seen TriclopsErrotinvalidEamera ssst hs anna rano einen eines bites TriclopsErrorInvalidContext ss TriclopsErrorInvalidParameter ss TriclopsErrorInvalidRequest ss JriclopsE 1 TOFINVANHROT ressens E Tacl psErr rnvalidSethng te sral nn TriclopsErrorNoConfigFile ss TriclopsErrorNonMMXCpu een TriclopsErrorNotImplemented ss EPICIOPSELLOLOK CE EE A ito TriclopsErrorSurface ValidationOverflow 127 Triclops Stereo Vision System Manual Version 3 1 Copyright 2003 Point Grey Research Inc TriclopsErrorSystemEltO cuina id tai 57 JriclopsErrorUnknoWf ie NA Te nt 57 TriclopsErrorBadOptions ss See TriclopsError TriclopsErrorBadOptions TriclopsErrorCorruptConfigFile See TriclopsError TriclopsErrorCorruptConfigFile TriclopsErrorCorruptTransformFile See TriclopsError TriclopsErrorCorruptTransformFile TriclopsErrorInvalidCamera oococconicconononencncnninnonncnnncnconon cn cnnonononos See TriclopsError TriclopsErrorInvalidCamera TriclopsErrorInvalidContext ss See TriclopsError TriclopsErrorInvalidContext TriclopsErrorInvalidParameter oociccccononococinnnononnnnnnanconon cn corno See TriclopsError TriclopsErrorInvalidParameter TriclopsErrorInvalidRequest See TriclopsError TriclopsErrorInvalidRequest TriclopsErrorInvalidROI ooosnrnnncncnononnononeno onen See TriclopsError TriclopsErrorIn
39. astriclopsTransform l TriclopsErrorok printf Can t read transform file s n transformFilel return 1 if e triclopsSetTriclopsToWorldTransform triclopsi triclopsTransform l TriclopsErrorok printf Fail to set cameral transform n return 1 if e triclopsGetTransformFromFile transformFile2 amp triclopsTransform l TriclopsErrorok printf Can t read transform file s n transformFile2 return 1 if e triclopsSetTriclopsToWorldTransform triclops2 triclopsTransform l TriclopsErrorok printf Fail to set camera2 transform n return 1 create a widebaseline context based on that of cameral right unit and camera2 left unit e triclopsCreateWidebaselineContext triclopsl triclops2 amp wideTriclops 49 Triclops StereoVision System Manual Version 3 1 Copyright 2003 Point Grey Research Inc e TriclopsErrorok printf Failed to create widebaseline context n set up some of the standard stereo processing flags iclopsSetResolution wideTriclops nrows ncols iclopsSetStereoMask wideTriclops 13 iclopsSetDisparity wideTriclops 1 200 iclopsSetSubpixelInterpolation wideTriclops 0 Load cameral s images from file ppmReadToTriclopsInputRGB inputFilel amp inputl printf Can t read input file Ss An inputFilel re
40. atToWorldXYZ TriclopsContext context float row float col float disp float x float v float z Parameters The stereo context context The row of the input pixel row The column of the input pixel The disparity value of the input pixel The x coordinate of the corresponding 3D point The z coordinate of the corresponding 3D point The y coordinate of the corresponding 3D point See Also triclopsRCDMappedToXYZO triclopsRCD8ToXYZO triclopsRCD16TOXYZO triclopsRCDToWorldX YZO triclopsRCD8ToWorldXYZ triclopsRCD16ToWorldXYZO triclopsSetTriclopsToWorldTransform triclopsGetTriclopsToWorldTransform triclopsRCDFloatToX YZ Converts image coordinates and a floating point disparity value into true 3D points This function takes a floating point disparity value and converts it to XYZ coordinates Note It is up to the user to supply valid pixel locations Pixels which have been invalidated may give negative results Declaration TriclopsError triclopsRCDFloatToXYZ TriclopsContext context float row float col float disp Triclops StereoVision System Manual Version 3 1 102 Copyright 2003 Point Grey Research Inc float x float y float z Parameters The stereo context context The row of the input pixel The column of the input pixel coordinate system coordinate system coordinate system See Also triclopsRCDMappedToXYZO triclopsRCDSTOXY Z 0 triclopsRCD16ToXYZ t
41. bpixel accuracy allowing K M For detailed descriptions of stereo vision parameters please refer to Chapter 7 Stereo Vision Details Triclops Context The Triclops software system allows specifying all characteristics of stereo processing discussed above Furthermore the software system allows the specification of multiple stereo processing that may occur on a single set of images To enable efficient stereo processing of different kinds on the same set of images the concept of Triclops Contexts is introduced By using the Triclops context it is possible to encapsulate all of the information reguired for a specific kind of stereo processing Furthermore multiple Triclops contexts allow for the sharing of data and processing with minimal effort on the user s part Triclops contexts store camera configuration parameters of stereo processing input data and results A Triclops context must first be initialized using the configuration of the camera module Configuration contains information about the number and geometry of the cameras as well as the intrinsic and extrinsic parameters of the cameras A Triclops context is then configured for the specific kind of stereo processing Parameters such as the processing resolution disparity range validation and subpixel interpolation may be specified Next a Triclops context must be assigned images that are to be processed by the stereo kernel This is done by passing into a context informati
42. ces For the latest demos and sample code written for the Triclops Stereo Vision SDK visit our web page at http www ptgrey com 11 Triclops StereoVision System Manual Version 3 1 Copyright 2003 Point Grey Research Inc Chapter 3 Installing the Software This chapter discusses installing the software and setting up the operating system Triclops StereoVision System Manual Version 3 1 Copyright 2003 Point Grey Research Inc 13 Triclops StereoVision System Manual Version 3 1 Copyright 2003 Point Grey Research Inc Installation of Triclops The Triclops software system is currently distributed on a CD ROM disk Please consult the README file on the disk for a detailed description of the installation procedure In addition to the CD ROM there will also be a floppy disk included with the system This disk contains the calibration file specific to your Digiclops camera unit In addition to the calibration file there may also be updated libraries on this floppy Please consult the README file on the floppy disk for details of contents and installation This section assumes the target operating systems is Microsoft Windows 98 2000 To install the Triclops software 1 Place the CD ROM installation disk into your CD ROM drive The Point Grey Research Inc message box will appear 3 Select the Install Triclops button and follow the prompts given by the Setup Wizard It is recommended that you install the Triclop
43. cesseesscdstacs oda tricl opsGetlmage CenteT sneri nn een SOV OK oV Kotov enr triclopsGetLowpass tri lopsetRoctky cutis triclopsGetResolutiome ssc i05 HN E E E EEEE E SE A E ks v io avi tTHICLOPSGELR OS zi soli Ei triclopsGetSeralNUMDEL ninio triclopsGetStereo Mask en triclopsGetStrictSubpixelValidation triclopsGetSubpixelInterpolation ss triclopsGetSubpixelValidation Mapping ss triclopsGretSurlace Validation sil ssa nanu nee en ee een roh triclopsGetSurfaceValidationDifference ss triclopsGetSurfaceValidationMapping s triclopsGetSurfaceValidationSize nn triclops6 TExture Val pie nt le etl E TE ee nn es triclopsGetTexture Validation Mapping sense triclopsGetTextureValidationThreshold esesncncnnnncncnonocnononnnno none triclopsGetTransformFromFile e esosocnonnononnnnononononnonononin onen triclopsGetTriclopsTo WorldTransform triclopsGetUniqueness Validation ss triclopsGetUniqueness ValidationMapping Triclops StereoVision System Manual Version 3 1 128 Copyright 2003 Point Grey Research Inc triclopsGetUniguenessValidationThreshold TriclopsImage Ericlopslima Sel OT pe iii lanes aha re ln Trilmg16_DISPARITY Triclopslmage3d points rowinc oe is z ss Triclopslma ge TY Poistn z sen a Erle DISPARITY zi si V Ada they ashes ment Be
44. cessing or has just been delivered by a frame grabber There are two formats of input data that are currently being supported RGB format indicates that the data is supplied with a separate buffer for each R G and B channel RGB packed indicates that the 3 channels are interleaved Declaration enum TriclopsInputType TriInp NONE Trilnp RGB 32BIT PACKED TriInp RGB Elements Trilnp NONE This 1s used to mark that the input has not vet been set Trilnp RGB An array of separated bands with the following ordering R R R G G G B B B Trilnp RGB 32BIT PACKED An array of pixels with color bands interleaved in the following order B GR U BGR U Types TriclopsBool Definition for Boolean variables Declaration typedef int TriclopsBool 59 Triclops StereoVision System Manual Version 3 1 Copyright 2003 Point Grey Research Inc TriclopsColorImage This structure is used for image output from the Triclops system for color images The structure is the same as Triclopslmage except that the data field is replaced by three color bands red green and blue Each band is a complete image for that particular color band In this case rowinc is the row increment for each color band Declaration struct TriclopsColorImage int nrows int ncols int rowinc unsigned char red unsigned char green unsigned char blue Elements blue The pixel data for blue band of the image gre
45. ction will not detect if the file could not be opened and will always show successful return Declaration TriclopsError triclopsSavelmage TriclopsImage image char filename Parameters The TriclopsImage to be saved image The file name in which to save the image filename triclopsSavelmage16 Saves an image to the specified filename The file format currently supported is PGM format This function saves the input image to the requested file Currently this function will not detect if the file could not be opened and will always return successful 79 Triclops StereoVision System Manual Version 3 1 Copyright 2003 Point Grey Research Inc Declaration TriclopsError triclopsSaveImagel6 TriclopsImagel6 image char filename Parameters The TriclopsImage16 to be saved image The file name in which to save the image filename See Also triclopsSave mage triclopsSavePackedColorImage Allows the user to save a packed color image to the given file Declaration TriclopsError triclopsSavePackedColorImage TriclopsPackedColorImage image char filename Parameters A pointer to the buffer containing the image image The name of the file to be written to filename triclopsSetColorImageBuffer Allows the user to set separate buffers to which individual bands of the processed color image are written to In this case the processed image means the rectified image that is r
46. d structure to allocate memory for See Also triclopsDestroyImage3d triclopsExtractlmage3d triclopsExtractWorldImage3d 111 Triclops StereoVision System Manual Version 3 1 Copyright 2003 Point Grey Research Inc triclopsCreateWidebaselineContext Creates a widebaseline context based on the contexts of the two underlying stereo devices This function creates a widebaseline context based on the contexts of the two underlying stereo devices The two input contexts beside having been properly initialized and loaded must have their transformation set previous to this operation Furthermore these transforms both relate back to the same world reference frame so that they can be used to determine how the two cameras are positioned relative to one another Once the widebaseline context has been created stereo processing for the virtual widebaseline camera can proceed by providing it with the corresponding widebaseline input Declaration TriclopsError triclopsCreateWidebaselineContext TriclopsContext triclopsi TriclopsContext triclops2 TriclopsContext triclops3 Parameters The context for the stereo devive which forms the right camera for the stereo pair triclopsl The context for the stereo devive which forms the left camera for the stereo pair triclops2 The new context for stereo between the two devices triclops3 See Also TriclopsCreateWidebaselinelnput triclopsCreateWidebaselinelnput Creates a wi
47. debaseline input based on the two camera inputs Create a widebaseline input based on the Triclopslnput of the two underlying stereo devices The resulting input can then be used to perform stereo processing with the corresponding widebaseline context Declaration TriclopsError triclopsCreateWidebaselineInput TriclopsInput inputl TriclopsInput input2 TriclopsInput input3 Parameters inputl The input from the stereo devive which forms the right camera for the stereo pair input2 The input from the stereo devive which forms the left camera for the stereo pair The new input constructed from that of the two underlying devices input3 See Also triclopsCreateWidebaselineContext Triclops StereoVision System Manual Version 3 1 112 Copyright 2003 Point Grey Research Inc triclopsDestroyImage3d Deallocates a TriclopsImage3d allocated by triclopsCreateImage3d Declaration void triclopsDestroyImage3d TriclopsImage3d ppimage Parameters Pointer to the address of the TriclopsImage3d structure to destroy ppimage See Also triclopsCreatelmage3d triclopsExtractlmage3d triclopsExtractWorldImage3d triclopsExtractlmage3d Creates a 3D image given the current disparity result of a TriclopsContext Declaration TriclopsError triclopsExtract Image3d TriclopsContext context TriclopsImage3d pimage Parameters The current TriclopsContext context Pointer to the TriclopsImage3d structure
48. des of gray while objects further away are represented with darker shades of gray Three camera module y Left Image Right Image Software System Depth Image Figure 1 Stereo Processing From images to distance measurements Triclops StereoVision System Manual Version 3 1 10 Copyright O 2003 Point Grey Research Inc With the depth image it is possible to determine the 3D position of every point in the image relative to the camera module This section was written to give the reader intuition about the functionality of the system A more detailed description of the process and programming details will be discussed in further chapters Who Should Read this Manual This manual is intended for personnel responsible for installing the Triclops Stereo Vision SDK and for programmers developing applications with the Triclops system Installers must have a working knowledge of the Windows 98 or Windows 2000 operating system at the system administrator level Developers will find familiarity with the concepts of stereo vision very useful in utilizing the Triclops system and making sense of the stereo results For a general background in stereo vision see Chapter 7 Stereo Vision Details System Reguirements To use the Triclops Stereo Vision SDK you must have an IBM compatible PC with A Pentium MMX or Pentium II processor of 166MHz or faster Windows 98 or Windows 2000 Recommended at least 16 MB of RAM Online Resour
49. e The pixel data for green band of the image nools The number of columns in the image moWS The number of rows in the image U The pixel data for red band of the image rowne The row increment of the image TriclopsContext Triclops context is a pointer to an internal structure that maintains all image and bookkeeping information necessary to the Triclops library It is the container for all parameters Declaration typedef void TriclopsContext TriclopsImage This structure is used both for image input and output from the Triclops system Declaration struct TriclopsImage int nrows int ncols int rowinc unsigned char data Triclops StereoVision System Manual Version 3 1 60 Copyright 2003 Point Grey Research Inc Elements The area for the pixel data This must be numRows numCols bytes large The number of columns in the image The number of rows in the image each row and the rows must be equally spaced Rowinc indicates the number of bytes between the beginning of a row and the beginning of the following row This is the pitch or row increment for the image Data must be contiguous within TriclopsImage16 This structure is used for image output from the Triclops system for image types that require 16 bits per pixel This is the format for subpixel interpolated images The structure is identical to the Triclopslmage structure except that the data contains unsigned shorts rat
50. e Also triclopsGetDisparityMapping triclopsSetDisparity triclopsRCD8ToX YZQ triclopsRCD16ToXYZO triclopsRCDMappedToX YZ triclopsSetDisparityMappingOn Enables or disables disparity mapping This function is used to enable or disable disparity mapping See the comments section on this subject in Chapter 7 in the Triclops manual for why disparity mapping can cause trouble Declaration TriclopsError triclopsSetDisparityMappingOn TriclopsContext context TriclopsBool on Parameters TriclopsContext for the operation context t A Boolean flag indicating if the mapping should be on or off triclopsSetDoStereo Turns stereo processing on or off Declaration 93 Triclops Stereo Vision System Manual Version 3 1 Copyright 2003 Point Grey Research Inc TriclopsError triclopsSetDoStereo TriclopsContext context TriclopsBool on Parameters The context context A Boolean indicating whether stereo processing should be turned on or off See Also triclopsGetDoStereo triclopsSetStereoMask Set the stereo correlation mask size Declaration TriclopsError triclopsSetStereoMask TriclopsContext context int masksize Parameters The context context The new correlation mask size which is valid between 1 and 15 masksize triclopsSetSubpixelInterpolation Turns subpixel interpolation stereo improvements on or off Declaration TriclopsError triclopsSetSubpixelInterpolati
51. e coordinates with disparity values that have been mapped using the disparity mapping function into true 3D points 105 Triclops StereoVision System Manual Version 3 1 Copyright 2003 Point Grey Research Inc This function takes disparity values that have been scaled by the disparity mapping feature If you do not have the disparity mapping values set to the same as the disparity values you should use this function However it is less efficient than the other XYZ conversion functions and may have some round off errors It is preferable to set the disparity mapping range to the same as the disparity range and use one of the other conversion functions Note It is up to the user to supply valid pixel locations Pixels that have been invalidated may give negative results Declaration TriclopsError triclopsRCDTOXYZ TriclopsContext context float row float col float disp floats x float y float z Parameters The stereo context context row The row of the input pixel TOW The column of the input pixe 1 coordinate system The y coordinate of the point represented by the inputrow column disparity in the camera coordinate system See Also triclopsRCDFloatToX YZO triclopsRCD8ToXYZO triclopsRCD16TOXYZ triclopsRectify Colorlmage Rectifies a TriclopsInput structure into a TriclopsColorlmage This function is used for TriclopsInput s that have been obtained from a Color Digiclops or a Color Triclops If the sys
52. e stereo processing module applies the Sum of Absolute Differences algorithm described in previous sections There are a number of parameters that determine the kind of depth image produced Disparity Range Disparity range is the range of pixels that the stereo algorithm searches in order to find the best match In the Triclops system a disparity of zero pixels corresponds to an infinitely far away object The maximum disparity defines the closest position of an object that is to be determined Users are allowed and encouraged to set the disparity range that is the most suitable for the task at hand Reducing the disparity range will allow the system to run faster and will reduce the chance of a mismatching Correlation Mask Correlation mask is a square neighborhood around the pixel that the system is trying to find the match for The user is allowed to specify the size of the correlation mask The correlation mask controls the coarseness of features compared between images Larger masks will produce depth maps that are denser and smoother however they may lack precision in identifying the position of depth discontinuities On the other hand smaller masks will produce sparser and more noisy depth images but the localization of depth discontinuities will be much better To produce similar results the size of the mask must be proportional to the resolution of the images processed Thus in order to produce comparable results a 5x5 mask on a 160x120
53. ear curved in the raw images This effect will be particularly evident in the corners of the images Rectified images will be corrected for these kinds of distortions Further rectified images will be corrected so that the rows of images digitized from horizontally displaced cameras are aligned and similarly that the columns of images obtained from vertically displaced cameras are aligned Without this feature searching along the rows and columns will not produce the correct results Edge Detection Edge detection is an optional feature that allows matching on the changes in the brightness rather than the absolute values of the pixels in the images This feature is useful because the cameras in the Triclops camera module have auto gain control If the auto gains in the cameras do not change identically the absolute brightness between images may not be the same While absolute brightness are not the same the change in the intensity stays constant Therefore using edge detection will help in environments where the lighting conditions change significantly 119 Triclops StereoVision System Manual Version 3 1 Copyright 2003 Point Grey Research Inc While edge detection may improve results there is an additional processing cost that is associated with it Therefore the user needs to evaluate the result improvement when choosing to turn edge detection on Note that validation is only available in the edge detection mode Stereo Processing Th
54. ectified when triclopsRectifyColorImage is called Declaration TriclopsError triclopsSetColorImageBuffer TriclopsContext context TriclopsCamera nCamera unsigned char red unsigned char green unsigned char blue Parameters The TriclopsContext to set the buffer for context nCamera The camera buffer to set nCamera A pointer to the red buffer A pointer to the green buffer Triclops Stereo Vision System Manual Version 3 1 80 Copyright 2003 Point Grey Research Inc A pointer to the blue buffer See Also triclopsRectifyColorlmage triclopsSetImage16Buffer This function allows the user to set the location to which 16bit generally subpixel depth images are written to once they are processed Declaration TriclopsError triclopsSetImagel6Buffer TriclopsContext context unsigned short buffer TriclopsImagel6Type imageType TriclopsCamera camera Parameters The TriclopsContext to set the bufferin context buffer A pointer to the buffer The type of image to be written to the buffer imageType camera triclopsSetImageBuffer Sets the internal image buffer for the specified camera and image type to be the buffer supplied by the user This function allows the user to specify directly what memory he she wishes the output images to be deposited into This memory will be used by the stereo kernel as working space This has the advantage of saving a copy for tasks such as displaying t
55. el The disparity value of the input pixel The xcoordinate of the corresponding 3D point The z coordinate of the corresponding 3D point The y coordinate of the corresponding 3D point See Also triclopsRCDFloa ToXY ZO triclopsRCDMappedToXYZO triclopsRCD8ToX YZO triclopsRCD16ToXYZO triclopsSetDisparity triclopsSetDisparity Mapping triclopsRCDTOWorldXY ZO triclopsRCDFloatToWorldX Y ZO triclopsRCD8ToWorldXYZ triclopsSetTriclopsToWorldTransform triclopsGetTriclopsToWorldTransform triclopsRCD16ToXYZ Converts image coordinates and a 16 bit disparity into true 3D points When using this function you should ensure that the values for the Triclops disparity mapping feature are the same as the disparity range Note it is up to the user to supply valid pixel locations Pixels which have been invalidated may give negative results Declaration TriclopsError triclopsRCD16ToXYZ TriclopsContext context 99 Triclops StereoVision System Manual Version 3 1 Copyright 2003 Point Grey Research Inc int row int col unsigned short disp float x float y float z Parameters The stereo context context row The row of the input pixel TOW The column of the input pixel coordinate system The y coordinate of the point represented by the inputrow column disparity in the camera coordinate system See Also triclopsRCDFloa ToXY ZO triclopsRCDMappedToXYZO triclopsRCD8ToX YZO tricl
56. eo context if e ok char szErrorString 1024 the error message buffer sprintf szErrorString triclopsStereo error s n triclopsErrorToString e pop up an error dialog with the formatted error string MessageBox 0 szErrorString Triclops Error 5 In addition the Triclops Stereo Vision SDK works with several different stereo devices This includes Triclops Color Triclops Digiclops and Color Digiclops The examples provided are designed to work with either a Digiclops or a Color Digiclops For other stereo acquisition devices image acquisition function need to be changed 23 Triclops StereoVision System Manual Version 3 1 Copyright 2003 Point Grey Research Inc Example 1 Generating a Depth Map Image processi Example 1 ng Loads three stereo images from a PPM file and performs stereo to create a disparity image which is then output to depth pgm x This program assumes there is a camera calibration file in the same directory named config Lei incl inc incl incl int lt stdio h gt lt stdlib h gt triclops h pnmutils h main int argc char a TGL CL icl IGE ge Err Lo ppmRe di Do pu das dE opsContext rgv ontext opslmage depthImage opsInput i opsError tE nputData Err t the Camera module configuration triclopsGetDef tErr
57. es the state of the edge based correlation flag Declaration TriclopsError triclopsGetEdgeCorrelation const TriclopsContext context TriclopsBool on Parameters The context context o A pointer to a Boolean that will contain the current setting See Also triclopsSetEdgeCorrelation triclopsGetEdgeMask Retrieves the edge detection mask size Triclops StereoVision System Manual Version 3 1 86 Copyright 2003 Point Grey Research Inc Declaration TriclopsError triclopsGetEdgeMask const TriclopsContext context int masksize Parameters The context context A pointer to an integer that will contain the current mask size masksize See Also triclopsSetEdgeMask triclopsGetLowpass Retrieves the state of the low pass filtering feature Declaration TriclopsError triclopsGetLowpass const TriclopsContext context TriclopsBool on Parameters The context context h A pointer to a Boolean variable that will store the current setting See Also triclopsSetLowpass triclopsGetRectify Retrieves the state of the rectification feature Declaration TriclopsError triclopsGetRectify const TriclopsContext context TriclopsBool on Parameters The context context A pointer to a Boolean that will store the current setting See Also triclopsSetRectify 87 Triclops StereoVision System Manual Version 3 1 Copyright 2003 Point Grey Research Inc tric
58. ge from the given context Declaration TriclopsError triclopsGetDisparityMapping const TriclopsContext context unsigned char minDisparity unsigned char maxDisparity Parameters The context context minDisparity The disparity range in the output disparity image minimum maxDisparity The disparity range in the output disparity image maximum See Also triclopsSetDisparityMapping triclo psSetDisparity triclopsGetDisparity MappingOn Retrieves the current setting This function is used to extract the current disparity mapping setting Declaration TriclopsError triclopsGetDisparityMappingOn TriclopsContext context TriclopsBool on Parameters Triclops StereoVision System Manual Version 3 1 90 Copyright 2003 Point Grey Research Inc TriclopsContext for the operation context A pointer that will contain the current value of this flag See Also triclopsSetDisparityMappingOn triclopsGetDoStereo Retrieves the state of the stereo processing Declaration TriclopsError triclopsGetDoStereo const TriclopsContext context TriclopsBool on Parameters The context context A pointer to a Boolean that will store the current setting See Also triclopsSetDoStereo triclopsGetStereoMask Retrieves the stereo correlation mask size Declaration TriclopsError triclopsGetStereoMask const TriclopsContext context int size Parameters The context context s
59. h data obtained from a file This function reads in the default option list and the camera calibration data from a file If the specified file is not found contains invalid fields or is for the wrong product the value of CorruptConfigFile will be returned Declaration TriclopsError triclopsGetDefaultContextFromFile TriclopsContext defaultContext char filename See Also TriclopsGetDefaultContextFromFile triclopsWriteDefaultContextToFile triclopsWriteDefault ContextToFile This writes the default calibration file from the TriclopsContext to a file This function writes the default context parameters and calibration data to a file It does not write the current configuration rather the original configuration that would obtained when getting the default from either a file or a device Declaration TriclopsError triclopsWriteDefaultContextToFile TriclopsContext context char filename Parameters 67 Triclops StereoVision System Manual Version 3 1 Copyright 2003 Point Grey Research Inc context The TriclopsContext The name of the file to be written filename See Also TriclopsGetDefaultContextFromFile Validation Support triclopsGetStrictSubpixel Validation Retrieves the value that appears in the disparity image for pixels that fail uniqueness validation Declaration TriclopsError triclopsGetStrictSubpixelValidation TriclopsContext context TriclopsBool on Parameters The context
60. he input row column disparity in the camera coordinate system See Also triclopsRCDFloatToX YZO triclopsRCD8ToXYZO triclopsRCD16ToX YZ triclopsRCDToWorldX YZO triclopsRCDFloatToWorldXY ZO triclopsRCD8ToWorldXYZ triclopsRCD16ToWorldXYZ triclopsSetTriclopsToWorldTransform triclopsGetTriclopsToWorldTransform triclopsRCDMappedToXY Z Converts image coordinates with disparity values that have been mapped using the disparity mapping function into true 3D points This function takes disparity values that have been scaled by the disparity mapping feature If you do not have the disparity mapping values set to the same as the disparity values you should use this function However it is less efficient than the other XY Z conversion functions and may have some round off errors It is preferable to set the disparity mapping range to the same as the disparity range and use one of the other conversion functions Note It is up to the user to supply valid pixel locations Pixels that have been invalidated may give negative results Declaration TriclopsError triclopsRCDMappedToXYZ TriclopsContext context int row int col unsigned char disp float x float y float z Parameters The stereo context context The row of the input pixel TOW col The column of the input pixel coordinate system E y coordinate system coordinate system Triclops StereoVision System Manual Version 3 1 104 Copyright 2003
61. her than unsigned chars Rowinc is still the number of bytes between the beginning of a row and the beginning of the following row NOT number of pixels Declaration struct TriclopsImagel6 int nrows int ncols int rowinc unsigned short data Elements data The pixel data of the image ncols The number of columns in the image nrows The number of rows in the image rowinc z The number row increment of the image TriclopsImage3d This structure defines the format of an image consisting of 3d points Declaration struct Triclopslmage3d int nrows int ncols int rowinc TriclopsPoint3d points 61 Triclops StereoVision System Manual Version 3 1 Copyright 2003 Point Grey Research Inc Elements The number of columns in the image The number of rows in the image The area for the pixel data This must be numRows numCols bytes large following row The number of bytes between the beginning of a row and the beginning of the TriclopsInput TriclopsInput structure contains image input to the Triclops library The library accepts two formats 32 bit packed and RGB separate buffer inputs Field u contains a pointer to one of the two typed structures that contain the image data The inputType field indicates which type of input is actually present in the structure Declaration struct TriclopsInput TriclopsInputType inputType TriclopsTimestamp timeStamp int nrows
62. herefore disparity values will not be scaled for better contrast and brightness for human viewers This is important as the disparity values should not be scaled if one of the triclopsRCDToX YZ family functions triclopsRCD8ToX YZ triclopsRCD16ToXYZ triclopsRCDFloatToX YZ will be used In cases where the scaling is extremely desirable use triclopsRCDMappedToXYZ 5 The points file can be viewed with the PGR View program 31 Triclops StereoVision System Manual Version 3 1 Copyright 2003 Point Grey Research Inc Example 4 Regions of Interest include lt stdio h gt include triclops h include digiclops h int main int argc char argv PriclopsContext triclops TriclopsImage depthImage TriclopsImage refImage TriclopsInput inputData DigiclopsContext digiclops TriclopsROI OLS int maxRois open the Digiclops digiclopsCreateContext amp digiclops iclopslnitialize digiclops 0 he camera module configuratio sGetTriclopsContextFromCamera digiclops amp triclops he digiclops to deliver the stereo image only sSetImageTypes digiclops STEREO_IMAGE se he Digiclops resolution use HALF resolution when you need faster throughput especially color images digiclopsSet ImageResolution digiclops DIGICLOPS HALF digiclopsSetImageResolution digiclops DIGICLOPS_FULL start grabbing digiclopsStart digic
63. his will of course be in B amp W digiclopsExtractTriclopsInput digiclops RIGHT IMAGE amp colorData preprocessing the images iclopsPreprocess triclops amp stereoData stereo processing lopsStereo triclops trieve the interpolated depth image from the context lopsGetImagel6 triclops Trilmgl6 DISPARITY TriCam REFERENCE amp depthImagel6 lopsRectifyColorImage triclops TriCam_REF amp colorData amp colorImage Triclops StereoVision System Manual Version 3 1 42 Copyright 2003 Point Grey Research Inc save points to disk pointFile fopen out pts wt determine the number of pixels spacing per row pixelinc depthImagel6 rowinc 2 for i 0 k 0 i lt depthImagel6 nrows i row depthImagel6 data i pixelinc for j 0 j lt depthImagel6 ncols j k disparity row j filter invalid points if disparity lt OxFFOO convert the 16 bit disparity value to floating point x y z triclopsRCD16ToXYZ triclops i j disparity X amp y 42 look at points within a range z lt 5 0 int colorImage red k int colorImage green b int colorImage blue k fprintf pointFile f sf nPoints fclose pointFile printf Points in file d n nPoints return 0 43 Triclops StereoVision System Manual Version 3 1 Copyright 200
64. iclopsContext context int nrows int ncols Parameters The context context Number of rows in the output images nrows Number of columns in the output images ncols See Also triclopsGetResolution triclopsGetROIs triclopsSetResolutionAndPrepare Sets the resolution of the resultant images This includes rectified disparity and edge images This function sets the desired resolution of the output images and also immediately constructs the rectification tables For large images the construction of the rectification can take a while This function allows you to control when the construction takes place otherwise it will occur during the first call to triclopsPreprocess The resolution of the input images must be specified at this time as this is necessary for the construction of the tables The output images include the rectified disparity and edge images This requested resolution must maintain the 640x480 columns to rows ratio If the user wishes to have an image of a different aspect ratio he she must use Regions Of Interest to control the size of the image that is being processed Declaration TriclopsError triclopsSetResolutionAndPrepare TriclopsContext context int nrows int ncols int nInputRows int nInputCols Parameters The context context Triclops StereoVision System Manual Version 3 1 Copyright 2003 Point Grey Research Inc 00 Ow Number of rows in the output images nrows Number
65. iclopsDestroyContext triclopsContext assert te ok return 0 Triclops StereoVision System Manual Version 3 1 Copyright 2003 Point Grey Research Inc 46 This example grabs an image from Digiclops and performs stereo on the image using a two camera kernel instead of the three camera kernel The use of the two camera kernel results in faster processing but sacrifices some of the accuracy of the three camera kernel Example 8 works in the following manner The Digiclops camera is opened and initialized The camera model configuration is obtained The Digiclops camera begins to grab images Edge based correlation is turned on The disparity range is set to 1 16 with 1 being the minimum and 16 being the maximum The camera configuration is set to 2 camera mode The image is preprocessed by unpacking the image smoothing it rectifying it and detecting the edges Stereo is performed on the image by doing stereo processing image validation and subpixel interpolation 9 The 16 bit stereo image is extracted and saved to disparity 16 dual pem 10 The context is destroyed and the example program terminates PANA PWN 47 Triclops StereoVision System Manual Version 3 1 Copyright 2003 Point Grey Research Inc Example 9 Using Wide Baseline Stereo Processing Example 9 Widebaselin xample Create a widebaseline context based on the context and 3d transformation information of two separate digic
66. ified image coordinates Declaration TriclopsError triclopsRectifyPixel const TriclopsContext context TriclopsCamera camera float rowln float collIn float rowOut float colOut Parameters The context context camera The camera for which the pixel should be rectified camera a The location of the pixel to rectify rowIn Triclops StereoVision System Manual Version 3 1 Copyright 2003 Point Grey Research Inc The location of the pixel to rectify The location of the rectified pixel The location of the rectified pixel See Also triclopsPreprocess triclopsRectifyColorlmage triclopsSetTriclopsToWorldTransform Sets the Triclops to World transform This function sets the internal TriclopsContext transform to match the provided transform There are several things to note e the transform is the Triclops to World transform ie when this transform is applied to a Triclops point it will change it to a world point e the transform must be of the approved format This means it has a 3x3 rotational component that is orthonormal and the bottom row must be of format 0 0 0 n This function will try to normalize the rotational component and clean up the bottom row of the matrix One can verify whether modifications to the transform were necessary by obtaining the current transform using triclopsGetTriclopsToWorldTransform and comparing Declaration TriclopsError triclopsSetTriclopsToWorldTra
67. ill be declared invalid The user can specify two thresholds that control the strictness of validation one for texture and one for unigueness Triclops StereoVision System Manual Version 3 1 120 Copyright 2003 Point Grey Research Inc Better Calibration The camera calibration has been improved to give greater overlap between cameras This means a wider range of focal length lens can be used in the Triclops family of stereo vision cameras Triclops SDK 2 2 is the first Triclops release that fully takes advantage of the new advances in calibration Subpixel Interpolation The Triclops library allows matching between images to subpixel accuracy The library takes advantage of the matching results of the neighboring pixels of the resulting disparity to determine an approximation that is within a fraction of a pixe 1 Accurate calibration between cameras allows an accuracy of 0 2 of a pixel This function marginally increases the computation time If precise 3D position information is not required it may be omitted Surface Validation Triclops SDK 2 5 supports surface validation This is a filtering process designed to remove noise from the disparity image The kind of noise removed with this process is spikes Spikes are characteristic of mismatches in correlation based stereo vision The spikes can often cover a connected region of many pixels This noise 1s not zero mean random evenly distributed or Gaussian The result is that
68. images obtained from the Triclops camera module and produces depth images There are two main processing blocks in the library The first processing block is the image pre processing block that applies a low pass filter rectifies the images and performs edge detection The second processing block does stereo matching validation of results and subpixel interpolation The result of the library is a depth image Raw input images Depth images Pre processed Pre processing images Stereo processing PAS Low pass filtering gt Stereo Matching Lee Rectification Validation Edge detection Subpixel interpolatoin Figure 4 Triclops library data flow Preprocessing The pre processing module of the Triclops library prepares the raw images for stereo processing Pre processing allows specification of the processing resolution and the following functionality Low Pass Filtering In order to rectify the images it is important to smooth them If image rectification is done it is a good idea to turn on the low pass filtering Rectification can still be done with low pass filtering disabled but the rectified images will exhibit aliasing effects The user has the option of disabling the low pass filtering in order to speed up processing Rectification Rectification is the process of correcting input images for the distortions of the lenses Lenses often cause distortions in raw images For example straight lines in the scene will often app
69. ion Turns uniqueness validation on or off Turns uniqueness validation on or off Uniqueness validation verifies that the match of a given pixel to its corresponding pixels in the top and left images is unique enough to be considered the definite correct match If pixels at other disparities have almost as good matching to the given pixel as the best disparity the pixel can be rejected as an unconfident match Declaration TriclopsError triclopsSetUniquenessValidation TriclopsContext context TriclopsBool on Parameters 75 Triclops StereoVision System Manual Version 3 1 Copyright 2003 Point Grey Research Inc The context context A Boolean value indicating whether validation is on or off See Also TriclopsGetUniguenessV alidation triclopsSetUniquenessValidationMapping Sets the value that appears in the disparity image for pixels that fail uniqueness validation Sets the unique matching validation mapping value This is the value that is assigned to pixels in the disparity image that fail the uniqueness validation test The range is between 0 and 255 Declaration TriclopsError triclopsSetUniguenessValidationMapping TriclopsContext context unsigned char value Parameters The context context value The value to which failing pixels are mapped See Also TriclopsGetUniquenessV alidationMapping triclopsSetUniqueness ValidationThreshold Sets the uniqueness validation threshold This fu
70. ion Programming Interface API This chapter presents the Triclops API and explains the engine behind the functions Several programming examples are presented in order to illustrate the API Triclops StereoVision System Manual Version 3 1 20 Copyright 2003 Point Grey Research Inc 21 Triclops StereoVision System Manual Version 3 1 Copyright 2003 Point Grey Research Inc Programming with the Triclops Stereo Vision SDK The goal of the Triclops Stereo Vision SDK is to provide the user with accurate and fast depth map generation Therefore the ultimate result of the Triclops Application Programming Interface APT is a depth map Depth maps can be produced in a nunber of different ways Further characteristics of depth maps may vary depending on a number of settings Triclops system allows specifying the following characteristics of the stereo processing Stereo Parameters Description of the Parameter Image size resolution The API allows the user to specify the size of the image that is to be used as the K a k Disparity range Allows the user to specify the range that distance measurements are to be done o m 7 0 1 between images Preprocessing Specifies whether matching should be done on gray scale or preprocessed K m N Validation Specifies the methods used for verifying the correctness of matched between E o feature allows processing speedup Subpixel Interpolation This feature allows establis hing correspondences to su
71. ision System Manual Version 3 1 88 Copyright 2003 Point Grey Research Inc TriclopsError triclopsSetEdgeMask TriclopsContext context int masksize Parameters The context context The new mask size which is valid between 3 and 11 masksize See Also triclopsGetEdgeMask triclopsSetLowpass Turns low pass filtering before rectification on or off Declaration TriclopsError triclopsSetLowpass TriclopsContext context TriclopsBool on Parameters The context context on A Boolean value indicating whether it should be turned on or off See Also triclopsGetLowpass triclopsSetRectify Turns rectification on or off Declaration TriclopsError triclopsSetRectify TriclopsContext context TriclopsBool on Parameters The context context A Boolean indicating whether rectification should be turned on or off See Also triclopsGetRectify 89 Triclops StereoVision System Manual Version 3 1 Copyright 2003 Point Grey Research Inc Stereo triclopsGetDisparity Retrieves the disparity range from the given context Declaration TriclopsError triclopsGetDisparity const TriclopsContext context int minDisparity int maxDisparity Parameters The context context r A pointer to an integer that will store the current value minDisparity A pointer to an integer that will store the current value maxDisparity triclopsGetDisparityMapping Retrieves the disparity ran
72. ize A pointer to an integer that will store the current value triclopsGetSubpixelInterpolation Retrieves the state of the subpixel interpolation feature Declaration TriclopsError triclopsGetSubpixelInterpolation const TriclopsContext context TriclopsBool on Parameters 91 Triclops StereoVision System Manual Version 3 1 Copyright 2003 Point Grey Research Inc The context context A pointer to a Boolean that will store the current setting See Also triclopsSetSubpixellnterpolation triclopsSetStrictSubpixelValidation triclopsSetAnyStereoMask Allows the user to set stereomask to any size This function allows you to set a stereo correlation mask of any size There is a danger that an internal counter in the stereo correlation engine may overflow if mask sizes over 15 are provided Thus the current limit for triclopsSetStereoMask is 15 However in practice much larger mask sizes can be used successfully If an overflow results it may not affect the stereo result and it will generally only happen for pathological cases Therefore this function is provided as an experimental function to allow users to set any mask size they wish Declaration TriclopsError triclopsSetAnyStereoMask TriclopsContext context int size Parameters TriclopsContext for the operation context e The size for a new stereo correlation mask See Also triclopsSetStereoMask triclopsSetDisparity Sets the di
73. l be processed Before calling this function the user must first call triclopsGetROIs and set up the ROIs he she intends to use If nrois is set to 0 the entire image will be processed This is the default setting Declaration TriclopsError triclopsSetNumberOfROIs TriclopsContext context int nrois Parameters The context context Number of ROIs nrois See Also triclopsGetROIs triclopsSetPackedColorImageBuffer Allows the user to set the buffer to which the processed color image is written to Declaration TriclopsError triclopsSetPackedColorImageBuffer TriclopsContext context TriclopsCamera nCamera TriclopsPackedColorPixel buffer Parameters The TriclopsContext to set the buffer for context The camera buffer to set nCamera Triclops StereoVision System Manual Version 3 1 82 Copyright 2003 Point Grey Research Inc A pointer to a buffer of TriclopsPackedColorPixels triclopsSetResolution Sets the resolution of the resultant images This includes rectified disparity and edge images This function sets the desired resolution of the output images These images include the rectified disparity and edge images This resolution must maintain the 640x480 columns to rows ratio If the user wishes to have an image of a different aspect ratio he she must use Regions Of Interest to control the size of the image that is being processed Declaration TriclopsError triclopsSetResolution Tr
74. l subpixel validation Strict subpixel validation verifies that the disparity values contribute to the subpixel interpolation make sense By setting the mapping value to 0x an invalid pixel that failed this validation step will be marked OxFF Declaration Triclops StereoVision System Manual Version 3 1 72 Copyright 2003 Point Grey Research Inc TriclopsError triclopsSet SubpixelValidationMapping TriclopsContext context unsigned char value Parameters TriclopsContext for the operation context The new subpixel validation mapping value The range is between 0 and 255 triclopsSetSurfaceValidation Enables or disables surface validation This function 1s used to enable or disable surface validation Declaration TriclopsError triclopsSetSurfaceValidation TriclopsContext context TriclopsBool on Parameters TriclopsContext for the operation context on on A Boolean flag indicating if surface validation should be enabled or disabled triclopsSetSurface ValidationDifference Set the maximum disparity difference between two adjacent pixels that will still allow the two pixels to be considered part of the same surface Declaration TriclopsError triclopsSetSurfaceValidationDi fference TriclopsContext context float diff Parameters TriclopsContext for the operation context The maximum disparity difference between two adjacent pixels that will still allow the two diff pixels
75. lidation is enabled Pixels that do not pass the validation test will be marked with the texture validation mapping value in the disparity image Declaration TriclopsError triclopsSetTextureValidation const TriclopsContext context TriclopsBool on Parameters The context context Texture validation flag on See Also triclopsGetTextureValidation Triclops StereoVision System Manual Version 3 1 74 Copyright 2003 Point Grey Research Inc triclopsSetTextureValidationMapping Sets the value that appears in the disparity image for pixels that fail texture validation Declaration TriclopsError triclopsSetTextureValidationMapping TriclopsContext context unsigned char value Parameters The TriclopsContext to set the texture validation mapping for value triclopsSetTexture ValidationThreshold Sets the texture validation threshold value The new value to map invalid pixels to The range is from 0 to 255 Sets the texture validation threshold This threshold allows one to tune the texture based rejection of pixels Values range from 0 0 no rejection to 128 0 complete rejection but good operating range is between 0 0 and 2 0 Declaration TriclopsError triclopsSetTextureValidationThreshold TriclopsContext context float value Parameters The context context The new texture validation threshold value See Also TriclopsGetTexture ValidationThreshold triclopsSetUniqueness Validat
76. lops Triclops StereoVision System Manual Version 3 1 32 Copyright 2003 Point Grey Research Inc grab an image digiclopsGrabImage digiclops digiclopsExtractTriclopsInput digiclops STE E amp inputData set up some stereo parameters set to 640x480 output images iclopsSetResolution triclops 480 640 set the stereo mask size to maximum iclopsSetStereoMask triclops 11 set disparity range iclopsSetDisparity triclops 5 60 SS OR SY GPO GE SAS IER O X set the display mapping iclopsSetTextureValidationMapping triclops 0 iclopsSetUniguenessValidationMapping triclops 0 get the pointer to the regions of interest array iclopsGetROIs triclops amp rois amp maxRois maxRois gt 4 set up four regions of interest ire upp left quadrant of image roi row 0 rois col 0 rol nrows 240 rois ncols 320 the lower rol roi roi roi red in upper right quadrant roi row 60 roi col 400 roi nrows 120 rois ncols 160 11 section of lower left roi row 300 roi col 30 roi nrows 80 roi ncols 80 lopsSetNumberOfROIs triclops 33 Triclops StereoVision System Manual Version 3 1 Copyright 2003 Point Grey Research Inc Preprocessing the images iclopsPreprocess triclops amp inputData stereo processing iclopsStereo triclops
77. lops camera and then perform stereo processing based on the widebaseline input created from the same pair of cameras AA 2 A 2 A F include tdio h gt nclude ath h gt nclude nmutils h nclude riclops h 480 640 ai int argc char ha configFilel 0 na configFile2 0 ha inputFilel 0 ha inputFile2 0 ha transformFilel 0 har transformFile2 0 riclopsError e riclopsContext triclopsl triclops2 wideTriclops riclopsTransform triclopsTransform riclopsInput inputi input2 riclopsInput widelnput retrieve arguments from command line switch argc default printf testwidebase lt configl gt lt inputl ppm gt lt transforml gt lt config2 gt lt input2 ppm gt lt transform2 gt HY return 1 case 7 configFilel inputFilel argv transformFilel configFile2 inputFile2 argv transformFile2 Triclops StereoVision System Manual Version 3 1 48 Copyright 2003 Point Grey Research Inc break get camera 1 s triclops context triclopsGetDefaultContextFromFile atriclopsl configFilel e TriclopsErrorok printf Can t read config file s n configFilel return 1 get camera 2 s triclops context triclopsGetDefaultContextFromFile amp triclops2 configFile2 e TriclopsErrorok printf Can t read config file s n configFilel return 1 if e triclopsGetTransformFromFile transformFilel
78. lopsImageType The enumerated type TriclopslmageType indicates what kind of image is either being requested or returned It also indicates the size of each pixel in the image Declaration enum TriclopsImageType Trilmg_DISPARITY 0 Trilmg_RAW Trilmg_RECTIFIED Trilmg_EDGE Trilmg_PACKED Triclops StereoVision System Manual Version 3 1 58 Copyright 2003 Point Grey Research Inc Elements T rilmg DISPARITY Disparity image This is the resultant depth image after stereo processing Trilmg EDGE Edge image A Bandpass filter has been applied to this image This image has values that range about 128 A value of 128 indicates no edge Values greater and less than 128 indicate an edge with strength relative to the difference between 128 and the pixel value Trilmg PACKED This image type indicates the image is actually multiple images interleaved This corresponds to the B G R U format that many RGB framegrabbers deliver data in Trilmg_RAW Raw unrectified image This is an image with the aspect ratio that was supplied by the input There is no correction for lens distortion or camera misalignment Trilmg_RECTIFIED Rectified image This is an image that has been corrected for lens distortion and camera misalignment to fit a pinhole camera model TriclopsInputType This enumerated type identifies the format of the input to the Triclops library This input has generally either been read from a set of files for off line pro
79. lopsPreprocess Does image unpacking smoothing rectification and edge detection as specified by parameters This function does all necessary preprocessing on the input data It unpacks the data which strips individual channels from 32 bit packed data and puts them into 3 Trilmg RAW channels It applies a low pass filter on these channels if requested and corrects for lens distortion and camera misalignment saving these images into Trilmg_RECTIFIED Finally it performs 2nd derivative Gaussian edge processing on the rectified images and saves them into Trilmg EDGE internal images Declaration TriclopsError triclopsPreprocess TriclopsContext context TriclopsInput input Parameters The context context The image to be processed See Also triclopsStereo triclopsSetResolution triclopsSetEdgeCorrelation triclopsSetRectify triclopsSetLowpass triclopsSetEdgeCorrelation Turns edge based correlation on or off Edge based correlation is required for texture and uniqueness validation to be used Declaration TriclopsError triclopsSetEdgeCorrelation TriclopsContext context TriclopsBool on Parameters The context context n A Boolean value indicating whether correlation should be turned on or off See Also triclopsGetEdgeCorrelation triclopsSetTexture Validation triclopsSetUniguenessValidation triclopsSetEdgeMask Sets the edge detection mask size Declaration Triclops StereoV
80. lopsToWorldTransform Gets the Triclops to World transform This function fills in the provided TriclopsTransform structure with the current contents of the Triclops to World transform for this TriclopsContext Declaration TriclopsError triclopsGetTriclopsToWorldTransform TriclopsContext context TriclopsTransform transform Parameters context the TriclopsContext the 4x4 homogenous transform transform See Also triclopsRCDToWorldX YZO triclopsRCDFloatToWorldX Y ZO triclopsRCD8ToWorldXYZ triclopsRCD16ToWorldXYZ triclopsWorldX YZToRCDO triclopsSetTriclopsToWorldTransform triclopsGetTransformFromFile triclopsWriteTransformToFile Triclops StereoVision System Manual Version 3 1 98 Copyright 2003 Point Grey Research Inc triclopsRCD16ToWorldX YZ Converts image coordinates and a 16 bit disparity into a world 3D point This function takes a 16 bit disparity value and converts it to XYZ coordinates in world coordinates The world coordinates are determined by transforming the point from the Triclops coordinate system to the world coordinate system based on the TriclopsContext transform Note It is up to the user to supply valid disparity values Declaration TriclopsError triclopsRCD16ToWorldXYZ TriclopsContext context int row int col unsigned short disp Eloat x float y float z Parameters The stereo context context The row of the input pixel TOW The column of the input pix
81. m moves the point to the Triclops coordinate system as described by the TriclopsContext transform and determines what row column and disparity value would result from the resulting point Declaration TriclopsError triclopsWorldXYZToRCD TriclopsContext context float x float y float z float row float col float disp Parameters TriclopsContext set up for desired resolution context X value of a point in the World coordinate system 109 Triclops StereoVision System Manual Version 3 1 Copyright 2003 Point Grey Research Inc See Also triclopsRCDFloa ToXY ZO triclopsRCDMappedToXYZO triclopsRCD8ToX YZO triclopsSetDisparity triclopsSetDisparity Mapping triclopsRCDToWorldX YZO triclopsRCDFloatToWorldXYZ triclopsRCD8ToWorldXY ZO triclopsRCD16ToWorldX YZO triclopsX YZToRCDO triclopsSetTriclopsToWorldTransform triclopsGetTriclopsToWorldTransform triclopsWriteTransformToFile Saves the contents of a TriclopsTransform to the output file This function saves the contents of the specified transform to an external file Declaration TriclopsError triclopsWriteTransformToFile char fileName TriclopsTransform transform Parameters name of the file to which to save the transform fileName the 4x4 homogenous transform to save transform See Also triclopsRCDTOWorldXY ZO triclopsRCDFloatToWorldX Y ZO triclopsRCD8ToWorldXYZ triclopsRCD16ToWorldXYZ triclopsWorldXYZToRCD
82. mage save the depth and reference images NOTE because we did not use disparity mapping these images will very dark This is because the disparity values have not been viewing triclopsSavelmage amp depthImage depth pgm triclopsSavelmage amp refImage reference pgm close the digiclops digiclopsStop digiclops digiclopsDestroyContext digiclops destroy the triclops context triclopsDestroyContext triclops return 0 This example is a modification of the previous one Instead of accepting input from a user supplied PPM file images are obtained from the first Digiclops device on the 1394 bus The example works as follows 1 2 3 eR DONANFA 27 Digiclops is opened and initialized The camera module configuration is retrieved The resolution for Digiclops 1s set to maximize throughout or for colour images set the resolution to HALF The camera starts to grab images The Triclops resolution is set to 240 x 320 The disparity range of the Triclops is set to 5 60 The texture validation mapping and the unigueness validation are turned off The images are preprocessed and stereo processed The depth image is retrieved and saved to the file depth pgm The raw image is retrieved and saved to reference pgm The images can be viewed in an image viewer such as Paint Shop Pro
83. n 2 camera stereo mode TriCfg 2CAM VERTICAL 2 Camera Vertical Unit or 3 Camera Unit in 2 camera vertical mode 3 Camera L Shaped Triclops or Digiclops TriclopsError All Triclops functions return an error value that indicates whether an error occurred and if so what error The following enumerated type lists the kinds of errors that may be returned Declaration enum TriclopsError PriclopsErrorok 0 ok 0 TriclopsErrorNot Implemented TriclopsErrorInvalidSetting TriclopsErrorInvalidContext TriclopsErrorInvalidCamera TriclopsErrorInvalidROI TriclopsErrorInvalidReguest TriclopsErrorBadOptions TriclopsErrorCorruptConfigFile TriclopsErrorNoConfigFile TriclopsErrorUnknown TriclopsErrorNonMMXCpu TriclopsErrorInvalidParameter TriclopsErrorSurfaceValidationOverflow o riclopsErrorCorruptTransformFile PriclopsErrorSystemError Elements TriclopsErrorBadOptions Some options are illegal or contradictory TriclopsErrorCorruptConfigFile The configuration file is corrupted missing mandatory fields or is for the wrong Triclops version TriclopsErrorCorruptTransformFile An error has occurred during a system call Check errno to determine the reason This includes the system running out of memory TriclopsErrorInvalidCamera The specified camera is not valid for this camera configuration TriclopsErrorInvalidContext The TriclopsContext passed in was corrupt or invalid TriclopsErrorInvalidPar
84. n image from the Digiclops calculates the depth for a pixel at the center as well as the average depth for an area around the same pixel and prints the values Once all stereo parameters have been set a 40 by 30 region of interest in the center is set up The code then enters an infinite loop Within this loop an image is taken from the Digiclops and the region of interest is stereo processed The disparity data at the center pixel is tested for validity If it is valid it is used to calculate the depth data the Z value returned by the triclopsRCD8ToX YZ function The same is also done for every other pixel in the region of interest except that these Z values are averaged together These two values are printed and the loop starts again This example can be tested by holding a large flat object in front of the Digiclops device for example a sheet of newspaper and moving it towards and away from the camera The depth values that are displayed should change accordingly The example works as follows Digiclops is opened and initialized The camera module configuration is obtained Digiclops is set to return the stereo image only The resolution is set set to HALF for faster throughput i e colour images The resolution is set to 240 x 320 The disparity range is set to 5 60 The texture validation mapping and the unigueness validation mapping are turned off sets an invalid pixel value 8 The centre of the image is fo
85. n of the cameras This configuration determines the configuration for the stereo algorithm For example a three camera stereo device may be set into 2 camera horizontal mode for faster stereo processing Declaration TriclopsError triclopsSetCameraConfiguration const TriclopsContext context TriclopsCameraConfiguration config Parameters The context context The new CameraConfiguration config See Also TriclopsCameraConfiguration TriclopsGetCameraConfiguration TriclopsGetDeviceConfiguration 97 Triclops StereoVision System Manual Version 3 1 Copyright 2003 Point Grey Research Inc Conversions triclopsGetTransformFromFile Loads the contents of a TriclopsTransform from the input file This function fills in the provided TriclopsTransform structure based on the contents read from the specified file If the specified file is not found contains invalid fields the value of CorruptTransformFile will be returned Declaration TriclopsError triclopsGetTransformFromFile char fileName TriclopsTransform transform Parameters fileName name of the file from which to load the transform the 4x4 homogenous transform transform See Also triclopsRCDTOWorldXY ZO triclopsRCDFloatToWorldX Y ZO triclopsRCD8ToWorldX YZO0 triclopsRCD 16ToWorldX YZO triclopsWorldX YZToRCDO triclopsSetTriclopsToWorldTransform triclopsGetTriclopsToWorldTransform triclopsWriteTransformToFile triclopsGetTric
86. n the image The number of rows in the image 63 Triclops StereoVision System Manual Version 3 1 Copyright 2003 Point Grey Research Inc rowne The number of bytes in each row of the image TriclopsPackedColorPixel This structure defines the format for a 32bit color pixel Declaration struct TriclopsPackedColorPixel unsigned char value 4 Elements value The 32 bit pixel data TriclopsPoint3d This structure defines a single 3d pixel It is only used in the TriclopsImage3d structure Declaration struct TriclopsPoint3d float point 3 Elements The 3 values for the x y z point in order x 0 y 1 z 2 TriclopsROI This structure describes a Region Of Interest for selective processing of the input images Declaration struct TriclopsROI int row int col int nrows int ncols Elements The column value for the upper left corner of the region of interest The width of the region of interest The height of the region of interest Triclops StereoVision System Manual Version 3 1 64 Copyright 2003 Point Grey Research Inc FW The row value for the upper left corner of the region of interest Triclops Timestamp This structure describes the format by which time is represented in the Triclops Stereo Vision SDK Declaration struct TriclopsTimestamp long sec long u_sec Elements sec The number of seconds since the epoch u sec
87. nction sets the uniqueness matching criteria threshold This value can range from 0 0 to 10 0 The larger the number the less rejection occurs Common operating ranges are between 0 5 and 3 0 Declaration TriclopsError triclopsSetUniquenessValidationThreshold TriclopsContext context float value Parameters The context context A float indicating the new threshold value See Also TriclopsGetUniguenessValidationThreshold Triclops StereoVision System Manual Version 3 1 76 Copyright 2003 Point Grey Research Inc General triclopsGetImage Retrieves a specified type of image associated with the specified camera This function supplies the data to a TriclopsImage The user is responsible for allocating the TriclopsImage structure The data value of the structure will point to memory within the stereo kernel working space Therefore if a permanent copy of this image is desired the user must copy it out Declaration TriclopsError triclopsGet Image const TriclopsContext context TriclopsImageType imageType TriclopsCamera camera Triclopslmage image Parameters The context context imageType The image type requested camera The camera that generated the reguested image camera A TriclopsImage with the image data image See Also triclopsSetImageBuffer triclopsGetImage16 Retrieves a specified 16 bit image associated with the specified camera This function performs the same acti
88. ngth See Also triclopsGetDefaultContextFromFile triclopsSetResolution triclopsGetImageCenter Returns the optical center for pinhole calculations It is important that the context already has the resolution set If triclopsSetResolution is not set the returned value cannot be used for calculations This image center can be used as the position in the image plane of the optical center for pinhole camera cakulations Declaration Triclops StereoVision System Manual Version 3 1 96 Copyright 2003 Point Grey Research Inc TriclopsError triclopsGet ImageCenter TriclopsContext context float centerRow float centerCol Parameters TriclopsContext for the operation context A pointer that will contain the row position of the image center for the current resolution centerkow A pointer that will contain the column position of the image center for the current centerCol resolution See Also triclopsSetResolution triclopsGetSerialNumber This function returns the serial number of the Digiclops Stereo Vision System associated with the given TriclopsContext Declaration TriclopsError triclopsGetSerialNumber const TriclopsContext context int serialNumber Parameters The context to extract the serial number from context The serial number of the Digiclops Stereo Stereo Vision System associated with the serialNumber given context triclopsSetCameraConfiguration Sets the configuratio
89. nsetPackedColorImageBuffer TCP EL M nn on nl sn een HClOpPSWorldXYZTORC Die a clin een te Zi vy dop ne mt En ne DE in anti triclopsWriteDefaultContextToFile siennes triclopsWriteTransformToFile triclops Xx YZTOR CDi litis Trilme DISPARA st See TriclopsImageType Trilmg DISPARITY Trilmg EDGE iia See TriclopslmageType Trilmg EDGE Trilme PACKED cuina tnt nine naines See TriclopsImageType Trilmg PACKED TAB RAW zi ett isc lence AS See TriclopsImageType Trilmg RAW Trilmg_RECTIFIED se sassties desirte See TriclopsImageType Trilmg RECTIFIED Trilmg16 DISPARITY none See TriclopsImage16Type Trilmg16_DISPARITY TaJnp NONE m nas a See TriclopsInputType Trilnp_NONE Tap RGB ii HA iso See TriclopsInputType Trilnp RGB Trilnp RGB 32BIT PACKED See TriclopsInputType Trilnp RGB 32BIT PACKED Troubleshooting Contacting Point Grey RESCATA no dessein nes 123 U u See Triclopslnput u SE CSP EDEN EP DE PR E EE r See TriclopsTimestamp u_sec Uniqueness Validation 28 EN deh in ein LR AO esos Eu 120 V VAlIdatom 4 AA ee Mien nent ooo on 22 120 Texture Validation br 120 Unigiieness validation iii ia nr tente 120 Value ne in See TriclopsPackedColorPixel value W Warrant in voodoo en nenne nn dr nn ani anne nie tree tin nr tenant E ne nn te te A ttrnte 2 SOMO tn md le ann An cubes Re st rent de ee ne ne 2 131 Triclops StereoVision System Manual Version 3 1 Copyright 2003 Point Grey Research Inc
90. nsform TriclopsContext context TriclopsTransform transform Parameters the 4x4 homogenous transform transform See Also triclopsRCDTOWorldXY ZO triclopsRCDFloatToWorldX Y ZO triclopsRCD8ToWorldXYZ triclopsRCD16ToWorldXYZ triclopsWorldX YZToRCDO triclopsGetTriclopsToWorldTransform triclopsGetTransformFromFile triclopsWriteTransformToFile triclopsUnrectifyPixel Converts a pixel coordinate location from the rectified image coordinates to unrectified image coordinates Declaration Triclops StereoVision System Manual Version 3 1 108 Copyright 2003 Point Grey Research Inc TriclopsError triclopsUnrectifyPixel const TriclopsContext context TriclopsCamera camera float rowln float colin float rowOut float colOut Parameters The context context camera The camera for which the pixel should be unrectified camera rown The location of the pixel to unrectify rowln The location of the pixel to unrectify The location of the unrectified pixel The location of the unrectified pixel Remarks This version will accommodate input rectified pixel locations that are outside of the normal rectified image bounds as long as the corresponding unrectified location is within its own image bounds See Also triclopsRectifyPixeK triclopsWorldXYZToRCD Converts world 3D points into image coordinates This function takes as input the XYZ position of a point in the World coordinate syste
91. nst TriclopsContext context float diff Parameters TriclopsContext for the operation context diff A pointer that returns the current value of the surface validation difference parameter triclopsGetSurfaceValidationMapping Retrieves the current surface validation mapping This function returns the current setting for the surface validation parameter Declaration TriclopsError triclopsGetSurfaceValidationMapping const TriclopsContext context unsigned char value Parameters TriclopsContext for the operation context value value A pointer that will return the current value of the surface validation mapping parameter 69 Triclops StereoVision System Manual Version 3 1 Copyright 2003 Point Grey Research Inc triclopsGetSurfaceValidationSize Retrieves the current validation size This function is used to extract the surface size parameter for surface validation Declaration TriclopsError triclopsGetSurfaceValidationSize const TriclopsContext context int size Parameters TriclopsContext for the operation context A pointer that returns the current value of the size parameter size See Also triclopsSetSurfaceV alidationSize triclopsGetTextureValidation Retrieves the state of the texture validation flag Declaration TriclopsError triclopsGetTextureValidation const TriclopsContext context TriclopsBool on See Also TriclopsSetTexture Validation triclopsGetTe
92. nstallation disk has on it the option of installing this program Triclops StereoVision System Manual Version 3 1 14 Copyright 2003 Point Grey Research Inc 15 Triclops StereoVision System Manual Version 3 1 Copyright 2003 Point Grey Research Inc Chapter 4 Getting Started This chapter goes through a number of exercises designed to ensure that the system is properly installed and to give the user an initial feel for the system s capabilities Triclops StereoVision System Manual Version 3 1 16 Copyright 2003 Point Grey Research Inc 17 Triclops StereoVision System Manual Version 3 1 Copyright 2003 Point Grey Research Inc This chapter is for Microsoft Windows 98 2000 users Running the Demo Program After installing the Triclops SDK and an appropriate stereo device 1 e a Digiclops stereo vision system 1t 1s a good idea to test the device and the stereo installation by running the interactive demonstration programs Please refer to the documentation for your stereo vision system installation for a description of the different demonstration programs available and their operation For further information on the meaning of stereo parameters that can be set in the demonstration programs please refer to Chapter 7 Stereo Vision Details Compiling a Triclops Program Now that you know that the system is installed correctly you can try compiling a sample program and verify that the Triclops library and include file
93. ntext amp inputData riclopsDestroyContext context This example generates a depth map from a PPM image file 1 D DMA The example performs stereo processing on the file input ppm and saves the depth map into a file It is not necessary to worry about grabbing and displaying for this example After loading the camera configuration file from a file named config in the same directory the input PPM file is read and is stored in a TriclopsInput data structure The resolution disparity range and pixel mapping values are then set in the program The rest of the stereo parameters are left with the default values loaded from the configuration file Image preprocessing and stereo processing is then done The disparity image associated with the reference camera is retrieved and saved to a gray scale pgm file named depth pgm Triclops StereoVision System Manual Version 3 1 Copyright O 2003 Point Grey Research Inc Example 2 Grabbing images and stereo processing Example 2 Gets input from the Digiclops and performs stereo processing to create a disparity image A raw image from the reference camera and the disparity image are both written out include lt stdio h gt include lt stdlib h gt include triclops h include digiclops h int main int argc char argv iclopsContext triclops iclopsImage depthImage iclopsImage refImage riclopsInput inputData igiclopsC
94. nts based on images obtained from slightly offset cameras There are three steps in performing stereo processing Establish correspondence between image features in different views of the scene Calculate the relative displacement between feature coordinates in each image Determine the 3D location of the feature relative to the cameras using the knowledge of the camera geometry Consider the following example Figure 2 shows an image pair obtained from the horizontally displaced cameras of the Triclops camera module We can identify two points A and B in both images The point A jeft corresponds to the point A on Similarly point Biet corresponds to the point Bright Figure 2 Example of matching points between stereo images Using a ruler if you measure out the horizontal distance between the left edge of the images and the points you will find that distances in the left image are greater than the distance to the corresponding point in the right image For example the distance to the phone handle from the left edge of the image is greater than the distance to the phone handle in the right image Based on this distance also called disparity it is possible to determine the distance to the phone handle from the camera module We will define the disparity as the difference between the coordinates of the same features in the left and right image You will find that the distances from the top of the image to the matching features are exactly
95. o the screen The user may simply set the output image buffer to his her display buffer However since this memory will be used by the stereo kernel as working space the contents of the buffer may change with each call of triclopsPreprocess or triclopsStereo If the results are to be saved it is the user s responsibility to do so In addition the user is responsible to allocate sufficient memory for the buffer and to de allocate the buffer after it is no longer needed Before de allocating the buffer the user should call triclopsUnsetImageBuffer If the user requests an invalid image such as the disparity image when the context stereo flag is set to false or the edge image when edge correlation is set to false an error of invalid request will be returned Disparity images are always associated with the reference camera Declaration TriclopsError triclopsSetImageBuffer TriclopsContext context unsigned char buffer TriclopsImageType imageType TriclopsCamera camera 81 Triclops StereoVision System Manual Version 3 1 Copyright 2003 Point Grey Research Inc Parameters The context context A user allocated buffer of sufficient size buffer imageType The image type eee o camera See Also triclopsGetImage triclopsUnsetImageBuffer triclopsSetNumberOfROIs Sets the number of Regions Of Interest the user currently wants active This function indicates to the stereo kernel how many ROIs in the ROI array wil
96. on TriclopsContext context TriclopsBool on Parameters The context context A Boolean indicating whether it should be on or off on See Also triclopsGetSubpixellnterpolation triclopsSetStrictSubpixel Validation triclopsStereo Does stereo processing validation and subpixel interpolation as specified by parameters This function performs the stereo processing and validation and generates the internal image Trilmg_DISPARITY Triclops StereoVision System Manual Version 3 1 94 Copyright 2003 Point Grey Research Inc Declaration TriclopsError triclopsStereo TriclopsContext context Parameters The context context See Also triclopsPreprocessing triclopsSetDoStereo triclopsEdgeCorrelation triclopsSetTexture Validation triclopsSetUniguenessValidation triclopsGetROIs triclopsSetSubpixelInterpolation Configuration triclopsGetBaseline Retrieves the baseline of the cameras This function retrieves the baseline of the cameras in meters The stereo context must have already been read Declaration TriclopsError triclopsGetBaseline TriclopsContext context float base Parameters The context context The baseline in meters base See Also triclopsGetDefaultContextFromFile triclopsGetCameraConfiguration Retrieves the current configuration of the stereo camera This configuration is the configuration that specifies the stereo algorithm used For example 2CAM
97. on as triclopsGetlmage except that it retrieves a 16 bit image type Currently the only supported 16 bit image is the resultant disparity image from subpixel interpolation Declaration TriclopsError triclopsGetImagel6 const TriclopsContext context TriclopsImagel6Type imageType TriclopsCamera camera TriclopsImagel6 image Parameters The context context imageType The image type reguested camera The camera that generated the reguested image camera 77 Triclops StereoVision System Manual Version 3 1 Copyright 2003 Point Grey Research Inc A TriclospImage16 with the image data image See Also triclopsGetlmage triclopsGetROIs Retrieves a handle to an array of Regions Of Interest This function returns a pointer to an array of region of interest ROD structures The user may set requested region of interest boundaries in this array The Regions Of Interest that will be valid must begin with the Oth element in the array and continue in a contiguous manner After having set the Regions Of Interest the user must call triclopsSetNumberOfROIs to indicate to the stereo kernel how many ROIs he she wishes processed Currently ROIs are only applied during the stereo processing not during preprocessing Declaration TriclopsError triclopsGetROIs TriclopsContext context TriclopsROI rois int maxROls Parameters The context context A pointer to a 1D array of ROI structures TOIS max
98. on obtained from the stereo device or by loading the image information from the file The Triclops context is then used for performing image pre processing and the stereo processing The results of stereo processing can then be retrieved from the context Triclops Stereo Vision System Manual Version 3 1 22 Copyright 2003 Point Grey Research Inc Triclops Example Source Code In order to guickly understand the Triclops library a number of examples are provided with the software distribution All examples can be found in the TRICLOPS_PATH lexamples directory It is a good idea for the user to make a copy of the examples and compile them in a new location Important Please check error codes It is important to note that the following examples with the exception of 6 do not check for error codes We have chosen to do this to ensure that the examples are not cluttered and are therefore easier to follow When creating your own source code it is important that you include error checking A list of different TriclopsErrors can be found at the beginning of chapter 6 All Triclops Stereo Vision SDK functions return a TriclopsError enumerated type error code This error code can be used to determine the reason for the function failure An example of checking the error code and formatting an error string is include stdafx h include triclops h int main int argc char argv TriclopsError e e triclopsSter
99. ontext digiclops open the Digiclops digiclopsCreateContext amp digiclops igiclopslnitialize digiclops 0 the camera module configuration iclopsGetTriclopsContextFromCamera digiclops amp triclops set the Digiclops resolution use HALF resolution when you need faster throughput especially color images digiclopsSetImageResolution digiclops DIGICLOPS_HALF iclopsSetImageResolution digiclops DIGICLOPS FULL start grabbing iclopsStart digiclops grab an image igiclopsGrabImage digiclops igiclopsExtractTriclopsInput digiclops STEREO IMAGE amp inputData set up some stereo parameters set to 320x240 output images lopsSetResolution triclops 240 320 t disparity range lopsSetDisparity triclops 5 60 set the display mapping iclopsSetTextureValidationMapping triclops 0 iclopsSetUniquenessValidationMapping triclops 0 Triclops StereoVision System Manual Version 3 1 26 Copyright 2003 Point Grey Research Inc appear scaled for Preprocessing the images iclopsPreprocess triclops amp inputData stereo processing lopsStereo triclops trieve the depth image from the triclops context lopsGetImage triclops Trilmg_DISPARITY TriCam R age trieve the raw image from the triclops contex lopsGetImage triclops TrilImg RAW TriCam REFERENCE srefI
100. opsSetDisparity triclopsSetDisparity Mapping triclopsRCD8ToWorldX YZ Converts image coordinates and an 8 bit disparity into a world 3D point This function takes an 8 bit disparity value and converts it to XYZ coordinates in world coordinates The world coordinates are determined by transforming the point from the Triclops coordinate system to the world coordinate system based on the TriclopsContext transform Note It is up to the user to supply valid disparity values Declaration TriclopsError triclopsRCD8ToWorldxXYZ TriclopsContext context int row int Col unsigned char disp float x float y float z Parameters The stereo context context The row of the input pixel row col The column of the input pixel Triclops StereoVision System Manual Version 3 1 100 Copyright 2003 Point Grey Research Inc The disparity value of the input pixel k The xcoordinate of the corresponding 3D point X y The y coordinate of the corresponding 3D point The z coordinate of the corresponding 3D point See Also triclopsRCDFloa ToXY ZO triclopsRCDMappedToXYZ0 triclopsRCD16TOXY Z 0 triclopsSetDisparity triclopsSetDisparityMapping triclopsRCDToWorldXY2Z triclopsRCDFloatToWorldX YZ triclopsRCD16ToWorldXYZO triclopsSetTriclopsToWorldTransform triclopsGetTriclopsToWorldTransform triclopsRCD8ToX YZ Converts image coordinates and an bit disparity into true 3D points When using this func
101. pth image is retrieved and rectified The points are saved to the file out pts The pixel spacing is determined and invalid points are filtered out The valid points are displayed to the screen EO PA Triclops StereoVision System Manual Version 3 1 44 Copyright 2003 Point Grey Research Inc Example 8 Performs Stereo Using a 2 Camera Kernel include lt stdio h gt include lt conio h gt include lt stdlib h gt include lt assert h gt include digiclops h include triclops h include pnmutils h int main int argc char argv iclopsContext triclopsContext igiclopsContext digiclopsContext lopsInput triclopsInput lopsImagel imageDepth16 lopsError te igiclopsError de open and initialize the Digiclops de digiclopsCreateContext amp digiclopsContext assert de DIGICLOPS_ok digiclopsInitialize digiclopsContext 0 assert de DIGICLOPS_ok get the camera module configuration de digiclopsGetTriclopsContextFromCamera digiclopsContext amp triclopsContext assert de DIGICLOPS_ok digiclopsSetImageTypes digiclopsContext ALL_IMAGES rt de DIGICLOPS_ok digiclopsSetImageResolution digiclopsContext DIGICLOPS_FULL r d DIGICLOPS ok 45 Triclops StereoVision System Manual Version 3 1 Copyright 2003 Point Grey Research Inc start grabbing de assert assert a
102. ras The example works as follows Two separate configuration files are used to create two contexts Two tranform files are used to create transforms to correspond to the contexts that were created Create a wide baseline context using the two contexts Set the resolution stereo mask disparity and subpixel interpolation Load the images from each camera Create a wide baseline input from the two separate contexts Perform stereo processing on the wide baseline input Save the following images right raw image left raw image right rectified image left rectified image and the resulting disparity image Free the allocated memory associated with this example Triclops StereoVision System Manual Version 3 1 52 Copyright 2003 Point Grey Research Inc 53 Triclops StereoVision System Manual Version 3 1 Copyright 2003 Point Grey Research Inc Chapter 6 Triclops Application Programming Interface API Function Reference This chapter presents a detailed description of each function in the API Triclops StereoVision System Manual Version 3 1 54 Copyright 2003 Point Grey Research Inc 55 Triclops StereoVision System Manual Version 3 1 Copyright 2003 Point Grey Research Inc In this chapter you will find detailed descriptions of all functions and types used by the Triclops library The first part of the chapter presents the enumerated types type structures and a summary of functions The second part of the chapter
103. riclopsImage16 data See TriclopsImage data DA O PE LKT OJ OOo R Disparity ranger ON De ooo OLP A lens E Edge ete Chi OM as c 5i A RTS an A asa eee Establishing COrfespondencesii sims cdta tintin rire EXAMPLES sir ane Abit HN Finding the depth of the center of the image Setting up the stereo context for simple stereo processing 23 Sub pixel interpolation and depth calculation sn 28 G Getting Martian Hr de et 16 PM T See TriclopsInputRGB green See TriclopsColorImage green I Image SIZO TES OLUTION ii AA sae 22 A OR 14 A re en PE UE Re ee AS podob M oo See TriclopsInput inputType Installation Soltware is A i ni b 12 L LICENSE A TA 2 L W pass fillerin g A ne nn den enter ren ennui 119 M MASK SIZE o A on EN 22 Matching DOM rene is o sa o 117 Multiple Cameras de ne eRe ee Re een es 118 125 Triclops StereoVision System Manual Version 3 1 Copyright 2003 Point Grey Research Inc N NCOIS See TriclopsROI ncols See TriclopsPackedColorImage ncols See TriclopsInput ncols See TriclopsImage3d ncols See Triclopslmagel6 ncols See TriclopsImage ncols See TriclopsColorImage ncols nrows See TriclopsROI nrows See TriclopsPackedColorImage nrows See TriclopsInput nrows See TriclopsImage3d nrows See Triclopslmagel6 nrows See TriclopsImage nrows See TriclopsColorImage nrows O e ad o Crest o See TriclopsError ok Online RESOULCES edi 11 P DOME rv See TriclopsPoint3d poin
104. riclopsRCDMappedToWorldX YZ Converts image coordinates with disparity values that have been mapped using the disparity mapping function into world 3D points This function takes disparity values that have been scaled by the disparity mapping feature If you have set Disparity Mapping on you should use this function However it is less efficient than the other XYZ conversion functions and may have some round off errors It is preferable to set the disparity mapping off This function will transform the point into a world coordinate system based on the transform recorded in the TriclopsContext Note It is up to the user to supply valid disparity values invalid disparity values as taken from an invalid pixel in the a disparity image may give negative results Declaration TriclopsError triclopsRCDMappedToWorldXYZ TriclopsContext context int row int col unsigned char disp float x float vy float z Parameters The stereo context context EM The row of the input pixel TOW The column of the input pixel 103 Triclops StereoVision System Manual Version 3 1 Copyright 2003 Point Grey Research Inc The disparity value of the input pixel The x coordinate of the point represented by the input row column disparity in the camera coordinate system The y coordinate of the point represented by the input row column disparity in the camera y coordinate system z The z coordinate of the point represented by t
105. s are properly set For this step we assume that your development environment is Microsoft Visual C In the following steps the variable TRICLOPS PATH represents the directory in which the Triclops SDK has been installed The default location for this directory is C Program Files Point Grey Research Triclops Stereo Vision SDK Create a new directory outside of the 1 TRICLOPS PATH directory sub tree Copy the directory TRICLOPS_PATH examples to your newly created directory Start Visual C and open the examples dsw workspace in your newly created directory Set the library path to TRICLOPS PA TH lib Set the preprocessor include path to TRICLOPS_PATH include Set the active project to example 1 Build the program Run the program View the images disparity pgm and reference pgm that are created by the program in your newly created directory with Paint Shop Pro Dons pr This program reads a raw stereo image from a file performs stereo processing and saves the gray scale images and depth map into separate files If you are using a compiler other than Visual C you will have to specify the library path and the include path in order for the compiler to find the appropriate files Triclops StereoVision System Manual Version 3 1 18 Copyright 2003 Point Grey Research Inc 19 Triclops StereoVision System Manual Version 3 1 Copyright 2003 Point Grey Research Inc Chapter 5 Programming with the Triclops Applicat
106. s software in the default location suggested by the install shield If not the example program project file settings will have to be changed to include the correct SDK paths for include and library files The Point Grey Research Inc message box also has an Explore CD button When this is selected you will be presented with the CD contents that contains Subdirecto This subdirectory contains PGRView a program which allows one to view point cloud files generated by Example7 of the provided source code example programs This subdirectory contains Triclops example source code The Triclops example source code is discussed in Chapter 5 Programming with the Triclops Application Programming Interface API Include This subdirectory contains the include files required to compile using the Triclops library The primary include file is the triclops h This subdirectory also contains the pnmutils h file which includes utilities for reading and writing PGM and PPM format images This subdirectory contains the Triclops and pnmutils libraries It also contains the triclops dll which is the dynamic link library for triclops lib This subdirectory contains the Triclops Manual and the PGRView User Manual Image Viewing At this time it is a good idea to also install an image viewing program The Triclops library supports the PGM image format Paint Shop Pro is a good choice for viewing PGM files The Triclops or the Digiclops i
107. sRecafyColorImar zistis s nku n z li dna triclopsRectifyPackedColorImage nn triclopsRectifyPixel ss triclopsSetTriclopsToWorldTransform triclopsUnrectifyPixel ss s triclopsWoOHdXYZPORCI EET E EA aid Ericlops WriteTransformToFle avi ara Triclops StereoVision System Manual Version 3 1 6 Copyright 2003 Point Grey Research Inc EVICIOPSX YZ LORCD ns nt ner tte tn sln UNGROUPED OBJECTS TRICLOPS VERSION WIDEBASELINE STEREO ItiClOpSEX ractImagesdis int E ANER A nine E 113 triclopsExtraciWorldImageS da ii 113 CHAPTER 7 STEREO VISION DETAILS seems 115 Establishing Correspondences noaee o iae erena e ea a eas aeee eae naar Etoo tee GRR Re 118 Calculating Distances 118 Triclops Library Data Flow 119 Preprocessing 119 Rectification 119 Edge Detection 119 Stereo Processing Disparity Range Correlation Mask Validation itis AA N DATA dt en tn Better Calibration Subpixel Interpolation 3 35 A392 A NE N RI EL Surface Validation sitie AN os ea oa i A do des ha do Real bu 121 Subpixel Validation Mapping 121 Region Of Interest and Subpixel 121 Disparity Map pit ges tai HI 121 CONTACTING POINT GREY RESEARCH seems 123 7 Triclops Stereo Vision System Manual Version 3 1 Copyright 2003 Point Grey Research Inc Chapter 1 Introduction This chapter presents the features of the Triclops
108. sions of the SDK Triclops StereoVision System Manual Version 3 1 122 Copyright 2003 Point Grey Research Inc Contacting Point Grey Research We encourage you to visit the online Q amp A forums on our web site if you encounter any problems with the Triclops Stereo Vision SDK For any problems not resolved on our web site or if you have any comments for us you can contact us via the methods listed below For any questions concerns or comments please contact us via the following methods Email info ptgrey com sales ptgrey com support ptgrey com Telephone 604 730 9937 Fax 604 732 8231 Mail Point Grey Research Inc 305 1847 W Broadway Vancouver BC V6J 1Y6 Canada 123 Triclops StereoVision System Manual Version 3 1 Copyright 2003 Point Grey Research Inc Triclops StereoVision System Manual Version 3 1 124 Copyright 2003 Point Grey Research Inc A o ON ARNO See Application Programming Interface Application Programming Interface API function references Rennes O ne en ne nr te se ene 54 Programming with the Triclops API nn 20 B blues rise anne his See TriclopsInputRGB blue See TriclopsColorlmage blue C Calcul ting distances nn ln 118 E A ds E et dd S See TriclopsROI col Compiling a Triclops Program ono on nn 18 Coordinate Sy Stems sir ns h hs nr n 118 Correlation mask is A 120 D data isa See TriclopsPackedColorImage data See TriclopsInputRGB32BitPacked data See T
109. sparity range for stereo processing Declaration TriclopsError triclopsSetDisparity TriclopsContext context int minDisparity int maxDisparity Parameters The context context minDisparity The disparity range minimum maxDisparity The disparity range maximum Triclops StereoVision System Manual Version 3 1 92 Copyright 2003 Point Grey Research Inc triclopsSetDisparityMapping Sets the disparity range for stereo processing This function sets the disparity mapping values The disparity mapping values control what range of pixels values appear in the output disparity image The true disparity ranges between the minimum and maximum values set with triclopsSetDisparity The output image has its pixel values linearly scaled from minimum gt maximum disparity to minimum gt maximum disparity mapping This is primarily used when one wishes to use a screen display buffer as the disparity image buffer Note it is advisable to set the disparity mapping to the exact values of the input disparities 1f one is not using the screen buffer display feature Declaration TriclopsError triclopsSetDisparityMapping TriclopsContext context unsigned char minDisparity unsigned char maxDisparity Parameters The context context minDisparity A disparity range in the output disparity image minimum The range is between 0 and maxDisparity a disparity range in the output disparity image maximum The range is between 0 and Se
110. ssing the images riclopsPreprocess triclops amp inputData stereo processing riclopsStereo triclops retrieve the depth image from the context riclopsGetImage triclops Trilmg_DISPARITY TriCam RE age get the depth of the center pixel at 159 119 disparity depthImage data 119 depthImage rowinc 159 Triclops StereoVision System Manual Version 3 1 36 Copyright 2003 Point Grey Research Inc invalid pixel if disparity 0 printf INVALID t t else triclopsRCD8ToXYZ triclops 119 159 disparity 8x amp y amp z print S f t E z calculate depth average of the entire ROI avgZ 0 nPoints 0 for i 104 i lt 134 i row depthImage data depthImage rowinc i for j 139 j lt 179 j disparity row 3 1 if disparity 0 nPoints triclopsRCD8ToXYZ triclops i j disparity x avgZ Z nPoints 0 printf INVALID Nr else avgZ nPoints printf Sf r avgZ fflush stdout close the digiclops digiclopsStop digiclops digiclopsDestroyContext digiclops destroy the context triclopsDestroyContext triclops return 0 37 Triclops StereoVision System Manual Version 3 1 Copyright 2003 Point Grey Research Inc Example 5 combines depth finding with the use of a region of interest it continuously grabs a
111. striclopslnput asser se te asser se te asser te asser do te TriGtg _ 2 asser di c de opss D g digicl de D digiclopsE gi opsGrabImage tart digiclopsContext IGICLOPS_ok digiclopsContext IGICLOPS ok xtractTriclopsInput digiclopsContext ST El d DIGICLOPS ok up some riclopsSe EG be tric El EXE El ste tric CAM El te te te lopsSe lopsSe reo in lopsSe HORIZO stereo parameters tEdgeCorrelation triclopsContext i K disparity range tDisparity triclopsContext 16 k 1 tSubpixelInterpolation triclopsContext k 2 camera mode tCameraConfiguration triclopsContext NTAL k 1 P t asse reprocess and stereo triclopsPreprocess triclopsContext t te amp triclopsInput k triclopsStereo triclopsContext t te ok ex te TriCam R asser tract the 16 bit disparity image triclopsGetImagel6 triclopsContext EFERENCE amp imageDepth16 t te ok TriImgl6 DISPARITY te asser triclopsSavelmagel t te ok amp imageDepth16 disparityl6 dual pgm close the digiclops digiclopsStop digiclopsContext digiclopsDestroyContext digiclopsContext destroy the triclops context te tr
112. t value value A pointer to an unsigned char that will contain the current value of the mapping See Also TriclopsSetUniquenessValidationMapping 71 Triclops StereoVision System Manual Version 3 1 Copyright 2003 Point Grey Research Inc triclopsGetUniguenessValidationThreshold Retrieves the unigueness validation threshold Declaration TriclopsError triclopsGetUniquenessValidationThreshold const TriclopsContext context float value Parameters The context context A pointer to a float indicating the current threshold value See Also TriclopsSetUniguenessThreshold triclopsSetStrictSubpixelValidation Sets the state of the subpixel validation setting The strict subpixel validation option is used when the subpixel interpolation flag is turned on Strict subpixel validation enables a more restrictive validation method for subpixel validation With strict subpixel validation on there will be less data in the output image but it will be more reliable Declaration TriclopsError triclopsSetStrictSubpixelValidation TriclopsContext context TriclopsBool on Parameters The context context A Boolean value indicating whether validation is on or off on See Also triclopsGetStrictSubpixelValidation triclopsSetSubpixelInterpolation triclopsGetSubpixelInterpolation triclopsSetSubpixel ValidationMapping Sets the value that appears in the disparity image for pixels that fai
113. t points See TriclopsImage3d points PEPE ESE AA An Re ozone 22 119 R Range measurement RECI TOZE KD O ER P en O S ne At ne E sates divest actus O O a O Ted en RNA hopu too es Regions OM di A nan A dai A beda dane REQUIEM cito See System requirements ROBA AA A EA AAA Aa See Regions of interest ANN See TriclopsROI row rowinc See TriclopsPackedColorlmage rowinc See TriclopsInput rowinc See Triclopslmage3d rowinc See TriclopsImage16 rowinc See TriclopsImage rowinc See TriclopsColorImage rowinc R nnine the Demo Pro ra iii nn 18 Software Warranty aeniea nn E O A E arenes Source Codeshare nn e i ASS OO NON STEED POC A AE o eal ate SLI Sa ee ala Stereo Vision Parameters Disparity range ni nn din ne nr eas vee beastie de nn ne tte Image siZe r solutilon es es ds en nt nn le Solus ne ER MASSA nn Lee nn ee re Re de Lt PREPTOCES SIM Bs nr en Sess C tree an nn NA en nn nine Regions Of INieLest r sisrr ro a Adi Sub pixel interpolation sens Validato Rene eee et ZR o br Stereo vision technology ie Subs pixel AME pol AtwOM see sine in An Mende en eve cet acne le S b pixel interpola OM zaen sodu Shiva nd db Va S da kde ooo OD O RaR Sum of Absolute Differences i SYSTEM LEQUIFEMIENES ii tii T Texture validation ins ee e o 120 timestamp ie nina nie nn An NU See TriclopsInput timeStamp Tal ARR ui r ll on 10 Tricamn COLOR raae oda See TriclopsCamera TriCam_COLOR TCM ECO ie See TriclopsCamera TriCam_L_COLOR
114. te ess Se tee ne de nn nn Re aah ooo ne Trilmg EDGE Trilmg_PACKED Trilmg RAW m bis a se Films RECTIFIED e ce nn E Rene A Een ss et CIO PS Input ssov Re POSUNE inputT ype E O Talp NONE zi spo Ai a Trilnp RGB silon ink ees Trilnp RGB 32BIT PACKED triclopsPreprocess triclopsREDLOT O WorldX AAEE edi triclopsRCD16ToX YZ ate gi js ss triclopSRCD8 TO World Li nan nn Len rit nn vest en AR ne triclopsREDSTO Zi triclopsRCDFloatTOWorldXYZ riens 129 Triclops StereoVision System Manual Version 3 1 Copyright 2003 Point Grey Research Inc triclopsRCDPIOA TOXY Loi k triclopsRCDMappedToWorldX YZ triclopsRCDMappedToXYZ triclopsRCDToWorldXYZ S his see is ticlopsREDTOXY Zino I Vo A E ene gate er ee A triclopsRectity Coloma in nan benne anne ral te den nn BE ire Es triclopsRectifyPackedColorImage ses ths st Es triclopsReCUTY PiX Clicr mitin norte daa sera Gossnavexenbvateuscones subeseuesedubs triclopsSaveColorlmage triclopsSavelmage triclopsSavelmage 16 ii A A A I triclopsSavePackedColorImage os nn triclopsSetAnyStereoMask triclopsSetCameraConfiguration triclopsSetColorImageBuff r sset aiment M O nn 80 triclopsSetDebug triclopsSetDisparity triclopsSetDisparityMapping hs bess see sive triclopsSetDisparityMappingON
115. tem is a Color Triclops nCamera should be set to TriCam_COLOR Declaration TriclopsError triclopsRectifyColorImage TriclopsContext context TriclopsCamera nCamera TriclopsInput input TriclopsColorImage output Parameters Triclops Stereo Vision System Manual Version 3 1 106 Copyright 2003 Point Grey Research Inc The context context A TriclopsCamera enumerated value indicating which camera the input image came from nCamera The raw color image encoded into a TriclopsInput structure input The resultant rectified color image output triclopsRectifyPackedColorImage This function rectifies a packed color image This function will only rectify a packed TriclopsInput a TriclopsInput of type Trilnp_RGB_32BIT_PACKED It is useful for creating rectified color images for display since bitmap displays commonly require the data format to be packed Declaration TriclopsError triclopsRectifyPackedColorImage TriclopsContext context TriclopsCamera nCamera TriclopsInput input TriclopsPackedColorImage output Parameters The TriclopsContext to use to rectify the color image context The camera from which this TriclopsInput originated If the system is a Color Triclops nCamera nCamera should be set to TriCam_COLOR The color image to be rectified input The rectified color image output triclopsRectifyPixel Converts a pixel coordinate location from the unrectified image coordinates to rect
116. ternal processing If the user no longer wants to have the supplied buffer used by the stereo kernel he she may use this function to inform the stereo kernel that it is no longer available A new buffer will be created the next time it is required by the stereo kernel Declaration TriclopsError triclopsUnsetImagel6Buffer TriclopsContext context TriclopsImageType imageType TriclopsCamera camera Triclops StereoVision System Manual Version 3 1 84 Copyright 2003 Point Grey Research Inc Parameters The context context imageType The image type The camera camera See Also triclopsGetImage triclopsSetImage 16Buffer triclopsUnsetImageBuffer This releases the user specified internal image buffer for the specified camera and image type The next time this buffer is required by the system it will allocate a new one for internal use If the user has already called triclopsSetImageBuffer for a particular camera and image type the stereo kernel will be using that buffer for internal processing If the user no longer wants to have the supplied buffer used by the stereo kernel he she may use this function to inform the stereo kernel that it is no longer available A new buffer will be created the next time it is required by the stereo kernel Declaration TriclopsError triclopsUnset ImageBuffer TriclopsContext context TriclopsImageType imageType TriclopsCamera camera Parameters The context context im
117. the same in both images This is because the cameras are horizontally aligned therefore only the horizontal displacement is relevant Disparity for the feature A will be defined as D A x A per X A right and the disparity of point B will be derived as D B x Bien X Bright Where x A jen is the x coordinate of the point A per If you calculated D A and D B you will find that D B gt D A this indicated that point B in the scene is closer than point A 117 Triclops StereoVision System Manual Version 3 1 Copyright 2003 Point Grey Research Inc Establishing Correspondence The Triclops library establishes correspondence between images using the Sum of Absolute Differences correlation method The intuition behind the approach is to do the following For every pixel in the image Select a neighborhood of a given sguare size from the reference image Compare this neighborhood to a number of neighborhoods in the other image along the same row Select the best match End Comparison of neighborhoods or masks is done using the following formula m m 2 dmx xh mm d d Lx L y J1 L x 1 d l y J min j m j m i 2 2 J 2 where din and dx are the minimum and maximum disparitie s mis the mask size Len and Ip are the right and left images right Equation 1 Sum of absolute differences Calculating Distances The distances from the cameras are determined using the displacement between im
118. tion TELLO Ad MM NIN t FiClopsGe1 OWDGSS ii triclopsGetRectify ss triclopsPreprocess ss triclopsSetEdgeCorrelation triclopsSetEdgeMask EVICLOPSS CLL OWDOSS 0 AAA E gn de nout triclopsSetRectify occ STEREO tiennent triclopsGetDisparity s seeere triclopsGetDisparityMappin halda a an 90 triclopsGetDisparityMappingON nee EFICLOPS GOLD OS TCL EOF iii AA an mt Eee CLOS Gel terco Mask ai n la triclopsGetSubpixelInterpolation triclopsSetAnyStereoMask triclopsSetDisparity s s ss s0 2 iriclopsSetDisparity MAap PIN essentiels ne 93 triclopsSetDisparity Mapping OA EER E EE ARE triclopsSetDoStereo sssi triclopsSetStereoMask triclopsGetBaseline triclopsGetCameraConfiguration triclopsGetDeviceConfiguration triclopsGetFocalLbength siiiiiissst citisstti dovi A ennemie tnelopstrei1ImasCenter At iriclopsGetSerialNumber is ses estne son sod aaa e loans oo 97 triclopsSetCameraConfiguration CONVERSIONS errana resns ie eee sev sts street triclopsGetTransformFromF ile iii triclopsGetTriclopsTo WorldTransform sise iriclopsRCDTOTOWOFIAKYZ Adi EFICLOPSRED TOT OX YL Re an id triclopsRCDSToWorldXYZ triclopsRCDSTOXYZ triclopsRCDFloatToWorldXYZ ss IICIOPSR CDF LOGLT OXY Lea triclopsRCDMappedToWorldXYZ een triclopsRCDMappedToX YZ triclopsRCDToWorldXYZ triclopsSRCDTOXYZ s triclop
119. tion you should ensure that the values for the Triclops disparity mapping feature are the same as the disparity range Note it is up to the user to supply valid pixel locations Pixels which have been invalidated may give negative results Declaration TriclopsError triclopsRCD8ToXYZ TriclopsContext context int row int Col unsigned char disp Eloat x float y float z Parameters EM The row of the input pixel TOW X y The disparity value of the input pixel The x coordinate of the point represented by the input row column disparity in the camera coordinate system The y coordinate of the point represented by the input row column disparity in the camera JZ E N coordinate system See Also triclopsRCDFloa ToXY ZO triclopsRCDMappedToXYZ0 triclopsRCD16TOXY Z 0 triclopsSetDisparity triclopsSetDisparity Mapping 101 Triclops StereoVision System Manual Version 3 1 Copyright 2003 Point Grey Research Inc triclopsRCDFloatToWorldX YZ Converts an image location and a floating point disparity value into a world 3D point This function takes a floating point disparity value and converts it to XYZ coordinates in world coordinates The world coordinates are determined by transforming the point from the Triclops coordinate system to the world coordinate system based on the TriclopsContext transform Note It is up to the user to supply valid disparity values Declaration TriclopsError triclopsRCDFlo
120. to be considered part of the same surface triclopsSetSurfaceValidationMapping Sets the current surface validation mapping Surface validation is a noise rejection method By setting the mapping value to 0x an invalid pixel that failed this validation step will be marked OxFF Declaration 73 Triclops StereoVision System Manual Version 3 1 Copyright 2003 Point Grey Research Inc TriclopsError triclopsSetSurfaceValidationMapping TriclopsContext context unsigned char value Parameters TriclopsContext for the operation context Mapping value for pixels that fail surface validation The range is between 0 and 255 triclopsSetSurfaceValidationSize Sets the minimum number of pixels a surface can cover and still be considered valid This function is used to set the minimum number of pixels a surface can cover and still be considered valid The larger the number is the fewer surfaces will be accepted The lower the number is the more surfaces will be accepted Common parameter values range from 100 to 500 depending on image resolution Declaration TriclopsError triclopsSetSurfaceValidationSize TriclopsContext context int size Parameters TriclopsContext for the operation context The minimum number of pixels a surface can cover and still be considered valid triclopsSetTexture Validation Turns texture validation on or off Sets the context texture validation flag When set to true texture based va
121. turn 1 Load camera2 s images from file if ppmReadToTriclopsInputRGB inputFile2 amp input2 printf Can t read input file s n inputFile2 return 1 create the widebaseline input based on the two cameras input e triclopsCreateWidebaselinelnput inputl input2 amp widelInput if e TriclopsErrorok printf Failed to create wide baseline input n return 1 TriclopsImage image PriclopsImage rightRectified Triclopslmage leftRectified Perform widebaseline stereo processing e triclopsPreprocess wideTriclops widelnput e triclopsStereo wideTriclops retrieve and save the right raw image iclopsGetImage wideTriclops Trilmg_RAW TriCam_RE amp image e t iclopsSavelmage amp image right raw pgm Triclops StereoVision System Manual Version 3 1 50 Copyright 2003 Point Grey Research Inc retrieve and save the left raw image Note Two camera stereo requires the non reference camera to be named TriCam L TOP even though in this case we are refering to the camera that is on the lef iclopsGetImage wideTriclops TrilImg RAW TriCam L TOP amp image iclopsSavelmage amp image left raw pgm rieve and save the right rectified image iclopsGetImage wideTriclops Trilmg RECTIFIED FERENCE amp rightRectified iclopsSavelmage amp rightRectified
122. und 9 The image is grabbed preprocessed and stereo processed 10 The depth image is retrieved and the depth at the centre pixel is obtained 11 The depth image at the centre of the image is calculated MAM PDT Triclops StereoVision System Manual Version 3 1 38 Copyright 2003 Point Grey Research Inc Example 6 Printing configuration information incl lt stdio h gt incl lt stdlib h gt incl ENTCIOPS lt A incl digiclops h int main int argc char argv iclopsError e iclopsContext triclops Float baseline int nCameras int nrows ncols loat focalLength riclopsCameraConfiguration config igiclopsContext digiclops to extract the TriclopsContext we will briefly open th Digiclops You can also do this from a file using triclopsGetDefaultContextFromFile open the Digiclops iclopsCreateContext amp digiclops iclopsInitialize digiclops 0 get the camera module configuration igiclopsGetTriclopsContextFromCamera digiclops amp triclops close the digiclops igiclopsStop digiclops lopsDestroyContext digiclops f Triclops Version s n triclopsVersion the camera configuration TriCfg L TriCfg BACKWARDS L etc riclopsGetCameraConfiguration triclops config e ok intf Error getting camera configuration s n ErrorToString e it 1 f Config
123. using reference pgm for comparison Triclops Stereo Vision System Manual Version 3 1 Copyright 2003 Point Grey Research Inc Example 3 Subpixel interpolation and depth calculation include lt stdio h gt include triclops h include digiclops h int main int argc char argv PriclopsContext triclops TriclopsImagel6 depthImagel6 TriclopsImage refImage TriclopsInput inputData DigiclopsContext digiclops int LL Je float Xj Vire Z FILE pointFile FILE vrmlFile in pixelinc open the Digiclops digiclopsCreateContext amp digiclops igiclopslnitialize digiclops 0 t the camera module configuratio lopsGetTriclopsContextFromCamera digiclops amp triclops t the digiclops to deliver the stereo image only lopsSetImageTypes digiclops STEREO IMAGE set the Digiclops resolution use HALF resolution when you need faster throughput especially color images digiclopsSet ImageResolution digiclops DIGICLOPS HALF iclopsSetImageResolution digiclops DIGICLOPS FULL start grabbing digiclopsStart digicl grab an image digiclopsGrabImage digiclops digiclopsExtractTriclopsInput digiclops STEREO IMAGE amp inputData Triclops StereoVision System Manual Version 3 1 28 Copyright 2003 Point Grey Research Inc set up some stereo parameters set to 3
124. validROI TriclopsErrorInvalidSetting esoononnnncncnononnonennno none See TriclopsError TriclopsErrorInvalidSetting TriclopsErrorNoConfigFile ss See TriclopsError TriclopsErrorNoConfigFile TriclopsErrorNonMMXCpu o eee eee eee eeeeee ne See TriclopsError TriclopsErrorNonMMXCpu TriclopsErrorNotlmplemented eee eeeeeeeeeeeee See TriclopsError TriclopsErrorNotImplemented TriclopsErrorOk naciste oasis See TriclopsError TriclopsErrorOk TriclopsErrorSurfaceV alidationO verflow See TriclopsError TriclopsErrorSurfaceValidationOverflow TriclopsErrorS ystemError ss See TriclopsError TriclopsErrorSystemError trielopsErro TO PR RE EEEE hn uni slok 65 TriclopsError Unknown ss See TriclopsError TriclopsError Unknown tHiclopSExtractimage dre aline net I benne pts in 113 triclopsExtractWorldImage3d s triclopsGetBaselin ss turnnne nine Rennes triclopsGetCameraConfiguration siennes triclopsGetDe AAA A Ta en triclopsGetDefaultContextFromFile triclopsGetDeviceConfiguration ss triclops66tDISPANNy iii RES as A een ES ENS triclopsGetDisparity Mapping ono o nn triclopsGetDisparity MappingOn e essncnonncnonnno ono on nn triclopsGetDoStereo iR NM IR aa ie Ales triclopsGetEdgeCorrelation ss triclopsGetEdg Ma k su rennes han in triclopsGetF calLength ii A ere tcp GAMA oni r er en ere TA Ne triclopsGretlima SEL 6 sissies bss ss
125. xtureValidationM apping Gets the value that appears in the disparity image for pixels that fail texture validation Declaration TriclopsError triclopsGetTextureValidationMapping const TriclopsContext context unsigned char value Parameters Content The TriclopsContext to get the texture validation mapping from The current texture validation mapping setting value pping 8 triclopsGetTextureValidationThreshold Retrieves the texture validation threshold Declaration Triclops StereoVision System Manual Version 3 1 70 Copyright O 2003 Point Grey Research Inc TriclopsError triclopsGetTextureValidationThreshold const TriclopsContext context float value Parameters The context context value The location for the retrieved threshold value See Also TriclopsSetTexture ValidationThreshold triclopsGetUniqueness Validation Retrieves the state of the uniqueness validation Declaration TriclopsError triclopsGetUniquenessValidation const TriclopsContext context TriclopsBool on Parameters The context context A pointer to a Boolean on See Also TriclopsSetUniguenessValidation triclopsGetUniguenessValidationMapping Retrieves the value that appears in the disparity image for pixels that fail unigueness validation Declaration TriclopsError triclopsGetUniguenessValidationMapping const TriclopsContext context unsigned char value Parameters The context contex
Download Pdf Manuals
Related Search
Related Contents
操作編 - SoftBank SELECTION AUXOISEAUX D`EAU MODE D`EMPLOI ITA Um K4-5.indd Emerson AMC-S402 User's Manual Enzym`Poudre GLO/uc User`s manual - HCFA corporation Ltd. 飛来虫誘引 対策 飛散防止 対策 取扱説明書 - TMEIC 東芝三菱電機産業システム株式会社 Copyright © All rights reserved.
Failed to retrieve file