随笔分类 -  Java

Java 相关
摘要:String imagePath = "测试图片完整地址"; String tesseractPath = "Tesseract安装路径\\tesseract.exe"; ProcessBuilder processBuilder = new ProcessBuilder( tesseractPat 阅读全文
posted @ 2024-08-23 16:36 Lee597 阅读(33) 评论(0) 推荐(0) 编辑
摘要:// 1、先连上opencv包System.setProperty("java.awt.headless", "false");System.out.println(System.getProperty("java.library.path"));URL url = ClassLoader.getS 阅读全文
posted @ 2024-08-21 09:35 Lee597 阅读(93) 评论(0) 推荐(0) 编辑
摘要:// 连接opencvSystem.setProperty("java.awt.headless", "false");System.out.println(System.getProperty("java.library.path"));URL url = ClassLoader.getSyste 阅读全文
posted @ 2024-08-16 11:42 Lee597 阅读(87) 评论(0) 推荐(0) 编辑
摘要://region 图像匹配 3.0 private Mat imageMatch(Image ori, Image tbi) { System.setProperty("java.awt.headless", "false"); System.out.println(System.getProper 阅读全文
posted @ 2024-08-16 10:57 Lee597 阅读(122) 评论(0) 推荐(0) 编辑
摘要:ITesseract instance = new Tesseract(); try { // 设置字体库路径 instance.setDatapath("/path/to/tessdata/"); // 添加特定的字体 instance.setLanguage("eng", "/path/to/f 阅读全文
posted @ 2024-08-16 10:44 Lee597 阅读(119) 评论(0) 推荐(0) 编辑
摘要:首先,需要有一个 Post 接口,有一个实体类 方法需要返回什么,直接修改void即可 实体类需要接收什么,直接改User即可 @PostMapping(value = "/post_interface") public void postInterface(@RequestParam("file" 阅读全文
posted @ 2024-08-15 17:24 Lee597 阅读(127) 评论(0) 推荐(0) 编辑
摘要:Mat img = Imgcodecs.imread("图片绝对路径");Mat imgCopy = new Mat(img.size(), CvType.CV_8UC1);HighGui.imshow("Ori",img);double alpha = 1.5; // 大于0增加亮度,小于1大于0 阅读全文
posted @ 2024-06-28 11:47 Lee597 阅读(33) 评论(0) 推荐(0) 编辑
摘要:Mat sharpened = new Mat();MatOfDouble kernel = new MatOfDouble(-1,-1,-1,-1,9,-1,-1,-1,-1);Imgproc.filter2D(原始图片的 Mat对象,sharpened,-1,kernel); 阅读全文
posted @ 2024-06-28 09:25 Lee597 阅读(38) 评论(0) 推荐(0) 编辑
摘要://region 异步线程查询测试@Testvoid testThread() { CountThread countThread = new CountThread(); Thread thread = new Thread(countThread); thread.setName("线程1"); 阅读全文
posted @ 2024-06-27 16:52 Lee597 阅读(12) 评论(0) 推荐(0) 编辑
摘要:直接上代码块了,导入opencv的步骤就不再赘述了,很多java opencv教程都只写了怎么导入,其他啥都没写,随便搜都是一大把//连接导入并使用opencv包System.setProperty("java.awt.headless", "false");System.out.println(S 阅读全文
posted @ 2024-06-25 16:03 Lee597 阅读(202) 评论(0) 推荐(0) 编辑
摘要:public void connectSQL(){ try { // 加载驱动 Class.forName("com.mysql.cj.jdbc.Driver"); // 连接三板斧 String url = "jdbc:mysql://localhost:3306/test_data"; Stri 阅读全文
posted @ 2024-06-12 10:09 Lee597 阅读(9) 评论(0) 推荐(0) 编辑
摘要:System.out.println(Date.from( (LocalDate.of(2024,6,7) .atStartOfDay() .toInstant(ZoneOffset.ofHours(8))) ). after(Date.from( (LocalDate.now() .atTime( 阅读全文
posted @ 2024-06-07 10:34 Lee597 阅读(42) 评论(0) 推荐(0) 编辑
摘要:public void 方法名() { RestTemplate restTemplate = new RestTemplate(); String url = "http://目标地址"; MultiValueMap<String, String> params = new LinkedMulti 阅读全文
posted @ 2024-06-04 17:34 Lee597 阅读(37) 评论(0) 推荐(0) 编辑
摘要:public static double CreateDouble(int min, int max) { double a = Math.random() * (max - min) + min; DecimalFormat df = new DecimalFormat("#.00"); doub 阅读全文
posted @ 2024-05-27 13:38 Lee597 阅读(42) 评论(0) 推荐(0) 编辑
摘要:/** * 查询对象 */@GetMapping("/getImage")@ApiOperationSupport(order = 1)@ApiOperation(value = "上传图片", notes = "保存本地")public R getImg(String jobId, HttpSer 阅读全文
posted @ 2024-05-22 09:56 Lee597 阅读(31) 评论(0) 推荐(0) 编辑
摘要:/** * 获取上传图片 */@PostMapping("/getImage")@ApiOperationSupport(order = 1)@ApiOperation(value = "获取图片", notes = "保存本地")public R Stringuploadtaskpic(Multi 阅读全文
posted @ 2024-05-22 09:53 Lee597 阅读(69) 评论(0) 推荐(0) 编辑
摘要:/** * 借助Map来获取listA、listB的不同元素集合 * 注意: 集合A尽量不要使用空集合 * @param listA 集合A * @param listB 集合B * @return list<String> 不同元素集合 */public static List<String> g 阅读全文
posted @ 2024-05-13 10:43 Lee597 阅读(254) 评论(0) 推荐(0) 编辑
摘要:public static int randomNumber(int min, int max) { int i = (int) ((Math.random() * min) * (Math.random() * max)); while (i < 4) i = (int) (Math.random 阅读全文
posted @ 2024-05-09 10:29 Lee597 阅读(3) 评论(0) 推荐(0) 编辑
摘要:public static Boolean checkPassword(String password) { //数字 final String REG_NUMBER = ".*\\d+.*"; //大写字母 final String REG_UPPERCASE = ".*[A-Z]+.*"; // 阅读全文
posted @ 2024-05-08 16:27 Lee597 阅读(106) 评论(0) 推荐(0) 编辑
摘要://计算两个时间相差的秒数public static long getTime(String startTime, String endTime) throws ParseException { SimpleDateFormat df = new SimpleDateFormat("yyyy-MM- 阅读全文
posted @ 2024-05-08 16:26 Lee597 阅读(170) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示