diff --git a/dlib/opencv/cv_image.h b/dlib/opencv/cv_image.h index 05af05511..31b96751c 100644 --- a/dlib/opencv/cv_image.h +++ b/dlib/opencv/cv_image.h @@ -23,7 +23,7 @@ namespace dlib typedef pixel_type type; typedef default_memory_manager mem_manager_type; - cv_image (const cv::Mat img) + cv_image (const cv::Mat &img) { DLIB_CASSERT(img.depth() == cv::DataType::basic_pixel_type>::depth && img.channels() == pixel_traits::num, @@ -119,34 +119,6 @@ namespace dlib long nc() const { return _nc; } long width_step() const { return _widthStep; } - cv_image& operator=( const cv_image& item) - { - _data = item._data; - _widthStep = item._widthStep; - _nr = item._nr; - _nc = item._nc; - return *this; - } - - cv_image& operator=( const IplImage* img) - { - init(img); - return *this; - } - - cv_image& operator=( const IplImage img) - { - init(&img); - return *this; - } - - cv_image& operator=( const cv::Mat img) - { - IplImage temp = img; - init(&temp); - return *this; - } - private: void init (const IplImage* img) diff --git a/dlib/opencv/cv_image_abstract.h b/dlib/opencv/cv_image_abstract.h index 6fbc56b43..d019d148d 100644 --- a/dlib/opencv/cv_image_abstract.h +++ b/dlib/opencv/cv_image_abstract.h @@ -181,70 +181,6 @@ namespace dlib of this image !*/ - cv_image& operator= ( - const cv_image& item - ); - /*! - ensures - - #*this is an identical copy of item - - returns #*this - !*/ - - cv_image& operator=( - const IplImage* img - ); - /*! - requires - - img->dataOrder == 0 - (i.e. Only interleaved color channels are supported with cv_image) - - (img->depth&0xFF)/8*img->nChannels == sizeof(pixel_type) - (i.e. The size of the pixel_type needs to match the size of the pixels - inside the OpenCV image) - ensures - - #nr() == img->height - #nc() == img->width - - using the operator[] on this object you will be able to access the pixels - inside this OpenCV image. - - returns #*this - !*/ - - cv_image& operator=( - const IplImage img - ); - /*! - requires - - img->dataOrder == 0 - (i.e. Only interleaved color channels are supported with cv_image) - - (img->depth&0xFF)/8*img->nChannels == sizeof(pixel_type) - (i.e. The size of the pixel_type needs to match the size of the pixels - inside the OpenCV image) - ensures - - #nr() == img->height - #nc() == img->width - - using the operator[] on this object you will be able to access the pixels - inside this OpenCV image. - - returns #*this - !*/ - - cv_image& operator=( - const cv::Mat img - ); - /*! - requires - - img.depth() == cv::DataType::basic_pixel_type>::depth - (i.e. The pixel_type template argument needs to match the type of pixel - used inside the OpenCV image) - - img.channels() == pixel_traits::num - (i.e. the number of channels in the pixel_type needs to match the number of - channels in the OpenCV image) - ensures - - #nr() == img.rows - - #nc() == img.cols - - using the operator[] on this object you will be able to access the pixels - inside this OpenCV image. - - returns #*this - !*/ - long width_step ( ) const; /*!