mirror of
https://github.com/kerberos-io/openalpr-base.git
synced 2025-10-07 00:02:52 +08:00
Merge pull request #172 from peters/master
Add overload for regionsOfInterest.
This commit is contained in:
@@ -38,5 +38,3 @@ using namespace System::Security::Permissions;
|
|||||||
[assembly:ComVisible(false)];
|
[assembly:ComVisible(false)];
|
||||||
|
|
||||||
[assembly:CLSCompliantAttribute(true)];
|
[assembly:CLSCompliantAttribute(true)];
|
||||||
|
|
||||||
[assembly:SecurityPermission(SecurityAction::RequestMinimum, UnmanagedCode = true)];
|
|
||||||
|
@@ -409,8 +409,9 @@ namespace openalprnet {
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
AlprResultsNet^ Recognize(MemoryStream^ memoryStream, List<System::Drawing::Rectangle>^ regionsOfInterest)
|
AlprResultsNet^ Recognize(MemoryStream^ memoryStream, List<System::Drawing::Rectangle>^ regionsOfInterest)
|
||||||
{
|
{
|
||||||
std::vector<char> p = AlprHelper::MemoryStreamToVector(memoryStream);
|
std::vector<char> buffer = AlprHelper::MemoryStreamToVector(memoryStream);
|
||||||
AlprResults results = m_Impl->recognize(p);
|
std::vector<AlprRegionOfInterest> rois = AlprHelper::ToVector(regionsOfInterest);
|
||||||
|
AlprResults results = m_Impl->recognize(buffer, rois);
|
||||||
return gcnew AlprResultsNet(results);
|
return gcnew AlprResultsNet(results);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -427,8 +428,9 @@ namespace openalprnet {
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="imageBuffer">Bytes representing image data</param>
|
/// <param name="imageBuffer">Bytes representing image data</param>
|
||||||
AlprResultsNet^ Recognize(cli::array<Byte>^ imageBuffer, List<System::Drawing::Rectangle>^ regionsOfInterest) {
|
AlprResultsNet^ Recognize(cli::array<Byte>^ imageBuffer, List<System::Drawing::Rectangle>^ regionsOfInterest) {
|
||||||
std::vector<char> p = AlprHelper::ToVector(imageBuffer);
|
std::vector<char> buffer = AlprHelper::ToVector(imageBuffer);
|
||||||
AlprResults results = m_Impl->recognize(p);
|
std::vector<AlprRegionOfInterest> rois = AlprHelper::ToVector(regionsOfInterest);
|
||||||
|
AlprResults results = m_Impl->recognize(buffer, rois);
|
||||||
return gcnew AlprResultsNet(results);
|
return gcnew AlprResultsNet(results);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -68,6 +68,11 @@ namespace alpr
|
|||||||
return impl->recognize(imageBytes);
|
return impl->recognize(imageBytes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AlprResults Alpr::recognize(std::vector<char> imageBytes, std::vector<AlprRegionOfInterest> regionsOfInterest)
|
||||||
|
{
|
||||||
|
return impl->recognize(imageBytes, regionsOfInterest);
|
||||||
|
}
|
||||||
|
|
||||||
AlprResults Alpr::recognize(unsigned char* pixelData, int bytesPerPixel, int imgWidth, int imgHeight, std::vector<AlprRegionOfInterest> regionsOfInterest)
|
AlprResults Alpr::recognize(unsigned char* pixelData, int bytesPerPixel, int imgWidth, int imgHeight, std::vector<AlprRegionOfInterest> regionsOfInterest)
|
||||||
{
|
{
|
||||||
return impl->recognize(pixelData, bytesPerPixel, imgWidth, imgHeight, regionsOfInterest);
|
return impl->recognize(pixelData, bytesPerPixel, imgWidth, imgHeight, regionsOfInterest);
|
||||||
|
@@ -132,8 +132,11 @@ namespace alpr
|
|||||||
// Recognize from an image on disk
|
// Recognize from an image on disk
|
||||||
AlprResults recognize(std::string filepath);
|
AlprResults recognize(std::string filepath);
|
||||||
|
|
||||||
// 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).
|
||||||
AlprResults recognize(std::vector<char> imageBytes);
|
AlprResults recognize(std::vector<char> imageBytes);
|
||||||
|
|
||||||
|
// Recognize from byte data representing an encoded image (e.g., BMP, PNG, JPG, GIF etc).
|
||||||
|
AlprResults recognize(std::vector<char> imageBytes, std::vector<AlprRegionOfInterest> regionsOfInterest);
|
||||||
|
|
||||||
// Recognize from raw pixel data.
|
// Recognize from raw pixel data.
|
||||||
AlprResults recognize(unsigned char* pixelData, int bytesPerPixel, int imgWidth, int imgHeight, std::vector<AlprRegionOfInterest> regionsOfInterest);
|
AlprResults recognize(unsigned char* pixelData, int bytesPerPixel, int imgWidth, int imgHeight, std::vector<AlprRegionOfInterest> regionsOfInterest);
|
||||||
|
@@ -345,6 +345,16 @@ namespace alpr
|
|||||||
return this->recognize(img);
|
return this->recognize(img);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AlprResults AlprImpl::recognize(std::vector<char> imageBytes, std::vector<AlprRegionOfInterest> regionsOfInterest)
|
||||||
|
{
|
||||||
|
cv::Mat img = cv::imdecode(cv::Mat(imageBytes), 1);
|
||||||
|
|
||||||
|
std::vector<cv::Rect> rois = convertRects(regionsOfInterest);
|
||||||
|
|
||||||
|
AlprFullDetails fullDetails = recognizeFullDetails(img, rois);
|
||||||
|
return fullDetails.results;
|
||||||
|
}
|
||||||
|
|
||||||
AlprResults AlprImpl::recognize( unsigned char* pixelData, int bytesPerPixel, int imgWidth, int imgHeight, std::vector<AlprRegionOfInterest> regionsOfInterest)
|
AlprResults AlprImpl::recognize( unsigned char* pixelData, int bytesPerPixel, int imgWidth, int imgHeight, std::vector<AlprRegionOfInterest> regionsOfInterest)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@@ -76,6 +76,7 @@ namespace alpr
|
|||||||
AlprFullDetails recognizeFullDetails(cv::Mat img, std::vector<cv::Rect> regionsOfInterest);
|
AlprFullDetails recognizeFullDetails(cv::Mat img, std::vector<cv::Rect> regionsOfInterest);
|
||||||
|
|
||||||
AlprResults recognize( std::vector<char> imageBytes );
|
AlprResults recognize( std::vector<char> imageBytes );
|
||||||
|
AlprResults recognize( std::vector<char> imageBytes, std::vector<AlprRegionOfInterest> regionsOfInterest );
|
||||||
AlprResults recognize( unsigned char* pixelData, int bytesPerPixel, int imgWidth, int imgHeight, std::vector<AlprRegionOfInterest> regionsOfInterest );
|
AlprResults recognize( unsigned char* pixelData, int bytesPerPixel, int imgWidth, int imgHeight, std::vector<AlprRegionOfInterest> regionsOfInterest );
|
||||||
AlprResults recognize( cv::Mat img );
|
AlprResults recognize( cv::Mat img );
|
||||||
AlprResults recognize( cv::Mat img, std::vector<cv::Rect> regionsOfInterest );
|
AlprResults recognize( cv::Mat img, std::vector<cv::Rect> regionsOfInterest );
|
||||||
|
Reference in New Issue
Block a user