Skip to content

Image.CollapseHorizontally and Image.CollapseVertically #6

@swharden

Description

@swharden

Something like

public static double[] CollapseHorizontally(SciTIF.Image imgR)
{
    double[] collapsed = new double[imgR.Height];
    for (int y = 0; y < imgR.Height; y++)
    {
        double xSum = 0;
        for (int x = 0; x < imgR.Width; x++)
        {
            int offset = y * imgR.Width + x;
            xSum += imgR.Values[offset];
        }
        double xMean = xSum / imgR.Width;
        collapsed[y] = xMean;
    }
    return collapsed;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions