mirror of
https://github.com/kerberos-io/openalpr-base.git
synced 2025-10-06 15:26:53 +08:00
Re-enabled inverting plates for white-on-black text
This commit is contained in:
@@ -17,6 +17,8 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <opencv2/core/core.hpp>
|
||||||
|
|
||||||
#include "charactersegmenter.h"
|
#include "charactersegmenter.h"
|
||||||
|
|
||||||
using namespace cv;
|
using namespace cv;
|
||||||
@@ -37,9 +39,12 @@ CharacterSegmenter::CharacterSegmenter(PipelineData* pipeline_data)
|
|||||||
timespec startTime;
|
timespec startTime;
|
||||||
getTime(&startTime);
|
getTime(&startTime);
|
||||||
|
|
||||||
|
if (pipeline_data->plate_inverted)
|
||||||
|
bitwise_not(pipeline_data->crop_gray, pipeline_data->crop_gray);
|
||||||
pipeline_data->clearThresholds();
|
pipeline_data->clearThresholds();
|
||||||
pipeline_data->thresholds = produceThresholds(pipeline_data->crop_gray, config);
|
pipeline_data->thresholds = produceThresholds(pipeline_data->crop_gray, config);
|
||||||
|
|
||||||
|
|
||||||
medianBlur(pipeline_data->crop_gray, pipeline_data->crop_gray, 3);
|
medianBlur(pipeline_data->crop_gray, pipeline_data->crop_gray, 3);
|
||||||
|
|
||||||
cout << "Segmenter: inverted: " << pipeline_data->plate_inverted << endl;
|
cout << "Segmenter: inverted: " << pipeline_data->plate_inverted << endl;
|
||||||
|
Reference in New Issue
Block a user