/*
* Copyright (c) 2013 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 .
*/
#ifndef OPENALPR_LICENSEPLATECANDIDATE_H
#define OPENALPR_LICENSEPLATECANDIDATE_H
#include
#include
#include
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/core/core.hpp"
#include "utility.h"
#include "constants.h"
#include "platelines.h"
#include "characterregion.h"
#include "charactersegmenter.h"
#include "platecorners.h"
#include "config.h"
//vector getCharacterRegions(Mat frame, vector regionsOfInterest);
//vector getCharSegmentsBetweenLines(Mat img, vector > contours, LineSegment top, LineSegment bottom);
class LicensePlateCandidate
{
public:
LicensePlateCandidate(cv::Mat frame, cv::Rect regionOfInterest, Config* config);
virtual ~LicensePlateCandidate();
float confidence; // 0-100
//vector points; // top-left, top-right, bottom-right, bottom-left
std::vector plateCorners;
void recognize();
cv::Mat deskewed;
CharacterSegmenter* charSegmenter;
private:
Config* config;
cv::Mat frame;
cv::Rect plateRegion;
cv::Mat filterByCharacterHue(std::vector > charRegionContours);
std::vector findPlateCorners(cv::Mat inputImage, PlateLines plateLines, CharacterRegion charRegion); // top-left, top-right, bottom-right, bottom-left
std::vector transformPointsToOriginalImage(cv::Mat bigImage, cv::Mat smallImage, cv::Rect region, std::vector corners);
cv::Mat deSkewPlate(cv::Mat inputImage, std::vector corners);
};
#endif // OPENALPR_LICENSEPLATECANDIDATE_H