Removed extra reference in record
This commit is contained in:
@@ -20,7 +20,7 @@ public struct float4(float r, float g, float b, float a) {
|
||||
}
|
||||
|
||||
public record ImageData(MagickImage Image, float3[,] Pixels, List<float2> Edges);
|
||||
public record MaskData(float3[,] Mask, ImageData A, ImageData B, List<float2> Edges);
|
||||
public record MaskData(float3[,] Mask, ImageData A, List<float2> Edges);
|
||||
|
||||
public record SDFData(float3[,] SDF);
|
||||
|
||||
@@ -51,10 +51,13 @@ public static class ArrayExt {
|
||||
public class Program {
|
||||
private const float MAX = 65535f;
|
||||
private const float MIN = 0f;
|
||||
private const bool outputMasks = true;
|
||||
private const bool outputMasks = false;
|
||||
private const bool outputSDFs = false;
|
||||
private const bool outputGradients = false;
|
||||
static List<ImageData> Images = new();
|
||||
static List<MaskData> Masks = new();
|
||||
static List<SDFData> SDFs = new();
|
||||
static List<float3[,]> Gradients = new();
|
||||
|
||||
static void LoadImage(string imgPath) {
|
||||
var image = new MagickImage(imgPath);
|
||||
@@ -75,6 +78,7 @@ public class Program {
|
||||
public static void Main(string[] args) {
|
||||
Console.WriteLine("Reading images...");
|
||||
//foreach image in arguments load the image
|
||||
|
||||
LoadImage("01.png");
|
||||
LoadImage("02.png");
|
||||
LoadImage("03.png");
|
||||
@@ -93,10 +97,11 @@ public class Program {
|
||||
}
|
||||
|
||||
Console.WriteLine("Creating masks...");
|
||||
Masks.Add(new (SelfMask(Images[0].Pixels, Images[0].Image.Width, Images[0].Image.Height), Images[0], new()));
|
||||
//for each image pair, create a mask
|
||||
for (int i = 0; i < Images.Count - 1; i++) {
|
||||
var mask = GetABMask(Images[i].Pixels, Images[i + 1].Pixels, Images[i].Image.Width, Images[i].Image.Height);
|
||||
Masks.Add(new(mask, Images[i], Images[i + 1], new()));
|
||||
for (int i = 1; i < Images.Count; i++) {
|
||||
var mask = GetABMask(Images[i-1].Pixels, Images[i].Pixels, Images[i].Image.Width, Images[i].Image.Height);
|
||||
Masks.Add(new(mask, Images[i], new()));
|
||||
}
|
||||
|
||||
Console.WriteLine("Edge detecting masks...");
|
||||
|
||||
Reference in New Issue
Block a user