Compare commits
7 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
11462707f9 | |
|
|
e2c99c798c | |
|
|
ea6dd88433 | |
|
|
505da61336 | |
|
|
7be7ec518e | |
|
|
3ca97a931f | |
|
|
49160dee87 |
|
|
@ -361,3 +361,4 @@ MigrationBackup/
|
|||
|
||||
# Fody - auto-generated XML schema
|
||||
FodyWeavers.xsd
|
||||
/Marking.OCR.Service/images
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ namespace Marking.OCR.Service.Controllers
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取模板截图定位点坐标信息
|
||||
/// 获取模板截图定位点坐标信息
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet("position")]
|
||||
|
|
@ -31,17 +31,17 @@ namespace Marking.OCR.Service.Controllers
|
|||
using var src = await _imageHelper.DownloadImageAsync(position.ImageUrl);
|
||||
if (src == null)
|
||||
{
|
||||
throw Oops.Oh("图片加载失败!");
|
||||
throw Oops.Oh("图片加载失败!");
|
||||
}
|
||||
// 调整图片大小
|
||||
// 调整图片大小
|
||||
Cv2.Resize(src, src, new Size(position.ImageWidth, position.ImageHeight));
|
||||
//_imageHelper.Show(src);
|
||||
|
||||
// 裁剪图片
|
||||
// 裁剪图片
|
||||
using var img_roi = new Mat(src, new Rect(position.X, position.Y, position.Width, position.Height));
|
||||
//_imageHelper.Show(img_roi);
|
||||
|
||||
// 转换灰度图片
|
||||
// 转换灰度图片
|
||||
Cv2.CvtColor(img_roi, img_roi, ColorConversionCodes.BGR2GRAY);
|
||||
//_imageHelper.Show(img_roi);
|
||||
|
||||
|
|
@ -50,11 +50,11 @@ namespace Marking.OCR.Service.Controllers
|
|||
var locationPoints = _imageHelper.FindLocationPoint(imgHandle, false);
|
||||
if (!locationPoints.Any())
|
||||
{
|
||||
throw Oops.Oh("框选范围未找到定位点,请重新框选!");
|
||||
throw Oops.Oh("框选范围未找到定位点,请重新框选!");
|
||||
}
|
||||
if (locationPoints.Count() > 1)
|
||||
{
|
||||
throw Oops.Oh("框选范围识别到多个定位点,请重新框选!");
|
||||
throw Oops.Oh("框选范围识别到多个定位点,请重新框选!");
|
||||
}
|
||||
|
||||
var locationPoint = locationPoints.FirstOrDefault();
|
||||
|
|
|
|||
|
|
@ -1,9 +1,12 @@
|
|||
#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.
|
||||
|
||||
FROM dotnet/aspnet:8.0
|
||||
#FROM dotnet/aspnet:8.0
|
||||
FROM noripi10/ubuntu22-dotnet8-opencv4.8.0:latest
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
ENV ASPNETCORE_HTTP_PORTS=80
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
COPY . .
|
||||
|
|
|
|||
|
|
@ -6,13 +6,26 @@
|
|||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Remove="images\**" />
|
||||
<Content Remove="images\**" />
|
||||
<EmbeddedResource Remove="images\**" />
|
||||
<None Remove="images\**" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Marking.WebExtensions" Version="1.2.1.4" />
|
||||
<PackageReference Include="OpenCvSharp4" Version="4.9.0.20240103" />
|
||||
<PackageReference Include="OpenCvSharp4.Extensions" Version="4.9.0.20240103" />
|
||||
<PackageReference Include="OpenCvSharp4.runtime.win" Version="4.9.0.20240103" />
|
||||
<PackageReference Include="OpenCvSharp4_.runtime.ubuntu.20.04-x64" Version="4.9.0.20240103" />
|
||||
<PackageReference Include="OpenCvSharp4" Version="4.8.0.20230708" />
|
||||
<PackageReference Include="OpenCvSharp4.Extensions" Version="4.8.0.20230708" />
|
||||
<PackageReference Include="OpenCvSharp4.runtime.win" Version="4.8.0.20230708" />
|
||||
<PackageReference Include="OpenCvSharp4_.runtime.ubuntu.20.04-x64" Version="4.8.0.20230708" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="Dockerfile">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ using Qwit;
|
|||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
|
||||
// Add services to the container.
|
||||
builder.Services.AddQwitPack();
|
||||
builder.Services.AddControllers(options =>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
version: "3"
|
||||
|
||||
services:
|
||||
admin-api:
|
||||
ocr-service:
|
||||
image: ${REGISTRY:-harbor.w.23544.com:8843}/marking/marking.ocr.service:${TAG:-latest}
|
||||
hostname: marking
|
||||
environment:
|
||||
|
|
|
|||
Loading…
Reference in New Issue