|
|
|
@ -26,7 +26,7 @@ public class ImageUtils {
|
|
|
|
|
/*
|
|
|
|
|
当涉及到图像压缩时,Java中有几个可以使用的库,比如ImageIO、Thumbnails和Java Advanced Imaging API(JAI)。以下是一个使用ImageIO库来进行图片压缩的示例:
|
|
|
|
|
*/
|
|
|
|
|
public static void main1(String[] args) throws FileNotFoundException {
|
|
|
|
|
public static void main(String[] args) throws FileNotFoundException {
|
|
|
|
|
String sourceImagePath = "C:\\Users\\Denim\\Desktop\\aabebdf71887c6c2707c65211cac2d3a.jpeg";
|
|
|
|
|
String outputImagePath = "C:\\Users\\Denim\\Desktop\\ds-aabebdf71887c6c2707c65211cac2d3a.jpeg";
|
|
|
|
|
//compressImage(sourceImagePath,outputImagePath,0.25f,0.25f);
|
|
|
|
@ -43,8 +43,8 @@ public class ImageUtils {
|
|
|
|
|
List<List<Point>> pointList = new ArrayList<>();
|
|
|
|
|
pointList.add(points);
|
|
|
|
|
pointList.add(points2);
|
|
|
|
|
drawDashedRectangleOnImages("http://47.103.213.109:8072/files/nfs/ocr/shared_directory/fdd50089f33e4b4391b8c88b6299735b/a86aff69fc3ff5397d038b4dbcde6165.jpeg", pointList, "C:\\Users\\Denim\\Desktop\\output_image.png","red");
|
|
|
|
|
//drawDashedRectangleOnImage("http://47.103.213.109:8072/files/nfs/ocr/shared_directory/fdd50089f33e4b4391b8c88b6299735b/a86aff69fc3ff5397d038b4dbcde6165.jpeg", points, "C:\\Users\\Denim\\Desktop\\output_image.png");
|
|
|
|
|
//drawDashedRectangleOnImages("http://47.103.213.109:8072/files/nfs/ocr/shared_directory/fdd50089f33e4b4391b8c88b6299735b/a86aff69fc3ff5397d038b4dbcde6165.jpeg", pointList, "C:\\Users\\Denim\\Desktop\\output_image.png","red");
|
|
|
|
|
drawDashedRectangleOnImages(sourceImagePath, pointList, "C:\\Users\\Denim\\Desktop\\output_image.png","green");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|