Skip to main content
added 6 characters in body
Source Link
Anton Antonov
  • 38k
  • 3
  • 103
  • 179

This is not an answer more of an extended comment...

My mission is to extract information on the typical distance between the black patches in the image I have attached here.

Do we have to use Fourier transform for this?

For example we can get the required estimate with these commands:

img = Import["https://i.sstatic.net/hALsH.jpg"];
Row[{"Image dimensions:", ImageDimensions[img]}]
imgB = ColorNegate@Binarize[img, 0.4];
Block[{img = imgB}, 
 Show[img, 
  Graphics[{Red, Thick, 
    Circle[#[[1]], #[[2]]] & /@ 
     ComponentMeasurements[
       img, {"Centroid", "EquivalentDiskRadius"}][[All, 2]]}]]
 ]

comps = ComponentMeasurements[
    imgB, {"Centroid", "EquivalentDiskRadius"}][[All, 2]];

dists = Flatten@
   Map[Take[Sort[#], UpTo[5]] &, 
    Outer[EuclideanDistance[#1[[1]], #2[[1]]] - (#1[[2]] + #2[[2]]) &,
      comps, comps, 1]];

qs = Range[0, 1, 0.25];
TableForm[{qs, Quantile[dists, qs]}]

Histogram[dists]

This is not answer more of extended comment...

My mission is to extract information on the typical distance between the black patches in the image I have attached here.

Do we have to use Fourier transform for this?

For example we can get the required estimate with these commands:

img = Import["https://i.sstatic.net/hALsH.jpg"];
Row[{"Image dimensions:", ImageDimensions[img]}]
imgB = ColorNegate@Binarize[img, 0.4];
Block[{img = imgB}, 
 Show[img, 
  Graphics[{Red, Thick, 
    Circle[#[[1]], #[[2]]] & /@ 
     ComponentMeasurements[
       img, {"Centroid", "EquivalentDiskRadius"}][[All, 2]]}]]
 ]

comps = ComponentMeasurements[
    imgB, {"Centroid", "EquivalentDiskRadius"}][[All, 2]];

dists = Flatten@
   Map[Take[Sort[#], UpTo[5]] &, 
    Outer[EuclideanDistance[#1[[1]], #2[[1]]] - (#1[[2]] + #2[[2]]) &,
      comps, comps, 1]];

qs = Range[0, 1, 0.25];
TableForm[{qs, Quantile[dists, qs]}]

Histogram[dists]

This is not an answer more of an extended comment...

My mission is to extract information on the typical distance between the black patches in the image I have attached here.

Do we have to use Fourier transform for this?

For example we can get the required estimate with these commands:

img = Import["https://i.sstatic.net/hALsH.jpg"];
Row[{"Image dimensions:", ImageDimensions[img]}]
imgB = ColorNegate@Binarize[img, 0.4];
Block[{img = imgB}, 
 Show[img, 
  Graphics[{Red, Thick, 
    Circle[#[[1]], #[[2]]] & /@ 
     ComponentMeasurements[
       img, {"Centroid", "EquivalentDiskRadius"}][[All, 2]]}]]
 ]

comps = ComponentMeasurements[
    imgB, {"Centroid", "EquivalentDiskRadius"}][[All, 2]];

dists = Flatten@
   Map[Take[Sort[#], UpTo[5]] &, 
    Outer[EuclideanDistance[#1[[1]], #2[[1]]] - (#1[[2]] + #2[[2]]) &,
      comps, comps, 1]];

qs = Range[0, 1, 0.25];
TableForm[{qs, Quantile[dists, qs]}]

Histogram[dists]

Source Link
Anton Antonov
  • 38k
  • 3
  • 103
  • 179

This is not answer more of extended comment...

My mission is to extract information on the typical distance between the black patches in the image I have attached here.

Do we have to use Fourier transform for this?

For example we can get the required estimate with these commands:

img = Import["https://i.sstatic.net/hALsH.jpg"];
Row[{"Image dimensions:", ImageDimensions[img]}]
imgB = ColorNegate@Binarize[img, 0.4];
Block[{img = imgB}, 
 Show[img, 
  Graphics[{Red, Thick, 
    Circle[#[[1]], #[[2]]] & /@ 
     ComponentMeasurements[
       img, {"Centroid", "EquivalentDiskRadius"}][[All, 2]]}]]
 ]

comps = ComponentMeasurements[
    imgB, {"Centroid", "EquivalentDiskRadius"}][[All, 2]];

dists = Flatten@
   Map[Take[Sort[#], UpTo[5]] &, 
    Outer[EuclideanDistance[#1[[1]], #2[[1]]] - (#1[[2]] + #2[[2]]) &,
      comps, comps, 1]];

qs = Range[0, 1, 0.25];
TableForm[{qs, Quantile[dists, qs]}]

Histogram[dists]