|
@@ -117,7 +117,7 @@ public class ImageRotationCorrector {
|
|
|
|
|
|
public static void main(String[] args) {
|
|
|
try {
|
|
|
- File fileDir = new File("D:\\02DATA\\三亚\\甲方数据\\飞行\\三亚无人机数据\\24001120450\\下");
|
|
|
+ File fileDir = new File("D:\\onemapfile\\gdbh\\flight\\batch\\24001120460\\下");
|
|
|
File[] files = fileDir.listFiles();
|
|
|
for (File imageFile : files) {
|
|
|
String name = imageFile.getName();
|
|
@@ -131,10 +131,9 @@ public class ImageRotationCorrector {
|
|
|
|
|
|
// 旋转270度(逆时针90度)
|
|
|
BufferedImage rotatedImage = rotateImage(correctedImage, 270);
|
|
|
-
|
|
|
- ImageIO.write(rotatedImage, "jpg", new File("D:\\02DATA\\三亚\\甲方数据\\飞行\\三亚无人机数据\\24001120450\\上\\" + name));
|
|
|
+ ImageIO.write(rotatedImage, "jpg", new File("D:\\onemapfile\\gdbh\\flight\\batch\\24001120460\\上\\" + name));
|
|
|
} else {
|
|
|
- ImageIO.write(image, "jpg", new File("D:\\02DATA\\三亚\\甲方数据\\飞行\\三亚无人机数据\\24001120450\\上\\" + name));
|
|
|
+ ImageIO.write(image, "jpg", new File("D:\\onemapfile\\gdbh\\flight\\batch\\24001120460\\上\\" + name));
|
|
|
}
|
|
|
}
|
|
|
System.out.println("图像方向已校正并保存");
|
|
@@ -157,7 +156,7 @@ public class ImageRotationCorrector {
|
|
|
BufferedImage image = ImageIO.read(imageFile);
|
|
|
|
|
|
// 获取EXIF方向信息
|
|
|
- int orientation = ImageRotationReader.getImageOrientation(imageFile);
|
|
|
+ int orientation = getImageOrientation(imageFile);
|
|
|
|
|
|
if (1 != orientation) {
|
|
|
// 校正图像方向
|