提交代码
This commit is contained in:
@@ -7,7 +7,7 @@ namespace HardwareWeb.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// 靶样轮廓识别与采样点规划接口。
|
||||
/// 流程:采集基准画面 -> 采集靶样画面 -> 分析并返回处理后的图像。
|
||||
/// 流程:抓取相机当前画面 -> 分析并返回处理后的图像。
|
||||
/// </summary>
|
||||
[ApiController]
|
||||
[Route("api/sample")]
|
||||
@@ -24,36 +24,21 @@ namespace HardwareWeb.Controllers
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
/// <summary>连续抓取多帧并取中值作为基准背景画面。</summary>
|
||||
[HttpPost("baseline")]
|
||||
[ProducesResponseType(typeof(SampleBaselinePayload), StatusCodes.Status200OK)]
|
||||
public async Task<IActionResult> CaptureBaseline(CancellationToken ct)
|
||||
/// <summary>
|
||||
/// 获取轮廓识别的等待超时时间,
|
||||
/// 取自系统参数 camera_Identification_outtime(秒)。
|
||||
/// </summary>
|
||||
[HttpGet("analyze-timeout")]
|
||||
[ProducesResponseType(typeof(AnalyzeTimeoutPayload), StatusCodes.Status200OK)]
|
||||
public IActionResult AnalyzeTimeout()
|
||||
{
|
||||
try
|
||||
{
|
||||
return Ok(SampleBaselinePayload.From(
|
||||
await _service.CaptureBaselineAsync(ct)));
|
||||
}
|
||||
catch (HardwareException ex)
|
||||
{
|
||||
return HardwareError(ex);
|
||||
}
|
||||
}
|
||||
var timeoutSeconds = _service.GetIdentificationTimeoutSeconds();
|
||||
_logger.LogInformation(
|
||||
"前端轮廓识别等待超时:{TimeoutSeconds} 秒" +
|
||||
"(系统参数 camera_Identification_outtime)",
|
||||
timeoutSeconds);
|
||||
|
||||
/// <summary>关闭红外测距光源后抓取当前最新画面作为靶样画面。</summary>
|
||||
[HttpPost("target")]
|
||||
[ProducesResponseType(typeof(SampleTargetPayload), StatusCodes.Status200OK)]
|
||||
public async Task<IActionResult> CaptureTarget(CancellationToken ct)
|
||||
{
|
||||
try
|
||||
{
|
||||
return Ok(SampleTargetPayload.From(
|
||||
await _service.CaptureTargetAsync(ct)));
|
||||
}
|
||||
catch (HardwareException ex)
|
||||
{
|
||||
return HardwareError(ex);
|
||||
}
|
||||
return Ok(new AnalyzeTimeoutPayload(timeoutSeconds));
|
||||
}
|
||||
|
||||
/// <summary>提取靶样轮廓、绘制采样点并返回处理后的 JPEG 图像。</summary>
|
||||
|
||||
Reference in New Issue
Block a user