首页 > 其他分享 >表格化构建系统-加入新的系统功能

表格化构建系统-加入新的系统功能

时间:2023-04-08 18:59:40浏览次数:31  
标签:String 表格 系统 构建 File import new main resources

要实现的功能

1.图片识别表格化重建

2.保存识别记录,可以查看自己的记录

3.分析记录并统计总结

4.能够将所有的记录形成一个完整的个人总结性表格

 

 部分代码:

package org.example;//import com.sun.media.sound.InvalidFormatException;

import net.sourceforge.tess4j.ITesseract;
import net.sourceforge.tess4j.Tesseract;
import net.sourceforge.tess4j.TesseractException;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.apache.poi.ss.usermodel.*;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;

public class Main {

    public static void main(String[] args) throws InvalidFormatException, IOException, TesseractException {
        ITesseract instance = new Tesseract();
        instance.setDatapath("src/main/resources/tessdata");
    instance.setLanguage("chi_sim"); String result = instance.doOCR(new File("src/main/resources/image.png")); String[] lines = result.split("\r?\n"); Workbook workbook = WorkbookFactory.create(new File("src/main/resources/table.xlsx")); Sheet sheet = workbook.getSheetAt(0); int rowCount = 0; for (String line : lines) { Row row = sheet.createRow(rowCount++); int columnCount = 0; for (String word : line.split("\s+")) { Cell cell = row.createCell(columnCount++); cell.setCellValue(word); } } File file = new File("src/main/resources/table_from_image.xlsx"); workbook.write(new FileOutputStream(file)); workbook.close(); } }
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>菜鸟教程</title>
    <link rel="stylesheet" href="css/side.css">

</head>
<body>

<div class="sidenav">
    <a href="http://localhost:8080/imageExcel_war_exploded/A1.html">关于我们</a>
    <a href="http://localhost:8080/imageExcel_war_exploded/A2.html">数据统计</a>
    <a href="http://localhost:8080/imageExcel_war_exploded/A3.html">我的记录</a>
    <a href="http://localhost:8080/imageExcel_war_exploded/A4.html">图片转化</a>
</div>

<div id="tabs-1" style="display: block">
    <form action="SubwayLine" >
        <table style="border-width: 0; width: 100%">
            <tr>

                <table border="1" style="border-left-color:     #B0C4DE; border-bottom-color:     #B0C4DE; width: 100%;border-top-style: solid; border-top-color:     #B0C4DE; border-right-style: solid; border-left-style: solid; height: 250px; border-right-color:     #B0C4DE; border-bottom-style: hidden">
                    <tr align="center"><td align="center" colspan="2">石家庄铁道大学北京地铁线路查询</td></tr>
                    <tr><td  style="width: 30%" align="center">线路名称:</td><td style="width: 70%" align="center"> <select name="line" style="height:40px;width:300px;">
                        <option value="1号线">1号线</option>
                        <option value="2号线">2号线</option>
                        <option value="4号线">4号线</option>
                    </select></td></tr>
                    <tr>
                        <td style="width: 50%" align="center" colspan="2"><input type="submit" style="height:40px;width:300px;" value="查询"/></td>
                    </tr>

                </table>
            </tr>
        </table>
    </form>
</div>

<hr />
<div style="text-align: center; width: 100%; font-size: 12px; color: #333;">&copy;版权所有:石家庄铁道大学信息科学与技术学院</div>

</body>
</html>

 

标签:String,表格,系统,构建,File,import,new,main,resources
From: https://www.cnblogs.com/rsy-bxf150/p/17298997.html

相关文章

  • Linux系统之普通用户sudo提权配置
    (Linux系统之普通用户sudo提权配置)一、检查本地系统版本检查本地环境的操作系统版本,本次实践为centos7.6版本。[root@docker~]#cat/etc/os-releaseNAME="CentOSLinux"VERSION="7(Core)"ID="centos"ID_LIKE="rhelfedora"VERSION_ID="7"PRETTY_NAME......
  • Windows 系统 多桌面切换的 鼠标实现
    我作为一个开发者正常在日常的工作环境中大多是使用MacOS系统进行开发。也经常会接触到windows系统。我认为,苹果操作系统在使用体验方面非常人性化,比如提供了很多方便的快捷键和快捷指令。对于我来说,最喜欢的功能就是苹果的多桌面,让我可以更加高效地处理任务。虽然Windows操作......
  • Debian系统 Docker部署
    curl-fsSLhttps://mirrors.aliyun.com/docker-ce/linux/debian/gpg|sudogpg--dearmor-o/usr/share/keyrings/docker-archive-keyring.gpgecho\"deb[arch=amd64signed-by=/usr/share/keyrings/docker-archive-keyring.gpg]https://mirrors.aliyun.com/dock......
  • Linux运维基础(1)之Linux的文件系统
    Linux的文件系统是指Linux操作系统中用于管理文件的文件系统。它是Linux操作系统的核心之一,是Linux文件管理的基础。Linux的文件系统采用了树形结构,以根目录为起点,下面链接着各个子目录和文件。以下是Linux文件系统的一些特点:根目录:Linux的文件系统以根目录(/)为起点,所有的文件和目录......
  • 心电图自动诊断系统附GUI界面
    ✅作者简介:热爱科研的Matlab仿真开发者,修心和技术同步精进,matlab项目合作可私信。......
  • 大型互联网系统技术架构设计的4个基本要素
    作为一名大厂SRE,对什么是好产品(技术架构角度)有深刻的感悟。一个好产品的技术架构不仅在优秀的代码本身,更体现在后期的易运维性、可扩展性、高可用性上。随着用户体量、产品功能、IaaS、PaaS的变化甚至员工的离职,随时需要动态调整架构改变策略来应对各种问题,而这些场景都是对技术架......
  • Linux系统下安装MySQL8.0图文教程
    Linux系统下安装MySQL8.0图文教程1.环境准备1.1. 操作系统Centos7.3,中标麒麟7.61.2. 防火墙配置(可关闭防火墙,不建议)操作系统开启防火墙(注意:不建议把防火墙关闭,应该设置开放对应的端口,或者开放给哪些IP地址的哪些端口)。(1) 防火墙端口开放设置:https://www.cnblogs.com/liu......
  • 剑指offer66(Java)-构建乘积数组(中等)
    题目:给定一个数组A[0,1,…,n-1],请构建一个数组B[0,1,…,n-1],其中 B[i]的值是数组A中除了下标i以外的元素的积,即 B[i]=A[0]×A[1]×…×A[i-1]×A[i+1]×…×A[n-1]。不能使用除法。 示例:输入:[1,2,3,4,5]输出:[120,60,40,30,24] 提示:所有元素乘积之和不会......
  • 内核实验(二):自定义一个迷你Linux ARM系统,基于Kernel v5.15.102, Busybox,Qemu
    原文:https://blog.csdn.net/yyzsyx/article/details/129576582文章目录一、篇头二、内核部分2.1源码下载2.1.1官网2.1.2镜像站点2.1.3代码下载2.2编译2.2.1设置工具链2.2.2配置2.2.3make2.2.4编译成功三、busybox部分3.1源码下载3.2编译3.2.1配置3.2.3编译3.2.4查......
  • Python简易学生管理系统
    目录结构:  1、学生文件student.py#学生类classStudent(object):#存放学生信息student_info={}#学生初始化方法def__init__(self,id,name,addr,tel):self.id=idself.name=nameself.addr=addrself.......