Add saliency-based smart crop before resize

Replace the center-crop cover resize with a Sobel edge-density search
that picks the target-aspect window with the most edge energy, so a
subject off-center isn't sliced when the input aspect differs from the
frame's. Failures fall back to the centered crop. Golden fixtures are
regenerated and an asymmetric-edges input exercises the bias.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
zyberzeroandClaude Opus 5.5 committed 2026-11-03 19:03:22 +01:00
1 parent 675d206234
commit ac9a0b43a8
24 files changed
+340 -24

No files matched your search

+2
View File
@@ -2,6 +2,7 @@ using System.Net;
using FrameProcessor.Concurrency;
using FrameProcessor.Configuration;
using FrameProcessor.ImagePipeline;
using FrameProcessor.ImagePipeline.SmartCrop;
using FrameProcessor.Middleware;
using FrameProcessor.Mqtt;
using FrameProcessor.Storage;
@@ -150,6 +151,7 @@ builder.Services.AddOptions<FramesOptions>()
.Bind(builder.Configuration);
builder.Services.AddSingleton<FramesOptionsValidator>();
builder.Services.AddSingleton<FramesRegistry>();
builder.Services.AddSingleton<ISmartCropper, SaliencySmartCropper>();
builder.Services.AddSingleton<IImagePipeline, FrameProcessor.ImagePipeline.ImagePipeline>();
builder.Services.AddSingleton<ImageStore>();
builder.Services.AddSingleton<MqttPublisher>();