Visual Servoing Platform version 3.7.0
Loading...
Searching...
No Matches
vpImage< Type > Class Template Reference

#include <vpImage.h>

Public Member Functions

 vpImage ()
 vpImage (const vpImage< Type > &img)
 vpImage (vpImage< Type > &&img)
 vpImage (unsigned int height, unsigned int width)
 vpImage (unsigned int height, unsigned int width, Type value)
 vpImage (Type *const array, unsigned int height, unsigned int width, bool copyData=false)
virtual ~vpImage ()

Public Attributes

Type * bitmap
vpDisplaydisplay

Friends

class vpImageConvert

(Note that these are not member symbols.)

template<>
void getMinMaxValue (double &min, double &max, bool onlyFiniteVal) const
template<>
void getMinMaxValue (float &min, float &max, bool onlyFiniteVal) const
template<>
void getMinMaxValue (vpRGBf &min, vpRGBf &max, bool onlyFiniteVal) const
template<>
void performLut (const unsigned char(&lut)[256], unsigned int nbThreads)
template<>
void performLut (const vpRGBa(&lut)[256], unsigned int nbThreads)

Inherited functionalities from vpImage

std::ostream & operator<< (std::ostream &s, const vpImage< Type > &I)
std::ostream & operator<< (std::ostream &s, const vpImage< unsigned char > &I)
std::ostream & operator<< (std::ostream &s, const vpImage< char > &I)
std::ostream & operator<< (std::ostream &s, const vpImage< float > &I)
std::ostream & operator<< (std::ostream &s, const vpImage< double > &I)
void swap (vpImage< Type > &first, vpImage< Type > &second)
void destroy ()
void doubleSizeImage (vpImage< Type > &res)
unsigned int getCols () const
unsigned int getHeight () const
Type getMaxValue (bool onlyFiniteVal=true) const
double getMeanValue (const vpImage< bool > *p_mask=nullptr, unsigned int *nbValidPoints=nullptr) const
Type getMinValue (bool onlyFiniteVal=true) const
void getMinMaxValue (Type &min, Type &max, bool onlyFiniteVal=true) const
void getMinMaxLoc (vpImagePoint *minLoc, vpImagePoint *maxLoc, Type *minVal=nullptr, Type *maxVal=nullptr) const
unsigned int getNumberOfPixel () const
unsigned int getRows () const
unsigned int getSize () const
double getStdev (const vpImage< bool > *p_mask=nullptr, unsigned int *nbValidPoints=nullptr) const
double getStdev (const double &mean, const vpImage< bool > *p_mask=nullptr, unsigned int *nbValidPoints=nullptr) const
double getSum (const vpImage< bool > *p_mask=nullptr, unsigned int *nbValidPoints=nullptr) const
Type getValue (unsigned int i, unsigned int j) const
Type getValue (double i, double j) const
Type getValue (const vpImagePoint &ip) const
unsigned int getWidth () const
void halfSizeImage (vpImage< Type > &res) const
void init (unsigned int height, unsigned int width)
void init (unsigned int height, unsigned int width, Type value)
void init (Type *const array, unsigned int height, unsigned int width, bool copyData=false)
void insert (const vpImage< Type > &src, const vpImagePoint &topLeft)
Type * operator[] (unsigned int i)
Type * operator[] (int i)
const Type * operator[] (unsigned int i) const
const Type * operator[] (int i) const
Type operator() (unsigned int i, unsigned int j) const
void operator() (unsigned int i, unsigned int j, const Type &v)
Type operator() (const vpImagePoint &ip) const
void operator() (const vpImagePoint &ip, const Type &v)
vpImage< Type > operator- (const vpImage< Type > &B) const
vpImage< Type > & operator= (const vpImage< Type > &other)
vpImage< Type > & operator= (vpImage< Type > &&other)
vpImage< Type > & operator= (const Type &v)
bool operator== (const vpImage< Type > &I) const
bool operator!= (const vpImage< Type > &I) const
void performLut (const Type(&lut)[256], unsigned int nbThreads=1)
void quarterSizeImage (vpImage< Type > &res) const
void resize (unsigned int h, unsigned int w)
void resize (unsigned int h, unsigned int w, const Type &val)
void sub (const vpImage< Type > &B, vpImage< Type > &C) const
void sub (const vpImage< Type > &A, const vpImage< Type > &B, vpImage< Type > &C) const
void subsample (unsigned int v_scale, unsigned int h_scale, vpImage< Type > &sampled) const

Detailed Description

template<class Type>
class vpImage< Type >

Definition of the vpImage class member functions.

This is a template class, therefore the type of each element of the array is not a priori defined.

Data structure

Each image is build using two structure (an array bitmap which size is [width*height]) and an array of pointer row (which size is [nrow]) the ith element in the row array row[i] is pointer toward the ith "line" of the image (ie, bitmap +i*width )

Such a structure allows a fast access to each element of the image. if i is the ith rows and j the jth columns the value of this pixel is given by I[i][j] (that is equivalent to row[i][j]).

Example

The following example available in tutorial-image-manipulation.cpp shows how to create gray level and color images and how to access to the pixels.

#include <visp3/core/vpConfig.h>
#include <visp3/core/vpImage.h>
int main()
{
#ifdef ENABLE_VISP_NAMESPACE
using namespace VISP_NAMESPACE_NAME;
#endif
try {
vpImage<unsigned char> gray_image(240, 320);
vpImage<vpRGBa> color_image(240, 320);
gray_image = 128;
vpRGBa color(255, 0, 0);
color_image = color;
unsigned int igray_max = gray_image.getHeight() - 1;
unsigned int jgray_max = gray_image.getWidth() - 1;
std::cout << "Gray image, last pixel intensity: " << static_cast<int>(gray_image[igray_max][jgray_max]) << std::endl;
unsigned int icolor_max = color_image.getHeight() - 1;
unsigned int jcolor_max = color_image.getWidth() - 1;
std::cout << "Color image, last pixel RGB components: "
<< static_cast<int>(color_image[icolor_max][jcolor_max].R) << " "
<< static_cast<int>(color_image[icolor_max][jcolor_max].G) << " "
<< static_cast<int>(color_image[icolor_max][jcolor_max].B) << std::endl;
}
catch (const vpException &e) {
std::cout << "Catch an exception: " << e << std::endl;
}
}
error that can be emitted by ViSP classes.
Definition vpException.h:60
vpImage()
constructor
Definition vpImage.h:521

Important remark

To provide high-performance access there is no verification to ensure that 0 $\le$ i < height and 0 $\le$ j < width. Since the memory allocated in the bitmap array is continuous, that means that if (i, j) is outside the image you will manipulate a pixel that is not as expected. To highlight this remark, we provide hereafter an example where the considered pixel is outside the image:

unsigned int width = 320;
unsigned int height = 240;
vpImage<unsigned char> I(height, width); // Create an 320x240 image
// Set pixel coordinates that is outside the image
unsigned int i = 100;
unsigned int j = 400;
unsigned char value;
value = I[i][j]; // Here we will get the pixel value at position (101, 80)
Examples
AROgre.cpp, AROgreBasic.cpp, BSpline.cpp, HelloWorldOgre.cpp, HelloWorldOgreAdvanced.cpp, SickLDMRS-Process.cpp, catchAprilTag.cpp, catchArUco.cpp, catchColorConversion.cpp, catchFont.cpp, catchGaussianFilter.cpp, catchGenericTrackerDeterminist.cpp, catchImageAddSub.cpp, catchImageLoadSave.cpp, catchImageMorphology.cpp, catchImageResize.cpp, catchImageWarp.cpp, catchIoEXR.cpp, catchIoPFM.cpp, catchLuminanceMapping.cpp, catchNPZ.cpp, catchPanda.cpp, catchParticleFilter.cpp, catchRBT.cpp, catchRBTDataset.cpp, displayD3D.cpp, displayGTK.cpp, displayOpenCV.cpp, displaySequence.cpp, displayX.cpp, displayXMulti.cpp, grab1394CMU.cpp, grab1394Two.cpp, grabDirectShow.cpp, grabDirectShowMulti.cpp, grabDisk.cpp, grabDiskFloat.cpp, grabFlyCapture.cpp, grabRealSense2.cpp, grabRealSense2_T265.cpp, grabV4l2.cpp, grabV4l2MultiCpp11Thread.cpp, histogram.cpp, imageDiskRW.cpp, imageSequenceReader.cpp, keyboardControlBebop2.cpp, kinectAcquisition.cpp, manDisplay.cpp, manGeometricFeatures.cpp, manGrab1394.cpp, manGrabDirectShow.cpp, manGrabDisk.cpp, manGrabV4l2.cpp, manServo4PointsDisplay.cpp, manSimu4Dots.cpp, mbot-apriltag-2D-half-vs.cpp, mbot-apriltag-ibvs.cpp, mbot-apriltag-pbvs.cpp, mbtEdgeKltTracking.cpp, mbtEdgeTracking.cpp, mbtGenericTracking.cpp, mbtGenericTracking2.cpp, mbtGenericTrackingDepth.cpp, mbtGenericTrackingDepthOnly.cpp, mbtKltTracking.cpp, perfApriltagDetection.cpp, perfColorConversion.cpp, perfGaussianFilter.cpp, perfGenericTracker.cpp, perfImageAddSub.cpp, perfImageLoadSave.cpp, perfImageMorphology.cpp, perfImageResize.cpp, perfImageWarp.cpp, photometricMappingVisualServoing.cpp, photometricVisualServoing.cpp, photometricVisualServoingWithoutVpServo.cpp, poseVirtualVS.cpp, servoAfma62DhalfCamVelocity.cpp, servoAfma6AprilTagIBVS.cpp, servoAfma6AprilTagPBVS.cpp, servoAfma6Cylinder2DCamVelocity.cpp, servoAfma6Cylinder2DCamVelocitySecondaryTask.cpp, servoAfma6Ellipse2DCamVelocity.cpp, servoAfma6FourPoints2DArtVelocity.cpp, servoAfma6FourPoints2DCamVelocityLs_cur.cpp, servoAfma6FourPoints2DCamVelocityLs_cur_integrator.cpp, servoAfma6FourPoints2DCamVelocityLs_des.cpp, servoAfma6Line2DCamVelocity.cpp, servoAfma6MegaposePBVS.cpp, servoAfma6Point2DArtVelocity.cpp, servoAfma6Point2DCamVelocity.cpp, servoAfma6Points2DCamVelocityEyeToHand.cpp, servoAfma6Segment2DCamVelocity.cpp, servoAfma6SquareLines2DCamVelocity.cpp, servoAfma6TwoLines2DCamVelocity.cpp, servoBebop2.cpp, servoBiclopsPoint2DArtVelocity.cpp, servoFlirPtuIBVS.cpp, servoFrankaIBVS-EyeToHand-Lcur_cVe_eJe.cpp, servoFrankaIBVS-EyeToHand-Lcur_cVf_fVe_eJe.cpp, servoFrankaIBVS-EyeToHand-Ldes_cVf_fVe_eJe.cpp, servoFrankaIBVS.cpp, servoFrankaPBVS.cpp, servoPioneerPanSegment3D.cpp, servoPioneerPoint2DDepth.cpp, servoPioneerPoint2DDepthWithoutVpServo.cpp, servoPixhawkDroneIBVS.cpp, servoPololuPtuPoint2DJointVelocity.cpp, servoPtu46Point2DArtVelocity.cpp, servoSimu4Points.cpp, servoSimuAfma6FourPoints2DCamVelocity.cpp, servoSimuCircle2DCamVelocityDisplay.cpp, servoSimuCylinder.cpp, servoSimuCylinder2DCamVelocityDisplay.cpp, servoSimuCylinder2DCamVelocityDisplaySecondaryTask.cpp, servoSimuFourPoints2DCamVelocityDisplay.cpp, servoSimuFourPoints2DPolarCamVelocityDisplay.cpp, servoSimuLine2DCamVelocityDisplay.cpp, servoSimuSphere.cpp, servoSimuSphere2DCamVelocityDisplay.cpp, servoSimuSphere2DCamVelocityDisplaySecondaryTask.cpp, servoSimuSquareLine2DCamVelocityDisplay.cpp, servoSimuViper850FourPoints2DCamVelocity.cpp, servoUniversalRobotsIBVS.cpp, servoUniversalRobotsPBVS.cpp, servoViper650FourPoints2DArtVelocityLs_cur.cpp, servoViper650FourPoints2DCamVelocityLs_cur-SR300.cpp, servoViper650FourPoints2DCamVelocityLs_cur.cpp, servoViper650Point2DCamVelocity.cpp, servoViper850FourPoints2DArtVelocityLs_cur.cpp, servoViper850FourPoints2DArtVelocityLs_des.cpp, servoViper850FourPoints2DCamVelocityLs_cur.cpp, servoViper850FourPointsKinect.cpp, servoViper850Point2DArtVelocity-jointAvoidance-basic.cpp, servoViper850Point2DArtVelocity-jointAvoidance-gpa.cpp, servoViper850Point2DArtVelocity-jointAvoidance-large.cpp, servoViper850Point2DArtVelocity.cpp, servoViper850Point2DCamVelocity.cpp, servoViper850Point2DCamVelocityKalman.cpp, sonarPioneerReader.cpp, templateTracker.cpp, test1394TwoGrabber.cpp, test1394TwoResetBus.cpp, testAutoThreshold.cpp, testClick.cpp, testConnectedComponents.cpp, testContours.cpp, testConversion.cpp, testCrop.cpp, testCropAdvanced.cpp, testDisplayPolygonLines.cpp, testDisplayRoi.cpp, testDisplayScaled.cpp, testDisplays.cpp, testFeatureSegment.cpp, testFloodFill.cpp, testGenericTracker.cpp, testGenericTrackerDepth.cpp, testHSVGradient.cpp, testHSVtoHSV.cpp, testHSVtoRGBa.cpp, testHistogram.cpp, testImageBinarise.cpp, testImageComparison.cpp, testImageDifference.cpp, testImageDraw.cpp, testImageFilter.cpp, testImageFilterHSVOldVSNew.cpp, testImageGetValue.cpp, testImageMeanAndStdev.cpp, testImageNormalizedCorrelation.cpp, testImageOwnership.cpp, testImagePrint.cpp, testImageTemplateMatching.cpp, testImgproc.cpp, testIoPGM.cpp, testIoPPM.cpp, testKeyPoint-2.cpp, testKeyPoint-3.cpp, testKeyPoint-4.cpp, testKeyPoint-5.cpp, testKeyPoint-6.cpp, testKeyPoint-7.cpp, testKeyPoint.cpp, testMomentAlpha.cpp, testMouseEvent.cpp, testNurbs.cpp, testOccipitalStructure_Core_images.cpp, testOccipitalStructure_Core_pcl.cpp, testPerformanceLUT.cpp, testPolygon.cpp, testPoseFeatures.cpp, testPylonGrabber.cpp, testRGBaToHSV.cpp, testReadImage.cpp, testRealSense2_D435.cpp, testRealSense2_D435_align.cpp, testRealSense2_D435_pcl.cpp, testRealSense2_SR300.cpp, testRealSense2_T265_images.cpp, testRealSense2_T265_images_odometry.cpp, testRealSense2_T265_images_odometry_async.cpp, testRealSense2_T265_odometry.cpp, testRealSense2_T265_undistort.cpp, testRobotAfma6Pose.cpp, testRobotBebop2.cpp, testRobotViper850Pose.cpp, testTrackDot.cpp, testUndistortImage.cpp, testVideoDevice.cpp, testVideoDeviceDual.cpp, testVirtuoseWithGlove.cpp, trackDot.cpp, trackDot2.cpp, trackDot2WithAutoDetection.cpp, trackKltOpencv.cpp, trackMeCircle.cpp, trackMeEllipse.cpp, trackMeLine.cpp, trackMeNurbs.cpp, tutorial-apriltag-detector-live-T265-realsense.cpp, tutorial-apriltag-detector-live-rgbd-realsense.cpp, tutorial-apriltag-detector-live-rgbd-structure-core.cpp, tutorial-apriltag-detector-live.cpp, tutorial-apriltag-detector.cpp, tutorial-autothreshold.cpp, tutorial-barcode-detector-live.cpp, tutorial-barcode-detector.cpp, tutorial-blob-auto-tracker.cpp, tutorial-blob-tracker-live.cpp, tutorial-bridge-opencv-camera-param.cpp, tutorial-bridge-opencv-image.cpp, tutorial-brightness-adjustment.cpp, tutorial-canny-hsv.cpp, tutorial-canny.cpp, tutorial-circle-hough.cpp, tutorial-compare-auto-gamma.cpp, tutorial-connected-components.cpp, tutorial-contour.cpp, tutorial-contrast-sharpening.cpp, tutorial-count-coins.cpp, tutorial-create-tag-image.cpp, tutorial-detection-object-mbt-deprecated.cpp, tutorial-detection-object-mbt.cpp, tutorial-detection-object-mbt2-deprecated.cpp, tutorial-detection-object-mbt2.cpp, tutorial-dnn-object-detection-live.cpp, tutorial-draw-circle.cpp, tutorial-draw-cross.cpp, tutorial-draw-frame.cpp, tutorial-draw-line.cpp, tutorial-draw-point.cpp, tutorial-draw-rectangle.cpp, tutorial-draw-text.cpp, tutorial-event-keyboard.cpp, tutorial-export-image.cpp, tutorial-face-detector-live-threaded.cpp, tutorial-face-detector-live.cpp, tutorial-face-detector.cpp, tutorial-flir-ptu-ibvs.cpp, tutorial-flood-fill.cpp, tutorial-grabber-1394-writer.cpp, tutorial-grabber-1394.cpp, tutorial-grabber-CMU1394.cpp, tutorial-grabber-basler-pylon.cpp, tutorial-grabber-bebop2.cpp, tutorial-grabber-flycapture.cpp, tutorial-grabber-ids-ueye.cpp, tutorial-grabber-opencv-threaded.cpp, tutorial-grabber-opencv.cpp, tutorial-grabber-realsense-T265.cpp, tutorial-grabber-realsense.cpp, tutorial-grabber-rgbd-D435-structurecore.cpp, tutorial-grabber-structure-core.cpp, tutorial-grabber-v4l2-threaded.cpp, tutorial-grabber-v4l2.cpp, tutorial-hsv-range-tuner.cpp, tutorial-hsv-segmentation-pcl-viewer.cpp, tutorial-hsv-segmentation-pcl.cpp, tutorial-hsv-segmentation.cpp, tutorial-ibvs-4pts-display.cpp, tutorial-ibvs-4pts-image-tracking.cpp, tutorial-ibvs-4pts-ogre-tracking.cpp, tutorial-ibvs-4pts-ogre.cpp, tutorial-ibvs-4pts-wireframe-camera.cpp, tutorial-ibvs-4pts-wireframe-robot-afma6.cpp, tutorial-ibvs-4pts-wireframe-robot-viper.cpp, tutorial-image-colormap.cpp, tutorial-image-converter.cpp, tutorial-image-display-scaled-auto.cpp, tutorial-image-display-scaled-manu.cpp, tutorial-image-display.cpp, tutorial-image-filter.cpp, tutorial-image-manipulation.cpp, tutorial-image-reader.cpp, tutorial-image-simulator.cpp, tutorial-image-viewer.cpp, tutorial-klt-tracker-live.cpp, tutorial-klt-tracker-with-reinit.cpp, tutorial-klt-tracker.cpp, tutorial-matching-keypoint-SIFT.cpp, tutorial-matching-keypoint-homography.cpp, tutorial-matching-keypoint.cpp, tutorial-mb-edge-tracker.cpp, tutorial-mb-generic-tracker-apriltag-rs2.cpp, tutorial-mb-generic-tracker-apriltag-webcam.cpp, tutorial-mb-generic-tracker-full.cpp, tutorial-mb-generic-tracker-live.cpp, tutorial-mb-generic-tracker-read.cpp, tutorial-mb-generic-tracker-rgbd-blender.cpp, tutorial-mb-generic-tracker-rgbd-realsense-json.cpp, tutorial-mb-generic-tracker-rgbd-realsense.cpp, tutorial-mb-generic-tracker-rgbd-structure-core.cpp, tutorial-mb-generic-tracker-rgbd.cpp, tutorial-mb-generic-tracker-save.cpp, tutorial-mb-generic-tracker-stereo-mono.cpp, tutorial-mb-generic-tracker-stereo.cpp, tutorial-mb-generic-tracker.cpp, tutorial-mb-hybrid-tracker.cpp, tutorial-mb-klt-tracker.cpp, tutorial-mb-tracker-full.cpp, tutorial-mb-tracker.cpp, tutorial-me-ellipse-tracker.cpp, tutorial-me-line-tracker.cpp, tutorial-megapose-live-single-object-tracking.cpp, tutorial-munkres-assignment.cpp, tutorial-npz.cpp, tutorial-panda3d-renderer.cpp, tutorial-pf-curve-fitting-all.cpp, tutorial-pf-curve-fitting-pf.cpp, tutorial-pf.cpp, tutorial-pose-from-planar-object.cpp, tutorial-pose-from-points-image.cpp, tutorial-pose-from-points-live.cpp, tutorial-pose-from-points-realsense-T265.cpp, tutorial-pose-from-qrcode-image.cpp, tutorial-rbt-realsense.cpp, tutorial-rbt-sequence.cpp, tutorial-template-tracker.cpp, tutorial-ukf.cpp, tutorial-undistort.cpp, tutorial-video-manipulation.cpp, tutorial-video-reader.cpp, tutorial-video-recorder.cpp, tutorial-viewer.cpp, videoReader.cpp, visp-acquire-franka-calib-data.cpp, visp-acquire-universal-robots-calib-data.cpp, visp-calibrate-camera.cpp, visp-compute-apriltag-poses.cpp, visp-compute-chessboard-poses.cpp, visp-read-rs-dataset.cpp, visp-save-rs-dataset.cpp, and wireframeSimulator.cpp.

Definition at line 130 of file vpImage.h.

Constructor & Destructor Documentation

◆ vpImage() [1/6]

◆ vpImage() [2/6]

template<class Type>
vpImage ( const vpImage< Type > & img)

copy constructor

Definition at line 600 of file vpImage.h.

References bitmap, display, resize(), and vpImage().

◆ vpImage() [3/6]

template<class Type>
vpImage ( vpImage< Type > && img)

move constructor

Definition at line 614 of file vpImage.h.

References bitmap, display, and vpImage().

◆ vpImage() [4/6]

template<class Type>
vpImage ( unsigned int height,
unsigned int width )

constructor set the size of the image

Definition at line 490 of file vpImage.h.

References bitmap, display, and init().

◆ vpImage() [5/6]

template<class Type>
vpImage ( unsigned int height,
unsigned int width,
Type value )

constructor set the size of the image and init all the pixel

Definition at line 501 of file vpImage.h.

References bitmap, display, and init().

◆ vpImage() [6/6]

template<class Type>
vpImage ( Type *const array,
unsigned int height,
unsigned int width,
bool copyData = false )

constructor from an image stored as a continuous array in memory

Definition at line 511 of file vpImage.h.

References bitmap, display, and init().

◆ ~vpImage()

template<class Type>
vpImage< Type >::~vpImage ( )
virtual

destructor

Destructor : Memory de-allocation.

Warning
does not deallocate memory for display and video

Definition at line 594 of file vpImage.h.

References destroy().

Member Function Documentation

◆ destroy()

template<class Type>
void vpImage< Type >::destroy ( )

Destructor : Memory de-allocation.

Warning
does not deallocate memory for display and video
Examples
testImageFilterHSVOldVSNew.cpp.

Definition at line 573 of file vpImage.h.

References bitmap.

Referenced by vpImageFilter::filter(), vpImageFilter::gaussianBlur(), vpTemplateTracker::initTracking(), and ~vpImage().

◆ doubleSizeImage()

template<class Type>
void vpImage< Type >::doubleSizeImage ( vpImage< Type > & res)

Returns a new image that's double size of the current image. Used (eg. in case of keypoints extraction, we might double size of the image in order to have more keypoints). The double size image is computed by nearest-neighbour interpolation:

A B C
E F G
H I J
where
A C H J are pixels from original image
B E G I are interpolated pixels
Warning
Operator = must be defined for Type.
Parameters
res[out] : Image that is double size of the current image.

The example below shows how to use this method:

vpImage<unsigned char> I; // original image
vpImageIo::read(I, "myImage.pgm");
vpImage<unsigned char> I2; // double size image
I.doubleSizeImage(I2);
vpImageIo::write(I2, "myDoubleSizeImage.pgm");
static void read(vpImage< unsigned char > &I, const std::string &filename, int backend=IO_DEFAULT_BACKEND)
static void write(const vpImage< unsigned char > &I, const std::string &filename, int backend=IO_DEFAULT_BACKEND)

See halfSizeImage(vpImage<Type> &) for an example of pyramid construction.

Definition at line 837 of file vpImage.h.

References resize(), and vpImage().

◆ getCols()

◆ getHeight()

template<class Type>
unsigned int vpImage< Type >::getHeight ( ) const
inline

Get the image height.

Returns
The image height.
See also
getWidth()
Examples
SickLDMRS-Process.cpp, catchArUco.cpp, catchColorConversion.cpp, catchImageWarp.cpp, catchIoEXR.cpp, catchIoPFM.cpp, displayXMulti.cpp, grab1394Two.cpp, grabDiskFloat.cpp, grabRealSense2.cpp, grabRealSense2_T265.cpp, grabV4l2.cpp, mbtGenericTracking2.cpp, perfColorConversion.cpp, perfGenericTracker.cpp, perfImageResize.cpp, testConnectedComponents.cpp, testConversion.cpp, testFloodFill.cpp, testImageBinarise.cpp, testImageComparison.cpp, testImageDifference.cpp, testImageNormalizedCorrelation.cpp, testImageTemplateMatching.cpp, testImgproc.cpp, testKeyPoint-3.cpp, testKeyPoint.cpp, testPerformanceLUT.cpp, testRealSense2_T265_images_odometry.cpp, testRealSense2_T265_images_odometry_async.cpp, testRealSense2_T265_odometry.cpp, testUndistortImage.cpp, tutorial-autothreshold.cpp, tutorial-brightness-adjustment.cpp, tutorial-canny-hsv.cpp, tutorial-circle-hough.cpp, tutorial-compare-auto-gamma.cpp, tutorial-connected-components.cpp, tutorial-contrast-sharpening.cpp, tutorial-count-coins.cpp, tutorial-grabber-realsense-T265.cpp, tutorial-ibvs-4pts-ogre-tracking.cpp, tutorial-ibvs-4pts-ogre.cpp, tutorial-image-colormap.cpp, tutorial-image-manipulation.cpp, tutorial-mb-generic-tracker-rgbd-realsense-json.cpp, tutorial-mb-generic-tracker-rgbd.cpp, tutorial-panda3d-renderer.cpp, tutorial-rbt-realsense.cpp, visp-calibrate-camera.cpp, and visp-read-rs-dataset.cpp.

Definition at line 181 of file vpImage.h.

Referenced by VISP_NAMESPACE_NAME::clahe(), VISP_NAMESPACE_NAME::clahe(), vpRBVisualOdometryUtils::computeIndicesObjectAndEnvironment(), vpImageCircle::computePixelsInMask(), vpPose::computePlanarObjectPoseFromRGBD(), vpPose::computePlanarObjectPoseFromRGBD(), vpColorHistogram::computeProbas(), vpColorHistogram::computeProbas(), VISP_NAMESPACE_NAME::connectedComponents(), vpColormap::convert(), vpColormap::convert(), vpImageConvert::convert(), vpImageConvert::convert(), vpImageConvert::convert(), vpImageConvert::convert(), vpImageConvert::convert(), vpImageConvert::convert(), vpImageConvert::convert(), vpImageConvert::convert(), vpImageConvert::convert(), vpImageConvert::convert(), vpImageConvert::convert(), vpImageConvert::convert(), vpImageConvert::convert(), vpImageConvert::convert(), vpKeyPoint::createImageMatching(), vpKeyPoint::createImageMatching(), vpKeyPoint::createImageMatching(), vpKeyPoint::createImageMatching(), vpImageConvert::depthToPointCloud(), vpImageConvert::depthToPointCloud(), vpImageMorphology::dilatation(), vpDisplayGTK::displayImageROI(), vpDisplayGTK::displayImageROI(), vpKeyPoint::displayMatching(), vpKeyPoint::displayMatching(), vpCircleHoughTransform::edgeDetection(), VISP_NAMESPACE_NAME::equalizeHistogram(), vpImageMorphology::erosion(), vpPlaneEstimation::estimatePlane(), vpRBSilhouetteCCDTracker::extractFeatures(), vpRBSilhouetteMeTracker::extractFeatures(), VISP_NAMESPACE_NAME::fillHoles(), vpCircleHoughTransform::filterEdgeMap(), VISP_NAMESPACE_NAME::findContours(), vpSimulatorAfma6::getCameraParameters(), vpSimulatorAfma6::getCameraParameters(), vpSimulatorViper850::getCameraParameters(), vpSimulatorViper850::getCameraParameters(), vpKinect::getDepthMap(), vpSimulatorAfma6::getExternalImage(), vpSimulatorViper850::getExternalImage(), vpRobotWireFrameSimulator::getInternalView(), vpRobotWireFrameSimulator::getInternalView(), vpPanda3DGeometryRenderer::getRender(), vpPanda3DGeometryRenderer::getRender(), vpPanda3DGeometryRenderer::getRender(), vpSilhouettePointsExtractionSettings::getSilhouetteCandidates(), getStdev(), getSum(), vpImageTools::imageAdd(), vpImageTools::imageDifference(), vpImageTools::imageDifference(), vpImageTools::imageDifferenceAbsolute(), vpImageTools::imageDifferenceAbsolute(), vpImageTools::imageDifferenceAbsolute(), vpImageTools::imageSubtract(), vpMbEdgeTracker::initPyramid(), insert(), vpKeyPoint::insertImageMatching(), vpKeyPoint::insertImageMatching(), vpImageTools::integralImage(), vpImageConvert::merge(), vpImageTools::normalizedCorrelation(), VISP_NAMESPACE_NAME::reconstruct(), vpImageTools::resize(), vpImageTools::resize(), vpImageTools::resize(), vpRBProbabilistic3DDriftDetector::score(), vpMeNurbs::seekExtremitiesCanny(), vpPanda3DRGBRenderer::setBackgroundImage(), vpImageConvert::split(), sub(), sub(), vpImageTools::templateMatching(), vpRBProbabilistic3DDriftDetector::update(), vpColorHistogramMask::updateMask(), vpDepthMask::updateMask(), vpImageTools::warpImage(), vpImageTools::warpLinear(), and vpKinect::warpRGBFrame().

◆ getMaxValue()

template<class Type>
float getMaxValue ( bool onlyFiniteVal = true) const
inline

Return the maximum value within the bitmap.

Return the maximum value within the float bitmap.

Return the maximum value within the double bitmap.

Parameters
onlyFiniteVal: This parameter is ignored for non double or non float bitmap. If true, consider only finite values.
See also
getMinValue()

Definition at line 349 of file vpImage_getters.h.

References bitmap, and vpException::fatalError.

◆ getMeanValue()

template<class Type>
double vpImage< Type >::getMeanValue ( const vpImage< bool > * p_mask = nullptr,
unsigned int * nbValidPoints = nullptr ) const

Return the mean value of the bitmap.

For vpRGBa and vpRGBf image types, the sum of image intensities is computed by (R+G+B).

Parameters
[in]p_maskOptional parameter. If not set to nullptr, a boolean mask that indicates which points must be considered, if set to true.
[out]nbValidPointsOptional parameter. When different from nullptr contains the number of points that are valid according to the boolean mask or image size when p_mask is set to nullptr.
Examples
catchGaussianFilter.cpp, and tutorial-compare-auto-gamma.cpp.

Definition at line 770 of file vpImage_getters.h.

References vpException::divideByZeroError, getSum(), and vpImage().

Referenced by getStdev(), and vpImageTools::normalizedCorrelation().

◆ getMinMaxLoc()

template<class Type>
void vpImage< Type >::getMinMaxLoc ( vpImagePoint * minLoc,
vpImagePoint * maxLoc,
Type * minVal = nullptr,
Type * maxVal = nullptr ) const

Get the position of the minimum and/or the maximum pixel value within the bitmap and the corresponding value. Following code allows retrieving only minimum value and position:

//[...] Fill I
vpImagePoint min_loc;
double min_val = 0.0;
I.getMinMaxLoc(&min_loc, nullptr, &min_val, nullptr);
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
Parameters
minLoc: Position of the pixel with minimum value if not nullptr.
maxLoc: Position of the pixel with maximum value if not nullptr.
minVal: Minimum pixel value if not nullptr.
maxVal: Maximum pixel value if not nullptr.
See also
getMaxValue()
getMinValue()
getMinMaxValue()
Examples
testImageNormalizedCorrelation.cpp, and testImageTemplateMatching.cpp.

Definition at line 720 of file vpImage_getters.h.

References bitmap, vpException::fatalError, and vpImagePoint::set_ij().

◆ getMinMaxValue()

template<class Type>
void vpImage< Type >::getMinMaxValue ( Type & min,
Type & max,
bool onlyFiniteVal = true ) const

Look for the minimum and the maximum value within the bitmap.

Parameters
min: The minimal value within the bitmap.
max: The maximal value within the bitmap.
onlyFiniteVal: This parameter is ignored for non double or non float bitmap.
See also
getMaxValue()
getMinValue()
getMinMaxLoc()
Examples
grabDiskFloat.cpp.

Definition at line 520 of file vpImage_getters.h.

References bitmap, and vpException::fatalError.

Referenced by vpImageConvert::convert(), vpImageConvert::convert(), vpImageConvert::convert(), VISP_NAMESPACE_NAME::stretchContrast(), and VISP_NAMESPACE_NAME::stretchContrastHSV().

◆ getMinValue()

template<class Type>
float getMinValue ( bool onlyFiniteVal = true) const
inline

Return the minimum value within the bitmap.

Return the minimum value within the float bitmap.

Return the minimum value within the double bitmap.

Parameters
onlyFiniteVal: This parameter is ignored for non double or non float bitmap. If true, consider only finite values.
See also
getMaxValue()

Definition at line 433 of file vpImage_getters.h.

References bitmap, and vpException::fatalError.

◆ getNumberOfPixel()

template<class Type>
unsigned int vpImage< Type >::getNumberOfPixel ( ) const
inline

Get the image number of pixels which corresponds to the image width multiplied by the image height.

Returns
The image number of pixels or image size.
See also
getWidth(), getHeight()

Definition at line 203 of file vpImage.h.

Referenced by vpImageConvert::split().

◆ getRows()

◆ getSize()

◆ getStdev() [1/2]

template<class Type>
double vpImage< Type >::getStdev ( const double & mean,
const vpImage< bool > * p_mask = nullptr,
unsigned int * nbValidPoints = nullptr ) const

Return the standard deviation of the bitmap.

  • For a vpRGBa or a vpRGBf image, we compute the standard deviation as follow:

    \‍[ stdev = \sqrt{\frac{1}{size} \sum_{r = 0}^{height-1} \sum_{c = 0}^{width-1} (I[r][c].R + I[r][c].G + I[r][c].B - \mu)^2}\‍]

  • For a unary type image (unsigned char, float, double), we compute the standard deviation as follow:

    \‍[ stdev = \sqrt{\frac{1}{size} \sum_{r = 0}^{height-1} \sum_{c = 0}^{width-1} (I[r][c] - \mu)^2}\‍]

where $ \mu $ is the mean of the image as computed by vpImage::getMeanValue() and $ \mbox{size} $ is the number of pixels to consider in the mask.

Parameters
[in]meanThe mean of the image.
[in]p_maskOptional parameter. When different from nullptr, a boolean mask that indicates which pixels must be considered, if set to true.
[out]nbValidPointsOptional parameter. When different from nullptr contains the number of points that are valid according to the boolean mask or image size when p_mask is set to nullptr.
Returns
double The standard deviation taking into account only the points for which the mask is true.

Definition at line 825 of file vpImage_getters.h.

References bitmap, vpException::fatalError, getHeight(), getWidth(), and vpImage().

◆ getStdev() [2/2]

template<class Type>
double vpImage< Type >::getStdev ( const vpImage< bool > * p_mask = nullptr,
unsigned int * nbValidPoints = nullptr ) const

Return the standard deviation of the bitmap.

  • For a vpRGBa or a vpRGBf image, we compute the standard deviation as follow:

    \‍[ stdev = \sqrt{\frac{1}{size} \sum_{r = 0}^{height-1} \sum_{c = 0}^{width-1} (I[r][c].R + I[r][c].G + I[r][c].B - \mu)^2}\‍]

  • For a unary type image (unsigned char, float, double), we compute the standard deviation as follow:

    \‍[ stdev = \sqrt{\frac{1}{size} \sum_{r = 0}^{height-1} \sum_{c = 0}^{width-1} (I[r][c] - \mu)^2}\‍]

where $ \mu $ is the mean of the image as computed by vpImage::getMeanValue() and $ \mbox{size} $ is the number of pixels to consider in the mask.

Parameters
[in]p_maskA boolean mask that indicates which points must be considered, if set to true.
[out]nbValidPointsOptional parameter. When different from nullptr contains the number of points that are valid according to the boolean mask or image size when p_mask is set to nullptr.

Definition at line 801 of file vpImage_getters.h.

References getMeanValue(), getStdev(), and vpImage().

Referenced by getStdev().

◆ getSum()

template<class Type>
double vpImage< Type >::getSum ( const vpImage< bool > * p_mask = nullptr,
unsigned int * nbValidPoints = nullptr ) const
inline

Compute the sum of image intensities.

  • For unary image types (unsigned char, float, double), compute the sum of image intensities.
  • For vpRGBa image type, compute the sum (R+G+B) of image intensities.
  • For vpRGBf image type, compute the sum (R+G+B) of image intensities.
Parameters
[in]p_maskOptional parameter. If not set to nullptr, pointer to a boolean mask that indicates the valid points by a true flag.
[out]nbValidPointsOptional parameter. When different from nullptr contains the number of points that are valid according to the boolean mask or image size when p_mask is set to nullptr.
Examples
catchImageLoadSave.cpp, and testUndistortImage.cpp.

Definition at line 976 of file vpImage_getters.h.

References bitmap, vpException::fatalError, getHeight(), getWidth(), and vpImage().

Referenced by getMeanValue().

◆ getValue() [1/3]

template<class Type>
vpRGBa getValue ( const vpImagePoint & ip) const
inline

Retrieves pixel value from an image containing values of type Type with sub-pixel accuracy.

Gets the value of a sub-pixel with coordinates (i,j) with bilinear interpolation.

See also vpImageTools::interpolate() for a similar result, but with a choice of the interpolation method.

Parameters
ip: Sub-pixel coordinates of a point in the image.
Returns
Interpolated sub-pixel value from the four neighbors.
Exceptions
vpImageException::notInTheImage: If the image point ip is out of the image.

Definition at line 313 of file vpImage_getters.h.

References vpImagePoint::get_i(), vpImagePoint::get_j(), and getValue().

◆ getValue() [2/3]

template<class Type>
vpRGBf getValue ( double i,
double j ) const
inline

Retrieves pixel value from an image containing values of type Type with sub-pixel accuracy.

Gets the value of a sub-pixel with coordinates (i,j) with bilinear interpolation.

See also vpImageTools::interpolate() for a similar result, but with a choice of the interpolation method.

Parameters
i: Sub-pixel coordinate along the rows.
j: Sub-pixel coordinate along the columns.
Returns
Interpolated sub-pixel value from the four neighbours.
Exceptions
vpImageException::notInTheImage: If (i,j) is out of the image.

Definition at line 76 of file vpImage_getters.h.

References vpImageException::notInitializedError, vpImageException::notInTheImage, and vpMath::round().

◆ getValue() [3/3]

template<class Type>
Type vpImage< Type >::getValue ( unsigned int i,
unsigned int j ) const
inline

Retrieves pixel value from an image containing values of type Type.

Gets the value of a sub-pixel with coordinates (i,j).

Parameters
i: Pixel coordinate along the rows.
j: Pixel coordinate along the columns.
Returns
Pixel value.
Exceptions
vpImageException::notInTheImage: If (i,j) is out of the image.

Definition at line 51 of file vpImage_getters.h.

References vpImageException::notInTheImage.

Referenced by vpTemplateTrackerMI::getMI(), vpTemplateTrackerMI::getMI256(), getValue(), vpTemplateTrackerZNCCForwardAdditional::initHessienDesired(), vpTemplateTrackerZNCCInverseCompositional::initHessienDesired(), and vpMeTracker::inRoiMask().

◆ getWidth()

template<class Type>
unsigned int vpImage< Type >::getWidth ( ) const
inline

Get the image width.

Returns
The image width.
See also
getHeight()
Examples
SickLDMRS-Process.cpp, catchArUco.cpp, catchColorConversion.cpp, catchImageWarp.cpp, catchIoEXR.cpp, catchIoPFM.cpp, displayXMulti.cpp, grab1394Two.cpp, grabDiskFloat.cpp, grabRealSense2.cpp, grabRealSense2_T265.cpp, grabV4l2.cpp, mbtGenericTracking.cpp, mbtGenericTracking2.cpp, perfColorConversion.cpp, perfGenericTracker.cpp, perfImageResize.cpp, testConnectedComponents.cpp, testConversion.cpp, testFloodFill.cpp, testGenericTracker.cpp, testImageBinarise.cpp, testImageComparison.cpp, testImageDifference.cpp, testImageNormalizedCorrelation.cpp, testImageTemplateMatching.cpp, testImgproc.cpp, testKeyPoint-3.cpp, testKeyPoint-4.cpp, testKeyPoint.cpp, testOccipitalStructure_Core_images.cpp, testOccipitalStructure_Core_pcl.cpp, testPerformanceLUT.cpp, testRealSense2_T265_images.cpp, testRealSense2_T265_images_odometry.cpp, testRealSense2_T265_images_odometry_async.cpp, testRealSense2_T265_odometry.cpp, testRealSense2_T265_undistort.cpp, testUndistortImage.cpp, tutorial-autothreshold.cpp, tutorial-brightness-adjustment.cpp, tutorial-canny-hsv.cpp, tutorial-circle-hough.cpp, tutorial-compare-auto-gamma.cpp, tutorial-connected-components.cpp, tutorial-contrast-sharpening.cpp, tutorial-count-coins.cpp, tutorial-grabber-realsense-T265.cpp, tutorial-grabber-structure-core.cpp, tutorial-hsv-segmentation-pcl.cpp, tutorial-hsv-segmentation.cpp, tutorial-ibvs-4pts-ogre-tracking.cpp, tutorial-ibvs-4pts-ogre.cpp, tutorial-image-colormap.cpp, tutorial-image-manipulation.cpp, tutorial-mb-generic-tracker-rgbd-realsense-json.cpp, tutorial-mb-generic-tracker-rgbd.cpp, tutorial-mb-generic-tracker-stereo.cpp, tutorial-panda3d-renderer.cpp, tutorial-pose-from-planar-object.cpp, tutorial-rbt-realsense.cpp, and visp-read-rs-dataset.cpp.

Definition at line 242 of file vpImage.h.

Referenced by VISP_NAMESPACE_NAME::clahe(), VISP_NAMESPACE_NAME::clahe(), vpRBVisualOdometryUtils::computeIndicesObjectAndEnvironment(), vpImageCircle::computePixelsInMask(), vpPose::computePlanarObjectPoseFromRGBD(), vpPose::computePlanarObjectPoseFromRGBD(), vpColorHistogram::computeProbas(), vpColorHistogram::computeProbas(), vpColorHistogram::computeSplitHistograms(), VISP_NAMESPACE_NAME::connectedComponents(), vpColormap::convert(), vpColormap::convert(), vpImageConvert::convert(), vpImageConvert::convert(), vpImageConvert::convert(), vpImageConvert::convert(), vpImageConvert::convert(), vpImageConvert::convert(), vpImageConvert::convert(), vpImageConvert::convert(), vpImageConvert::convert(), vpImageConvert::convert(), vpImageConvert::convert(), vpImageConvert::convert(), vpImageConvert::convert(), vpImageConvert::convert(), vpKeyPoint::createImageMatching(), vpKeyPoint::createImageMatching(), vpKeyPoint::createImageMatching(), vpKeyPoint::createImageMatching(), vpImageConvert::depthToPointCloud(), vpImageConvert::depthToPointCloud(), vpImageMorphology::dilatation(), vpDisplayGTK::displayImageROI(), vpDisplayGTK::displayImageROI(), vpKeyPoint::displayMatching(), vpKeyPoint::displayMatching(), vpKeyPoint::displayMatching(), vpKeyPoint::displayMatching(), vpKeyPoint::displayMatching(), vpCircleHoughTransform::edgeDetection(), VISP_NAMESPACE_NAME::equalizeHistogram(), vpImageMorphology::erosion(), vpPlaneEstimation::estimatePlane(), vpRBSilhouetteCCDTracker::extractFeatures(), vpRBSilhouetteMeTracker::extractFeatures(), VISP_NAMESPACE_NAME::fillHoles(), vpCircleHoughTransform::filterEdgeMap(), VISP_NAMESPACE_NAME::findContours(), vpSimulatorAfma6::getCameraParameters(), vpSimulatorAfma6::getCameraParameters(), vpSimulatorViper850::getCameraParameters(), vpSimulatorViper850::getCameraParameters(), vpSimulatorAfma6::getExternalImage(), vpSimulatorViper850::getExternalImage(), vpRobotWireFrameSimulator::getInternalView(), vpRobotWireFrameSimulator::getInternalView(), vpPanda3DGeometryRenderer::getRender(), vpPanda3DGeometryRenderer::getRender(), vpPanda3DGeometryRenderer::getRender(), vpSilhouettePointsExtractionSettings::getSilhouetteCandidates(), getStdev(), getSum(), vpImageTools::imageAdd(), vpImageTools::imageDifference(), vpImageTools::imageDifference(), vpImageTools::imageDifferenceAbsolute(), vpImageTools::imageDifferenceAbsolute(), vpImageTools::imageDifferenceAbsolute(), vpImageTools::imageSubtract(), vpMbTracker::initClick(), vpMbEdgeTracker::initPyramid(), insert(), vpKeyPoint::insertImageMatching(), vpKeyPoint::insertImageMatching(), vpKeyPoint::insertImageMatching(), vpKeyPoint::insertImageMatching(), vpImageTools::integralImage(), vpImageConvert::merge(), vpImageTools::normalizedCorrelation(), VISP_NAMESPACE_NAME::reconstruct(), vpImageTools::resize(), vpImageTools::resize(), vpImageTools::resize(), vpRBProbabilistic3DDriftDetector::score(), vpMeNurbs::seekExtremitiesCanny(), vpPanda3DRGBRenderer::setBackgroundImage(), vpImageConvert::split(), sub(), sub(), vpImageTools::templateMatching(), vpRBProbabilistic3DDriftDetector::update(), vpColorHistogramMask::updateMask(), vpDepthMask::updateMask(), vpImageTools::warpImage(), vpImageTools::warpLinear(), and vpKinect::warpRGBFrame().

◆ halfSizeImage()

template<class Type>
void vpImage< Type >::halfSizeImage ( vpImage< Type > & res) const

Returns a new image that's half size of the current image. No filtering is used during the sub sampling.

Used for building pyramid of the image.

Warning
Operator = must be defined for Type.
Parameters
res[out] : Subsampled image that is half size of the current image.

The example below shows how to use this method:

vpImage<unsigned char> I; // original image
vpImageIo::read(I, "myImage.pgm");
vpImage<unsigned char> I2; // half size image
I.halfSizeImage(I2);
vpImageIo::write(I2, "myHalfSizeImage.pgm");

This other example shows how to construct a pyramid of the image:

vpImage<unsigned char> I[4]; // pyramid with 4 levels
vpImageIo::read(I[1], "myImage.pgm"); // Original image at level 1
// compute the other levels
I5[1].doubleSizeImage(I5[0]); // double size image at level 0
I5[1].halfSizeImage(I5[2]); // half size image at level 2
I5[1].quarterSizeImage(I5[3]); // quarter size image at level 3
See also
subsample()
Examples
testImgproc.cpp, and testKeyPoint-5.cpp.

Definition at line 725 of file vpImage.h.

References resize(), and vpImage().

◆ init() [1/3]

template<class Type>
void init ( Type *const array,
unsigned int height,
unsigned int width,
bool copyData = false )

Initialization from an image stored as a continuous array in memory.

Definition at line 432 of file vpImage.h.

References bitmap, and vpException::memoryAllocationError.

◆ init() [2/3]

template<class Type>
void init ( unsigned int height,
unsigned int width )

Set the size of the image.

Examples
testDisplays.cpp, testRealSense2_D435.cpp, and tutorial-compare-auto-gamma.cpp.

Definition at line 387 of file vpImage.h.

References bitmap, and vpException::memoryAllocationError.

Referenced by init(), resize(), resize(), vpImage(), vpImage(), and vpImage().

◆ init() [3/3]

template<class Type>
void init ( unsigned int height,
unsigned int width,
Type value )

Set the size of the image and initialize all the elements to 'value'.

Definition at line 378 of file vpImage.h.

References bitmap, and init().

◆ insert()

template<class Type>
void vpImage< Type >::insert ( const vpImage< Type > & src,
const vpImagePoint & topLeft )

Insert an image into another one.

It is possible to insert the image $ src $ into the calling vpImage. You can set the point in the destination image where the top left corner of the $ src $ image will be located.

Parameters
src: Image to insert
topLeft: Upper/left coordinates in the image where the image src is inserted in the destination image.
Examples
testKeyPoint-3.cpp, testKeyPoint-4.cpp, testKeyPoint.cpp, tutorial-autothreshold.cpp, tutorial-brightness-adjustment.cpp, tutorial-compare-auto-gamma.cpp, and visp-read-rs-dataset.cpp.

Definition at line 639 of file vpImage.h.

References bitmap, vpImagePoint::get_i(), vpImagePoint::get_j(), getHeight(), getWidth(), and vpImage().

Referenced by vpKeyPoint::insertImageMatching(), vpKeyPoint::insertImageMatching(), vpKeyPoint::insertImageMatching(), and vpKeyPoint::insertImageMatching().

◆ operator!=()

template<class Type>
bool vpImage< Type >::operator!= ( const vpImage< Type > & I) const

Compare two images.

Returns
true if the images are different, false if they are the same.

Definition at line 300 of file vpImage_operators.h.

References vpImage().

◆ operator()() [1/4]

template<class Type>
Type vpImage< Type >::operator() ( const vpImagePoint & ip) const
inline

Get the value of an image point.

Parameters
ip: An image point with sub-pixel coordinates. Sub-pixel coordinates are roughly transformed to insigned int coordinates by cast.
Returns
Value of the image point ip.
See also
getValue(const vpImagePoint &)

Definition at line 290 of file vpImage.h.

References bitmap, vpImagePoint::get_i(), and vpImagePoint::get_j().

◆ operator()() [2/4]

template<class Type>
void vpImage< Type >::operator() ( const vpImagePoint & ip,
const Type & v )
inline

Set the value of an image point.

Parameters
ip: An image point with sub-pixel coordinates. Sub-pixel coordinates are roughly transformed to insigned int coordinates by cast.
v: Value to set for the image point.

Definition at line 306 of file vpImage.h.

References bitmap, vpImagePoint::get_i(), and vpImagePoint::get_j().

◆ operator()() [3/4]

template<class Type>
Type vpImage< Type >::operator() ( unsigned int i,
unsigned int j ) const
inline

Get the value of an image point with coordinates (i, j), with i the row position and j the column position.

Returns
Value of the image point (i, j).

Definition at line 272 of file vpImage.h.

References bitmap.

◆ operator()() [4/4]

template<class Type>
void vpImage< Type >::operator() ( unsigned int i,
unsigned int j,
const Type & v )
inline

Set the value v of an image point with coordinates (i, j), with i the row position and j the column position.

Definition at line 278 of file vpImage.h.

References bitmap.

◆ operator-()

template<class Type>
vpImage< Type > vpImage< Type >::operator- ( const vpImage< Type > & B) const

Operation A - B (A is unchanged).

#include <visp3/core/vpImage.h>
#ifdef ENABLE_VISP_NAMESPACE
using namespace VISP_NAMESPACE_NAME;
#endif
int main()
{
A = 128;
B = 120;
// operator-() : C = A - B
C = A - B;
return 0;
}
See also
sub(const vpImage<Type> &, const vpImage<Type> &, vpImage<Type> &) to avoid matrix allocation for each use.

Definition at line 331 of file vpImage_operators.h.

References sub(), and vpImage().

◆ operator=() [1/3]

template<class Type>
vpImage< Type > & vpImage< Type >::operator= ( const Type & v)

= operator : Set all the element of the bitmap to a given value v. $ A = v <=> A[i][j] = v $

Warning
= must be defined for $ <$ Type $ > $

Definition at line 257 of file vpImage_operators.h.

References bitmap, and vpImage().

◆ operator=() [2/3]

template<class Type>
vpImage< Type > & vpImage< Type >::operator= ( const vpImage< Type > & other)

Copy operator.

Copy operator. Resizes and copies the contents of the image other. The pointer to the display remains unchanged.

Parameters
[in]other: Image to copy.
Exceptions
Whenthe display is initialised and the images have different sizes.

Definition at line 190 of file vpImage_operators.h.

References bitmap, vpException::dimensionError, display, resize(), and vpImage().

◆ operator=() [3/3]

template<class Type>
vpImage< Type > & vpImage< Type >::operator= ( vpImage< Type > && other)

move constructor

Move operator. Moves the image pointers without deep copying image content.

Parameters
[in]other: Image to move.
Exceptions
vpException::dimensionErrorWhen the display is initialised and the images have different sizes.
vpException::fatalErrorWhen the display attached to the `other` image is initialized.

Definition at line 213 of file vpImage_operators.h.

References bitmap, vpException::dimensionError, display, vpException::fatalError, and vpImage().

◆ operator==()

template<class Type>
bool vpImage< Type >::operator== ( const vpImage< Type > & I) const

Compare two images.

Returns
true if the images are the same, false otherwise.

Definition at line 271 of file vpImage_operators.h.

References bitmap, and vpImage().

◆ operator[]() [1/4]

template<class Type>
Type * vpImage< Type >::operator[] ( int i)
inline

Definition at line 260 of file vpImage.h.

◆ operator[]() [2/4]

template<class Type>
const Type * vpImage< Type >::operator[] ( int i) const
inline

Definition at line 264 of file vpImage.h.

◆ operator[]() [3/4]

template<class Type>
Type * vpImage< Type >::operator[] ( unsigned int i)
inline

operator[] allows operation like I[i] = x.

Definition at line 259 of file vpImage.h.

◆ operator[]() [4/4]

template<class Type>
const Type * vpImage< Type >::operator[] ( unsigned int i) const
inline

operator[] allows operation like x = I[i]

Definition at line 263 of file vpImage.h.

◆ performLut()

template<class Type>
void vpImage< Type >::performLut ( const Type(&) lut[256],
unsigned int nbThreads = 1 )
Warning
This generic method is not implemented. You should rather use the instantiated methods for unsigned char and vpRGBa images.
See also
vpImage<unsigned char>::performLut(const unsigned char (&lut)[256], unsigned int nbThreads)
vpImage<vpRGBa>::performLut(const vpRGBa (&lut)[256], unsigned int nbThreads)
Examples
testPerformanceLUT.cpp.

Definition at line 172 of file vpImage_lut.h.

Referenced by vpHistogram::equalize().

◆ quarterSizeImage()

template<class Type>
void vpImage< Type >::quarterSizeImage ( vpImage< Type > & res) const

Returns a new image that's a quarter size of the current image. No filtering is used during the sub sampling. Used for building a quarter of the image.

Warning
Operator = must be defined for Type.
Parameters
res[out] : Subsampled image that is quarter size of the current image.

The example below shows how to use this method:

vpImage<unsigned char> I; // original image
vpImageIo::read(I, "myImage.pgm");
vpImage<unsigned char> I4; // quarter size image
I.halfSizeImage(I4);
vpImageIo::write(I4, "myQuarterSizeImage.pgm");

See halfSizeImage(vpImage<Type> &) for an example of pyramid construction.

See also
subsample()
Examples
testKeyPoint-6.cpp.

Definition at line 793 of file vpImage.h.

References resize(), and vpImage().

◆ resize() [1/2]

template<class Type>
void vpImage< Type >::resize ( unsigned int h,
unsigned int w )

resize the image : Image initialization

Allocate memory for an [height x width] image.

Warning
The image is not initialized.
Parameters
w: Image width.
h: Image height.

Element of the bitmap are not initialized

If the image has been already initialized, memory allocation is done only if the new image size is different, else we re-use the same memory space.

Exceptions
vpException::memoryAllocationErrorMemory allocation error.
See also
init(unsigned int, unsigned int)
Examples
mbtGenericTrackingDepth.cpp, mbtGenericTrackingDepthOnly.cpp, testHSVGradient.cpp, testImageDifference.cpp, testImageNormalizedCorrelation.cpp, testKeyPoint-3.cpp, testKeyPoint-4.cpp, testKeyPoint.cpp, testRealSense2_T265_images_odometry_async.cpp, tutorial-apriltag-detector-live-rgbd-realsense.cpp, tutorial-apriltag-detector-live-rgbd-structure-core.cpp, tutorial-canny-hsv.cpp, tutorial-canny.cpp, tutorial-circle-hough.cpp, tutorial-mb-generic-tracker-rgbd-blender.cpp, tutorial-mb-generic-tracker-rgbd.cpp, tutorial-pose-from-planar-object.cpp, and visp-read-rs-dataset.cpp.

Definition at line 544 of file vpImage.h.

References init().

Referenced by vpRealSense2::acquire(), vpRealSense2::acquire(), vpRealSense2::acquire(), VISP_NAMESPACE_NAME::clahe(), VISP_NAMESPACE_NAME::clahe(), vpImageFilter::computePartialDerivatives(), vpColorHistogram::computeProbas(), vpColorHistogram::computeProbas(), VISP_NAMESPACE_NAME::connectedComponents(), vpColormap::convert(), vpColormap::convert(), doubleSizeImage(), vpImageTools::extract(), vpImageTools::extract(), vpImageFilter::filter(), vpImageFilter::filter(), vpImageTools::flip(), vpImageTools::flip(), vpImageFilter::getGaussXPyramidal(), vpImageFilter::getGaussYPyramidal(), vpRealSense2::getGreyFrame(), vpPanda3DDepthCannyFilter::getRender(), vpPanda3DDepthCannyFilter::getRender(), vpPanda3DGeometryRenderer::getRender(), vpPanda3DGeometryRenderer::getRender(), vpPanda3DGeometryRenderer::getRender(), vpImageFilter::gradientFilter(), vpImageFilter::gradientFilterX(), vpImageFilter::gradientFilterY(), halfSizeImage(), vpImageTools::imageAdd(), vpImageTools::imageDifference(), vpImageTools::imageDifference(), vpImageTools::imageDifferenceAbsolute(), vpImageTools::imageDifferenceAbsolute(), vpImageTools::imageDifferenceAbsolute(), vpImageTools::imageSubtract(), vpImageTools::integralImage(), vpImageConvert::merge(), operator=(), vpObjectCentricRenderer::placeRenderInto(), quarterSizeImage(), vpImageTools::remap(), vpImageTools::remap(), vpImageTools::resize(), vpImageFilter::sepFilter(), vpImageConvert::split(), sub(), sub(), subsample(), vpImageTools::templateMatching(), vpImageTools::undistort(), vpColorHistogramMask::updateMask(), vpCombinedDepthAndColorMask::updateMask(), vpDepthMask::updateMask(), vpRBTracker::updateRender(), vpImage(), vpImageSimulator::vpImageSimulator(), vpImageTools::warpImage(), and vpKinect::warpRGBFrame().

◆ resize() [2/2]

template<class Type>
void vpImage< Type >::resize ( unsigned int h,
unsigned int w,
const Type & val )

resize the image : Image initialization

Allocate memory for an [height x width] image and initialize the image.

Parameters
w: Image width.
h: Image height.
val: Pixels value.

Element of the bitmap are not initialized

If the image has been already initialized, memory allocation is done only if the new image size is different, else we re-use the same memory space.

Exceptions
vpException::memoryAllocationErrorMemory allocation error.
See also
init(unsigned int, unsigned int)

Definition at line 565 of file vpImage.h.

References init().

◆ sub() [1/2]

template<class Type>
void vpImage< Type >::sub ( const vpImage< Type > & A,
const vpImage< Type > & B,
vpImage< Type > & C ) const

Operation C = A - B.

The result is placed in the third parameter C and not returned. A new image won't be allocated for every use of the function (Speed gain if used many times with the same result matrix size).

Exceptions
vpException::memoryAllocationErrorIf the images size differ.
See also
operator-()

Definition at line 950 of file vpImage.h.

References bitmap, getHeight(), getWidth(), vpException::memoryAllocationError, resize(), and vpImage().

◆ sub() [2/2]

template<class Type>
void vpImage< Type >::sub ( const vpImage< Type > & B,
vpImage< Type > & C ) const

Operation C = *this - B.

#include <visp3/core/vpImage.h>
#ifdef ENABLE_VISP_NAMESPACE
using namespace VISP_NAMESPACE_NAME;
#endif
int main()
{
A = 128;
B = 120;
A.sub(B, C); // C = A - B
return 0;
}

The result is placed in the third parameter C and not returned. A new image won't be allocated for every use of the function (Speed gain if used many times with the same result matrix size).

Exceptions
vpException::memoryAllocationErrorIf the images size differ.
See also
operator-()

Definition at line 915 of file vpImage.h.

References bitmap, getHeight(), getWidth(), vpException::memoryAllocationError, resize(), and vpImage().

Referenced by operator-().

◆ subsample()

template<class Type>
void vpImage< Type >::subsample ( unsigned int v_scale,
unsigned int h_scale,
vpImage< Type > & sampled ) const

Computes a subsampled image. No filtering is used during the sub sampling.

Parameters
v_scale[in] : Vertical subsampling factor.
h_scale[in] : Horizontal subsampling factor.
sampled[out] : Subsampled image.

The example below shows how to use this method:

vpImage<unsigned char> I; // original image
vpImageIo::read(I, "myImage.pgm");
vpImage<unsigned char> I2; // half size image
I.subsample(2, 2, I2);
vpImageIo::write(I2, "myHalfSizeImage.pgm");
Examples
testDisplayScaled.cpp, tutorial-klt-tracker.cpp, tutorial-mb-generic-tracker-full.cpp, and tutorial-template-tracker.cpp.

Definition at line 755 of file vpImage.h.

References resize(), and vpImage().

Referenced by VISP_NAMESPACE_NAME::gammaCorrectionSpatialBased(), and VISP_NAMESPACE_NAME::gammaCorrectionSpatialBased().

◆ getMinMaxValue() [1/3]

void getMinMaxValue ( double & min,
double & max,
bool onlyFiniteVal ) const
related

Look for the minimum and the maximum value within the double bitmap.

Parameters
min: The minimal value within the bitmap.
max: The maximal value within the bitmap.
onlyFiniteVal: If true, consider only finite values.
See also
getMaxValue()
getMinValue()
getMinMaxLoc()

Definition at line 550 of file vpImage_getters.h.

◆ getMinMaxValue() [2/3]

void getMinMaxValue ( float & min,
float & max,
bool onlyFiniteVal ) const
related

Look for the minimum and the maximum value within the float bitmap.

Parameters
min: The minimal value within the bitmap.
max: The maximal value within the bitmap.
onlyFiniteVal: If true, consider only finite values.
See also
getMaxValue()
getMinValue()
getMinMaxLoc()

Definition at line 593 of file vpImage_getters.h.

◆ getMinMaxValue() [3/3]

void getMinMaxValue ( vpRGBf & min,
vpRGBf & max,
bool onlyFiniteVal ) const
related

Look for the minimum and the maximum value within the 3-channels float bitmap.

Parameters
min: The minimal values within the bitmap.
max: The maximal values within the bitmap.
onlyFiniteVal: If true, consider only finite values.
See also
getMaxValue()
getMinValue()
getMinMaxLoc()

Definition at line 636 of file vpImage_getters.h.

◆ operator<< [1/5]

template<class Type>
std::ostream & operator<< ( std::ostream & s,
const vpImage< char > & I )
friend

Definition at line 93 of file vpImage_operators.h.

References operator<<, and vpImage().

◆ operator<< [2/5]

template<class Type>
std::ostream & operator<< ( std::ostream & s,
const vpImage< double > & I )
friend

Definition at line 152 of file vpImage_operators.h.

References operator<<, and vpImage().

◆ operator<< [3/5]

template<class Type>
std::ostream & operator<< ( std::ostream & s,
const vpImage< float > & I )
friend

Definition at line 122 of file vpImage_operators.h.

References operator<<, and vpImage().

◆ operator<< [4/5]

template<class Type>
std::ostream & operator<< ( std::ostream & s,
const vpImage< Type > & I )
friend

Definition at line 39 of file vpImage_operators.h.

References operator<<, and vpImage().

Referenced by operator<<, operator<<, operator<<, operator<<, and operator<<.

◆ operator<< [5/5]

template<class Type>
std::ostream & operator<< ( std::ostream & s,
const vpImage< unsigned char > & I )
friend

Definition at line 64 of file vpImage_operators.h.

References operator<<, and vpImage().

◆ performLut() [1/2]

void performLut ( const unsigned char(&) lut[256],
unsigned int nbThreads )
related

Modify the intensities of a grayscale image using the look-up table passed in parameter.

Parameters
lut: Look-up table (unsigned char array of size=256) which maps each intensity to his new value.
nbThreads: Number of threads to use for the computation.

Definition at line 187 of file vpImage_lut.h.

◆ performLut() [2/2]

void performLut ( const vpRGBa(&) lut[256],
unsigned int nbThreads )
related

Modify the intensities of a color image using the look-up table passed in parameter.

Parameters
lut: Look-up table (vpRGBa array of size=256) which maps each intensity to his new value.
nbThreads: Number of threads to use for the computation.

Definition at line 266 of file vpImage_lut.h.

◆ swap

template<class Type>
void swap ( vpImage< Type > & first,
vpImage< Type > & second )
friend

Definition at line 350 of file vpImage.h.

References bitmap, display, swap, and vpImage().

Referenced by swap.

◆ vpImageConvert

template<class Type>
friend class vpImageConvert
friend

Definition at line 132 of file vpImage.h.

References vpImageConvert.

Referenced by vpImageConvert.

Member Data Documentation

◆ bitmap

template<class Type>
Type* vpImage< Type >::bitmap

points toward the bitmap

Examples
catchColorConversion.cpp, catchImageLoadSave.cpp, catchLuminanceMapping.cpp, grabDiskFloat.cpp, grabRealSense2.cpp, grabV4l2MultiCpp11Thread.cpp, testConversion.cpp, testImageDifference.cpp, testOccipitalStructure_Core_images.cpp, testOccipitalStructure_Core_pcl.cpp, testRealSense2_D435.cpp, testRealSense2_D435_pcl.cpp, testRealSense2_T265_images_odometry_async.cpp, tutorial-count-coins.cpp, tutorial-grabber-rgbd-D435-structurecore.cpp, tutorial-grabber-structure-core.cpp, tutorial-hsv-segmentation-pcl.cpp, tutorial-hsv-segmentation.cpp, tutorial-mb-generic-tracker-rgbd-realsense-json.cpp, tutorial-panda3d-renderer.cpp, and tutorial-rbt-realsense.cpp.

Definition at line 135 of file vpImage.h.

Referenced by vpOccipitalStructure::acquire(), vpOccipitalStructure::acquire(), vpOccipitalStructure::acquire(), vpOccipitalStructure::acquire(), vpV4l2Grabber::acquire(), vpV4l2Grabber::acquire(), vpColorHistogram::build(), VISP_NAMESPACE_NAME::clahe(), vpImageFilter::computeCannyThreshold(), vpImageFilter::computeCannyThreshold(), vpColorHistogram::computeProbas(), vpColorHistogram::computeSplitHistograms(), vpColorHistogram::computeSplitHistograms(), vpImageConvert::convert(), vpImageConvert::convert(), vpImageConvert::convert(), vpImageConvert::convert(), vpImageConvert::convert(), vpImageConvert::convert(), vpImageConvert::convert(), vpImageConvert::convert(), vpImageConvert::convert(), vpImageConvert::convert(), vpImageConvert::convert(), vpImageConvert::convert(), vpImageConvert::convert(), vpImageConvert::convert(), vpImageConvert::convert(), vpImageConvert::convert(), vpImageConvert::depthToPointCloud(), vpImageConvert::depthToPointCloud(), destroy(), vpObjectMask::display(), VISP_NAMESPACE_NAME::equalizeHistogram(), vpImageTools::flip(), vpImageTools::flip(), VISP_NAMESPACE_NAME::gammaCorrection(), VISP_NAMESPACE_NAME::gammaCorrectionSpatialBased(), VISP_NAMESPACE_NAME::gammaCorrectionSpatialBased(), vpRealSense2::getGreyFrame(), getMaxValue(), getMinMaxLoc(), getMinMaxValue(), getMinValue(), getStdev(), getSum(), vpImageTools::imageAdd(), vpImageTools::imageDifference(), vpImageTools::imageDifference(), vpImageTools::imageDifferenceAbsolute(), vpImageTools::imageDifferenceAbsolute(), vpImageTools::imageDifferenceAbsolute(), vpImageTools::imageSubtract(), init(), init(), init(), insert(), vpImageConvert::merge(), VISP_NAMESPACE_NAME::MSRCR(), vpImageTools::normalizedCorrelation(), operator()(), operator()(), operator()(), operator()(), operator=(), operator=(), operator=(), operator==(), vpObjectCentricRenderer::placeRenderInto(), vpImageTools::remap(), vpImageConvert::split(), VISP_NAMESPACE_NAME::stretchContrastHSV(), sub(), sub(), swap, vpImageTools::templateMatching(), vpImageTools::undistort(), VISP_NAMESPACE_NAME::unsharpMask(), VISP_NAMESPACE_NAME::unsharpMask(), vpColorHistogramMask::updateMask(), vpCombinedDepthAndColorMask::updateMask(), vpDepthMask::updateMask(), vpImage(), vpImage(), vpImage(), vpImage(), vpImage(), and vpImage().

◆ display