First please excuse my English, it isn’t my first language!
I am attempting to course of an present picture to create a sport map, to be clear, this isn’t a procedurally-generated picture. Nevertheless, I want to implement a procedural method, to spotlight the borders of any such picture:
I began by processing the picture and created a filter/masks to isolate the border utilizing a primary sobel algorithm, carried out utilizing UE
float2 sobelMatrix[9] =
{
float2(-1, -1), float2(0, -2), float2(1, -1),
float2(-2, 0), float2(0, 0), float2(2, 0),
float2(-1, 1), float2(0, 2), float2(1, 1)
};
float2 gradients = .0;
for (int i = 0; i < 9; ++i)
{
int row = i / 3;
int column = i % 3;
float offsetX = (column - 1) / decision.x;
float offsetY = (column - 1) / decision.y;
float2 offsetUV = float2(uv.x + offsetX, uv.y + offsetY);
float sampledIntensity = SceneTextureLookup(offsetUV, 14, false);
gradients += sobelMatrix[i] * sampledIntensity;
}
return size(gradients);
I can get varied outcomes by additional manipulation of the masks made by sobel
That is what I need obtain, so here is Actuality vs Expectation,
I wish to obtain a picture just like the instance on the precise. I am not referring to tiling, I’m referring to the clear-cut area and borders.
Does an algorithm exist that may do that?