国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

c++版本的opencv檢測PCB上的燈珠(顏色)

這篇具有很好參考價值的文章主要介紹了c++版本的opencv檢測PCB上的燈珠(顏色)。希望對大家有所幫助。如果存在錯誤或未考慮完全的地方,請大家不吝賜教,您也可以點(diǎn)擊"舉報違法"按鈕提交疑問。

? ?不多廢話,直接上代碼:

#include "read.hpp"
#include <math.h>

#include <algorithm>

//圓形PCB板,有l(wèi)ed燈點(diǎn)亮?xí)r
int DetectImage::native_read_pic(cv::String path){
    if(access(path.c_str(),F_OK)!=0){
        f << "Open pic file failed!" << std::endl;
        return -1;
    }
    f << "native_read_pic run... " << std::endl;
    cv::namedWindow("camera", cv::WINDOW_AUTOSIZE);
    cv::Mat img = cv::imread(path);
    cv::Mat resize_img(img);
    cv::resize(img, resize_img, cv::Size(img.cols/cameraInfo.scale, img.rows/cameraInfo.scale));//縮小大小
    
    cv::Mat draw_img(resize_img);//拷貝一張,便于畫出輪廓
    cv::cvtColor(resize_img,resize_img,cv::COLOR_BGR2GRAY);//變成灰度
    
    cv::GaussianBlur(resize_img,resize_img,cv::Size(11,11),0);//高斯變化
    cv:threshold(resize_img,resize_img,cameraInfo.threshold_value, cameraInfo.maxval,cv::THRESH_BINARY);//二值化

    std::vector<std::vector<cv::Point>> contours;
    std::vector<cv::Vec4i> hierarchy;

    cv::findContours(resize_img,contours,hierarchy,cv::RETR_EXTERNAL,cv::CHAIN_APPROX_SIMPLE);
    std::cout << contours.size() << std::endl;

    //計算面積contourArea
    std::vector<double> Area_all;
    for (int i = 0; i < contours.size(); i++)
    {
        Area_all.push_back(cv::contourArea(contours[i]));
    }
    double sum = std::accumulate(std::begin(Area_all), std::end(Area_all), 0.0);  
    double mean =  sum / Area_all.size(); //周長的均值

    std::vector<double>::iterator biggest = std::max_element(Area_all.begin(), Area_all.end());

    int find_index = -1;
    if(*biggest > mean *5){//如果最大值>平均值*5的話
        find_index = std::distance(Area_all.begin(), biggest);
        char text_show[16]={0};
        sprintf(text_show,"Numis:%d",find_index);
	    cv::putText(draw_img, text_show, cv::Point(20, 20), cv::FONT_HERSHEY_SIMPLEX, 0.9, cv::Scalar(255, 0, 0));
    }
    for (int i = 0; i < contours.size(); i++){
        if(i != find_index){
            cv::drawContours(draw_img,contours,i,cv::Scalar(0, 0, 255), 1,8,hierarchy);
        }
    }
    
    cv::imshow("camera", draw_img);
    cv::waitKey(0);	
    return contours.size();
}

// camera open
int DetectImage::camera_operationImage(unsigned char read_or_wirte,const char* path){ //>> 1920×1080 == 1080p
    //打開一個默認(rèn)的相機(jī)
	cv::VideoCapture capture(cameraInfo.camera_id);
	//檢查是否成功打開
	if (!capture.isOpened()){
        f << "Open capture failed!" << cameraInfo.camera_id <<  std::endl;
        return -1;
    }
		
    //設(shè)置攝像頭的分辨率
	capture.set(cv::CAP_PROP_FRAME_WIDTH, cameraInfo.width);
	capture.set(cv::CAP_PROP_FRAME_HEIGHT, cameraInfo.height);
	capture.set(cv::CAP_PROP_FOURCC, cv::VideoWriter::fourcc('M', 'J', 'P', 'G'));
	//攝像頭幀數(shù)
	capture.set(cv::CAP_PROP_FPS, cameraInfo.fps);
    static unsigned char save_number = 1;
    while(1)
    {
        cv::Mat frame;
        capture>>frame;
        if(read_or_wirte == 0){
            cv::imshow("camera",frame);
        }
        if(save_number && read_or_wirte){
            if(path == NULL || strlen(path) == 0){
                cv::imwrite(cameraInfo.save_pic_path,frame);
            }else{
                cv::imwrite(path,frame);
            }
            
            save_number--;
            cv::imshow("camera",frame);
        }
        if(cv::waitKey(30)==27){
            break;
        }
        if(save_number==0){
            break;
        }
    }
    return 0;
}
//讀配置文件
int DetectImage::readjson(std::string json_path){
    Json::Reader     json_reader;
	Json::Value      json_value;
	
	std::ifstream    infile(json_path, std::ios::binary);
	if(!infile.is_open())
	{
		f << "Open config file failed!" << std::endl;
		return -1;
	}
    if(json_reader.parse(infile, json_value)){
        std::string     pic_path = json_value["SavePath"].asString();
        std::string     log_path = json_value["LogFile"].asString();
        //...
        cameraInfo.save_pic_path = pic_path;
        cameraInfo.logs_path = log_path;
        cameraInfo.camera_id = json_value["camera_id"].asInt();  // 讀取字符串型參數(shù)
		cameraInfo.threshold_value = json_value["threshold"].asInt();
        cameraInfo.maxval = json_value["maxval"].asInt();
        cameraInfo.width  = json_value["width"].asInt();
        cameraInfo.height = json_value["height"].asInt();
	    cameraInfo.fps    = json_value["fps"].asInt();
        cameraInfo.scale    = json_value["scale"].asInt();

        //add
        cameraInfo.circles.is_find_circles      = json_value["circles"]["is_find_circles"].asBool();
        cameraInfo.circles.is_draw_circles_dist = json_value["circles"]["is_draw_circles_dist"].asBool();
        cameraInfo.circles.minCircles_minRadius = json_value["circles"]["minCircles_minRadius"].asInt();
        cameraInfo.circles.minCircles_maxRadius = json_value["circles"]["minCircles_maxRadius"].asInt();
        cameraInfo.circles.maxCircles_minRadius = json_value["circles"]["maxCircles_minRadius"].asInt();
        cameraInfo.circles.maxCircles_maxRadius = json_value["circles"]["maxCircles_maxRadius"].asInt();
        //add 2
        cameraInfo.colors.red_color_hmin = json_value["colors"]["red_color_hmin"].asInt();
        cameraInfo.colors.red_color_hmax = json_value["colors"]["red_color_hmax"].asInt();
        cameraInfo.colors.green_color_hmin = json_value["colors"]["green_color_hmin"].asInt();
        cameraInfo.colors.green_color_hmax = json_value["colors"]["green_color_hmax"].asInt();
        cameraInfo.colors.blue_color_hmin = json_value["colors"]["blue_color_hmin"].asInt();
        cameraInfo.colors.blue_color_hmax = json_value["colors"]["blue_color_hmax"].asInt();
        cameraInfo.colors.color_smin = json_value["colors"]["color_smin"].asInt();
        cameraInfo.colors.color_smax = json_value["colors"]["color_smax"].asInt();
    }else{
        init_default_camera();
    }
    infile.close();
    return 0;
}
//設(shè)置默認(rèn)參數(shù)
void DetectImage::init_default_camera(){
    //set default settings
    cameraInfo.camera_id = 0;
    cameraInfo.scale    = 1;
    cameraInfo.threshold_value = 209;
    cameraInfo.maxval = 255;
    cameraInfo.width  = 640;
    cameraInfo.height = 480;
    cameraInfo.fps    = 60;
    cameraInfo.logs_path = "./LogFile.txt";
    cameraInfo.save_pic_path = "./Detect_image.jpeg";
    //add
    cameraInfo.circles =  {false,false,5,15,100,120};
    cameraInfo.colors =   {0,10,35,77,100,124,43,255};
    f << "use default_camera_params !" << std::endl;
}

int DetectImage::process(int argc, char* argv[]){
    std::ofstream file_writer(cameraInfo.logs_path, std::ios_base::out);
	//追加寫入,在原來基礎(chǔ)上加了ios::app 
	f.open(cameraInfo.logs_path,std::ios::out|std::ios::app);
	//輸入你想寫入的內(nèi)容 
    if(argc < 2){
        f << "One argument expected"<< std::endl;
        f.close();
        return 0;
    }
    if(argc > 5){
        f << "Too many arguments not supplied"<< std::endl;
        f.close();
        return 0;
    }
    int ret = 0;
    if(strcmp(argv[1],"preview") == 0){
        f << "preview process..."<< std::endl;
        camera_operationImage(0,NULL);
    }else if(strcmp(argv[1],"save") == 0){
        camera_operationImage(1,argv[2]);
        f << "save 1 process..."<< std::endl;
    }else if(strcmp(argv[1],"detect") == 0){
        f << "detect process..."<< std::endl;
        int read_ret = 0;
        if(argc >= 2){
            if(argc >= 4){
                if(strlen(argv[3]) > 0){
                    if(strcmp(argv[3],"circles") == 0){
                        ret   = find_circles(argv[2]);
                    }else if(strcmp(argv[3],"colors") == 0){
                        ret   = find_colors(argv[2],argv[4]);
                    }
                    return ret;
                }
            }
            if(strlen(argv[2]) > 0){
                f << "use cmd params path detect..."<< std::endl;
                read_ret = native_read_pic(argv[2]);
            }else{
                f << "use config file path detect..."<< std::endl;
                read_ret = native_read_pic(cameraInfo.save_pic_path);
            }
        }
        char ret_str[32]={0};
        sprintf(ret_str,"detect_completed:%d",read_ret);
        f << ret_str << std::endl;
    }
    f << "normal exit"<< std::endl;
    f.close();
    return  0;
}
//得到2點(diǎn)之間的距離
float DetectImage::getDistance(cv::Point pointO, cv::Point pointA)
{
    float distance;
    distance = powf((pointO.x - pointA.x), 2) + powf((pointO.y - pointA.y), 2);
    distance = sqrtf(distance);
    return distance;
}

//找圓
int DetectImage::find_circles(cv::String path){
    cv::namedWindow("find_circles", cv::WINDOW_AUTOSIZE);
    if(access(path.c_str(),F_OK)!=0){
        f << "Open pic file failed!" << std::endl;
        return -1;
    }
    f << "find_circles run... " << std::endl;
    if(!cameraInfo.circles.is_find_circles){
        f << "not find_circles flag... " << std::endl;
        return -2;
    }
    cv::Mat img = cv::imread(path);

    cv::Mat resize_img(img);
    cv::resize(img, resize_img, cv::Size(img.cols/cameraInfo.scale, img.rows/cameraInfo.scale));//縮小大小
    cv::Mat draw_img(resize_img);
    cv::cvtColor(resize_img,resize_img,cv::COLOR_BGR2GRAY);//變成灰度
    //cv:threshold(resize_img,resize_img,cameraInfo.threshold_value, cameraInfo.maxval,cv::THRESH_BINARY);//二值化
    cv::medianBlur(resize_img,resize_img,3);

    //找小圓
    std::vector<cv::Vec3f> circles;
    cv::HoughCircles(resize_img,circles,cv::HOUGH_GRADIENT,1,10,100,30,cameraInfo.circles.minCircles_minRadius,cameraInfo.circles.minCircles_maxRadius);//should add config params 
    f << "circles_size :" << circles.size()  << std::endl;
    //找大圓
    std::vector<cv::Vec3f> Maxcircles;
    cv::HoughCircles(resize_img,Maxcircles,cv::HOUGH_GRADIENT,1,10,100,30,cameraInfo.circles.maxCircles_minRadius,cameraInfo.circles.maxCircles_maxRadius);//should add config params2
    f << "Maxcircles_size :" << Maxcircles.size()  << std::endl;
    
    std::vector<double> max_dist_circle;

    for (size_t i = 0; i < circles.size(); i++)
    {
        /* code */
        cv::Vec3f circle = circles[i];
        cv::circle(draw_img,cv::Point(circle[0],circle[1]),circle[2],cv::Scalar(0,255,0));//小圓
        cv::circle(draw_img,cv::Point(circle[0],circle[1]),2,cv::Scalar(0,0,255));//小圓圓心
    }

    //如果找到的大圓數(shù)量大于2個,畫出?
    if(Maxcircles.size() > 2)
    {
        cv::Vec3f circle = Maxcircles[0];
        cv::circle(draw_img,cv::Point(circle[0],circle[1]),circle[2],cv::Scalar(19,69,139));
        //cv::circle(draw_img,cv::Point(circle[0],circle[1]),2,cv::Scalar(0,0,255));
    }
    
    max_dist_circle.push_back(0.0f);
    for (size_t i = 1; i < circles.size(); i++){
        cv::Vec3f o_circle = circles[0];//起始圓心
        cv::Vec3f circle   = circles[i];//其他圓心

        double dist = getDistance(cv::Point(o_circle[0],o_circle[1]),cv::Point(circle[0],circle[1]));
        max_dist_circle.push_back(dist);

        //std::cout << dist << std::endl;
    }

    int max_pos = std::max_element(max_dist_circle.begin(), max_dist_circle.end())- max_dist_circle.begin();
    f << "max pos:" << max_pos  << std::endl;

    //check range max_pos :   1  ~  size(max_dist_circle) 
    if(circles.size() > max_pos){
        cv::Vec3f circles_LineA = circles[0];
        cv::Vec3f circles_LineB = circles[max_pos];
        //是否畫出小圓間的 最大距離 直線
        if(cameraInfo.circles.is_draw_circles_dist){
            cv::line(draw_img,cv::Point(circles_LineA[0],circles_LineA[1]),cv::Point(circles_LineB[0],circles_LineB[1]),cv::Scalar(34,34,178));
        }
    }

    cv::imshow("find_circles", draw_img);
    cv::waitKey(0);	
    return 0;
}

/**
 * @brief detectHSColor 提取圖像中具有特定顏色范圍的區(qū)域,圖像是3 通道 BGR 圖像
 * @param image 輸入圖像,要求是 3 通道 BGR 圖像
 * @param minHue  Hue 的最小值,Hue 范圍 0-179 (Hue本質(zhì)是個角度,在0-360之間,OpenCV 用 0-180 表示。0表示紅色。)
 * @param maxHue  Hue 的最大值,Hue 范圍 0-179
 * @param minSat Sat 的最小值,Sat 范圍 0-255
 * @param maxSat Sat 的最大值,Sat 范圍 0-255
 * @param mask 提取出的區(qū)域
 */
void detectHSColor(const cv::Mat &image,
                   double minHue, double maxHue,
                   double minSat, double maxSat,
                   cv::Mat &mask)
{
    cv::Mat hsv;
    cv::cvtColor(image, hsv, cv::COLOR_BGR2HSV);
    std::vector<cv::Mat> channels;
    cv::split(hsv, channels);
    cv::Mat mask1, mask2, hueMask;
    cv::threshold(channels[0], mask1, maxHue, 255, cv::THRESH_BINARY_INV);
    cv::threshold(channels[0], mask2, minHue, 255, cv::THRESH_BINARY);
    if(minHue < maxHue)
    {
        hueMask = mask1 & mask2;
    }
    else
    {
        hueMask = mask1 | mask2;
    }
    cv::Mat satMask;
    cv::inRange(channels[1], minSat, maxSat, satMask);
    mask = hueMask & satMask;
}

//找顏色
int DetectImage::find_colors(cv::String path,char* argv){
    cv::namedWindow("find_colors", cv::WINDOW_AUTOSIZE);
    if(access(path.c_str(),F_OK)!=0){
        f << "Open pic file failed!" << std::endl;
        return -1;
    }
    if(argv == NULL) {
        f << "plase input colors type!" << std::endl;
        return -2;
    }
    f << "find_colors: " << argv << " , run... " << std::endl;

    cv::Mat img = cv::imread(path);
	
    cv::Mat resize_img(img);
    if(cameraInfo.scale != 1){
        cv::resize(img, resize_img, cv::Size(img.cols/cameraInfo.scale, img.rows/cameraInfo.scale));//縮小大小
    }
    cv::Mat draw_img(resize_img);
    
    unsigned char h_min = 0;
    unsigned char h_max = 0;
    unsigned char s_min = cameraInfo.colors.color_smin;
    unsigned char s_max = cameraInfo.colors.color_smax;

    if(strcmp(argv,"red") == 0){
        h_min = cameraInfo.colors.red_color_hmin;
        h_max = cameraInfo.colors.red_color_hmax;
    }else if(strcmp(argv,"green") == 0){
        h_min = cameraInfo.colors.green_color_hmin;
        h_max = cameraInfo.colors.green_color_hmax;
    }else if(strcmp(argv,"blue") == 0){
        h_min = cameraInfo.colors.blue_color_hmin;
        h_max = cameraInfo.colors.blue_color_hmax;
    }else{
        return 0;
    }

    detectHSColor(resize_img,h_min,h_max,s_min,s_max,resize_img);
    
    //找輪廓
    std::vector<std::vector<cv::Point>> contours;
    std::vector<cv::Vec4i> hierarchy;

    cv::findContours(resize_img,contours,hierarchy,cv::RETR_EXTERNAL,cv::CHAIN_APPROX_SIMPLE);
    f << "find_colors_contours.size:" << contours.size() << std::endl;

    //計算面積contourArea
    std::vector<double> Area_all;
    for (int i = 0; i < contours.size(); i++)
    {
        Area_all.push_back(cv::contourArea(contours[i]));
    }
    double sum = std::accumulate(std::begin(Area_all), std::end(Area_all), 0.0);  
    double mean =  sum / Area_all.size(); //面積的均值
    f << "find_colors_area,mean:" << mean << std::endl;

    cv::imshow("find_colors", resize_img);
    cv::waitKey(0);
    return 0;
}

下面是main.cpp 的 部分:

#include <opencv2/opencv.hpp>
#include <opencv2/highgui.hpp>
#include <iostream>
#include <unistd.h>
#include <thread>
#include <string.h>
#include "read.hpp"

int main(int argc, char* argv[])
{
    DetectImage detectImage;
    detectImage.readjson("./Config.json");
    detectImage.process(argc,argv);
    return 0;  
}

下面是 頭文件?


#ifndef __READ_HPP
#define __READ_HPP

#include <opencv2/opencv.hpp>
#include <opencv2/highgui.hpp>
#include <iostream>
#include <unistd.h>
#include <numeric>
#include "json/json.h"
#include <fstream>
#include <fstream>
#include <read.hpp>
#include <thread>
#include <string.h>

typedef struct _Circles{
    bool            is_find_circles;
    bool            is_draw_circles_dist;
    unsigned int    minCircles_minRadius;
    unsigned int    minCircles_maxRadius;
    unsigned int    maxCircles_minRadius;
    unsigned int    maxCircles_maxRadius;
}Circles;

typedef struct _RGBColors{
    unsigned char red_color_hmin;
    unsigned char red_color_hmax;
    unsigned char green_color_hmin;
    unsigned char green_color_hmax;
    unsigned char blue_color_hmin;
    unsigned char blue_color_hmax;
    unsigned char color_smin;
    unsigned char color_smax;
}RGBColors;

typedef struct _CameraInfo {
    unsigned char    fps;
    unsigned char    camera_id;
    unsigned int     threshold_value;
    unsigned int     maxval;
    unsigned int     width;
    unsigned int     height;
    unsigned int     scale;
    Circles          circles;
    RGBColors        colors;
    std::string      save_pic_path;
    std::string      logs_path;
}CameraInfo;

class DetectImage
{
    std::fstream f;
    CameraInfo   cameraInfo;
    int  camera_operationImage(unsigned char read_or_wirte,const char* path);
    void init_default_camera();
    int  native_read_pic(cv::String path);
public:
    int readjson(std::string json_path);
    int process(int argc, char* argv[]);

    //add
    int find_circles(cv::String path);
    int find_colors(cv::String path,char* argv);
    float getDistance(cv::Point pointO, cv::Point pointA);//兩點(diǎn)之間距離
};
#endif

附錄 上 json配置文件內(nèi)容:

{
    "camera_id":0,
    "scale"    :1,
    "threshold":200,
    "maxval"   :255,
    "width"    :640,
    "height"   :480,
    "fps"      :60,
    "SavePath":"./Detect_image.jpeg",
    "LogFile":"./LogFile.txt",
    "circles"   :{
        "is_find_circles":true,
        "is_draw_circles_dist":false,
        "minCircles_minRadius":25,
        "minCircles_maxRadius":45,
        "maxCircles_minRadius":300,
        "maxCircles_maxRadius":560
    },
    "colors" :{
        "red_color_hmin":0,
        "red_color_hmax":10,
        "green_color_hmin":35,
        "green_color_hmax":77,
        "blue_color_hmin":100,
        "blue_color_hmax":124,
        "color_smin":43,
        "color_smax":255
    }
}

jsoncpp 的部分需自行加載進(jìn)來。謝謝~?文章來源地址http://www.zghlxwxcb.cn/news/detail-524563.html

到了這里,關(guān)于c++版本的opencv檢測PCB上的燈珠(顏色)的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請點(diǎn)擊違法舉報進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

  • YOLOV5-LITE實(shí)時目標(biāo)檢測(onnxruntime部署+opencv獲取攝像頭+NCNN部署)python版本和C++版本

    使用yolov5-lite自帶的export.py導(dǎo)出onnx格式,圖像大小設(shè)置320,batch 1 之后可以使用 onnxsim對模型進(jìn)一步簡化 onnxsim參考鏈接:onnxsim-讓導(dǎo)出的onnx模型更精簡_alex1801的博客-CSDN博客 這個版本的推理FPS能有11+FPS 這兩處換成自己的模型和訓(xùn)練的類別即可: ??? parser.add_argument(\\\'--modelpa

    2024年02月04日
    瀏覽(30)
  • VC++中使用OpenCV進(jìn)行顏色檢測

    VC++中使用OpenCV進(jìn)行顏色檢測

    在VC++中使用OpenCV進(jìn)行顏色檢測非常簡單,首選讀取一張彩色圖像,并調(diào)用函數(shù) cvtColor(img, imgHSV, COLOR_BGR2HSV); 函數(shù)將原圖img轉(zhuǎn)換成HSV圖像imgHSV,再設(shè)置好HSV三個分量的上限和下限值,調(diào)用 inRange 函數(shù) inRange(imgHSV, lower, upper, mask); 將HSV色彩圖像轉(zhuǎn)換成掩碼圖,掩碼圖中只有黑白二

    2024年01月21日
    瀏覽(23)
  • 使用 ESP32 CAM 和 OpenCV 進(jìn)行顏色檢測和跟蹤

    這個項目是關(guān)于使用 ESP32 CAM 模塊 和 OpenCV 進(jìn)行顏色檢測和跟蹤的 。因此,我們將在 實(shí)時視頻流 中檢測任何特定顏色。顏色檢測是識別物體所必需的,它也被用作各種圖像編輯和繪圖應(yīng)用程序的工具。 這種方法與其他ESP32-CAM 顏色檢測方法 完全不同,因為我們不是為 Microc

    2024年02月10日
    瀏覽(43)
  • 【OpenCV ? c++】顏色數(shù)據(jù)結(jié)構(gòu)與顏色空間轉(zhuǎn)換

    【OpenCV ? c++】顏色數(shù)據(jù)結(jié)構(gòu)與顏色空間轉(zhuǎn)換

    ?? 個人簡介:CSDN「 博客新星 」TOP 10 , C/C++ 領(lǐng)域新星創(chuàng)作者 ?? 作 ?? 者: 錫蘭_CC ?? ?? 專 ?? 欄: 【OpenCV ? c++】計算機(jī)視覺 ?? 若有幫助,還請 關(guān)注?點(diǎn)贊?收藏 ,不行的話我再努努力??????

    2024年02月11日
    瀏覽(14)
  • 競賽選題 深度學(xué)習(xí)YOLOv5車輛顏色識別檢測 - python opencv

    競賽選題 深度學(xué)習(xí)YOLOv5車輛顏色識別檢測 - python opencv

    ?? 優(yōu)質(zhì)競賽項目系列,今天要分享的是 ?? **基于深度學(xué)習(xí)YOLOv5車輛顏色識別檢測 ** 該項目較為新穎,適合作為競賽課題方向,學(xué)長非常推薦! ??學(xué)長這里給一個題目綜合評分(每項滿分5分) 難度系數(shù):3分 工作量:3分 創(chuàng)新點(diǎn):4分 ?? 更多資料, 項目分享: https://gitee.com

    2024年02月07日
    瀏覽(88)
  • [C++] opencv中如何生成隨機(jī)顏色?

    我們可以通過C++來生成OpenCV繪圖使用的隨機(jī)顏色,代碼如下: 這個代碼將生成一個大小為100x100像素的隨機(jī)顏色圖像。它首先使用當(dāng)前時間作為隨機(jī)數(shù)種子來初始化隨機(jī)數(shù)生成器。然后,它使用 rand() 函數(shù)生成三個介于0到255之間的隨機(jī)整數(shù),分別表示紅色、綠色和藍(lán)色通道的

    2024年01月19日
    瀏覽(28)
  • 【畢業(yè)設(shè)計】深度學(xué)習(xí)YOLOv5車輛顏色識別檢測 - python opencv

    【畢業(yè)設(shè)計】深度學(xué)習(xí)YOLOv5車輛顏色識別檢測 - python opencv

    ?? 這兩年開始畢業(yè)設(shè)計和畢業(yè)答辯的要求和難度不斷提升,傳統(tǒng)的畢設(shè)題目缺少創(chuàng)新和亮點(diǎn),往往達(dá)不到畢業(yè)答辯的要求,這兩年不斷有學(xué)弟學(xué)妹告訴學(xué)長自己做的項目系統(tǒng)達(dá)不到老師的要求。 為了大家能夠順利以及最少的精力通過畢設(shè),學(xué)長分享優(yōu)質(zhì)畢業(yè)設(shè)計項目,今天

    2024年02月16日
    瀏覽(26)
  • C++ opencv:視頻讀取、變換顏色風(fēng)格、保存

    C++ opencv:視頻讀取、變換顏色風(fēng)格、保存

    通過此文章可快速了解C++opencv的關(guān)于視頻讀取、顏色風(fēng)格、視頻保存相關(guān)的知識點(diǎn)。 目錄 1. 相關(guān)知識點(diǎn) 2. 代碼 編寫代碼main.cpp: 編寫CmakeLists.txt: 編譯并執(zhí)行: 3. 效果展示 ????????在C++中,使用OpenCV庫中的 VideoCapture 類來捕獲視頻流; VideoCapture 構(gòu)造函數(shù)接受一個參數(shù),指

    2024年02月14日
    瀏覽(19)
  • 計算機(jī)競賽 深度學(xué)習(xí)YOLOv5車輛顏色識別檢測 - python opencv

    計算機(jī)競賽 深度學(xué)習(xí)YOLOv5車輛顏色識別檢測 - python opencv

    ?? 優(yōu)質(zhì)競賽項目系列,今天要分享的是 ?? **基于深度學(xué)習(xí)YOLOv5車輛顏色識別檢測 ** 該項目較為新穎,適合作為競賽課題方向,學(xué)長非常推薦! ??學(xué)長這里給一個題目綜合評分(每項滿分5分) 難度系數(shù):3分 工作量:3分 創(chuàng)新點(diǎn):4分 ?? 更多資料, 項目分享: https://gitee.com

    2024年02月08日
    瀏覽(95)
  • python畢業(yè)設(shè)計 深度學(xué)習(xí)yolov5車輛顏色識別檢測系統(tǒng) - opencv

    python畢業(yè)設(shè)計 深度學(xué)習(xí)yolov5車輛顏色識別檢測系統(tǒng) - opencv

    ?? 這兩年開始畢業(yè)設(shè)計和畢業(yè)答辯的要求和難度不斷提升,傳統(tǒng)的畢設(shè)題目缺少創(chuàng)新和亮點(diǎn),往往達(dá)不到畢業(yè)答辯的要求,這兩年不斷有學(xué)弟學(xué)妹告訴學(xué)長自己做的項目系統(tǒng)達(dá)不到老師的要求。 為了大家能夠順利以及最少的精力通過畢設(shè),學(xué)長分享優(yōu)質(zhì)畢業(yè)設(shè)計項目,今天

    2024年02月04日
    瀏覽(25)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包