Skip to content

Commit dd50d5b

Browse files
committed
modify samples for feature storing option
1 parent a81322a commit dd50d5b

File tree

12 files changed

+429
-233
lines changed

12 files changed

+429
-233
lines changed

modules/cnn_3dobj/include/opencv2/cnn_3dobj.hpp

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ the use of this software, even if advised of the possibility of such damage.
7272
#include "opencv2/highgui.hpp"
7373
#include "opencv2/highgui/highgui_c.h"
7474
#include "opencv2/imgproc.hpp"
75-
using std::string;
7675
using caffe::Blob;
7776
using caffe::Caffe;
7877
using caffe::Datum;
@@ -185,7 +184,7 @@ namespace cnn_3dobj
185184

186185
/** @brief Suit the position of bytes in 4 byte data structure for particular system.
187186
*/
188-
CV_WRAP static uint32_t swapEndian(uint32_t val);
187+
CV_WRAP static int swapEndian(int val);
189188

190189
/** @brief Create header in binary files collecting the image data and label.
191190
@param num_item Number of items.
@@ -206,7 +205,7 @@ namespace cnn_3dobj
206205
@param z Pose label of Z.
207206
@param isrgb Option for choice of using RGB images or not.
208207
*/
209-
CV_WRAP static void writeBinaryfile(string filenameImg, const char* binaryPath, const char* headerPath, int num_item, int label_class, int x, int y, int z, int isrgb);
208+
CV_WRAP static void writeBinaryfile(String filenameImg, const char* binaryPath, const char* headerPath, int num_item, int label_class, int x, int y, int z, int isrgb);
210209
};
211210

212211
/** @brief Caffe based 3D images descriptor.
@@ -223,13 +222,13 @@ namespace cnn_3dobj
223222
bool net_set;
224223
int net_ready;
225224
cv::Mat mean_;
226-
string deviceType;
225+
String deviceType;
227226
int deviceId;
228227

229228
/** @brief Load the mean file in binaryproto format if it is needed.
230229
@param mean_file Path of mean file which stores the mean of training images, it is usually generated by Caffe tool.
231230
*/
232-
void setMean(const string& mean_file);
231+
void setMean(const String& mean_file);
233232

234233
/** @brief Wrap the input layer of the network in separate cv::Mat objects(one per channel).
235234
This way we save one memcpy operation and we don't need to rely on cudaMemcpy2D.
@@ -246,11 +245,11 @@ namespace cnn_3dobj
246245
@param device_type CPU or GPU.
247246
@param device_id ID of GPU.
248247
*/
249-
descriptorExtractor(const string& device_type, int device_id = 0);
248+
descriptorExtractor(const String& device_type, int device_id = 0);
250249

251250
/** @brief Get device type information for feature extraction.
252251
*/
253-
string getDeviceType();
252+
String getDeviceType();
254253

255254
/** @brief Get device ID information for feature extraction.
256255
*/
@@ -260,7 +259,7 @@ namespace cnn_3dobj
260259
Useful to change device without the need to reload the net.
261260
@param device_type CPU or GPU.
262261
*/
263-
void setDeviceType(const string& device_type);
262+
void setDeviceType(const String& device_type);
264263

265264
/** @brief Set device ID information for feature extraction.
266265
Useful to change device without the need to reload the net. Only used for GPU.
@@ -274,15 +273,15 @@ namespace cnn_3dobj
274273
@param trained_file Path of prototxt which defining the structure of CNN.
275274
@param mean_file Path of mean file(option).
276275
*/
277-
void loadNet(const string& model_file, const string& trained_file, const string& mean_file = "");
276+
void loadNet(const String& model_file, const String& trained_file, const String& mean_file = "");
278277

279278
/** @brief Extract features from a single image or from a vector of images.
280279
If loadNet was not called before, this method invocation will fail.
281280
@param inputimg Input images.
282281
@param feature Output features.
283282
@param feature_blob Layer which the feature is extracted from.
284283
*/
285-
void extract(InputArrayOfArrays inputimg, OutputArray feature, std::string feature_blob);
284+
void extract(InputArrayOfArrays inputimg, OutputArray feature, String feature_blob);
286285
};
287286
//! @}
288287
}

modules/cnn_3dobj/samples/datagen.sh

Lines changed: 0 additions & 90 deletions
This file was deleted.

0 commit comments

Comments
 (0)