Commit 94b11f53 张士柳

1 个父辈 e9d5142d
......@@ -305,6 +305,7 @@ namespace eyemLib_Sharp
[StructLayout(LayoutKind.Sequential)]
public struct EyemBlobParams
{
// public bool isLight;
public bool filterByArea; //斑点大小限制
public int minArea, maxArea; //最小面积/最大面积
public bool filterByCircularity; //斑点圆度限制
......@@ -694,13 +695,15 @@ namespace eyemLib_Sharp
/// <returns></returns>
[DllImport("eyemLib.dll", CharSet = CharSet.None, CallingConvention = CallingConvention.Cdecl)]
private static extern int eyemMatDiv(EyemImage tpImage1, EyemImage tpImage2, ref EyemImage tpDstImg);
//图像归一化
[DllImport("eyemLib.dll", CharSet = CharSet.None, CallingConvention = CallingConvention.Cdecl)]
private static extern int eyemNormalize(ref EyemImage tpImage);
//通道分离
[DllImport("eyemLib.dll", CharSet = CharSet.None, CallingConvention = CallingConvention.Cdecl)]
private static extern int eyemDecompose(EyemImage tpImage, out EyemImage tpDstImgR, out EyemImage tpDstImgG, out EyemImage tpDstImgB);
//图像反转
[DllImport("eyemLib.dll", CharSet = CharSet.None, CallingConvention = CallingConvention.Cdecl)]
private static extern int eyemBitwiseNot(ref EyemImage tpImage);
#endregion
#region 一维边缘测量
......@@ -1225,31 +1228,32 @@ namespace eyemLib_Sharp
//return;
#region Test Blob
sw.Restart();
EyemBlobParams tpParams = new EyemBlobParams();
tpParams.filterByArea = true; tpParams.minArea = 25; tpParams.maxArea = int.MaxValue;
tpParams.filterByCircularity = false; tpParams.minCircularity = 0.8F; tpParams.maxCircularity = float.MaxValue;
tpParams.filterByConvexity = false; tpParams.minConvexity = 0.95F; tpParams.maxConvexity = float.MaxValue;
tpParams.filterByInertia = false; tpParams.minInertiaRatio = 0.8F; tpParams.maxInertiaRatio = float.MaxValue;
int ipNum;
BlobHandle hObject;
EyemBinBlob* tpResults;
eyemBinBlob(image, out hObject, tpParams, out tpResults, out ipNum, out tpDstImg);
sw.Stop();
for (int i = 0; i < ipNum; i++)
{
Console.WriteLine(tpResults[i].iArea);
}
Bitmap bitmap = eyemCvtToBitmap(tpDstImg);
if (bitmap != null)
{
bitmap.Save(System.Windows.Forms.Application.StartupPath + "\\ResOut\\" + file);
}
hObject.Dispose();
eyemImageFree(ref tpDstImg);
eyemImageFree(ref image);
Console.WriteLine("时间-:" + sw.ElapsedMilliseconds.ToString());
return;
//sw.Restart();
//EyemBlobParams tpParams = new EyemBlobParams();
////tpParams.isLight = true;
//tpParams.filterByArea = true; tpParams.minArea = 25; tpParams.maxArea = int.MaxValue;
//tpParams.filterByCircularity = false; tpParams.minCircularity = 0.8F; tpParams.maxCircularity = float.MaxValue;
//tpParams.filterByConvexity = false; tpParams.minConvexity = 0.95F; tpParams.maxConvexity = float.MaxValue;
//tpParams.filterByInertia = false; tpParams.minInertiaRatio = 0.8F; tpParams.maxInertiaRatio = float.MaxValue;
//int ipNum;
//BlobHandle hObject;
//EyemBinBlob* tpResults;
//eyemBinBlob(image, out hObject, tpParams, out tpResults, out ipNum, out tpDstImg);
//sw.Stop();
//for (int i = 0; i < ipNum; i++)
//{
// Console.WriteLine(tpResults[i].iArea);
//}
//Bitmap bitmap = eyemCvtToBitmap(tpDstImg);
//if (bitmap != null)
//{
// bitmap.Save(System.Windows.Forms.Application.StartupPath + "\\ResOut\\" + file);
//}
//hObject.Dispose();
//eyemImageFree(ref tpDstImg);
//eyemImageFree(ref image);
//Console.WriteLine("时间-:" + sw.ElapsedMilliseconds.ToString());
//return;
#endregion
#region Test 1DEdge
......@@ -1457,20 +1461,20 @@ namespace eyemLib_Sharp
//如果对象供其他接口使用要先释放
//eyemImageFree(ref tpDstImg);
//"IP_SMALL_PARTS","IP_LARGE_PARTS","IP_LONG_PARTS","IP_LOWCONTRAST_PARTS",IP_SQUARE_PARTS
//"IP_SMALL_PARTS","IP_LARGE_PARTS","IP_LONG_PARTS",,IP_SQUARE_PARTS
//eyemCountObject(image, tpRoi, file.Replace(".png", ""), ipReelNum, out tpDstImg);
eyemCountObjectIrregularParts(image, tpRoi, file.Replace(".png", ""), "IP_LARGE_PARTS", ipReelNum, out tpDstImg);
eyemCountObjectIrregularParts(image, tpRoi, file.Replace(".png", ""), "IP_SQUARE_PARTS", ipReelNum, out tpDstImg);
//eyemCountObjectE(image, tpRoi, file.Replace(".png", ""), ipReelNum, out tpDstImg);
//eyemCountObjectIrregularPartsE(image, tpRoi, file.Replace(".png", ""), "D:\\模板文件\\" + "20210825095751-1.tpl", hModelID, ipReelNum, out tpDstImg);
//移除模板
//flag = eyemRemoveModelByName(hModelID, "D:\\模板文件及图像\\df871193-6632-48f9-abfe-540c3fc49c3f.tpl");
//Bitmap bitmap = eyemCvtToBitmap(tpDstImg);
//if (bitmap != null)
//{
// bitmap.Save(System.Windows.Forms.Application.StartupPath + "\\ResOut\\" + file);
//}
Bitmap bitmap = eyemCvtToBitmap(tpDstImg);
if (bitmap != null)
{
bitmap.Save(System.Windows.Forms.Application.StartupPath + "\\ResOut\\" + file);
}
//< 解码测试
//int ipNum; EyemBarCode* tpResults;
......
......@@ -1320,9 +1320,7 @@ int eyemBinClosing(EyemImage tpSrcImg, int iBinLevel, int iNum, EyemImage *tpDst
int eyemBinBlob(EyemImage tpImage, IntPtr *hObject, EyemBlobParams tpParams, EyemBinBlob **tpResult, int *ipNum, EyemImage *tpDstImg)
{
CV_Assert(tpImage.vpImage != NULL);
cv::Mat image = cv::Mat(tpImage.iHeight, tpImage.iWidth, MAKETYPE(tpImage.iDepth, tpImage.iChannels), tpImage.vpImage).clone();
if (image.empty()) {
return FUNC_IMAGE_NOT_EXIST;
}
......@@ -1330,8 +1328,10 @@ int eyemBinBlob(EyemImage tpImage, IntPtr *hObject, EyemBlobParams tpParams, Eye
if (image.type() != CV_8UC1 || image.channels() != 1) {
return FUNC_CANNOT_CALC;
}
cv::threshold(image, image, 0, 255, cv::THRESH_BINARY_INV | cv::THRESH_OTSU);
////判断提取明暗部分
//if (!tpParams.isLight) {
// cv::bitwise_not(image, image);
//}
//显示图像
cv::Mat showMat;
cv::cvtColor(image, showMat, cv::COLOR_GRAY2RGB);
......@@ -1457,12 +1457,20 @@ int eyemBinBlob(EyemImage tpImage, IntPtr *hObject, EyemBlobParams tpParams, Eye
}
});
EyemBinBlob blob;
EyemBinBlob blob; int idx = 0;
std::vector<EyemBinBlob> * tpResults = new std::vector<EyemBinBlob>();
for (int i = 1; i < nccomps; i++) {
if (colors[i]) {
cv::rectangle(showMat, cv::Rect(stats.ptr<int>(i)[cv::CC_STAT_LEFT], stats.ptr<int>(i)[cv::CC_STAT_TOP],
stats.ptr<int>(i)[cv::CC_STAT_WIDTH], stats.ptr<int>(i)[cv::CC_STAT_HEIGHT]), cv::Scalar(0, 0, 255));
std::string label = "";
label += std::to_string(idx);
cv::Rect bound(stats.ptr<int>(i)[cv::CC_STAT_LEFT], stats.ptr<int>(i)[cv::CC_STAT_TOP],
stats.ptr<int>(i)[cv::CC_STAT_WIDTH], stats.ptr<int>(i)[cv::CC_STAT_HEIGHT]);
int baseLine;
cv::Size labelSize = cv::getTextSize(label, cv::FONT_HERSHEY_SIMPLEX, 0.5, 1, &baseLine);
//cv::rectangle(showMat, cv::Point(bound.tl().x, bound.tl().y - 2 * baseLine - round(1.5*labelSize.height) - 1), cv::Point(bound.tl().x + round(1.5*labelSize.width) + baseLine + 1, bound.tl().y - 1), cv::Scalar(255, 255, 255), cv::FILLED);
//cv::putText(showMat, label, cv::Point(bound.tl().x, bound.tl().y - baseLine - 2), cv::FONT_HERSHEY_COMPLEX, 0.75, cv::Scalar(0, 0, 0), 1);
cv::rectangle(showMat, bound, cv::Scalar(0, 0, 255));
cv::drawMarker(showMat, cv::Point((int)centroids.ptr<double>(i)[0], (int)centroids.ptr<double>(i)[1]), cv::Scalar(255, 0, 0), cv::MARKER_CROSS, 6);
double x1, y1, x2, y2;
......@@ -1484,6 +1492,7 @@ int eyemBinBlob(EyemImage tpImage, IntPtr *hObject, EyemBlobParams tpParams, Eye
blob.iArea = stats.ptr<int>(i)[cv::CC_STAT_AREA];
blob.dTheta = mOrientation.ptr<float>(i)[0];
tpResults->push_back(blob);
idx++;
}
}
//<输出结果图像
......@@ -1511,4 +1520,3 @@ bool eyemBinFree(IntPtr hObject)
tpResult = NULL;
return true;
}
......@@ -445,6 +445,7 @@ extern "C" {
EXPORTS int eyemMatAdd(EyemImage vpA, EyemImage vpB, EyemImage &vpC);
EXPORTS int eyemMatSub(EyemImage tpImageMinuend, EyemImage tpImageSubtrahend, EyemImage &tpDstImg);
EXPORTS int eyemMatAbs(EyemImage &tpImage);
EXPORTS int eyemBitwiseNot(EyemImage &tpImage);
EXPORTS int eyemNormalize(EyemImage &tpImage);
EXPORTS int eyemDecompose(EyemImage tpImage, EyemImage *tpDstImgR, EyemImage *tpDstImgG, EyemImage *tpDstImgB);
EXPORTS int eyemCvtImageType(EyemImage tpImage, const char *ccSubType, double alpha, double beta, EyemImage &tpDstImg);
......
此文件类型无法预览
......@@ -330,21 +330,15 @@ int eyemMatSub(EyemImage tpImageMinuend, EyemImage tpImageSubtrahend, EyemImage
int eyemMatAbs(EyemImage &tpImage)
{
CV_Assert(NULL != tpImage.vpImage);
cv::Mat _src = cv::Mat(tpImage.iHeight, tpImage.iWidth, MAKETYPE(tpImage.iDepth, tpImage.iChannels), tpImage.vpImage).clone();
//释放内存
_free(tpImage);
//运算
cv::Mat _dst = cv::abs(_src);
//内存尺寸
int _Size = _dst.cols *_dst.rows *_dst.channels();
//图像信息
tpImage.iWidth = _dst.cols, tpImage.iHeight = _dst.rows, tpImage.iDepth = _dst.depth(), tpImage.iChannels = _dst.channels();
switch (_dst.depth())
{
case CV_8U:
......@@ -405,6 +399,14 @@ int eyemMatAbs(EyemImage &tpImage)
return FUNC_OK;
}
int eyemBitwiseNot(EyemImage &tpImage)
{
CV_Assert(NULL != tpImage.vpImage&&tpImage.iDepth == 0);
cv::Mat _src = cv::Mat(tpImage.iHeight, tpImage.iWidth, MAKETYPE(tpImage.iDepth, tpImage.iChannels), tpImage.vpImage);
cv::bitwise_not(_src, _src, cv::noArray());
return FUNC_OK;
}
int eyemCvtImageType(EyemImage tpImage, const char *ccSubType, double alpha, double beta, EyemImage &tpDstImg)
{
CV_Assert(NULL != tpImage.vpImage);
......
......@@ -672,33 +672,24 @@ int eyemCountObject(EyemImage tpImage, EyemRect tpRoi, const char *fileName, int
//转单通道
if (src.channels() != 1)
cv::cvtColor(src, src, cv::COLOR_BGR2GRAY);
//跳过执行
if (killProcessID == 0) {
logger.t("eyemCountObjectIrregularPartsE 初始阶段被跳过执行...");
return FUNC_CANNOT_CALC;
}
//图像裁剪
src = src(cv::Rect(tpRoi.iXs, tpRoi.iYs, tpRoi.iWidth, tpRoi.iHeight)).clone();
//image size
int X = src.cols, Y = src.rows;
//测试用,用于去除黑色坏点干扰
cv::Mat medBlur;
cv::medianBlur(src, medBlur, 3);
//去除局部量斑影响(默认亮斑尺寸不会大于15个像素)
cv::Mat srcTmp;
cv::morphologyEx(src, srcTmp, cv::MORPH_ERODE, cv::getStructuringElement(cv::MORPH_RECT, cv::Size(15, 15)));
//去除黑斑影响
int m = cvRound(cv::mean(src)[0]);
srcTmp.forEach<uint16_t>([&](uint16_t& pixel, const int *pos)->void {
pixel = pixel == 0 ? m : pixel;
});
cv::morphologyEx(medBlur, medBlur, cv::MORPH_ERODE, cv::getStructuringElement(cv::MORPH_RECT, cv::Size(15, 15)));
//image enhancement
double min, max;
cv::Point maxId;
cv::minMaxLoc(srcTmp, &min, &max, NULL, &maxId);
cv::minMaxLoc(medBlur, &min, &max, NULL, &maxId);
src.convertTo(src, CV_64FC1);
src -= min;
......@@ -1672,23 +1663,17 @@ int eyemCountObjectIrregularParts(EyemImage tpImage, EyemRect tpRoi, const char
}
//图像裁剪
src = src(cv::Rect(tpRoi.iXs, tpRoi.iYs, tpRoi.iWidth, tpRoi.iHeight)).clone();
//图像尺寸
int X = src.cols, Y = src.rows;
//去除局部亮斑与黑斑影响(默认亮斑尺寸不会大于15个像素)
cv::Mat srcTmp, srcTmp2;
cv::morphologyEx(src, srcTmp, cv::MORPH_ERODE, cv::getStructuringElement(cv::MORPH_RECT, cv::Size(15, 15)));
//去除黑斑影响
int m = cvRound(cv::mean(src)[0]);
srcTmp.forEach<uint16_t>([&](uint16_t& pixel, const int *pos)->void {
pixel = pixel == 0 ? m : pixel;
});
//测试用,用于去除黑色坏点干扰
cv::Mat medBlur;
cv::medianBlur(src, medBlur, 3);
//去除局部亮斑(默认亮斑尺寸不会大于15个像素)
cv::Mat srcTmp;
cv::morphologyEx(medBlur, medBlur, cv::MORPH_ERODE, cv::getStructuringElement(cv::MORPH_RECT, cv::Size(15, 15)));
//图像增强
double min, max;
cv::minMaxLoc(srcTmp, &min, &max);
cv::minMaxLoc(medBlur, &min, &max);
src.convertTo(src, CV_64FC1);
src -= min;
src /= (max - min);
......@@ -1727,7 +1712,6 @@ int eyemCountObjectIrregularParts(EyemImage tpImage, EyemRect tpRoi, const char
}
}
});
//增强到目标亮度方便显示
cc += cv::Scalar((162 - backThresh), (162 - backThresh), (162 - backThresh));
//去掉干扰
......@@ -2008,7 +1992,7 @@ int eyemCountObjectIrregularParts(EyemImage tpImage, EyemRect tpRoi, const char
binary = filtermap;
//释放资源
free((void *)pLabelImg);
}
}//
else if (strcmp(ccSubType, "IP_LARGE_PARTS") == 0)
{
//二值化
......@@ -2694,7 +2678,7 @@ int eyemCountObjectIrregularParts(EyemImage tpImage, EyemRect tpRoi, const char
//当作一种辅助手段,无需设置太严格
double dmax;
cv::minMaxLoc(traceMat(tRec_).clone(), NULL, &dmax);
if (dmax < 0.7*taMaxGray) {
if (dmax < 0.6*taMaxGray) {
trayEnd = true;
}
}
......@@ -3031,7 +3015,7 @@ int eyemCountObjectIrregularParts(EyemImage tpImage, EyemRect tpRoi, const char
//当作一种辅助手段,无需设置太严格
double dmax;
cv::minMaxLoc(traceMat(tRec_).clone(), NULL, &dmax);
if (dmax < 0.7*taMaxGray) {
if (dmax < 0.6*taMaxGray) {
trayEnd = true;
}
}
......@@ -4477,7 +4461,7 @@ int eyemCountObjectIrregularParts(EyemImage tpImage, EyemRect tpRoi, const char
{
//面积过滤
if (stats.ptr<int>(j)[cv::CC_STAT_AREA] > 2) {
cv::circle(cc, cv::Point(cvRound((float)dpCent[(0) + (j)* 2]), cvRound((float)dpCent[(1) + (j)* 2])), 1, cv::Scalar(0, 255, 0));
cv::circle(cc, cv::Point(cvRound((float)dpCent[(0) + (j)* 2]), cvRound((float)dpCent[(1) + (j)* 2])), 1, cv::Scalar(0, 255, 0, 255));
binary.at<uchar>(cv::Point(cvRound((float)dpCent[(0) + (j)* 2]), cvRound((float)dpCent[(1) + (j)* 2]))) = 255;
}
}
......@@ -4495,23 +4479,17 @@ int eyemCountObjectIrregularParts(EyemImage tpImage, EyemRect tpRoi, const char
const int SizeConst = 4;
//<输出计数结果标记图像
memset(ipReelNum, 0, SizeConst);
ipReelNum[0] = trayNum;
tpDstImg->iWidth = cc.cols; tpDstImg->iHeight = cc.rows; tpDstImg->iDepth = cc.depth(); tpDstImg->iChannels = cc.channels();
//内存尺寸
int _Size = tpDstImg->iWidth*tpDstImg->iHeight*tpDstImg->iChannels * sizeof(uint8_t);
//分配/初始化内存
tpDstImg->vpImage = (uint8_t *)malloc(_Size);
if (NULL == tpDstImg->vpImage)
return FUNC_NOT_ENOUGH_MEM;
memset(tpDstImg->vpImage, 0, _Size);
//拷贝数据
memcpy(tpDstImg->vpImage, cc.data, _Size);
return FUNC_OK;
}
......@@ -4534,20 +4512,15 @@ int eyemCountObjectE(EyemImage tpImage, EyemRect tpRoi, const char *fileName, in
src = src(cv::Rect(tpRoi.iXs, tpRoi.iYs, tpRoi.iWidth, tpRoi.iHeight)).clone();
//image size
int X = src.cols, Y = src.rows;
//测试用,用于去除黑色坏点干扰
cv::Mat medBlur;
cv::medianBlur(src, medBlur, 3);
//去除局部量斑影响(默认亮斑尺寸不会大于15个像素)
cv::Mat srcTmp;
cv::morphologyEx(src, srcTmp, cv::MORPH_ERODE, cv::getStructuringElement(cv::MORPH_RECT, cv::Size(15, 15)));
//去除黑斑影响
int m = cvRound(cv::mean(src)[0]);
srcTmp.forEach<uint16_t>([&](uint16_t& pixel, const int *pos)->void {
pixel = pixel == 0 ? m : pixel;
});
cv::morphologyEx(medBlur, medBlur, cv::MORPH_ERODE, cv::getStructuringElement(cv::MORPH_RECT, cv::Size(15, 15)));
//图像增强
double min, max;
cv::Point maxId;
cv::minMaxLoc(srcTmp, &min, &max, NULL, &maxId);
cv::minMaxLoc(medBlur, &min, &max, NULL, &maxId);
src.convertTo(src, CV_64FC1);
src -= min;
......@@ -5967,13 +5940,10 @@ int eyemCountObjectIrregularPartsE(EyemImage tpImage, EyemRect tpRoi, const char
//转单通道图像
if (src.channels() != 1)
cv::cvtColor(src, src, cv::COLOR_BGR2GRAY);
//图像裁剪
src = src(cv::Rect(tpRoi.iXs, tpRoi.iYs, tpRoi.iWidth, tpRoi.iHeight)).clone();
//图像尺寸
int X = src.cols, Y = src.rows;
//加载模板
std::vector<EyemModelID> *tpModelIDs = reinterpret_cast<std::vector<EyemModelID>*>(hModelID);
......@@ -6002,19 +5972,16 @@ int eyemCountObjectIrregularPartsE(EyemImage tpImage, EyemRect tpRoi, const char
int tplWidth, tplHeight;
tplWidth = tplMat.cols, tplHeight = tplMat.rows;
//去除局部量斑影响(默认亮斑尺寸不会大于15个像素)
cv::Mat srcTmp;
cv::morphologyEx(src, srcTmp, cv::MORPH_ERODE, cv::getStructuringElement(cv::MORPH_RECT, cv::Size(15, 15)));
//测试用,用于去除黑色坏点干扰
cv::Mat medBlur;
cv::medianBlur(src, medBlur, 3);
//去除黑斑影响
int m = cvRound(cv::mean(src)[0]);
srcTmp.forEach<uint16_t>([&](uint16_t& pixel, const int *pos)->void {
pixel = pixel == 0 ? m : pixel;
});
//去除局部量斑影响(默认亮斑尺寸不会大于15个像素)
cv::morphologyEx(medBlur, medBlur, cv::MORPH_ERODE, cv::getStructuringElement(cv::MORPH_RECT, cv::Size(15, 15)));
//图像增强
double min, max;
cv::minMaxLoc(srcTmp, &min, &max);
cv::minMaxLoc(medBlur, &min, &max);
src.convertTo(src, CV_64FC1);
src -= min;
......@@ -7028,7 +6995,6 @@ int eyemAchvMatchMat(EyemImage tpImage, EyemRect tpRoi, EyemImage *tpDstImg)
int eyemAchvTemplateImage(EyemImage tpImage, EyemRect tpRoi, EyemImage *tpDstImg)
{
cv::Mat image = cv::Mat(tpImage.iHeight, tpImage.iWidth, MAKETYPE(tpImage.iDepth, tpImage.iChannels), tpImage.vpImage).clone();
//检查文件是否存在
if (image.empty())
return FUNC_IMAGE_NOT_EXIST;
......@@ -7039,23 +7005,16 @@ int eyemAchvTemplateImage(EyemImage tpImage, EyemRect tpRoi, EyemImage *tpDstImg
//范围
image = image(cv::Rect(tpRoi.iXs, tpRoi.iYs, tpRoi.iWidth, tpRoi.iHeight));
//图像尺寸
int X = image.cols, Y = image.rows;
//测试用,用于去除黑色坏点干扰
cv::Mat medBlur;
cv::medianBlur(image, medBlur, 3);
//去除局部量斑影响(默认亮斑尺寸不会大于15个像素)
cv::Mat srcTmp;
cv::morphologyEx(image, srcTmp, cv::MORPH_ERODE, cv::getStructuringElement(cv::MORPH_RECT, cv::Size(15, 15)));
//去除局部黑斑影响
int m = cvRound(cv::mean(image)[0]);
srcTmp.forEach<uint16_t>([&](uint16_t& pixel, const int *pos)->void {
pixel = pixel == 0 ? m : pixel;
});
cv::morphologyEx(medBlur, medBlur, cv::MORPH_ERODE, cv::getStructuringElement(cv::MORPH_RECT, cv::Size(15, 15)));
//图像增强
double min, max;
cv::minMaxLoc(srcTmp, &min, &max);
cv::minMaxLoc(medBlur, &min, &max);
image.convertTo(image, CV_64FC1);
image -= min;
......@@ -7066,7 +7025,6 @@ int eyemAchvTemplateImage(EyemImage tpImage, EyemRect tpRoi, EyemImage *tpDstImg
//转8位灰度图
cv::Mat srcPrev;
image.convertTo(srcPrev, CV_8UC1, 1 / 255.);
//设定bin数目
const int histSize = 17;
//设定取值范围
......
......@@ -380,6 +380,8 @@ int eyemNonLocalMeansFilter(EyemImage tpImage, int iCMPSize, int iSearchSize, do
return FUNC_IMAGE_NOT_EXIST;
}
//std::vector<cv::Mat> mvs(3);
//cv::split(image, mvs);
//mvs[0] = cv::imread("C:\\Users\\nzslw\\OneDrive\\程序\\VSProject\\eyemLib\\x64\\Debug\\Portada_paper_b.png", cv::IMREAD_GRAYSCALE);
......@@ -391,12 +393,12 @@ int eyemNonLocalMeansFilter(EyemImage tpImage, int iCMPSize, int iSearchSize, do
//cv::merge(mvs, dest);
//for (int i = 0; i < 10; i++)
//{
//nonLocalMeansFilter_SSE(image, dest, cv::Size(3, 3), cv::Size(5, 5), 10.0, -1, 0);
//image = dest;
//nonLocalMeansFilter_SSE(image, dest, cv::Size(3, 3), cv::Size(5, 5), 10.0, -1, 0);
//image = dest;
//}
//cv::imwrite("Portada_paper5.png", dest);
dest = image < 220;
cv::imwrite("Portada_paper5.png", dest);
return FUNC_OK;
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!