Chapter 6 Precise Hit
Chapter 6 Precise Hit
On the other side of the residential area, Lin Dong was still unaware of what had happened to the Xu family.
Tomorrow is Saturday, no school, and the rule that we have to go to bed at 9 pm is lifted tonight.
He held the digital camera his father, Lin Weiliang, had bought last year, and pointed it at a large, transparent glass jar used for pickling vegetables, aiming it at a few mosquitoes inside to take pictures.
click-
click-
Photos of mosquitoes flying from different angles were taken and imported into the computer.
Lin Dong opened the image processing software and analyzed the morphological characteristics of the mosquitoes bit by bit.
"Mosquitoes range in size from 3 to 9 millimeters, their flight paths exhibit a distinct zigzag pattern, and their bodies are elongated oval in shape..."
Lin Dong extracted the mosquito's body shape characteristics and imported them into the laser's control program as identification samples, then set the similarity trigger value.
Compared to the improvements to the laser, the task of identifying and controlling the program was a simple one for Lin Dong.
After all, he studied animation in his previous life, so he had a foundation in computational animation and computer programming. In addition, he had experience working with product managers and technical departments, so he also had a certain understanding of programming algorithms in this life.
Now, with a little review of programming books and the added boost of spiritual vision, one can practically become the code god of this era.
From image acquisition by the camera, target recognition of mosquitoes, spatial position calculation, to motion control of the turret and triggering of the laser, the entire recognition and control process is achieved in less than a thousand lines of code.
"The recognition module uses contour matching and motion detection for dual verification to reduce the false recognition rate..."
"The PID algorithm is used for turret motion control to ensure smooth tracking..."
"The security logic has the highest priority. If either the infrared sensor or the human detection is triggered, all outputs will be immediately interrupted..."
"Based on the current power of the laser, and considering the laser energy absorption rate of mosquitoes, a 0.1-second laser pulse within a 5-meter range would be enough to kill a mosquito..."
Lin Dong wrote and tested simultaneously, compiling and running each functional module as soon as it was finished, using previously taken photos and videos of mosquitoes for debugging.
Time slipped away quietly amidst the clatter of keyboard clicks.
By the time he finished writing the last line of code, it was nearly 10 p.m.
"The software work is complete. We'll wait for Uncle Xu's parts tomorrow, and then the entire laser turret can be assembled."
Lin Dong took a computer motherboard with a pre-installed graphics card, flashed the program onto it, confirmed there were no problems, yawned, and went to the next room to sleep.
The next day, at nine o'clock in the morning.
Sunlight streamed through the sheer curtains in the living room, casting a warm, golden glow on the floor.
Zhang Xiali and Lin Weiliang were cleaning together with mops.
At this time.
The doorbell rang a few times.
The couple exchanged a glance, and Zhang Xiali took off her gloves and went to open the door, where Xu Ziming's family of three came into view.
Xu Ziming carried two bottles of wine, Zhou Xiaoyan carried a bag of fruit, and Xu Qingling, dressed in a dress and holding a box, followed behind her parents with excitement on her face.
"Engineer Xu, Sister Zhou, come in quickly."
Zhang Xiali paused for a moment when she saw the visitor, then quickly took out several pairs of new slippers, while calling out to the inside, "Weiliang, Engineer Xu and his family are here. Please tidy up and make some tea."
"Mr. Zhang, sorry to bother you." Xu Ziming smiled and nodded, then changed into slippers and came in.
Xu Qingling walked into the entrance hall and looked inside, but did not see Lin Dong. She turned to Zhang Xiali and asked, "Aunt Zhang, where is Lin Dong? I want to go play with him."
"He's still sleeping. I'll wake him up."
Zhang Xiali handed Xu Qingling a new pair of children's slippers: "Auntie just mopped the floor, be careful."
"I'm going to find him."
Xu Qingling, the little girl, didn't seem to be unfamiliar with the place. She changed into slippers, grabbed the box, and ran inside.
Just then, Lin Dong heard the noise outside and, without Zhang Xiali calling him, came out wearing short-sleeved pajamas and with his hair all messy.
"Lin Dong, look!"
Xu Qingling saw Lin Dong's figure and exclaimed in surprise. She opened the box in her hand, revealing a dozen or so metal parts neatly stacked inside.
"My dad finished making the parts you requested last night. When do we start assembling the laser mosquito killer?"
"No rush, let me have breakfast first."
Lin Dong took the box, and with a thought, he entered his soul vision, focusing his mind on the parts in front of him.
Wow! The shape, structure, and dimensional parameters of each part automatically appeared in my mind, and every dimension matched the drawing perfectly.
"Thank you, Uncle Xu. This technique is excellent; it looks perfect."
Lin Dong regained his composure and politely thanked Xu Ziming.
"Take it and play with it."
Looking at Lin Dong's polite demeanor, and then at Xu Qingling who had been following Lin Dong in, Xu Ziming's smiling expression vanished instantly, and he forced out a stiff voice.
"Old Xu, come and sit down. Let the kids play their games. Why are you getting involved?"
Zhou Xiaoyan nudged him from the side and smiled at Lin Dong, "Xiao Dong, go have breakfast, take Qingling out to play, we'll chat with your parents for a while."
"Okay, Aunt Xiaoyan, you two chat."
Lin Dong didn't join in the adults' conversation. He took a bottle of milk from the refrigerator and then brought out a bowl of dan dan noodles with the noodles and seasonings separated from the noodles from the kitchen. He mixed the seasonings and noodles together and that was his breakfast.
After breakfast, Lin Dong led Xu Qingling into the study and took out the computer motherboard whose control program had been flashed the day before, ready to assemble it.
"Lin Dong, does this laser device also require a graphics card?"
Xu Qingling saw the computer motherboard that Lin Dong took out and couldn't help but ask a question out of curiosity.
"It needs to be able to identify mosquitoes, so its performance requirements are quite high," Lin Dong explained simply.
The laser's turret base is driven by a motor, and theoretically, an industrial microcontroller is the most suitable device to control the motor's operation.
If you just want to use the laser to swatt mosquitoes, controlling the direction is secondary.
The most crucial task is to identify and track mosquitoes, a requirement that a single-chip microcomputer simply cannot meet; a computing chip must be used.
But it was 08, and the concept of computing chips had not yet emerged. We had to settle for using GPU graphics cards, which had better computing power, as a substitute.
talking.
Lin Dong then took the camera, infrared sensor, and improved the triggering laser, servo motor, and other components, arranging them in a row on the ground.
First, the laser's base is installed. The horizontal rotation mechanism is then mounted on the base, and the meshing clearance of the worm gear is adjusted. Next, the pitch mechanism and drive motor are installed, followed by the mounting bracket. Finally, the laser is mounted on the bracket.
The camera and infrared sensor are rigidly mounted above the laser, with the angle as parallel to the laser as possible to ensure aiming accuracy.
Finally, there's the control motherboard. The sensor signal lines, motor control lines, and laser trigger lines are all routed to the motherboard and secured to the side of the base with cable ties.
Xu Qingling squatted down beside him, watching Lin Dong's movements intently with her small face, occasionally helping to hand him tools, and she was as quiet as a docile kitten.
Soon, the last screw was tightened.
A circular base about 30 centimeters in diameter, supporting a laser emitter that could rotate 160° horizontally and be adjusted in pitch, appeared in front of the two.
"You can test it now."
Lin Dong plugged in the power, turned on the laser, connected it to the computer, and opened the debugging interface of the control software.
beep!
Laser activated.
A bright red dot appeared on the wall.
Lin Dong looked at the laser's position, then measured the actual focus point of the camera, and entered the difference between the camera and the laser in the debugging interface to correct the aiming data.
With a shooting distance of 5 meters, a total of 1000 spatial points are divided, with each point spaced 0.5 centimeters apart, which is enough to bring all mosquitoes that fly into the range into the aiming range.
"There's also a time delay..."
Lin Dong opened the debugging interface and repeatedly measured the camera's shooting delay and the turret's movement delay. Finally, based on the obtained data, he corrected the motor's poor operation and improved the control program's operating algorithm...
After spending more than an hour debugging and correcting a series of data, Lin Dong picked up the glass jar from yesterday and released the mosquitoes inside.
"Don't stand in front of the camera."
Lin Dong shouted, signaling Xu Qingling to stand further away, and then activated the laser turret.
beep!
The monitoring computer screen displays images captured by the camera.
The next instant, the recognition code captured the image of the mosquito, drove the motor to start, and the laser began to aim and lock.
Sizzle sizzle sizzle—
Laser pulses are emitted at 0.1-second intervals.
Three mosquitoes were flying in the air. Two of them flashed red light for a moment and then fell straight down, emitting a burnt smell.
Sizzle sizzle sizzle—
The laser continued firing to finish off the enemy.
In less than a second, the third mosquito was also hit and fell to the ground, turning into a charred corpse.
dognovel