You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
809 B
C++
43 lines
809 B
C++
//
|
|
// Created by UnknownObject on 2022/9/21.
|
|
// Copyright (c) 2022 UnknownNetworkService. All rights reserved.
|
|
//
|
|
|
|
#ifndef MAINCAR_TRAFFIC_LIGHT_H
|
|
#define MAINCAR_TRAFFIC_LIGHT_H
|
|
|
|
//交通灯识别
|
|
|
|
#include <jni.h>
|
|
#include <cmath>
|
|
#include <string>
|
|
#include <iostream>
|
|
#include "public_types.h"
|
|
#include "opencv_support.h"
|
|
#include "debug_logger.h"
|
|
#include <opencv2/highgui.hpp>
|
|
|
|
#define TRAFFIC_LIGHT_RECO_VERSION "1.0.0"
|
|
|
|
namespace uns
|
|
{
|
|
class TrafficLight
|
|
{
|
|
private:
|
|
int tri_max(int a, int b, int c);
|
|
|
|
cv::Mat GetLight(const cv::Mat &img);
|
|
|
|
cv::Rect GetMaxRect(const cv::Mat &img);
|
|
|
|
bool MuchLarger(int a, int b, double rate);
|
|
|
|
Light::TL_COLOR GetImageColor(const cv::Mat &img, double rate);
|
|
|
|
public:
|
|
Light::TL_COLOR Reco(cv::Mat &img);
|
|
};
|
|
};
|
|
|
|
#endif //MAINCAR_TRAFFIC_LIGHT_H
|