Marching squares: Difference between revisions

Content deleted Content added
Djexplo (talk | contribs)
Djexplo (talk | contribs)
Line 4:
The Marching Squares algorithm consist of the same step as [[marching cubes]] in [[3D]] .
A basic description of the steps:
# First step is to apply a threshold the 2D matrix (image) to make a binary image with all pixelpixels above the iso-treshold set to true (1) and the other pixels to false (0)
# Now every 2x2 pixels values in the binary image form a cell, thus the image is represented by an grid of cells
# Every cell has 4 binary-pixel-values [b1,b2,b3,b4], these are used to calculate a number from 0 to 15 which describes these values. The following equation is used N = b1 + b2*2+b3*4+b4*8
# Then the cell-number is used to look up which lines are needed to represent the cell, using an lines-database with all the 16 cases.
# After placing the lines from the database into the cells, you have found the contour geometry.