|
@@ -118,7 +118,7 @@ public class VideoCapture {
|
|
|
|
|
|
public static boolean saveImage(Frame frame, String savePath, int idx) {
|
|
public static boolean saveImage(Frame frame, String savePath, int idx) {
|
|
try {
|
|
try {
|
|
- Path outPath = Paths.get(savePath, System.currentTimeMillis() + "_" + idx + ".jpg");
|
|
|
|
|
|
+ Path outPath = Paths.get(savePath, String.format("%05d", idx) + "_" + System.currentTimeMillis() + ".jpg");
|
|
// System.out.println("图片已保存:" + outPath);
|
|
// System.out.println("图片已保存:" + outPath);
|
|
File outPut = new File(outPath.toString());
|
|
File outPut = new File(outPath.toString());
|
|
ImageIO.write(frameToBufferedImage(frame), "jpg", outPut);
|
|
ImageIO.write(frameToBufferedImage(frame), "jpg", outPut);
|