Migration to V1 #1326
-
I used to use SixLabors.ImageSharp.Processing.Processors.Convolution.SobelProcessor in 1.0.0-beta0008, it seems to have been removed or renamed in V1. For broader context, I am using the Sobel Processor to find a bounding box for forms that have been scanned in to position the content. Here is some F# code:
I am using some internal stuff to achieve this, specifically I use reflection to get the bounding rectangle, perhaps there is an easier way? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Yeah Regarding The equivalent code that we use to calculate the bounding box for entropy cropping can be found in the source here. |
Beta Was this translation helpful? Give feedback.
Yeah
GetFilteredBoundingRectangle
is internal, we've no plans currently to expose the method as I would like to refactor it first so I would copy the code rather than use reflection as I'm not even happy with the name.Regarding
SobelProcessor
yeah that was changed as part of #1299 where we refactored the edge detection API to allow passing of custom kernels.EdgeDetector2DProcessor(KnownEdgeDetectorKernels.Sobel, true)
performs the equivalent operation.The equivalent code that we use to calculate the bounding box for entropy cropping can be found in the source here.
ImageSharp/src/ImageSharp/Processing/Processors/Transforms/EntropyCropProcessor{TPixel}.cs
Lines 44 to 51 in 8e2792e