20 #ifndef KJB_CPP_EDGE_HOG_H
21 #define KJB_CPP_EDGE_HOG_H
37 static inline float hog_min(
float x,
float y) {
return (x <= y ? x : y); }
38 static inline float hog_max(
float x,
float y) {
return (x <= y ? y : x); }
40 static inline int hog_min(
int x,
int y) {
return (x <= y ? x : y); }
41 static inline int hog_max(
int x,
int y) {
return (x <= y ? y : x); }
57 num_rows(src.num_rows), num_cols(src.num_cols), hog_num_rows(src.hog_num_rows),
58 hog_num_cols(src.hog_num_cols), hog_size(src.hog_size)
60 hog_responses =
new float[hog_size];
61 memcpy(hog_responses, src.hog_responses, hog_size*
sizeof(
float));
66 delete[] hog_responses;
71 bin_size = src.bin_size;
72 num_rows = src.num_rows;
73 num_cols = src.num_cols;
74 hog_num_rows = src.hog_num_rows;
75 hog_num_cols = src.hog_num_cols;
76 hog_size = src.hog_size;
77 delete[] hog_responses;
79 hog_responses =
new float[hog_size];
80 memcpy(hog_responses, src.hog_responses, hog_size*
sizeof(
float));
86 return ((
int)round((
double)num_rows/(
double)bin_size)) -2;
91 return ((
int)round((
double)num_cols/(
double)bin_size)) -2;
106 return (
int)
std::floor(((
double)img_pix_row + 0.5)/(
double)bin_size - 0.5);
111 return (
int)
std::floor(((
double)img_pix_col + 0.5)/(
double)bin_size - 0.5);
116 return 1.5 + bin_size + (bin_size*hog_x_index);
121 return 1.5 + bin_size + (bin_size*hog_y_index);
126 void get_bims(std::vector<Matrix> & bim);
129 void read(std::istream& in);
132 void write(std::ostream& out)
const;
141 return hog_responses;
156 float * hog_responses;
int get_num_rows() const
Definition: hog.h:94
void get_HOG_picture(Image &positive_image, Image &negative_image, bool &negative_weights)
Definition: hog.cpp:322
Abstract class to write this object to an output stream.
Definition: l_writeable.h:41
Abstract class to read this object from an input stream.
Definition: l_readable.h:39
~Hog_responses()
Definition: hog.h:64
void read(std::istream &in)
Reads this Line segment from an input stream.
Definition: hog.cpp:249
int get_hog_cell_x_center(int hog_x_index) const
Definition: hog.h:114
Hog_responses(const Image &img, int ibin_size)
Definition: hog.cpp:23
void compute_HOG_features(const Image &img, int bin_size)
int get_hog_num_rows() const
Definition: hog.h:84
int get_num_cols() const
Definition: hog.h:99
Hog_responses(const Hog_responses &src)
Definition: hog.h:56
void get_bims(std::vector< Matrix > &bim)
Definition: hog.cpp:398
int get_hog_cell_y_center(int hog_y_index) const
Definition: hog.h:119
void rotateMatrix(Matrix &m, double angle)
int get_hog_pix_row(int img_pix_row) const
Definition: hog.h:104
Int_matrix floor(const Matrix &m)
Definition: m_matrix.cpp:2026
x
Definition: APPgetLargeConnectedEdges.m:100
Hog_responses(const std::string &file_name)
Definition: hog.h:50
int get_hog_pix_col(int img_pix_col) const
Definition: hog.h:109
Hog_responses & operator=(const Hog_responses &src)
Definition: hog.h:69
virtual void read(std::istream &in)=0
Reads this Readable from an input stream.
void write(std::ostream &out) const
Writes this Line segment to an output stream.
Definition: hog.cpp:313
Code for a wrapper class around the C struct KJB_Image.
const float * get_hog_responses() const
Definition: hog.h:139
for m
Definition: APPgetLargeConnectedEdges.m:64
int get_hog_num_cols() const
Definition: hog.h:89
Wrapped version of the C struct KJB_image.
Definition: i_image.h:76
int get_bin_size() const
Definition: hog.h:144
int get_hog_size() const
Definition: hog.h:134
void rotate_matrix_90_degrees(Matrix &m, int number_of_times)
Definition: hog.cpp:504