When Python meets Harbin Institute of Technology drone rehearsal

6.7 is the 100th anniversary of Harbin Institute of Technology. I have been in love with the University for 11 years. From a young man to an uncle, in the year of decisive victory in poverty alleviation, I am also rushing towards the uncle. There is no sign of slowing down.

When Python meets Harbin Institute of Technology drone rehearsal
When Python meets Harbin Institute of Technology drone rehearsal
I planted grass in DJI's spark in 17 years. I feel that electronic products are very cool, but during the special time of the 100th anniversary of the University of Technology, I watched the drone performance very seriously. I forgot my troubles and sorrows. I went to Uncle T with pride and excitement from time to time. woc, NB words. If you haven’t seen it, you can press the picture below for a long time and review it with Deng. It’s really good-looking, I won’t lie to you^_^

When Python meets Harbin Institute of Technology drone rehearsal
When Python meets Harbin Institute of Technology drone rehearsal
I didn’t want to write about wobbly work. I don’t need my propaganda about wobbly work, but I just saw a problem when I knew it.

When Python meets Harbin Institute of Technology drone rehearsal

One of the answers fits my straight man's appetite, and it is an analysis done in Python, so I will share it with you. On the one hand, you can learn Python and have fun; on the other hand, to promote your alma mater, our University of Technology is particularly suitable for the following two types of people to apply for:

  1. Boys interested in engineering
  2. Girls who are interested in engineering men are
    far away. Regarding Zhihu questions, here are the answers from Zhihu user Yihui alumni

Looking at this question, as a rigorous university of engineering, the first thing that comes to mind is how many drones are used? Are there thousands? count! So I cut a few pictures at station B and wrote a small Python program to count the number of drones~

When Python meets Harbin Institute of Technology drone rehearsal

There are about 871 in this picture, the code is like this:

作者:Yihui
链接:https://www.zhihu.com/question/399162890/answer/1271327705
来源:知乎
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

from skimage.feature import blob_log
from skimage.color import rgb2gray
import skimage.io
import matplotlib.pyplot as plt

image = skimage.io.imread('1920-2020.png')
image_gray = rgb2gray(image)

# Laplacian of Gaussian
blobs_log = blob_log(image_gray, max_sigma=4, threshold=.09)
blobs_log[:, 2] = 4

fig, ax = plt.subplots(1)
ax.set_aspect('equal')

# Show the image
ax.imshow(image_gray)

n = 0
for blob in blobs_log:
    y, x, r = blob
    if x > 2100:    # remove bilibili logo
        continue
    n += 1
    c = plt.Circle((x, y), r, color='red', linewidth=1, fill=False)
    ax.add_patch(c)
ax.set_axis_off()
ax.set_title('{} drones'.format(n))
print(n)
plt.show()

The original picture is like this:

When Python meets Harbin Institute of Technology drone rehearsal

Of course, not all drones in this picture are bright, let's take another one~

When Python meets Harbin Institute of Technology drone rehearsal

There are a bit less in this picture, about 801. How many are there? You can take out a ruler and measure the picture below, or ask alumni directly~

When Python meets Harbin Institute of Technology drone rehearsal

The conclusion is that 60 x 15 = 900 are used, and there are no 1,000 drones, so the problem is not true!

In fact
, the drones participating in the show, like the dancing robots in the Spring Festival Gala, are all products of the Harbin Institute of Technology Robotics Group.

Guess you like

Origin blog.51cto.com/15069487/2578486