67、C#调用Visual Studio 2019生成的Paddle+OCR(使用ncnn库),去完成业务任务

news2024/9/23 21:32:19

基本思想:这里使用飞哥写的android代码,将其取出纯c++代码逻辑,自己尝试转了paddle+ocr模型,可以成功转换,不在详细阐述生成ncnn模型的过程和写后处理ocr识别过程,这里要实现的目的是使用c#调用ncnn的ocr工程,完成对应部门的业务支撑~

一、在window10+ncnn+clion+mingw32测试结果,对源代码进行稍微修改,不在此放出来了,只贴目录和识别结果 ,可以跳过直接使用vs开发18、window10+Clion2022+minGW编译opencv4.4.0+opencv_contrib4.4.0并测试_sxj731533730的博客-CSDN博客

1)打开CLion集成开发环境,在设置界面设置各种编码均为UTF-8。

然后,双击Shift,在弹出的搜索栏中,输入“Registry”,点击“Registry…”进入软件注册表界面,去掉“run.processes.with.pty”中默认的对勾,即不要选中该项。这样控制台程序的输出对中文的解析就是政策的

cmakelists.txt

cmake_minimum_required(VERSION 3.16)
project(untitled4)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
# Where to find CMake modules and OpenCV
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -o3 -lstdc++")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -o3 -lstdc++")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fopenmp ")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp ")


find_package(OpenCV REQUIRED)
include_directories(${OpenCV_INCLUDE_DIRS})
# add libs you need


include_directories(${CMAKE_SOURCE_DIR}/include)

#导入ncnn
add_library(libncnn STATIC IMPORTED)
set_target_properties(libncnn PROPERTIES IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/lib/libncnn.a)
add_executable(untitled4 main.cpp common.cpp clipper.cpp)

target_link_libraries(untitled4 ${OpenCV_LIBS} libncnn)

测试图片 

测试结果

D:\ncnn_ocr\cmake-build-debug\untitled4.exe
 91.000000, 452.000000, 837.000000, 434.000000, 838.000000, 467.000000, 92.000000, 485.000000, 0.679223, 登机口于起飞前10分钟关闭GATESCLOSE10MINUTESBEFOREDEPARTURETIME
 337.000000, 343.000000, 665.000000, 337.000000, 666.000000, 371.000000, 338.000000, 376.000000, 0.644384, ETKT7813699238489/1
 56.000000, 103.000000, 327.000000, 96.000000, 329.000000, 131.000000, 57.000000, 138.000000, 0.698961, 航班FLIGHT日期DATE
 74.000000, 134.000000, 331.000000, 127.000000, 333.000000, 162.000000, 75.000000, 169.000000, 0.714993, MU237903DEC
 414.000000, 18.000000, 665.000000, 11.000000, 666.000000, 63.000000, 415.000000, 70.000000, 0.816461, BOArdING
 149.000000, 21.000000, 361.000000, 15.000000, 362.000000, 72.000000, 151.000000, 78.000000, 0.831414, 登机牌
 67.000000, 271.000000, 268.000000, 264.000000, 270.000000, 299.000000, 68.000000, 306.000000, 0.735916, zHaNGQIWEI
 666.000000, 92.000000, 848.000000, 86.000000, 849.000000, 121.000000, 667.000000, 127.000000, 0.687389, 座位号SEATNO.
 477.000000, 98.000000, 653.000000, 92.000000, 655.000000, 127.000000, 478.000000, 133.000000, 0.690239, 序号SERIALNO.
 334.000000, 214.000000, 491.000000, 208.000000, 492.000000, 239.000000, 336.000000, 245.000000, 0.678569, TAIYUAN
 338.000000, 233.000000, 488.000000, 229.000000, 490.000000, 260.000000, 340.000000, 264.000000, 0.689959, 身份识别IDNO.
 673.000000, 162.000000, 821.000000, 158.000000, 823.000000, 193.000000, 674.000000, 197.000000, 0.646862, 登机时间,BDT
 331.000000, 169.000000, 476.000000, 163.000000, 477.000000, 198.000000, 333.000000, 204.000000, 0.707408, 始发地FROM
 480.000000, 169.000000, 618.000000, 165.000000, 620.000000, 196.000000, 481.000000, 200.000000, 0.680858, 登机口GATE
 690.000000, 11.000000, 826.000000, 7.000000, 827.000000, 60.000000, 691.000000, 64.000000, 0.810896, PASS
 331.000000, 100.000000, 463.000000, 96.000000, 464.000000, 127.000000, 333.000000, 131.000000, 0.698563, 舱位CLASS
 453.000000, 289.000000, 582.000000, 285.000000, 583.000000, 322.000000, 455.000000, 326.000000, 0.696833, 票号TKTNO.
 84.000000, 224.000000, 207.000000, 224.000000, 207.000000, 254.000000, 84.000000, 254.000000, 0.716215, FUZHOU
 93.000000, 308.000000, 214.000000, 303.000000, 215.000000, 338.000000, 95.000000, 343.000000, 0.715540, 张祺伟
 60.000000, 246.000000, 179.000000, 242.000000, 180.000000, 273.000000, 61.000000, 277.000000, 0.682952, 姓名NAME
 58.000000, 173.000000, 173.000000, 169.000000, 175.000000, 204.000000, 60.000000, 208.000000, 0.707852, 目的地TO
 63.000000, 338.000000, 169.000000, 334.000000, 170.000000, 366.000000, 64.000000, 371.000000, 0.725013, 票价FARE
 89.000000, 201.000000, 175.000000, 197.000000, 176.000000, 229.000000, 91.000000, 233.000000, 0.691946, 福州
 480.000000, 208.000000, 557.000000, 208.000000, 557.000000, 239.000000, 480.000000, 239.000000, 0.638389, LG11
 505.000000, 126.000000, 572.000000, 126.000000, 572.000000, 162.000000, 505.000000, 162.000000, 0.731808, 035
 728.000000, 131.000000, 768.000000, 131.000000, 768.000000, 154.000000, 728.000000, 154.000000, 0.474316, 12F
 401.000000, 128.000000, 434.000000, 128.000000, 434.000000, 162.000000, 401.000000, 162.000000, 0.641305, W
 795.000000, 126.000000, 826.000000, 126.000000, 826.000000, 154.000000, 795.000000, 154.000000, 0.543135, 西

代码目录

 二、先在clion上改写一下代码,然后在用vs生成dll.改写过程需要使用c语言包裹一下,这里直接上最后的结果了

 c#的主界面函数

using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using OpenCvSharp;

using OpenCvSharp.Extensions;
using System.IO;
using System.IO.Compression;
using System.Drawing.Imaging;
using System.Runtime.InteropServices;

namespace WindowsFormsApp1
{
    //
    static class Program
    {
        [DllImport(@"D:\vs_project\Project2\x64\Release\Project2.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
        public static extern int init_model(StringBuilder model_param, StringBuilder bin_param, StringBuilder model_text, StringBuilder bin_text, StringBuilder texta);

        [DllImport(@"D:\vs_project\Project2\x64\Release\Project2.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]

        public static extern int detect_image(byte[] ImageBuffer, int height, int width, float boxscorethresh, float boxthresh, float unclipratio, StringBuilder data);

        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main()
        {

            StringBuilder model_param = new StringBuilder("D:/vs_project/Project2/model/pdocrv2.0_det-op.param");
            StringBuilder model_bin = new StringBuilder("D:/vs_project/Project2/model/pdocrv2.0_det-op.bin");
            StringBuilder param_text = new StringBuilder("D:/vs_project/Project2/model/pdocrv2.0_rec-op.param");
            StringBuilder bin_text = new StringBuilder("D:/vs_project/Project2/model/pdocrv2.0_rec-op.bin");
            StringBuilder texta = new StringBuilder("D:/vs_project/Project2/model/paddleocr_keys.txt");

            int ret = init_model(model_param, model_bin, param_text, bin_text, texta);
            if (ret == 0)
            {
                Console.WriteLine("successfully\n");
            }
            else
            {
                Console.WriteLine("fail\n");
            }


            Mat frame = new Mat(@"D:/vs_project/Project2/1.jpg", ImreadModes.Color);
            Bitmap bmp = frame.ToBitmap();
            byte[] source = GetBGRValues(bmp);
            StringBuilder textaa = new StringBuilder(10240);
            detect_image(source, bmp.Height, bmp.Width, 0.3f, 0.2f, 2.0f, textaa);
            Console.WriteLine(textaa);
            Cv2.ImShow("Demo", frame);
            // Console.WriteLine("show image");
            // Cv2.WaitKey(0);

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());
        }
        public static byte[] GetBGRValues(Bitmap bmp)
        {
            var rect = new Rectangle(0, 0, bmp.Width, bmp.Height);
            var bmpData = bmp.LockBits(rect, System.Drawing.Imaging.ImageLockMode.ReadOnly, bmp.PixelFormat);
            var rowBytes = bmpData.Width * Image.GetPixelFormatSize(bmp.PixelFormat) / 8;
            var imgBytes = bmp.Height * rowBytes;
            byte[] rgbValues = new byte[imgBytes];
            IntPtr ptr = bmpData.Scan0;
            for (var i = 0; i < bmp.Height; i++)
            {
                Marshal.Copy(ptr, rgbValues, i * rowBytes, rowBytes);
                ptr += bmpData.Stride;
            }
            bmp.UnlockBits(bmpData);
            return rgbValues;
        }
        public static Bitmap Byte2Bitmap(Byte[] data, int width, int height)
        {
            Bitmap image = new Bitmap(width, height, System.Drawing.Imaging.PixelFormat.Format24bppRgb);
            Rectangle rect = new Rectangle(0, 0, image.Width, image.Height);

            BitmapData bmData = image.LockBits(rect, ImageLockMode.ReadWrite, image.PixelFormat);
            IntPtr ptr = bmData.Scan0;

            for (int i = 0; i < image.Height; i++)
            {
                Marshal.Copy(data, i * image.Width * 3, ptr, image.Width * 3);
                ptr = (IntPtr)(ptr.ToInt64() + bmData.Stride);
            }

            image.UnlockBits(bmData);

            return image;
        }

    }
}

c++的vs界面工程

mian.cpp

#include <windows.h>//显示中文
#include <iostream>
#include "connect.h"

int main() {

	cv::Mat image = cv::imread("D:/vs_project/Project2/1.jpg");
	unsigned char* src = image.data;

	const char* model_param = "D:/vs_project/Project2/model/pdocrv2.0_det-op.param";
	const char* model_bin = "D:/vs_project/Project2/model/pdocrv2.0_det-op.bin";

	const char* param_text = "D:/vs_project/Project2/model/pdocrv2.0_rec-op.param";
	const char* bin_text = "D:/vs_project/Project2/model/pdocrv2.0_rec-op.bin";
	const char* text = "D:/vs_project/Project2/model/paddleocr_keys.txt";
	char result_text[10240] = { 0 };
	float boxscorethresh = 0.4;
	float boxthresh = 0.3;
	float unclipratio = 2.0;

	init_model(model_param, model_bin, param_text, bin_text, text);
	detect_image(src, image.rows, image.cols, boxscorethresh, boxthresh, unclipratio, result_text);
	SetConsoleOutputCP(65001);//显示中文
	printf("%s\n", result_text);

	return 0;
}

connect.h

//
// Created by 1 on 2023/6/17.
//

#ifndef UNTITLED4_CONNECT_H
#define UNTITLED4_CONNECT_H
#include "dbnet.h"
#include "crnnnet.h"

extern "C" __declspec(dllexport) int __stdcall init_model(const char* model_param, const char* bin_param, const char* model_param_text, const char* model_bin_text, const char* text);
extern "C" __declspec(dllexport) int __stdcall detect_image(unsigned char* ImageBuffer, int height, int width, float boxscorethresh, float boxthresh, float unclipratio, char* data);


#endif //UNTITLED4_CONNECT_H

connect.cpp

#pragma once
//
// Created by 1 on 2023/6/17.
//

#include "connect.h"

dbnet* item_dbnet = new dbnet();
crnnnet* item_crnnnet = new crnnnet();

int __stdcall init_model(const char* model_param, const char* bin_param, const char* model_param_text, const char* model_bin_text, const char* text)
{
	int ret = item_dbnet->init_model(model_param, bin_param);
	if (ret != 0) {
		return -1;
	}
	ret = item_crnnnet->init_model(model_param_text, model_bin_text, text);
	if (ret != 0) {
		return -1;
	}
	return 0;
}

int __stdcall detect_image(unsigned char* ImageBuffer, int height, int width, float boxscorethresh, float boxthresh, float unclipratio, char* data)
{

	cv::Mat rgb = cv::Mat(height, width, CV_8UC3, ImageBuffer);
	std::vector<TextBox> objects = item_dbnet->getTextBoxes(rgb, boxscorethresh, boxthresh, unclipratio);

	std::string textLines = item_crnnnet->getPartImages(rgb, objects);
	//printf("%s\n",textLines.c_str());
	memcpy(data, textLines.c_str(), textLines.size());
	return 0;
}

c#的主函数,就不写界面了

using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using OpenCvSharp;

using OpenCvSharp.Extensions;
using System.IO;
using System.IO.Compression;
using System.Drawing.Imaging;
using System.Runtime.InteropServices;

namespace WindowsFormsApp1
{
    //
    static class Program
    {
        [DllImport(@"D:\vs_project\Project2\x64\Release\Project2.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
        public static extern int init_model(StringBuilder model_param, StringBuilder bin_param, StringBuilder model_text, StringBuilder bin_text, StringBuilder texta);

        [DllImport(@"D:\vs_project\Project2\x64\Release\Project2.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]

        public static extern int detect_image(byte[] ImageBuffer, int height, int width, float boxscorethresh, float boxthresh, float unclipratio, StringBuilder data);

        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main()
        {

            StringBuilder model_param = new StringBuilder("D:/vs_project/Project2/model/pdocrv2.0_det-op.param");
            StringBuilder model_bin = new StringBuilder("D:/vs_project/Project2/model/pdocrv2.0_det-op.bin");
            StringBuilder param_text = new StringBuilder("D:/vs_project/Project2/model/pdocrv2.0_rec-op.param");
            StringBuilder bin_text = new StringBuilder("D:/vs_project/Project2/model/pdocrv2.0_rec-op.bin");
            StringBuilder texta = new StringBuilder("D:/vs_project/Project2/model/paddleocr_keys.txt");

            int ret = init_model(model_param, model_bin, param_text, bin_text, texta);
            if (ret == 0)
            {
                Console.WriteLine("successfully\n");
            }
            else
            {
                Console.WriteLine("fail\n");
            }


            Mat frame = new Mat(@"D:/vs_project/Project2/1.jpg", ImreadModes.Color);
            Bitmap bmp = frame.ToBitmap();
            byte[] source = GetBGRValues(bmp);
            StringBuilder textaa = new StringBuilder(10240);
            detect_image(source, bmp.Height, bmp.Width, 0.3f, 0.2f, 2.0f, textaa);
            Console.WriteLine(textaa);
            Cv2.ImShow("Demo", frame);
            // Console.WriteLine("show image");
            // Cv2.WaitKey(0);

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());
        }
        public static byte[] GetBGRValues(Bitmap bmp)
        {
            var rect = new Rectangle(0, 0, bmp.Width, bmp.Height);
            var bmpData = bmp.LockBits(rect, System.Drawing.Imaging.ImageLockMode.ReadOnly, bmp.PixelFormat);
            var rowBytes = bmpData.Width * Image.GetPixelFormatSize(bmp.PixelFormat) / 8;
            var imgBytes = bmp.Height * rowBytes;
            byte[] rgbValues = new byte[imgBytes];
            IntPtr ptr = bmpData.Scan0;
            for (var i = 0; i < bmp.Height; i++)
            {
                Marshal.Copy(ptr, rgbValues, i * rowBytes, rowBytes);
                ptr += bmpData.Stride;
            }
            bmp.UnlockBits(bmpData);
            return rgbValues;
        }
        public static Bitmap Byte2Bitmap(Byte[] data, int width, int height)
        {
            Bitmap image = new Bitmap(width, height, System.Drawing.Imaging.PixelFormat.Format24bppRgb);
            Rectangle rect = new Rectangle(0, 0, image.Width, image.Height);

            BitmapData bmData = image.LockBits(rect, ImageLockMode.ReadWrite, image.PixelFormat);
            IntPtr ptr = bmData.Scan0;

            for (int i = 0; i < image.Height; i++)
            {
                Marshal.Copy(data, i * image.Width * 3, ptr, image.Width * 3);
                ptr = (IntPtr)(ptr.ToInt64() + bmData.Stride);
            }

            image.UnlockBits(bmData);

            return image;
        }

    }
}

界面和运行结果,调用的c++生成的dll产生的文字检测数据

 其他代码不放了,c#接收到结果,然后自己json格式化解析吧

successfully

[{"x0":91.0,"y0":452.0,"x1":837.0,"y1":434.0,"x2":838.0,"y2":467.0,"x3":92.0,"y3":485.0,"score":0.6764066815376282,"text":"登机口于起飞前10分钟关闭GATESCLOSE10MINUTESBEFOREDEPARTURETIME"},{"x0":337.0,"y0":343.0,"x1":665.0,"y1":337.0,"x2":666.0,"y2":371.0,"x3":338.0,"y3":376.0,"score":0.6362003087997437,"text":"ETKT7813699238489/1"},{"x0":56.0,"y0":103.0,"x1":327.0,"y1":96.0,"x2":329.0,"y2":131.0,"x3":57.0,"y3":138.0,"score":0.6969771981239319,"text":"航班FLIGHT日期DATE"},{"x0":72.0,"y0":133.0,"x1":333.0,"y1":126.0,"x2":334.0,"y2":163.0,"x3":74.0,"y3":170.0,"score":0.7076754570007324,"text":"MU237903DEC"},{"x0":414.0,"y0":18.0,"x1":665.0,"y1":11.0,"x2":666.0,"y2":63.0,"x3":415.0,"y3":70.0,"score":0.8130143880844116,"text":"BOArdING"},{"x0":149.0,"y0":21.0,"x1":361.0,"y1":15.0,"x2":362.0,"y2":72.0,"x3":151.0,"y3":78.0,"score":0.8278303146362305,"text":"登机牌"},{"x0":67.0,"y0":271.0,"x1":268.0,"y1":264.0,"x2":270.0,"y2":299.0,"x3":68.0,"y3":306.0,"score":0.7345755696296692,"text":"zHaNGQIWEI"},{"x0":666.0,"y0":92.0,"x1":849.0,"y1":86.0,"x2":851.0,"y2":121.0,"x3":667.0,"y3":127.0,"score":0.682906448841095,"text":"座位号SEATNO.T"},{"x0":477.0,"y0":98.0,"x1":653.0,"y1":92.0,"x2":655.0,"y2":127.0,"x3":478.0,"y3":133.0,"score":0.6870359182357788,"text":"序号SERIALNO."},{"x0":334.0,"y0":214.0,"x1":492.0,"y1":208.0,"x2":494.0,"y2":239.0,"x3":336.0,"y3":245.0,"score":0.6759243607521057,"text":"TAIYUANL"},{"x0":338.0,"y0":233.0,"x1":488.0,"y1":229.0,"x2":490.0,"y2":260.0,"x3":340.0,"y3":264.0,"score":0.6890138983726501,"text":"身份识别IDNO."},{"x0":673.0,"y0":162.0,"x1":821.0,"y1":158.0,"x2":823.0,"y2":193.0,"x3":674.0,"y3":197.0,"score":0.6356645226478577,"text":"登机时间,BDT"},{"x0":331.0,"y0":169.0,"x1":476.0,"y1":163.0,"x2":477.0,"y2":198.0,"x3":333.0,"y3":204.0,"score":0.7054211497306824,"text":"始发地FROM"},{"x0":688.0,"y0":11.0,"x1":826.0,"y1":7.0,"x2":827.0,"y2":60.0,"x3":690.0,"y3":64.0,"score":0.8068178296089172,"text":"PASS"},{"x0":480.0,"y0":169.0,"x1":618.0,"y1":165.0,"x2":620.0,"y2":196.0,"x3":481.0,"y3":200.0,"score":0.6808584332466125,"text":"登机口GATE"},{"x0":331.0,"y0":100.0,"x1":463.0,"y1":96.0,"x2":464.0,"y2":127.0,"x3":333.0,"y3":131.0,"score":0.6964778900146484,"text":"舱位CLASS"},{"x0":453.0,"y0":289.0,"x1":582.0,"y1":285.0,"x2":583.0,"y2":322.0,"x3":455.0,"y3":326.0,"score":0.6907559037208557,"text":"票号TKTNO."},{"x0":84.0,"y0":224.0,"x1":207.0,"y1":224.0,"x2":207.0,"y2":254.0,"x3":84.0,"y3":254.0,"score":0.7162151336669922,"text":"FUZHOU"},{"x0":93.0,"y0":308.0,"x1":214.0,"y1":303.0,"x2":215.0,"y2":338.0,"x3":95.0,"y3":343.0,"score":0.7120270729064941,"text":"张祺伟"},{"x0":60.0,"y0":246.0,"x1":180.0,"y1":242.0,"x2":182.0,"y2":273.0,"x3":61.0,"y3":277.0,"score":0.6744962930679321,"text":"姓名NAME"},{"x0":58.0,"y0":173.0,"x1":173.0,"y1":169.0,"x2":175.0,"y2":204.0,"x3":60.0,"y3":208.0,"score":0.7066438794136047,"text":"目的地TO"},{"x0":63.0,"y0":338.0,"x1":169.0,"y1":334.0,"x2":170.0,"y2":366.0,"x3":64.0,"y3":371.0,"score":0.7236731648445129,"text":"票价FARE"},{"x0":89.0,"y0":201.0,"x1":175.0,"y1":197.0,"x2":176.0,"y2":229.0,"x3":91.0,"y3":233.0,"score":0.6728214621543884,"text":"福州"},{"x0":480.0,"y0":208.0,"x1":557.0,"y1":208.0,"x2":557.0,"y2":239.0,"x3":480.0,"y3":239.0,"score":0.6250905394554138,"text":"LG11"},{"x0":505.0,"y0":126.0,"x1":572.0,"y1":126.0,"x2":572.0,"y2":162.0,"x3":505.0,"y3":162.0,"score":0.7296301126480103,"text":"035"},{"x0":728.0,"y0":131.0,"x1":768.0,"y1":131.0,"x2":768.0,"y2":154.0,"x3":728.0,"y3":154.0,"score":0.459035187959671,"text":"12F"},{"x0":401.0,"y0":128.0,"x1":434.0,"y1":128.0,"x2":434.0,"y2":162.0,"x3":401.0,"y3":162.0,"score":0.6323981285095215,"text":"W"},{"x0":795.0,"y0":126.0,"x1":826.0,"y1":126.0,"x2":826.0,"y2":154.0,"x3":795.0,"y3":154.0,"score":0.5345842242240906,"text":"西"}]

实验结果:链接:https://pan.baidu.com/s/1fLcMPKja5grOyAvgyZN30Q?pwd=4h99 
提取码:4h99

参考代码:

GitHub - Tencent/ncnn: ncnn is a high-performance neural network inference framework optimized for the mobile platform

GitHub - FeiGeChuanShu/ncnn_paddleocr: Android paddleocr demo infer by ncnn

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/658635.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

Ps修改文字

第一步&#xff1a;打开ps软件&#xff0c;选择菜单栏“文件”中的“打开”选项。 第二步&#xff1a;在弹出的“打开”对话框中&#xff0c;选择一张需要修改文字的图片&#xff0c;单击“打开”按钮。 第三步&#xff1a;在左侧工具栏中&#xff0c;选择“仿制图章工具”。 第…

【Python 随练】输出 9*9 口诀

题目&#xff1a; 输出 9*9 口诀 简介&#xff1a; 在本篇博客中&#xff0c;我们将使用 Python 代码输出 9*9 口诀表。口诀表是一个常见的数学乘法表格&#xff0c;用于展示从 1 到 9 的乘法结果。我们将给出问题的解析&#xff0c;并提供一个完整的代码示例来生成这个口诀…

全志V3S嵌入式驱动开发(USB camera驱动)

【 声明&#xff1a;版权所有&#xff0c;欢迎转载&#xff0c;请勿用于商业用途。 联系信箱&#xff1a;feixiaoxing 163.com】 soc和mcu的一个重要区别&#xff0c;就是soc会涉及到大量的音视频操作&#xff0c;当然音视频也就包括了camera摄像头这部分。v3s本身支持csi接口和…

webpack优化代码运行之Code split

一、 什么是code split Webpack的code split是一种技术&#xff0c;它能够将代码分割成多个块&#xff0c;从而优化应用程序的性能。这样做可以实现按需加载和并行加载&#xff0c;从而减少初始化时间和请求次数。Code split在Webpack中通过使用entry语法和各种Loader和插件来…

享元模式:减少内存占用的诀窍

一&#xff0c;概要 享元模式&#xff08;Flyweight Pattern&#xff09;是一种结构型设计模式&#xff0c;它主要通过共享对象来降低系统中对象的数量&#xff0c;从而减少内存占用和提高程序性能。这听起来有点像单例模式&#xff0c;但它们在实现和用途上有很大的区别。享元…

JavaScript Day01 初识JavaScript

文章目录 1.初识JavaScript1.1.什么是JavaScript1.2.JavaScript的组成部分1.3.JavaScript的历史-JavaScript发展历史-系统环境-编辑器-运行环境-调试&#xff1a; 2. js组成2.1 ECMAScrpt 【js标准】&#xff08;兼容性100%&#xff09; (类似于CoreJava&#xff0c;制定了基础…

【备战秋招】每日一题:2023.05-B卷-华为OD机试 - 阿里巴巴找黄金宝箱(III)

为了更好的阅读体检&#xff0c;可以查看我的算法学习博客阿里巴巴找黄金宝箱(III) 题目描述 贫如洗的樵夫阿里巴巴在去砍柴的路上&#xff0c;无意中发现了强盗集团的藏宝地&#xff0c;藏宝地有编号从0-N的箱子&#xff0c;每个箱子上面贴有一个数字。 阿里巴巴念出一个咒…

SpringMVC 学习整理

文章目录 一、SpringMVC 简介1.1 什么是MVC1.2 什么是Spring MVC1.3 Spring MVC的特点 二、SpringMVC 快速入门三、RequestMapping注解说明四、SpringMVC获取请求参数4.1 通过ServletAPI获取请求参数4.2 通过控制器方法的形参获取请求参数4.3 通过RequestParam接收请求参数4.4 …

Elasticsearch:实用 BM25 - 第 3 部分:在 Elasticsearch 中选择 b 和 k1 的注意事项

这是系列文章的第三篇文章。之前的文章是&#xff1a; Elasticsearch&#xff1a;实用 BM25 - 第 1 部分&#xff1a;分片如何影响 Elasticsearch 中的相关性评分 Elasticsearch&#xff1a;实用 BM25 - 第 2 部分&#xff1a;BM25 算法及其变量 选择 b 和 k1 值得注意的是&…

【备战秋招】每日一题:2023.05-B卷-华为OD机试 - 比赛的冠亚季军

为了更好的阅读体检&#xff0c;可以查看我的算法学习博客比赛的冠亚季军 题目描述 有个运动员&#xff0c;他们的id为0到N-1,他们的实力由一组整数表示。他们之间进行比赛&#xff0c;需要决出冠亚军。比赛的规则是0号和1号比赛&#xff0c;2号和3号比赛&#xff0c;以此类推…

014、数据库管理之配置管理

配置管理 TiDB配置系统配置集群配置配置的存储位置区分TiDB的系统参数和集群参数 系统参数系统参数的作用域系统参数的修改 集群参数集群参数的修改配置参数的查看 实验一&#xff1a; 在不同作用域下对数据库的系统参数进行修改session级别global级别 实验二&#xff1a; 修改…

Redis入门(二)

3.7 Redis 默认16个库 1&#xff09;Redis默认创建16个库,每个库对应一个下标,从0开始. 通过客户端连接后默认进入到0 号库&#xff0c;推荐只使用0号库. 127.0.0.1:6379> 16个是因为配置文件中是这样的 [aahadoop102 redis]$ vim redis.conf 2&#xff09;使用命令 sele…

DataX和SQLServer的导入导出案例

DataX和SQLServer的导入导出案例 文章目录 DataX和SQLServer的导入导出案例写在前面SQLServer数据库的简单使用SQLServer数据库一些常用的Shell脚本命令创建数据库 DataX 导入导出案例创建表并插入数据读取 SQLServer 的数据导入到 HDFS读取 SQLServer 的数据导入 MySQL 总结 写…

【C++Coppeliasim】UR机械臂位置正逆解Coppeliasim集成测试

前言&#xff1a; 基于改进的 Denavit-Hartenberg 参数的UR机械臂正向运动学求解和基于几何分析的逆运动学求解。该代码在 C 和 MATLAB 中可用&#xff0c;两者都与 CoppeliaSim 集成。 该解决方案是使用 Microsoft Visual Studio 2022 和 C 20 标准构建的。 依赖&#xff1a; …

C++ 类继承

目录 类继承基类派生一个类构造函数访问权限派生类与基类之间的特殊关系 完整demo 类继承 基类 #ifndef __TEST_1_H_ #define __TEST_1_H_ #include <iostream> #include<string> using namespace std; typedef unsigned int uint;//father class class TableTen…

《编译原理》2022年期末试卷

北京信息科技大学《编译原理》2022年期末考试 试卷附录

双指针-链表相交

面试题 02.07. 链表相交 同&#xff1a;160.链表相交 力扣题目链接 给你两个单链表的头节点 headA 和 headB &#xff0c;请你找出并返回两个单链表相交的起始节点。如果两个链表没有交点&#xff0c;返回 null 。 图示两个链表在节点 c1 开始相交&#xff1a; 题目数据 保…

用c语言查找交通肇事者。

问题&#xff1a; 一辆卡车违反交通规则&#xff0c;撞人后逃跑。现场有3人目击事件&#xff0c;但都没有记住车号&#xff0c; 只记下车号的一些特征。 甲说&#xff1a;“牌照的前两位数字是相同的”。 乙说&#xff1a;“牌照的后两位…

如何高效阅读源码

最近在研究一款开源软件&#xff0c;从初步上手使用到源码分析&#xff0c;依靠看源码解决问题&#xff0c;可以说让自己在阅读源码能力上有了一点小的成长。鲁迅先生曾没说过&#xff0c;“源码是最好的文档”&#xff0c;他还没说过&#xff0c;“带着问题阅读源码最有效”。…

bat脚本添加以管理员权限执行方法

在windows上运行bat脚本的时候&#xff0c;有时候&#xff0c;会因为权限问题导致操作失败&#xff0c;这时候&#xff0c;需要在脚本中提升权限&#xff0c;以管理员权限执行脚本命令。 现在介绍两种方法可以实现管理员权限执行&#xff0c;如下所示&#xff0c;是一段以管理员…