Crofton Perimeter Counts Directional Boundary Crossings
2026-11-26

Crofton Perimeter Counts Directional Boundary Crossings

Crofton Perimeter estimates a silhouette's boundary length by counting how families of lines cross that boundary. This provides a different construction from tracing every horizontal and vertical edge around foreground pixels. For a manufacturing image, the distinction matters when interpreting a perimeter reported in pixels and when comparing the same shape at different orientations.

The continuous formula averages over line position and direction

Describe a line by its normal angle theta and its signed distance p from the origin. Let N of theta and p be the number of intersections between that line and the boundary of a sufficiently regular planar region. Except for measure-zero tangency cases, crossings can be counted consistently.

The continuous Crofton expression for boundary length is one half times the integral over theta from zero to pi of the integral of N over all p. Both line positions and directions are necessary. Counting only lines at a single orientation would favor some boundary orientations over others.

For a circle of radius R, every line with absolute p less than R crosses twice. The integral over p is therefore four R for each direction. Multiplying by the angle range pi and the factor one half gives two pi R, the circle's circumference.

The official scikit-image perimeter-estimator example compares ordinary perimeter approximations with two- and four-direction Crofton estimates while rotating a square and a disk. Its comparison directly illustrates why the estimator definition belongs alongside an image measurement.

Circle2crossings pwithinR integral4R angleπ factorhalf2πR.
Original abstract geometric line-family diagram. Source: Zhilianhai editorial desk, original AI-assisted conceptual illustration.

A sampled grid replaces integrals with directional quadrature

On a square grid with unit spacing, horizontal and vertical scan-line families each have perpendicular line spacing one. The two diagonal families have perpendicular spacing one divided by the square root of two. That perpendicular spacing is different from the distance traveled along a diagonal from one pixel center to the next.

Let Nh and Nv denote the total foreground-background boundary transitions along the horizontal and vertical families. Let Nd1 and Nd2 be the analogous totals for the two diagonal families. Include the background outside the image so a foreground run has both an entering and a leaving transition.

A two-direction estimate is pi divided by four times Nh plus Nv. A four-direction estimate is pi divided by eight times the quantity Nh plus Nv plus Nd1 plus Nd2 divided by the square root of two, where the division applies to the combined diagonal counts.

The official scikit-image implementation uses binary conversion, background padding and local-pattern lookup weights for its Crofton estimator. The directional counting exercise here independently checks the simple rectangle case rather than reproducing a library output without explaining its convention.

An invented four-by-six mask makes the weights visible

Fill four consecutive rows and six consecutive columns of a binary grid with foreground, surrounded by background. Each of the four horizontal foreground runs has two transitions, giving Nh equal to eight. The six vertical runs similarly give Nv equal to twelve.

There are nine nonempty diagonal runs in either diagonal direction because four plus six minus one is nine. Each run has two transitions, so Nd1 and Nd2 are both eighteen. The individual diagonal run lengths vary, but their transition count remains two per nonempty run.

The two-direction estimate is five pi, approximately 15.708. The four-direction estimate is pi divided by eight times twenty plus thirty-six divided by the square root of two, approximately 17.850. Those numbers use unit pixel spacing and the declared line-family quadrature.

Walking the outer edges of the twenty-four unit square cells instead gives a perimeter of twenty. This is an exact length for that union of square cells, while Crofton is being used as an estimate of an underlying continuous boundary from samples. The different results should not be compared as if all three procedures integrated the identical geometric representation exactly.

4x6binarymask Nh8Nv12 Nd18each L2=15.708 L4=17.850.
Original invented sample mask and directional arithmetic. Source: Zhilianhai editorial desk, original AI-assisted conceptual illustration.

More directions do not remove every source of image uncertainty

Adding diagonal directions improves the angular sampling relative to using only the axes, but it does not magically recover a boundary lost through coarse sampling. A small shape can retain appreciable grid and orientation dependence. The continuous formula and its finite-direction approximation should therefore remain separate claims.

A binary mask must also be defined before measuring. Changing a threshold, filling a hole or merging two touching objects changes which boundary is counted. A total perimeter can include several components and internal holes; it is not automatically the outside perimeter of one selected part.

For an isotropic pixel pitch a, multiply a result in pixel units by a to obtain a physical length. If the horizontal and vertical pixel pitches differ, a single scalar conversion is insufficient for the square-grid weights used here. The coordinate geometry or estimator must account for that anisotropy.

Related reading appears in industrial image analysis and measurement interpretation. Both original figures explain synthetic crossings and weights, without supplying a measured contour, an acceptance threshold or a universal claim that one finite-grid estimate is exact.

18028484626 CONTACT US

公司:智联海(惠州)科技有限公司

地址:惠州仲恺高新区陈江街道白云山工业大道 5 号六楼 601

Q Q:18028484626

Copyright © 2002-2026

粤xxx

咨询 在线留言 电话:18028484626
微信 微信扫码添加我