文件编码格式 改为 utf-8
部署开发环境 / 编译发布 (push) Successful in 2m3s
Details
部署开发环境 / 编译发布 (push) Successful in 2m3s
Details
This commit is contained in:
parent
e2c99c798c
commit
11462707f9
|
|
@ -361,3 +361,4 @@ MigrationBackup/
|
||||||
|
|
||||||
# Fody - auto-generated XML schema
|
# Fody - auto-generated XML schema
|
||||||
FodyWeavers.xsd
|
FodyWeavers.xsd
|
||||||
|
/Marking.OCR.Service/images
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ namespace Marking.OCR.Service.Controllers
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取模板截图定位点坐标信息
|
/// 获取模板截图定位点坐标信息
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpGet("position")]
|
[HttpGet("position")]
|
||||||
|
|
@ -31,17 +31,17 @@ namespace Marking.OCR.Service.Controllers
|
||||||
using var src = await _imageHelper.DownloadImageAsync(position.ImageUrl);
|
using var src = await _imageHelper.DownloadImageAsync(position.ImageUrl);
|
||||||
if (src == null)
|
if (src == null)
|
||||||
{
|
{
|
||||||
throw Oops.Oh("图片加载失败!");
|
throw Oops.Oh("图片加载失败!");
|
||||||
}
|
}
|
||||||
// 调整图片大小
|
// 调整图片大小
|
||||||
Cv2.Resize(src, src, new Size(position.ImageWidth, position.ImageHeight));
|
Cv2.Resize(src, src, new Size(position.ImageWidth, position.ImageHeight));
|
||||||
//_imageHelper.Show(src);
|
//_imageHelper.Show(src);
|
||||||
|
|
||||||
// 裁剪图片
|
// 裁剪图片
|
||||||
using var img_roi = new Mat(src, new Rect(position.X, position.Y, position.Width, position.Height));
|
using var img_roi = new Mat(src, new Rect(position.X, position.Y, position.Width, position.Height));
|
||||||
//_imageHelper.Show(img_roi);
|
//_imageHelper.Show(img_roi);
|
||||||
|
|
||||||
// 转换灰度图片
|
// 转换灰度图片
|
||||||
Cv2.CvtColor(img_roi, img_roi, ColorConversionCodes.BGR2GRAY);
|
Cv2.CvtColor(img_roi, img_roi, ColorConversionCodes.BGR2GRAY);
|
||||||
//_imageHelper.Show(img_roi);
|
//_imageHelper.Show(img_roi);
|
||||||
|
|
||||||
|
|
@ -50,11 +50,11 @@ namespace Marking.OCR.Service.Controllers
|
||||||
var locationPoints = _imageHelper.FindLocationPoint(imgHandle, false);
|
var locationPoints = _imageHelper.FindLocationPoint(imgHandle, false);
|
||||||
if (!locationPoints.Any())
|
if (!locationPoints.Any())
|
||||||
{
|
{
|
||||||
throw Oops.Oh("框选范围未找到定位点,请重新框选!");
|
throw Oops.Oh("框选范围未找到定位点,请重新框选!");
|
||||||
}
|
}
|
||||||
if (locationPoints.Count() > 1)
|
if (locationPoints.Count() > 1)
|
||||||
{
|
{
|
||||||
throw Oops.Oh("框选范围识别到多个定位点,请重新框选!");
|
throw Oops.Oh("框选范围识别到多个定位点,请重新框选!");
|
||||||
}
|
}
|
||||||
|
|
||||||
var locationPoint = locationPoints.FirstOrDefault();
|
var locationPoint = locationPoints.FirstOrDefault();
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ using Qwit;
|
||||||
|
|
||||||
var builder = WebApplication.CreateBuilder(args);
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
|
|
||||||
|
|
||||||
// Add services to the container.
|
// Add services to the container.
|
||||||
builder.Services.AddQwitPack();
|
builder.Services.AddQwitPack();
|
||||||
builder.Services.AddControllers(options =>
|
builder.Services.AddControllers(options =>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue