public class CvUndistort extends CvBase
Extends CvBase
to optionally perform undistortion.
Undistortion requires the camera_matrix and distortion_coefficients
fields from an OpenCV YAML camera calibration file, saved to intrinsics
and distortions
, respectively.
The camera_to_model_0 matrix is also read, if available, and saved to
extrinsics
.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
APPNAME
Application name.
|
protected com.googlecode.javacv.cpp.opencv_core.CvMat |
distortions
Camera distortions from calibration file.
|
protected com.googlecode.javacv.cpp.opencv_core.CvMat |
extrinsics
Camera extrinsics from calibration file.
|
protected com.googlecode.javacv.cpp.opencv_core.CvMat |
intrinsics
Camera intrinsics from calibration file.
|
protected com.googlecode.javacv.cpp.opencv_core.IplImage |
mapx
Remap coordinates, allocated on first call to
process(com.googlecode.javacv.cpp.opencv_core.IplImage) . |
protected com.googlecode.javacv.cpp.opencv_core.IplImage |
mapy
Remap coordinates, allocated on first call to
process(com.googlecode.javacv.cpp.opencv_core.IplImage) . |
protected boolean |
undistort
Whether to attempt undistortion.
|
protected com.googlecode.javacv.cpp.opencv_core.IplImage |
undistortImage
Undistorted image buffer, allocated on first call to
process(com.googlecode.javacv.cpp.opencv_core.IplImage) . |
appname, brightness, canvasFrame, canvasFrameKeyEvent, cap, CAP_PROP_NAMES, CAP_PROPS, capImage, dbg, DEF_APPNAME, DEF_CAM_H, DEF_CAM_W, DEF_INPUT, DEF_MAX_FPS, DEF_MIN_DELAY_MS, DEF_SERVER_FPS, DEF_SERVER_PORT, DEF_USE_CANVAS_FRAME, DEF_USE_CONSOLE, DEF_USE_SERVER, DEF_USE_WINDOW, enableExit, exposure, FMT, frameEndMS, frameN, gain, grabber, height, hue, maxFPS, minDelayMS, mouseCallback, msgStream, msPerTick, paused, procImage, saturation, saveImage, server, serverFPS, serverImage, serverKey, serverPort, streamIndex, useCanvasFrame, useConsole, useServer, useWindow, V4L2_AUTO_PROP_NAMES, V4L2_AUTO_PROP_OFF_VALS, V4L2_AUTO_PROP_ON_VALS, V4L2_AUTO_PROPS, V4L2_CID_AUDIO_BALANCE, V4L2_CID_AUDIO_BASS, V4L2_CID_AUDIO_LOUDNESS, V4L2_CID_AUDIO_MUTE, V4L2_CID_AUDIO_TREBLE, V4L2_CID_AUDIO_VOLUME, V4L2_CID_AUTO_WHITE_BALANCE, V4L2_CID_AUTOGAIN, V4L2_CID_BACKLIGHT_COMPENSATION, V4L2_CID_BASE, V4L2_CID_BLACK_LEVEL, V4L2_CID_BLUE_BALANCE, V4L2_CID_BRIGHTNESS, V4L2_CID_CAMERA_CLASS, V4L2_CID_CAMERA_CLASS_BASE, V4L2_CID_CONTRAST, V4L2_CID_DO_WHITE_BALANCE, V4L2_CID_EXPOSURE, V4L2_CID_EXPOSURE_ABSOLUTE, V4L2_CID_EXPOSURE_AUTO, V4L2_CID_EXPOSURE_AUTO_PRIORITY, V4L2_CID_FOCUS_ABSOLUTE, V4L2_CID_FOCUS_AUTO, V4L2_CID_FOCUS_RELATIVE, V4L2_CID_GAIN, V4L2_CID_GAMMA, V4L2_CID_HCENTER_DEPRECATED, V4L2_CID_HFLIP, V4L2_CID_HUE, V4L2_CID_HUE_AUTO, V4L2_CID_LASTP1, V4L2_CID_PAN_ABSOLUTE, V4L2_CID_PAN_RELATIVE, V4L2_CID_PAN_RESET, V4L2_CID_POWER_LINE_FREQUENCY, V4L2_CID_POWER_LINE_FREQUENCY_50HZ, V4L2_CID_POWER_LINE_FREQUENCY_60HZ, V4L2_CID_POWER_LINE_FREQUENCY_DISABLED, V4L2_CID_PRIVATE_BASE, V4L2_CID_RED_BALANCE, V4L2_CID_SATURATION, V4L2_CID_SHARPNESS, V4L2_CID_TILT_ABSOLUTE, V4L2_CID_TILT_RELATIVE, V4L2_CID_TILT_RESET, V4L2_CID_USER_BASE, V4L2_CID_USER_CLASS, V4L2_CID_VCENTER_DEPRECATED, V4L2_CID_VFLIP, V4L2_CID_WHITE_BALANCE_TEMPERATURE, V4L2_CID_WHITENESS, V4L2_CTRL_CLASS_CAMERA, V4L2_CTRL_CLASS_MPEG, V4L2_CTRL_CLASS_USER, V4L2_EXPOSURE_APERTURE_PRIORITY, V4L2_EXPOSURE_AUTO, V4L2_EXPOSURE_MANUAL, V4L2_EXPOSURE_SHUTTER_PRIORITY, v4l2Auto, warnStream, width
Constructor and Description |
---|
CvUndistort()
Sets
APPNAME . |
CvUndistort(java.lang.String appname)
Chains to superclass constructor.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
camIndexOptional()
Help for the extra command line parameter.
|
protected void |
cmdHelpExt()
Display extra command line help, for subclasses.
|
protected java.lang.String |
cmdHelpExtParams()
Shows the extra command line parameter.
|
protected void |
guiHelpExt()
Help for the extra GUI keyboard commands.
|
protected boolean |
handleKeyExt(int code)
Handle our custom keypresses.
|
int |
initExt(int argc,
java.lang.String[] argv,
int ate)
Loads camera calibration if given.
|
static void |
main(java.lang.String[] argv)
Program entry point.
|
protected com.googlecode.javacv.cpp.opencv_core.IplImage |
process(com.googlecode.javacv.cpp.opencv_core.IplImage frame)
|
com.googlecode.javacv.cpp.opencv_core.CvMat |
readMat(com.googlecode.javacv.cpp.opencv_core.CvFileStorage fs,
java.lang.String name)
Read the named OpenCV matrix from file.
|
void |
release()
Releases allocated memory.
|
cmdHelp, doneProcessing, dumpCaptureProperties, finalize, fmt, getCaptureProperty, getDefAppname, getDefInput, guiHelp, handleKey, handleMouse, handleMouse, init, init, init, init, mainLoop, makeGrabber, makeServer, mouseEventToString, msg, nowMS, save, setCaptureProperty, updateServerImage, v4l2DisableAuto, v4l2EnableAuto, v4l2GetExposure, v4l2SetExposure, waitForKeypresss, warn
public static final java.lang.String APPNAME
protected com.googlecode.javacv.cpp.opencv_core.CvMat intrinsics
protected com.googlecode.javacv.cpp.opencv_core.CvMat distortions
protected com.googlecode.javacv.cpp.opencv_core.CvMat extrinsics
protected com.googlecode.javacv.cpp.opencv_core.IplImage mapx
process(com.googlecode.javacv.cpp.opencv_core.IplImage)
.protected com.googlecode.javacv.cpp.opencv_core.IplImage mapy
process(com.googlecode.javacv.cpp.opencv_core.IplImage)
.protected boolean undistort
protected com.googlecode.javacv.cpp.opencv_core.IplImage undistortImage
process(com.googlecode.javacv.cpp.opencv_core.IplImage)
.public CvUndistort(java.lang.String appname)
public CvUndistort()
APPNAME
.protected boolean camIndexOptional()
camIndexOptional
in class CvBase
protected void cmdHelpExt()
CvBase
cmdHelpExt
in class CvBase
protected java.lang.String cmdHelpExtParams()
cmdHelpExtParams
in class CvBase
protected void guiHelpExt()
guiHelpExt
in class CvBase
protected com.googlecode.javacv.cpp.opencv_core.IplImage process(com.googlecode.javacv.cpp.opencv_core.IplImage frame)
Applies undistortion if undistort
and intrinsics
and
distortions
available.
protected boolean handleKeyExt(int code)
handleKeyExt
in class CvBase
public int initExt(int argc, java.lang.String[] argv, int ate)
initExt
in class CvBase
ate
- the number of command line arguments already eaten by CvBase.init(int, String[])
public com.googlecode.javacv.cpp.opencv_core.CvMat readMat(com.googlecode.javacv.cpp.opencv_core.CvFileStorage fs, java.lang.String name)
public static void main(java.lang.String[] argv)