Skip to main content
added 104 characters in body
Source Link
ubpdqn
  • 67.8k
  • 3
  • 66
  • 164

This is a recreational question. At my workplace within the same stairwell there are different steps numbers per floor on certain floors.

I have tried to automate counting the steps by binarising the image (Binarize and Dilation, Erosion, DeleteSmallComponents) to minimize lines. ImageLines, ImageCorners and GradientOrientahitionFilter did not yield helpful results (this is most likely my lack of experience and understanding). I have not tried AI queries.

I can manually count the steps (as it is a small number of points):

enter image description here

pts = {{2118, 4821}, {2041, 4657}, {1933, 4478}, {1820, 4242}, {1718, 4001}, {1590, 3739}, {1456, 3452}, {1261, 3118}, {1072, 2713}, {805, 2236}, {533, 1687}, {164, 1056}} Show[i, Graphics[{Red, PointSize[0.02], Point[pts], MapThread[ Text[Style[#1, Bold], #2, {0, -3}] &, {Range[Length[pts]], pts}]}, ImageSize -> ImageDimensions[i]]] 

enter image description here

The other example: enter image description here

pts2 = {{1194, 3120}, {1173, 3011}, {1151, 2921}, {1111, 2834}, {1082, 2733}, {1050, 2628}, {999, 2476}, {955, 2309}, {879, 2103}, {807, 1889}, {742, 1578}, {626, 1241}, {477, 777}}; Show[i2, Graphics[{Red, PointSize[0.02], Point[pts2], MapThread[ Text[Style[#1, Bold], #2, {1, -4}] &, {Range[Length[pts2]], pts2}]}, ImageSize -> ImageDimensions[i2]]] 

enter image description here

I did not post my attempts other than the above as they were not edifying and it would be too messy.

This is a recreational question. At my workplace within the same stairwell there are different steps numbers per floor on certain floors.

I have tried to automate counting the steps by binarising the image (Binarize and Dilation, Erosion, DeleteSmallComponents) to minimize lines. ImageLines, ImageCorners and GradientOrientahitionFilter did not yield helpful results (this is most likely my lack of experience and understanding). I have not tried AI queries.

I can manually count the steps (as it is a small number of points):

enter image description here

pts = {{2118, 4821}, {2041, 4657}, {1933, 4478}, {1820, 4242}, {1718, 4001}, {1590, 3739}, {1456, 3452}, {1261, 3118}, {1072, 2713}, {805, 2236}, {533, 1687}, {164, 1056}} Show[i, Graphics[{Red, PointSize[0.02], Point[pts], MapThread[ Text[Style[#1, Bold], #2, {0, -3}] &, {Range[Length[pts]], pts}]}, ImageSize -> ImageDimensions[i]]] 

enter image description here

The other example: enter image description here

pts2 = {{1194, 3120}, {1173, 3011}, {1151, 2921}, {1111, 2834}, {1082, 2733}, {1050, 2628}, {999, 2476}, {955, 2309}, {879, 2103}, {807, 1889}, {742, 1578}, {626, 1241}, {477, 777}}; Show[i2, Graphics[{Red, PointSize[0.02], Point[pts2], MapThread[ Text[Style[#1, Bold], #2, {1, -4}] &, {Range[Length[pts2]], pts2}]}, ImageSize -> ImageDimensions[i2]]] 

enter image description here

This is a recreational question. At my workplace within the same stairwell there are different steps numbers per floor on certain floors.

I have tried to automate counting the steps by binarising the image (Binarize and Dilation, Erosion, DeleteSmallComponents) to minimize lines. ImageLines, ImageCorners and GradientOrientahitionFilter did not yield helpful results (this is most likely my lack of experience and understanding). I have not tried AI queries.

I can manually count the steps (as it is a small number of points):

enter image description here

pts = {{2118, 4821}, {2041, 4657}, {1933, 4478}, {1820, 4242}, {1718, 4001}, {1590, 3739}, {1456, 3452}, {1261, 3118}, {1072, 2713}, {805, 2236}, {533, 1687}, {164, 1056}} Show[i, Graphics[{Red, PointSize[0.02], Point[pts], MapThread[ Text[Style[#1, Bold], #2, {0, -3}] &, {Range[Length[pts]], pts}]}, ImageSize -> ImageDimensions[i]]] 

enter image description here

The other example: enter image description here

pts2 = {{1194, 3120}, {1173, 3011}, {1151, 2921}, {1111, 2834}, {1082, 2733}, {1050, 2628}, {999, 2476}, {955, 2309}, {879, 2103}, {807, 1889}, {742, 1578}, {626, 1241}, {477, 777}}; Show[i2, Graphics[{Red, PointSize[0.02], Point[pts2], MapThread[ Text[Style[#1, Bold], #2, {1, -4}] &, {Range[Length[pts2]], pts2}]}, ImageSize -> ImageDimensions[i2]]] 

enter image description here

I did not post my attempts other than the above as they were not edifying and it would be too messy.

Source Link
ubpdqn
  • 67.8k
  • 3
  • 66
  • 164

Counting steps on a staircase

This is a recreational question. At my workplace within the same stairwell there are different steps numbers per floor on certain floors.

I have tried to automate counting the steps by binarising the image (Binarize and Dilation, Erosion, DeleteSmallComponents) to minimize lines. ImageLines, ImageCorners and GradientOrientahitionFilter did not yield helpful results (this is most likely my lack of experience and understanding). I have not tried AI queries.

I can manually count the steps (as it is a small number of points):

enter image description here

pts = {{2118, 4821}, {2041, 4657}, {1933, 4478}, {1820, 4242}, {1718, 4001}, {1590, 3739}, {1456, 3452}, {1261, 3118}, {1072, 2713}, {805, 2236}, {533, 1687}, {164, 1056}} Show[i, Graphics[{Red, PointSize[0.02], Point[pts], MapThread[ Text[Style[#1, Bold], #2, {0, -3}] &, {Range[Length[pts]], pts}]}, ImageSize -> ImageDimensions[i]]] 

enter image description here

The other example: enter image description here

pts2 = {{1194, 3120}, {1173, 3011}, {1151, 2921}, {1111, 2834}, {1082, 2733}, {1050, 2628}, {999, 2476}, {955, 2309}, {879, 2103}, {807, 1889}, {742, 1578}, {626, 1241}, {477, 777}}; Show[i2, Graphics[{Red, PointSize[0.02], Point[pts2], MapThread[ Text[Style[#1, Bold], #2, {1, -4}] &, {Range[Length[pts2]], pts2}]}, ImageSize -> ImageDimensions[i2]]] 

enter image description here