Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Yes, the Triclops API can be used to process offline images. The requirements as you point out are the calibration file (.cal) which comes from the camera and the image file. The calibration file is best extracted at image capture time, though in my experience unless you change the settings it always stays the same. To satisfy the inputs for the Triclops API you'll also need to use the Point Grey Fly Capture API as it provides the methods for image conversion. My project is doing exactly all of what you are asking. I capture raw pixel interleaved images in the field and then process them later using the FlyCapture and Triclops API to create rectified and disparity images as well as a point cloud from the stereo pair.</p> <p>Check the Point Grey samples and their API documentation for how to capture the calibration file. Essentially the method is this: <code>flycaptureGetCalibrationFileFromCamera( context, &amp;szCalFile );</code> Where the context is the 'camera context'</p> <p>Your initial image file format will vary the conversion method, but in my case here is how I did the conversion from raw to the stereo using C++. I'm using a bumblebee XB3 color camera with raw images 1280x960 in size and grabbing images from the outer two cameras:</p> <pre><code> // Read raw file //pFile = fopen ( "FlyCap.raw" , "rb" ); pFile = fopen ( argv[1] , "rb" ); if (pFile==NULL) {fputs ("File error",stderr); exit (1);} // Set raw file size ISize = (numCols*numRows*bytesPerPixel); // allocate memory to contain the whole file: buffer = (unsigned char*) malloc (sizeof(char)*ISize); if (buffer == NULL) {fputs ("Memory error",stderr); exit (2);} // copy the file into the buffer: result = fread (buffer,1,ISize,pFile); if (result != ISize) {fputs ("Reading error",stderr); exit (3);} // Create the FlyCapture Context for processing fe = flycaptureCreateContext( &amp;flycapture ); _HANDLE_FLYCAPTURE_ERROR( "flycaptureCreateContext()", fe ); fe = flycaptureSetColorProcessingMethod(flycapture, FLYCAPTURE_HQLINEAR); _HANDLE_FLYCAPTURE_ERROR( "flycaptureSetColorProcessingMethod()", fe ); fe = flycaptureSetColorTileFormat(flycapture, FLYCAPTURE_STIPPLEDFORMAT_GBRG); _HANDLE_FLYCAPTURE_ERROR( "flycaptureSetColorTileFormat()", fe ); //Import the raw image in buffer into FlyCaptureImage structure flycaptureImage.iCols = 1280; flycaptureImage.iRows = 960; flycaptureImage.iNumImages = 2; flycaptureImage.bStippled = true; flycaptureImage.pixelFormat = FLYCAPTURE_RAW16; flycaptureImage.iRowInc = 2560; flycaptureImage.timeStamp.ulSeconds = 100; flycaptureImage.timeStamp.ulMicroSeconds = 100; flycaptureImage.pData = buffer; // Create buffers for holding the color and mono images unsigned char* rowIntColor = new unsigned char[ numCols * numRows * flycaptureImage.iNumImages * 4 ]; unsigned char* rowIntMono = new unsigned char[ numCols * numRows * flycaptureImage.iNumImages ]; // Create a temporary FlyCaptureImage for preparing the stereo image FlyCaptureImage tempColorImage; FlyCaptureImage tempMonoImage; tempColorImage.pData = rowIntColor; tempMonoImage.pData = rowIntMono; // Convert the pixel interleaved raw data to row interleaved format fe = flycapturePrepareStereoImage( flycapture, flycaptureImage, &amp;tempMonoImage, &amp;tempColorImage ); _HANDLE_FLYCAPTURE_ERROR( "flycapturePrepareStereoImage()", fe ); //Save side-by-side color stereo image fe = flycaptureSaveImage( flycapture, &amp;tempColorImage, stereoimg, FLYCAPTURE_FILEFORMAT_PPM ); _HANDLE_FLYCAPTURE_ERROR( "flycaptureSaveImage()", fe ); printf ("Saving Stereo...\n"); </code></pre> <p>Note that so far I didn't use the Triclops API at all. The output from the <code>flycaptureSaveImage();</code> is what feeds into the Triclops methods. There are some options at that point which deal with color vs mono. Take a look at the Point Grey sample that comes with their Triclops API called 'stereoto3dpoints.cpp' It takes over from where I left off. I hope this helps you out. </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload