From 84f208f1fb677a1473c041c3bae52050f1f80bde Mon Sep 17 00:00:00 2001 From: aikang <2979801816@qq.com> Date: Mon, 17 Aug 2020 23:01:44 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/test/java/com/yuxue/test/PlateRecoTest.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/test/java/com/yuxue/test/PlateRecoTest.java b/src/test/java/com/yuxue/test/PlateRecoTest.java index ada80e1..7b7cc41 100644 --- a/src/test/java/com/yuxue/test/PlateRecoTest.java +++ b/src/test/java/com/yuxue/test/PlateRecoTest.java @@ -40,7 +40,7 @@ public class PlateRecoTest { */ @Test public void testPlateRecognise() { - String imgPath = "res/image/test_image/E.D3098.jpg"; + String imgPath = "res/image/test_image/plate_recognize.jpg"; Mat src = opencv_imgcodecs.imread(imgPath); @@ -79,17 +79,18 @@ public class PlateRecoTest { System.out.println("数据库连接成功!"); // String SQL = "INSERT INTO Parking_in(number,color) VALUES('"+palte+"','"+col+"' )"; -// String SQL = "INSERT INTO Parking_out(number,color,time_in) VALUES('"+palte+"','"+col+"','2020-08-17 12:50:00')"; +// String SQL = "INSERT INTO Parking_out(number,color,time_in) VALUES('"+palte+"','"+col+"','2020-08-17 18:50:00')"; stmt = con.createStatement(); // stmt.executeUpdate(SQL); - + String time1=null,time2=null; String SQL = "SELECT * FROM Parking_in"; rs = stmt.executeQuery(SQL); while(rs.next()) time1=rs.getString("time_in"); + System.out.println("您的进入时间:"); System.out.println(time1); @@ -97,14 +98,15 @@ public class PlateRecoTest { rs = stmt.executeQuery(SQL); while(rs.next()) time2=rs.getString("time_in"); + System.out.println("您的离开时间:"); System.out.println(time2); Count count=new Count(); double cost=count.charging(time1, time2); System.out.println(palte+"车主您的停车费用为:"); - System.out.println(cost+"元"); - + System.out.println(String.format("%.1f", cost)+"元"); +