commit
6c1aa4029e
|
@ -1,3 +1,12 @@
|
|||
kylin-photo-viewer (1.3.0.3-ok22.33) nile; urgency=medium
|
||||
|
||||
* BUG号:无
|
||||
* 需求号:无
|
||||
* 其他改动说明:修改ai插件架构判断
|
||||
* 影响域:无
|
||||
|
||||
-- sufang <sufang@kylinos.cn> Wed, 28 Aug 2024 15:22:54 +0800
|
||||
|
||||
kylin-photo-viewer (1.3.0.3-ok22.32) nile; urgency=medium
|
||||
|
||||
* BUG号:无
|
||||
|
|
|
@ -30,8 +30,15 @@ LIBS += -lopencv_core \
|
|||
-lopencv_dnn \
|
||||
|
||||
#onnxruntime
|
||||
contains(QMAKE_HOST.arch, x86_64){
|
||||
INCLUDEPATH += /usr/local/include/onnxruntime
|
||||
LIBS += -L/usr/local/lib -lonnxruntime
|
||||
}
|
||||
|
||||
contains(QMAKE_HOST.arch, aarch64){
|
||||
INCLUDEPATH += /usr/local/include/onnxruntime
|
||||
LIBS += -L/usr/local/lib -lonnxruntime
|
||||
}
|
||||
|
||||
INCLUDEPATH += /usr/include/kylin_image_codec/
|
||||
#LIBS += -L/usr/lib -lkylinimagecodec
|
||||
|
|
|
@ -33,6 +33,7 @@ void PhotoViewerPlugin::matToTransparent()
|
|||
qDebug() << "Please input RGB image.";
|
||||
return;
|
||||
}
|
||||
#if !defined(__loongarch64)
|
||||
// 调整图像大小为模型期望的尺寸
|
||||
int inputWidth = 512;
|
||||
int inputHeight = 512;
|
||||
|
@ -85,6 +86,9 @@ void PhotoViewerPlugin::matToTransparent()
|
|||
cv::resize(matte_np, matte_resized, cv::Size(m_origMattingMat.cols, m_origMattingMat.rows), 0, 0, cv::INTER_LINEAR);
|
||||
// 将抠图结果中背景部分设置为透明色
|
||||
matte_resized.convertTo(m_transparentMat, CV_8U, 255); // 将灰度图像转换为 8 位图像
|
||||
#else
|
||||
return;
|
||||
#endif
|
||||
}
|
||||
|
||||
QString PhotoViewerPlugin::startMatting(QString origImagePath, uint b, uint g, uint r, uint a)
|
||||
|
|
|
@ -13,7 +13,9 @@
|
|||
#include <opencv4/opencv2/imgcodecs.hpp>
|
||||
#include <opencv4/opencv2/imgproc.hpp>
|
||||
#include <opencv2/opencv.hpp>
|
||||
#if !defined(__loongarch64)
|
||||
#include <onnxruntime/onnxruntime_cxx_api.h>
|
||||
#endif
|
||||
#include "kylinimagecodec.h"
|
||||
using namespace cv;
|
||||
using namespace std;
|
||||
|
|
Loading…
Reference in New Issue