Added prewarp to ALPR analysis

This commit is contained in:
Matt Hill
2015-03-28 13:13:38 -04:00
parent 7dc085df70
commit 96135dfc56
9 changed files with 369 additions and 13 deletions

56
src/openalpr/prewarp.h Normal file
View File

@@ -0,0 +1,56 @@
/*
* Copyright (c) 2015 New Designs Unlimited, LLC
* Opensource Automated License Plate Recognition [http://www.openalpr.com]
*
* This file is part of OpenAlpr.
*
* OpenAlpr is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License
* version 3 as published by the Free Software Foundation
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef OPENALPR_PREWARP_H
#define OPENALPR_PREWARP_H
#include "config.h"
#include "utility.h"
#include "opencv2/imgproc/imgproc.hpp"
#include "detection/detector.h"
namespace alpr
{
class PreWarp {
public:
PreWarp(Config* config);
virtual ~PreWarp();
cv::Mat warpImage(cv::Mat image);
std::vector<cv::Point2f> projectPoints(std::vector<cv::Point2f> points, bool inverse);
std::vector<cv::Rect> projectRects(std::vector<cv::Rect> rects, int maxWidth, int maxHeight, bool inverse);
void projectPlateRegions(std::vector<PlateRegion>& plateRegions, int maxWidth, int maxHeight, bool inverse);
bool valid;
private:
Config* config;
cv::Mat transform;
float w, h, rotationx, rotationy, rotationz, dist, panX, panY;
cv::Mat findTransform(float w, float h, float rotationx, float rotationy, float rotationz, float panX, float panY, float dist);
};
}
#endif /* OPENALPR_PREWARP_H */