### ImageMagick version

7.1.1-30

### Operating system

Windows

### Operating system, version and so on

Windows 10, Powershell

### Description

In connected components labeling, the perimeter and hence the circularity calculation seem to be off.

See [discussion 7257](https://github.com/ImageMagick/ImageMagick/discussions/7257).

```
magick -version
Version: ImageMagick 7.1.1-30 Q16-HDRI x64 dd459b0:20240407 https://imagemagick.org                    
Copyright: (C) 1999 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Channel-masks(64-bit) Cipher DPC HDRI Modules OpenCL OpenMP(2.0)
Delegates (built-in): bzlib cairo flif freetype gslib heic jng jp2 jpeg jxl lcms lqr lzma openexr pangocairo png ps raqm raw rsvg tiff webp xml zip zlib
Compiler: Visual Studio 2022 (193833135)
```

### Steps to Reproduce

Given a binary image with a black circle and a black square drawn on white background (shapes.png):

![shapes](https://github.com/ImageMagick/ImageMagick/assets/58369032/2818a66d-3d40-49aa-bfdd-4d650a1950ab)

Image size: 200px x 100px
Square edge length 50px
Circle diameter: 50px

```
magick shapes.png \
-define connected-components:verbose=true \
-define connected-components:area-threshold=0 \
-define connected-components:perimeter-threshold=0 \
-define connected-components:circularity-threshold=0 \
-connected-components 8 \
-contrast-stretch 0 \
components.png
Objects (id: bounding-box centroid area mean-color perimeter circularity):
  0: 200x100+0+0 97.6,49.5 15584 gray(255) 436 1.47804
  2: 50x50+125+25 149.5,49.5 2500 gray(0) 0 0
  1: 50x50+25+25 49.5,49.5 1916 gray(0) 202 0.884377
```

The circle perimeter (ID 1) should be approximately 157.

The square perimeter (ID 2) should be approximately 200.

I would expect the circle's circularity value to be close to 1.0 and the square's circularity value to be around 0.78.


### Images

_No response_
Connected components labeling perimeter and circularity calculation issue
This is a GitHub Issue
repo:ImageMagick
owner:ImageMagick
Title : Connected components labeling perimeter and circularity calculation issue
Issue date:

--- start body ---
### ImageMagick version

7.1.1-30

### Operating system

Windows

### Operating system, version and so on

Windows 10, Powershell

### Description

In connected components labeling, the perimeter and hence the circularity calculation seem to be off.

See [discussion 7257](https://github.com/ImageMagick/ImageMagick/discussions/7257).

```
magick -version
Version: ImageMagick 7.1.1-30 Q16-HDRI x64 dd459b0:20240407 https://imagemagick.org                    
Copyright: (C) 1999 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Channel-masks(64-bit) Cipher DPC HDRI Modules OpenCL OpenMP(2.0)
Delegates (built-in): bzlib cairo flif freetype gslib heic jng jp2 jpeg jxl lcms lqr lzma openexr pangocairo png ps raqm raw rsvg tiff webp xml zip zlib
Compiler: Visual Studio 2022 (193833135)
```

### Steps to Reproduce

Given a binary image with a black circle and a black square drawn on white background (shapes.png):

![shapes](https://github.com/ImageMagick/ImageMagick/assets/58369032/2818a66d-3d40-49aa-bfdd-4d650a1950ab)

Image size: 200px x 100px
Square edge length 50px
Circle diameter: 50px

```
magick shapes.png \
-define connected-components:verbose=true \
-define connected-components:area-threshold=0 \
-define connected-components:perimeter-threshold=0 \
-define connected-components:circularity-threshold=0 \
-connected-components 8 \
-contrast-stretch 0 \
components.png
Objects (id: bounding-box centroid area mean-color perimeter circularity):
  0: 200x100+0+0 97.6,49.5 15584 gray(255) 436 1.47804
  2: 50x50+125+25 149.5,49.5 2500 gray(0) 0 0
  1: 50x50+25+25 49.5,49.5 1916 gray(0) 202 0.884377
```

The circle perimeter (ID 1) should be approximately 157.

The square perimeter (ID 2) should be approximately 200.

I would expect the circle's circularity value to be close to 1.0 and the square's circularity value to be around 0.78.


### Images

_No response_
--- end body ---
