Voxel Calibration Wizard

Table Of Contents

Previous topic

CalibrationWizard

Next topic

capture package

This Page

calibration package

Submodules

calibration.CalibrationsCommandLine

calibration.CalibrationsCommandLine.parseArgs(args=None)[source]

calibration.CheckerboardLensCalibration

Checkerboard Lens Calibration - uses the open cv algorithm to compute calibration parameters for a lens. Takes PNGs or VXLs as input. Also converts the vxls into pngs. Rows and columns of the checkerboard need to be provided. Usage: python CheckerBoardLensCalibration.py –file filePath –rows rows –cols cols

calibration.CheckerboardLensCalibration.CheckerBoardLensCalibration(filePath, rows, cols)[source]

Returns Lens Parameters and distortion coefficients using images or vxl files of a checkerboard taken in different orientations.

Checkerboard Lens Calibration - uses the open cv algorithm to compute calibration parameters for a lens. Takes PNGs or VXLs as input. Also converts the vxls into pngs. Rows and columns of the checkerboard need to be provided.
  • Parameters required:

    :param filePath: Takes the path of the file with checkerboard images / vxl files
    :param rows: Rows present in the checkerboard
    :param cols: Columns present in the checkerboard

    Note

    Use at least ten images of the checkerboard in different orientations to get the correct result

calibration.CheckerboardLensCalibration.parseArgs(args=None)[source]

Parsing the arguments in the command line - this is used to get the parameters using this script

calibration.CommonPhaseOffsetComplexAverage

CommonPhaseOffset.py - takes vxl file as input along with modulation frequency and distance to give phaseCorr values. Requires two vxl files - one for each frequency to calculate phase corr 1 and phase corr 2 ‘’‘

‘’‘Example Script: python CommonPhaseOffset.py -f “file.vxl” -d 0.7 -m 20 -c tintin.ti (-n 10 -g “file2.vxl”) or python CommonPhaseOffset.py –file1 “file.vxl” –distance 0.7 –modFreq1 20 –chipset tintin.ti (–modFreq2 10 –file2 “file2.vxl”)

calibration.CommonPhaseOffsetComplexAverage.commonPhaseOffset(file1, distance, modFreq1, cx, cy, file2=None, modFreq2=None, window=4, chipset='ti.tinitn')[source]

Computes the common phase offsets.

This function calculates the common phase offsets for a given file, taking VXL as input.

Parameters:

- file1, file2: File(s) for computing common phase offsets. These should be vxl files of a flat wall. The camera should be almost parallel to the wall.
- modFreq1, modFreq2 : Modulation Frequency (ies) when the data is captured. If dealiasing is enabled, two modulation frequencies are required
- cx, cy: The coordinates of the center pixel, found during lens calibration. If cx and cy are not available, the central value (120,160) is taken.
- window: The window size. By default, a window of 4x4 is required. 
- chipset: The chipset being used. 

Returns:

- phase_Corr1: Phase offset value for the first modulation frequency
- phase_Corr2: Phase offset value for the second modulation frequency
calibration.CommonPhaseOffsetComplexAverage.computeAveragePhases(camsys, filename, cx=0, cy=0, window=4)[source]

Computes the average phases for a given file. Uses the complex average for getting phase value

calibration.CommonPhaseOffsetComplexAverage.parseArgs(args=None)[source]

Parsing the arguments in the command line - this is used to get the parameters using this script

calibration.CommonPhaseOffsetComplexAverage.wrapPhaseToSignedInteger(phase)[source]

Keeps the phase offset value between -2048 and 2048

calibration.CommonPhaseOffsetRawDataComplexAverage

CommonPhaseOffset.py - takes vxl file as input along with modulation frequency and distance to give phaseCorr values. Requires two vxl files - one for each frequency to calculate phase corr 1 and phase corr 2 ‘’‘

‘’‘Example Script: python CommonPhaseOffset.py -f “file.vxl” -d 0.7 -m 20 -c tintin.ti (-n 10 -g “file2.vxl”) or python CommonPhaseOffset.py –file1 “file.vxl” –distance 0.7 –modFreq1 20 –chipset tintin.ti (–modFreq2 10 –file2 “file2.vxl”)

calibration.CommonPhaseOffsetRawDataComplexAverage.commonPhaseOffset(file1, distance, modFreq1, cx, cy, file2=None, modFreq2=None, window=4, chipset='ti.tinitn')[source]

Computes the common phase offsets.

This function calculates the common phase offsets for a given file, taking VXL as input.

Parameters:

- file1, file2: File(s) for computing common phase offsets. These should be vxl files of a flat wall. The camera should be almost parallel to the wall.
- modFreq1, modFreq2 : Modulation Frequency (ies) when the data is captured. If dealiasing is enabled, two modulation frequencies are required
- cx, cy: The coordinates of the center pixel, found during lens calibration. If cx and cy are not available, the central value (120,160) is taken.
- window: The window size. By default, a window of 4x4 is required. 
- chipset: The chipset being used. 

Returns:

- phase_Corr1: Phase offset value for the first modulation frequency
- phase_Corr2: Phase offset value for the second modulation frequency
calibration.CommonPhaseOffsetRawDataComplexAverage.computeAveragePhases(camsys, fileName, window=4, cx=0, cy=0)[source]

Computes the average phases for a given file. Uses the complex average for getting phase value

calibration.CommonPhaseOffsetRawDataComplexAverage.extractPhasesandAmplitudes(fileName, camsys)[source]

Extracts just phase and amplitude values from the parsed frames

calibration.CommonPhaseOffsetRawDataComplexAverage.extractRawdataFromVXL(filename, camsys)[source]

Takes raw data from vxl file

calibration.CommonPhaseOffsetRawDataComplexAverage.parseArgs(args=None)[source]

Parsing the arguments in the command line - this is used to get the parameters using this script

calibration.CommonPhaseOffsetRawDataComplexAverage.parseframe(frame, rows=240, cols=320)[source]

Parses the values given by the group by 16 mode of the code and gives individual frames. Required for using raw data

calibration.CommonPhaseOffsetRawDataComplexAverage.wrapPhaseToSignedInteger(phase)[source]

Keeps the phase offset value between -2048 and 2048

calibration.CommonPhaseOffsetRawDataSimpleAverage

CommonPhaseOffset.py - takes vxl file as input along with modulation frequency and distance to give phaseCorr values. Requires two vxl files - one for each frequency to calculate phase corr 1 and phase corr 2 ‘’‘

‘’‘Example Script: python CommonPhaseOffset.py -f “file.vxl” -d 0.7 -m 20 -c tintin.ti (-n 10 -g “file2.vxl”) or python CommonPhaseOffset.py –file1 “file.vxl” –distance 0.7 –modFreq1 20 –chipset tintin.ti (–modFreq2 10 –file2 “file2.vxl”)

calibration.CommonPhaseOffsetRawDataSimpleAverage.commonPhaseOffset(file1, distance, modFreq1, cx, cy, file2=None, modFreq2=None, window=4, chipset='ti.tinitn')[source]

Computes the common phase offsets.

This function calculates the common phase offsets for a given file, taking VXL as input.

Parameters:

- file1, file2: File(s) for computing common phase offsets. These should be vxl files of a flat wall. The camera should be almost parallel to the wall.
- modFreq1, modFreq2 : Modulation Frequency (ies) when the data is captured. If dealiasing is enabled, two modulation frequencies are required
- cx, cy: The coordinates of the center pixel, found during lens calibration. If cx and cy are not available, the central value (120,160) is taken.
- window: The window size. By default, a window of 4x4 is required. 
- chipset: The chipset being used. 

Returns:

- phase_Corr1: Phase offset value for the first modulation frequency
- phase_Corr2: Phase offset value for the second modulation frequency
calibration.CommonPhaseOffsetRawDataSimpleAverage.computeAveragePhases(camsys, fileName, window=4, cx=0, cy=0)[source]

Computes the average phases for a given file. Uses simple average for getting phase value

calibration.CommonPhaseOffsetRawDataSimpleAverage.extractPhasesandAmplitudes(fileName, camsys)[source]

Extracts just phase and amplitude values from the parsed frames

calibration.CommonPhaseOffsetRawDataSimpleAverage.extractRawdataFromVXL(filename, camsys)[source]

Takes raw data from vxl file

calibration.CommonPhaseOffsetRawDataSimpleAverage.parseArgs(args=None)[source]

Parsing the arguments in the command line - this is used to get the parameters using this script

calibration.CommonPhaseOffsetRawDataSimpleAverage.parseframe(frame, rows=240, cols=320)[source]

Parses the values given by the group by 16 mode of the code and gives individual frames. Required for using raw data

calibration.CommonPhaseOffsetRawDataSimpleAverage.wrapPhaseToSignedInteger(phase)[source]

Keeps the phase offset value between -2048 and 2048

calibration.CommonPhaseOffsetSimpleAverage

CommonPhaseOffset.py - takes vxl file as input along with modulation frequency and distance to give phaseCorr values. Requires two vxl files - one for each frequency to calculate phase corr 1 and phase corr 2

calibration.CommonPhaseOffsetSimpleAverage.commonPhaseOffset(file1, distance, modFreq1, cx, cy, file2=None, modFreq2=None, window=4, chipset='ti.tinitn')[source]
calibration.CommonPhaseOffsetSimpleAverage.computeAveragePhases(camsys, filename, cx=0, cy=0, window=4)[source]
calibration.CommonPhaseOffsetSimpleAverage.parseArgs(args=None)[source]
calibration.CommonPhaseOffsetSimpleAverage.wrapPhaseToSignedInteger(phase)[source]

calibration.ComputeAveragePhase

calibration.ComputeAveragePhase.computeAveragePhases(camsys, filename, cx=0, cy=0, window=4)[source]

calibration.FlatWallLensCalib

calibration.FlatWallLensCalib.flatWallLensCalibration(fileName1, distance1, fileName2, distance2, cx=0, cy=0)[source]

calibration.HDRcommonphaseoffset

HDRcommonPhaseOffset.py - takes vxl file as input along with modulation frequency and distance to give phaseCorr values. Requires two vxl files - one for each frequency to calculate phase corr 1 and phase corr 2 Make sure that hdr_scale is greater than zero before recording the vxl (only works for tintin at this point of time)

calibration.HDRcommonphaseoffset.computeHDRAveragePhases(camsys, filename, cx=0, cy=0, window=4, chipset='tintin.ti')[source]

Computes average phases for the HDR frame

calibration.HDRcommonphaseoffset.hdrCommonPhaseOffset(fileName1, distance, modFreq1, cx=0, cy=0, fileName2=None, modFreq2=None, window=4, chipset='tintin.ti')[source]

Calculates HDR phase offsets for ti chipsets.

calibration.HDRcommonphaseoffset.parseArgs(args=None)[source]
calibration.HDRcommonphaseoffset.wrapPhaseToSignedInteger(phase)[source]

Phase offset should be between more than -2048 and less than 2048

calibration.NonLinearityCalibration

The following program computes the non-linearity correction coefficients using csv as the input

calibration.NonLinearityCalibration.NonLinearityCalibration(filename, modFreq, modFreq2, phaseCorr=0, phaseCorr2=0)[source]

This function computes non linearity coefficients.

Parameters::
-fileName: CSV file containing data of measured distance and captured phase -phaseCorr: The phase offset value for the given modulation frequency -modFreq: The modulation frequency at which data is captured.
Returns::
-Non linearity coefficients for the given profile
calibration.NonLinearityCalibration.getCoefficients(measuredPhase, distancesToPhase, phaseCorr)[source]
calibration.NonLinearityCalibration.parseArgs(args=None)[source]

calibration.PerPixelOffset

This file calculates the phase offsets and saves it as an npy file. It also returns the bin file of the offsets. Usage: python PerPixelOffset.py -f “file.vxl” -n “profileName” or python PerPixelOffset.py –file “file.vxl” –name “profileName”

calibration.PerPixelOffset.computeAveragePhases(camsys, filename, window=0)[source]

Returns the average phases for all pixels for a given file

calibration.PerPixelOffset.parseArgs(args=None)[source]
calibration.PerPixelOffset.perPixelOffset(fileName, pathToSave=None, profileName=None)[source]

Computes pixelwise phase offset for all pixels. Returns a numpy file containing the pixelwise offsets as well as the bin file

calibration.PerPixelOffset.wrapPhaseToSignedInteger(phase)[source]

calibration.TemperatureCalibration

calibration.TemperatureCalibration.TemperatureCalibration(csvFile)[source]

Calculates temperature calibration offsets (coeff_illum, coeff_sensor), taking csv file as input.

Takes a CSV file containing phase values at temperatures for illumination and sensor. Gives coeff_illum and coeff_sensor as output Uses a least squares fit to compute temperature calibration

calibration.TemperatureCalibration.parseArgs(args=None)[source]

calibration.VxlToPng

calibration.VxlToPng.vxltoPng(filename)[source]

Converts VXL file to a PNG using amplitude data. Uses open cv libraries

calibration.saveConfigFile