Commit 88125136 authored by Hamdi Sahloul's avatar Hamdi Sahloul

Remove cuda.HOG unnamed enum

parent bcf8f15a
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
#endif #endif
#include "opencv2/core/cuda.hpp" #include "opencv2/core/cuda.hpp"
#include "opencv2/objdetect.hpp"
/** /**
@addtogroup cuda @addtogroup cuda
...@@ -78,12 +79,6 @@ namespace cv { namespace cuda { ...@@ -78,12 +79,6 @@ namespace cv { namespace cuda {
class CV_EXPORTS_W HOG : public Algorithm class CV_EXPORTS_W HOG : public Algorithm
{ {
public: public:
enum
{
DESCR_FORMAT_ROW_BY_ROW,
DESCR_FORMAT_COL_BY_COL
};
/** @brief Creates the HOG descriptor and detector. /** @brief Creates the HOG descriptor and detector.
@param win_size Detection window size. Align to block size and block stride. @param win_size Detection window size. Align to block size and block stride.
...@@ -138,8 +133,8 @@ public: ...@@ -138,8 +133,8 @@ public:
//! Descriptor storage format: //! Descriptor storage format:
//! - **DESCR_FORMAT_ROW_BY_ROW** - Row-major order. //! - **DESCR_FORMAT_ROW_BY_ROW** - Row-major order.
//! - **DESCR_FORMAT_COL_BY_COL** - Column-major order. //! - **DESCR_FORMAT_COL_BY_COL** - Column-major order.
CV_WRAP virtual void setDescriptorFormat(int descr_format) = 0; CV_WRAP virtual void setDescriptorFormat(HOGDescriptor::DescriptorStorageFormat descr_format) = 0;
CV_WRAP virtual int getDescriptorFormat() const = 0; CV_WRAP virtual HOGDescriptor::DescriptorStorageFormat getDescriptorFormat() const = 0;
/** @brief Returns the number of coefficients required for the classification. /** @brief Returns the number of coefficients required for the classification.
*/ */
......
...@@ -170,8 +170,8 @@ namespace ...@@ -170,8 +170,8 @@ namespace
virtual void setGroupThreshold(int group_threshold) { group_threshold_ = group_threshold; } virtual void setGroupThreshold(int group_threshold) { group_threshold_ = group_threshold; }
virtual int getGroupThreshold() const { return group_threshold_; } virtual int getGroupThreshold() const { return group_threshold_; }
virtual void setDescriptorFormat(int descr_format) { descr_format_ = descr_format; } virtual void setDescriptorFormat(HOGDescriptor::DescriptorStorageFormat descr_format) { descr_format_ = descr_format; }
virtual int getDescriptorFormat() const { return descr_format_; } virtual HOGDescriptor::DescriptorStorageFormat getDescriptorFormat() const { return descr_format_; }
virtual size_t getDescriptorSize() const; virtual size_t getDescriptorSize() const;
...@@ -208,7 +208,7 @@ namespace ...@@ -208,7 +208,7 @@ namespace
Size win_stride_; Size win_stride_;
double scale0_; double scale0_;
int group_threshold_; int group_threshold_;
int descr_format_; HOGDescriptor::DescriptorStorageFormat descr_format_;
Size cells_per_block_; Size cells_per_block_;
private: private:
...@@ -240,7 +240,7 @@ namespace ...@@ -240,7 +240,7 @@ namespace
win_stride_(block_stride), win_stride_(block_stride),
scale0_(1.05), scale0_(1.05),
group_threshold_(2), group_threshold_(2),
descr_format_(DESCR_FORMAT_COL_BY_COL), descr_format_(HOGDescriptor::DESCR_FORMAT_COL_BY_COL),
cells_per_block_(block_size.width / cell_size.width, block_size.height / cell_size.height) cells_per_block_(block_size.width / cell_size.width, block_size.height / cell_size.height)
{ {
CV_Assert((win_size.width - block_size.width ) % block_stride.width == 0 && CV_Assert((win_size.width - block_size.width ) % block_stride.width == 0 &&
...@@ -502,7 +502,7 @@ namespace ...@@ -502,7 +502,7 @@ namespace
switch (descr_format_) switch (descr_format_)
{ {
case DESCR_FORMAT_ROW_BY_ROW: case HOGDescriptor::DESCR_FORMAT_ROW_BY_ROW:
hog::extract_descrs_by_rows(win_size_.height, win_size_.width, hog::extract_descrs_by_rows(win_size_.height, win_size_.width,
block_stride_.height, block_stride_.width, block_stride_.height, block_stride_.width,
win_stride_.height, win_stride_.width, win_stride_.height, win_stride_.width,
...@@ -512,7 +512,7 @@ namespace ...@@ -512,7 +512,7 @@ namespace
descriptors, descriptors,
StreamAccessor::getStream(stream)); StreamAccessor::getStream(stream));
break; break;
case DESCR_FORMAT_COL_BY_COL: case HOGDescriptor::DESCR_FORMAT_COL_BY_COL:
hog::extract_descrs_by_cols(win_size_.height, win_size_.width, hog::extract_descrs_by_cols(win_size_.height, win_size_.width,
block_stride_.height, block_stride_.width, block_stride_.height, block_stride_.width,
win_stride_.height, win_stride_.width, win_stride_.height, win_stride_.width,
......
...@@ -187,10 +187,10 @@ CUDA_TEST_P(HOG, GetDescriptors) ...@@ -187,10 +187,10 @@ CUDA_TEST_P(HOG, GetDescriptors)
hog->setWinStride(Size(64, 128)); hog->setWinStride(Size(64, 128));
hog->setDescriptorFormat(cv::cuda::HOG::DESCR_FORMAT_ROW_BY_ROW); hog->setDescriptorFormat(HOGDescriptor::DESCR_FORMAT_ROW_BY_ROW);
hog->compute(d_img, descriptors); hog->compute(d_img, descriptors);
hog->setDescriptorFormat(cv::cuda::HOG::DESCR_FORMAT_COL_BY_COL); hog->setDescriptorFormat(HOGDescriptor::DESCR_FORMAT_COL_BY_COL);
hog->compute(d_img, descriptors_by_cols); hog->compute(d_img, descriptors_by_cols);
// Check size of the result train table // Check size of the result train table
......
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