removed workaround codes

This commit is contained in:
Masroor Ehsan
2015-01-07 00:29:21 +06:00
parent bc0c569f39
commit 8121672cce

View File

@@ -336,18 +336,19 @@ namespace openalprnet {
/// Recognize from an image on disk /// Recognize from an image on disk
/// </summary> /// </summary>
AlprResultsNet^ recognize(System::String^ filepath) { AlprResultsNet^ recognize(System::String^ filepath) {
/*
AlprResults results = m_Impl->recognize(marshal_as<std::string>(filepath)); AlprResults results = m_Impl->recognize(marshal_as<std::string>(filepath));
return gcnew AlprResultsNet(results); return gcnew AlprResultsNet(results);
*/ }
/// <summary>
/// Recognize from an image on disk
/// </summary>
AlprResultsNet^ recognize(System::String^ filepath, List<System::Drawing::Rectangle>^ regionsOfInterest) {
cv::Mat frame = cv::imread( marshal_as<std::string>(filepath) ); cv::Mat frame = cv::imread( marshal_as<std::string>(filepath) );
std::vector<AlprRegionOfInterest> rois = AlprHelper::ToVector(regionsOfInterest);
std::vector<AlprRegionOfInterest> regionsOfInterest; AlprResults results = m_Impl->recognize(frame.data, frame.elemSize(), frame.cols, frame.rows, rois );
regionsOfInterest.push_back(AlprRegionOfInterest(0,0, frame.cols, frame.rows));
AlprResults results = m_Impl->recognize(frame.data, frame.elemSize(), frame.cols, frame.rows, regionsOfInterest );
return gcnew AlprResultsNet(results); return gcnew AlprResultsNet(results);
} }
/// <summary> /// <summary>
/// Recognize from byte data representing an encoded image (e.g., BMP, PNG, JPG, GIF etc). /// Recognize from byte data representing an encoded image (e.g., BMP, PNG, JPG, GIF etc).
@@ -378,11 +379,6 @@ namespace openalprnet {
return AlprHelper::ToManagedString(Alpr::getVersion()); return AlprHelper::ToManagedString(Alpr::getVersion());
} }
// System::String^ toJson(AlprResultsNet^ results) {
// std::string json = Alpr::toJson(marshal_as<AlprResults>(results));
// return AlprHelper::ToManagedString(json);
// }
protected: protected:
// Deallocate the native object on the finalizer just in case no destructor is called // Deallocate the native object on the finalizer just in case no destructor is called
!AlprNet() { !AlprNet() {