package com.xhkjedu.smarking.utils.opencv;

import com.alibaba.fastjson.JSON;
import com.xhkjedu.smarking.utils.MarkingUtil;
import com.xhkjedu.vo.ResultVo;
import org.opencv.core.Core;
import org.opencv.core.Mat;
import org.opencv.imgcodecs.Imgcodecs;

/**
 * @Description：
 * @Author: WN
 * @Date: 2025/1/10 14:56:28
 **/
public class TestMain {
    static {
        System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
    }
    public static void main(String[] args) {

        // String libraryPath = System.getProperty("java.library.path");
        // // 输出java.library.path的值，用于查看当前系统的库搜索路径。
        // System.out.println("java.library.path：" + libraryPath);


        String imgPath= "D:\\school\\images\\tr2.jpg";
        String param = "AAA/0110";
        Mat img =  Imgcodecs.imread(imgPath, Imgcodecs.IMREAD_GRAYSCALE);
        String resultVo = MarkingUtil.sendPostForMat(img, param);
        ResultVo result = JSON.parseObject(resultVo, ResultVo.class);
        System.out.println(result.getObj());
    }
}
