"_backup/topdown/model.py" did not exist on "9c9ac7c960aff5e4e6524202483c774f407fcf42"
Commit a4bf6e1e authored by Davis King's avatar Davis King
Browse files

cleanup cv_image code. This also fixes a build error with the very latest version of OpenCV.

parent 34dc7303
...@@ -23,7 +23,7 @@ namespace dlib ...@@ -23,7 +23,7 @@ namespace dlib
typedef pixel_type type; typedef pixel_type type;
typedef default_memory_manager mem_manager_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<typename pixel_traits<pixel_type>::basic_pixel_type>::depth && DLIB_CASSERT(img.depth() == cv::DataType<typename pixel_traits<pixel_type>::basic_pixel_type>::depth &&
img.channels() == pixel_traits<pixel_type>::num, img.channels() == pixel_traits<pixel_type>::num,
...@@ -119,34 +119,6 @@ namespace dlib ...@@ -119,34 +119,6 @@ namespace dlib
long nc() const { return _nc; } long nc() const { return _nc; }
long width_step() const { return _widthStep; } 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: private:
void init (const IplImage* img) void init (const IplImage* img)
......
...@@ -181,70 +181,6 @@ namespace dlib ...@@ -181,70 +181,6 @@ namespace dlib
of this image 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<pixel_traits<pixel_type>::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<pixel_type>::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 ( long width_step (
) const; ) const;
/*! /*!
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment