0%

NaoVision Concise Document

Project Summary

Introduction

NaoVision is a dedicated NAO group of dedicated vision method solutions for NAO robots in the RoboCup competition. NaoVision was written in C++ and is designed to solve the problem that NAO robots in the Bhuman system under the original fixed threshold scheme for the color discrimination of the field is easily interfered by light and other factors, resulting in the actual game NAO robot for the objects in the field (especially football) The identification is not fast enough and accurate.

Correspondingly, for the judgment of the football field, NaoVision adopts the OTSU algorithm to realize the automatic adjustment of the image processing threshold, and is able to correctly identify and mark the field pixels in most cases without being affected by the light shadow.

Based on the color discrimination of the site, NaoVision creates a scan line in the picture. The boundary between the site and the non-site is determined by sampling and scanning the pixels where the scan line is located. The picture is then divided into part and non-site parts by connecting between the demarcation points.

In general, in order to reduce the computational overhead, NaoVision only calculates the picture pixels belonging to the site part. After determining the calculation range, NaoVison will create smaller scan lines within the calculation range for more detailed scanning and detection of objects within the calculation range.

Then, NaoVision limited the detection of circular objects in the field. The program will perform a uniform skip scan on the scan line. After detecting pixels that do not belong to the field within the calculation range, three non-collinear points are randomly selected around the pixel. Based on these three points, the scanning is performed in eight directions, and it is known that the pixels of the field are detected and returned. Then judge whether the 24 effective points are on a circle, and simultaneously calculate the center coordinates of the circle and its radius. After the circle is added to the candidate queue, the program will continue to scan the rest of the calculation area.

(To be continued)

Main Component

Under NaoVision’s solution (developed with Visual Studio 2019), there is

  • NAOFastTools Core Toolset
  • NFTCommandLineTools Common Command Line Tools
  • NFTDeamon Daemon
  • NFTGUI Debugging Interface
  • NFTTest OpenCV Docking Toolset
  • UnitTest Unit Test Project

Brief Process Introduction

Problem Description: Due to various problems with the direct embedding scheme of NFT and BHuman, this project intends to adopt the independent process with BHuman.

In the actual game process, the NAOFastTools Framework is driven by the NFTDeamon, running in parallel with Nao qi and BHuman in the NAO robot system. NFTDeamon communicates with BHuman by sharing memory. Camera data is obtained from BHuman. After calculation, visual correction information is transmitted to BHuman. In the usual debugging process, you can use the NFTCommandLineTools ** or **NFTGUI Debug Interface to establish a connection with the NFTDeamon to monitor and adjust the NAOFastTools Framework or *BHuman * Operating status and related parameters.

(To be continued)

Introduction To Each Component

1. NAOFastTools Core Toolset

The core framework for image processing and storage of the solution and the corresponding graphics processing module stored in the NAOFastTools Core Tools Group (hereinafter referred to as NFT) is the core project of the solution. The project follows the C++14 standard, and a small portion of the code contains C++14 features (the system with BHuman2018 has libstdc++.so that supports C++14). NFT eventually generates a static link library (NAOFastTools.lib and NAOFastTools.a) that corresponds to Windows and Linux. NFT works by linking with other programs. In addition to compiling in the VS environment, the NFT framework can also be compiled in a Linux environment, provided that the clang, make, and cmake tools are properly installed. The following is an extremely simple introduction to several of the most important common classes and functions in the NFT (including not limited to the following) (the actual use requires code understanding).

OperaMatrix is a proxy class that is a layer of proxy access to the Matrix class of the Eigen linear algebra library. In addition to providing proxy access services, it also provides a smart pointer service that automatically creates and releases Matrix objects based on reference counts. One or more OperaMatrix corresponds to a Matrix object. OperaMatrix objects provide a variety of constructors to meet the needs of users in most situations. The elements in OperaMatrix are stored in memory in a column-first manner, and the user can directly get a pointer to the first element of the matrix via the getData() interface. The number of rows and columns of the matrix corresponding to OperaMatrix can be obtained using getRows() and getCols().

The Image class is a storage vector for images that contains one or more OpreaMatrix objects, corresponding to multiple channels of the image. An OperaMatrix stores pixel data for a corresponding channel. Normally, the type of pixel data (PIXEL_TYPE) is defined in NFT.h. The number of channels in an image can be obtained using the getColumns() method, and a reference to a channel can be obtained directly using the [] operator. The height and width of the image are obtained using the getHeight() and getWidth() methods.

The ImageYUV422 class inherits from the Image class, which provides storage for the compressed color space YUV422. Need to note that it has one and only one channel. In a specific memory implementation, it compresses the pixel data of three channels into one channel for storage. If you need to get the Y, Cr, and Cb values of a pixel, you can call getY(int, int), getCr(int, int), getCb(int, int) to access it. Further, if it is necessary to modify the Y, Cr, and Cb values of a certain pixel in the picture, the corresponding setter is called and the coordinate parameters of the pixel are provided.

The ImageColored class inherits from the ImageYUV422 class and has one and only one channel. It mainly provides a single-channel image storage function and is a storage carrier for the output of the site color discrimination module. It is also a storage carrier for input data for many other vision modules. It disables all of the features of the ImageYUV422 parent class that have operations on the YUV color space.

The ImageSaver class is a storage service class for the Image class. It can store the data in the Image object correctly in a file on a Windows or Linux system (.nftd suffix). It can also build the corresponding Image object by reading the file in .nftd format.

(To be continued)

2. NFTGUI Debugging Interface

The NFTGUI debugging interface is based on Qt5. It is a visual debugging interface for NAOFastTools. It can output intermediate results and internal related parameters for processing each graphics processing module.

(To be continued)

3.NFTTest Opencv Docking Toolset

The NFTTest Opencv Docking Toolset is a bridge between the NaoVision framework and the OpenCV framework. It provides a conversion function between the main data structures between the two frameworks. In addition, the project is also used for the most basic debugging information output during the development process. .

(To be continued)

4.UnitTest

Based on the Google Test test framework, the unit test code of the core framework in NAOFastTools is stored. This code will ensure that the core framework can run efficiently and accurately, and it is convenient to discover the loopholes in the framework in time.

(To be continued)

Next Plan

I have to admit that last year(2016-2017) was a year of depression, whether it was in life, in learning, or in spirit. Seeing and moving away from my goal, I am unable to change this situation.

However, it is different now. After experiencing all kinds of difficult situations, I finally found a new way of thinking about problems in the difficult ones, and found myself for the first time. After solving a series of problems, internal worries tend to collapse. I feel that I can finally concentrate all my abilities without being subject to myself.

I have found the answer that I need to find. At this time, I feel quiet inside. It’s time to start running. Learning to run, I will never be a person who is tortured by my own heart and then crawls and competes with others. After I learned to run, those who were surpassed by me could no longer catch up with me.

Talk about something about Anti-Metamorphism

Although quantitative change is a necessary preparation for qualitative change. However, in some specific cases, the accumulation of quantitative changes will result in anti-metamorphism due to the occurrence of emergencies. This anti-metamorphism is powerful, very fast, and almost irreversible. The deeper the amount of accumulation, the more fierce the anti-quality changes. The anti-metamorphic condition is not only the superficial cause of an emergency. Suddenly triggering this event, the suspicion caused by the large amount of quantitative accumulation and the lack of specific information on the internal changes of the quantitative change eventually led to the occurrence of anti-metamorphism. After the anti-metamorphism occurs, on the surface, in the eyes of others, the external manifestation of the self may not change, but the self’s perception of things has rapidly changed radically. The impact of this anti-quality change on the thoughts of the self is very large, and it will have a huge impact on the physiological psychology of the self in the time. In the future, although the quantitative change is still likely to continue to accumulate, the anti-quality change is irreversible for the change of the self.

For example, I think a person can believe it, so I don’t think I need to know more about this person’s specific thinking. The reality of the performance has gradually confirmed my intuition, I continue to believe this person, the trust is gradually deepening. In this way, my trust in this person is like operating a black box. I don’t know the internal operation and I know that this person is trustworthy. Such trust is to a great extent, but it is also extremely sensitive. Therefore, once there has been a breach of trust, no matter whether the person is really untrustworthy or not, the incident is small, as long as I observe the performance of the incident from my point of view, and then I unilaterally judge that this is likely to be a breach of confidence. After that, anti-quality changes have taken place. The behavior of this person first impacted my body and mind, directly causing me to feel cheated. Then, my opinion on this person has also changed radically, although on the surface I still smile at this person. Whether the performance of this person in the future is still trustworthy is of little effect on this anti-metamorphism. When I still want to think that I can believe this person, this anti-quality effect will inevitably form a strong resistance.

Therefore, we should cherish when we receive trust from others without guessing, because this trust is very deep and extremely sensitive. Although I think that the behavior is theoretically understandable, it is not the case for the other party. In the event of an emergency, this trust will undergo an irreversible change.

This process is still true for other identical or similar conditions.

God Engine Brief Conception

Overview

God Engine is a simulation engine with atomic microscopic model macro-intelligence multi-space temporal asynchronous computing. The underlying layer communicates directly with the hardware, which communicates with other applications over the network. Through the definition of the standard mathematical physics of the basic universe model, coupled with the cosmological model plug-in, according to the timeline, detailed analysis of the relationship between the objects is provided, thus providing reliable relationship between objects and reliable macroscopic properties of the object group. . By establishing a connection between the object groups and providing a basic model, the engine will gradually build a large and complex object group based on this information, and the engine will perform atomic and microscopic relationship analysis between the object groups to obtain a larger The stable macroscopic nature of the object group. These preliminary and reliable models will be stored in the database to provide a basis for the analysis of other models. In the end, the engine draws the final stable model that the user wants, and then it will perform the final analysis and screening of the historical information to obtain a detailed definition and logical description of the model to provide a reliable finished model for human society.

Logical component

  1. *Mathematical operation module: * Provide mathematical operation support for the engine and handle various mathematical atomic operations.
  2. Logic operation module: Provides logical operation support for the engine and handles various logical atomic operations.
  3. Mathematical controller: transforms complex mathematical and logical problems into atomic operations, and coordinates the work of mathematical operations modules and logic computing modules.
  4. Space controller: manages the space of a specific association used in the engine instance, defines the space attribute, coordinates the operation resource occupancy in the space, collects the information generated in the model controller, and aggregates it into primary information.
  5. Model controller: A model that defines a specific association in space, handles the interactions between the models, collects the original information generated by the model, and performs initial collation.
  6. Timeline controller: Each space corresponds to a unique timeline controller that coordinates the order within the space, controls and records the space simulation process.
    Information processing module: with information screening, analysis, generalization, and finishing capabilities. Process the primary information submitted by each space controller, generate valid information, and archive it into the instance database.
  7. Instance database: The basic information of the stored instance, and the original information generated, valid information, and final information.
  8. Information induction module: According to various valid information stored in the database, analyze and summarize, summarize the final information, and store it in the instance database.
  9. The example guidance module: based on the final information in the database, performs the final analysis, and adjusts the example simulation process according to the analysis, so that the simulation process develops toward the final result.

Methods to Solve Problem

In real life, I have encountered many challenges. When the problem first appeared, I was often surprised and confused. But in calming down the initial analysis of the problem, I tried to analyze the problem from the original system. For general problems, it can be alleviated within the original system. However, sometimes the problem is precisely at the root of the system. When I tried many times to solve the problem in the system, the previous one I thought was to strengthen the original system and let the original system overclock to get the relief of the problem. But in practice, the problem caused by the system itself is that such an approach is inefficient and impossible to solve such a problem. Often, such a solution will lead to deeper and deeper within the original system and eventually die within the original system.

For learning, I have never worried about my original study habits. However, in the face of a big slip, I think this is a personal problem, simply ignore it. However, the slip is getting bigger and bigger and deeper. At this time, I feel that I encountered such a big challenge for the first time. At first, I felt dizzy and felt that it was ridiculous. In the initial attempt, I tried to strengthen the original learning system and overclock the original learning system. However, I found that this did not have a big effect. After the next downturn, I have almost no way to deal with it.

However, the problems that arise will not disappear in the future and it must be resolved. The ultimate way to overcome the fear of solving this problem is to stand up straight and then face the fear and the problem.

After the recent blow to my fate, I finally challenged my learning system. Just as quantum theory is to be reborn, the old causal theory must die. Also according to Marxist philosophy, the future of things is bright and the road is tortuous. I carefully analyzed the reason for this slip, and I used to blame my own carelessness, which is the reason for luck. However, several slips clearly told me that this is by no means simple and careless.

There is a bigger reason for this, which is the basic problem that I did not dare to face before. My intelligence is by no means a problem. This is what I am convinced. However, the basic problems have been revealed more than once since the beginning of the small period. It’s just not too obvious, I can’t get my attention. It can also be said that my intelligence masks the lack of my foundation.

Once, I told my junior high school information teacher about my carelessness in mathematics. He said that behind many carelessness may be my basic problem. This reminded me for the first time, but I didn’t pay much attention. There is no current ability to analyze problems.

But in high school, at least for now, this problem has been exposed, and it has fully shown its face. In high school, the comprehensiveness of the test questions has not been the same as that of junior high school. This is a serious test for my foundation. In high school, intelligence has been unable to cover up the serious lack of foundation.

What is the foundation is the rigor of the solution to the problem, the rigor of the problem-solving operation, and the mastery of simple basic knowledge. Now, I can say without a word that my foundation does have a big problem. This is something I never dared to face before.

For example, my scientific notation, unit conversion, the concept of basic physical units, mathematical division, etc. have relatively large problems. In the past, I did not consider some subtleties in solving problems. For example, can this take zero, which has no meaning. Especially the basic knowledge, concepts and the like, I have never bothered. I scorned these questions because they were covered up by me at the time. To think of the idea is king, and it will be king. It seems that this is wrong now.

The lack of learning system has really reminded me that to solve the problem fundamentally, I can only return to the basics and return to what I despise. Despising these things, I paid a heavy price. This also reflects the problem of the method of analyzing my problem. In the face of the problem, there is no careful analysis. I dare not analyze from the fundamentals of the system.

I now know that the analysis of the problem is not just a matter of encounter. Be sure to find the reason behind it, and always maintain a critical state for your own state. This also shows that setbacks are the best chance to expose problems. In the setbacks, my psychological endurance has been greatly improved.

My thoughts on the IoT 2

The previous article roughly talked about the germination of the idea of decentralization of the Internet of Things in my mind. This week I further thought about the germination of my heart. Now, I mainly want to elaborate on the conceptual framework in my mind. There may be some omissions and hopes.

Overview

This article mainly summarizes my decentralized view of the Internet of Things and the main organizational form of the public network of the Internet of Things after decentralization. For everyone’s easy acceptance, don’t be bothered by the boring logical thinking in my mind. I gave some examples to illustrate. This has lost some professionalism and hopes for understanding.

Thoughts

In my vision, the objects connected to the Internet of Things are equal. They all have their own functions, such as boiling water, cooking rice, making yogurt (maybe I am a little hungry now), of course, this object may also be a robot. If engineers want to connect them to the Internet of Things, they don’t have to develop them from scratch. They just need to add off-the-shelf IoT terminal modules to their appliances (objects) and then operate the module according to a standardized protocol. It can be said that as long as the IoT module is added, this lonely object can use it to talk to other objects that own this module. Because of the unified protocol, they can understand each other’s words, and can easily communicate with other objects to obtain the necessary information, thus saving a lot of trouble. And the Internet of Things module will also provide Internet access to facilitate the acquisition of information by objects. For detailed instructions on how to get information, how to know what information other objects provide, will be discussed in a future article.

Now that this talking object wants to talk to many objects, like humans, they also form a network of relationships to facilitate the exchange of information. The relational network is divided into a public relationship network and a private relationship network. In public relations networks, objects that access this network should follow a common password (the password, see in later articles), and objects can exchange information widely. Because public network access does not require strict security checks like private networks and does not use packets encrypted with private passwords, it can be seen that access to public networks is very convenient, so public networks will become very large. Objects with public service functions are generally connected to the network, such as traffic lights, automatic weather stations, public service robots, buses, etc., so there are many types of information that objects can obtain. For example, my bus stop can be connected to the public network, and it is convenient to obtain weather information from the nearest automatic weather station through the public network, adjust itself within the scope of its existing functions, and provide passengers with more comfortable and environmentally friendly. Car plan. If there are too many passengers in this bus stop and it is raining, the passengers will be sheltered from the rain. The platform can also communicate with the mobile phone that is connected to the public network nearby, telling the person who is using the mobile phone. There are too many people at this station. Come again. When people, people who use mobile phones can also use the contact station to get the information they need. All communication is mainly done by wireless. It is very convenient. The platform has doubts: the coverage of the wireless network is so large. How can I contact people who are several kilometers away? Could it be that I am not equipped with a high-power transmitter? In fact, this is ok, but I have a better solution. In my vision, an object connected to the Internet of Things has to be obligated to have benefits. When the station sends out its information, the object that is connected to the Internet of Things close to him will receive the message. They need to be responsible for forwarding this message and propagating it to other objects in their vicinity. If there are enough objects in the net, the message can be communicated to a farther place. However, this method can not solve all problems. In order to transmit information in time, the platform can directly connect the Internet of Things module to the Internet and tell other objects through the Internet. In fact, in the absence of a way, for example, at the edge of the object, the object can also be wired communication, satellite communication and other means. It’s just that the price will be even greater. It can be said that the communication method of the Internet of Things is very flexible and has the ability to timely convey the information obtained. What’s more, every object in the public network has its own unique code, which is specified at birth, so that objects in the public network can be located to find a certain object. In addition to its own unique code, the object has an identifier called a function identifier. Why do you have this logo? Because other objects are communicating with this object, you need to know what the object is doing.

Let’s take a comprehensive example. For example, a newly bought rice cooker that can talk (connected to the Internet of Things) is unfamiliar and wants to know what can be done by objects next to me. I can let them show their own feature logo, then the rice cooker knows that the benevolent man next to him is a socket and the other is a refrigerator. Obviously, the rice cooker is very interested in the refrigerator. Since he knows that he is a refrigerator, the rice cooker can talk to the refrigerator with his own words. He got the food stored in the refrigerator from the refrigerator, as well as their freshness, price and so on. It looked for ways the engineer told him to go online, and then told the IoT module to use the Internet to find out what to do with the things in those refrigerators. The Internet told him that pork ribs, red rice porridge, mung bean porridge (now I am so hungry) are good. Then he asks himself again, the owner generally likes to eat 啥, from the owner’s mobile phone, the owner is a Jiangxi person, ask the Internet, what Jiangxi people like to eat. Big data, as well as his own intuition (artificial intelligence), told him that ribs and lean meat porridge are good. Then he told the owner’s mobile phone (known with the function logo), recommend the pork porridge to the owner as the breakfast for tomorrow. Ten minutes later, the owner approved its recommendation via mobile phone. At the appropriate time, he told the robots at home to take out the raw materials in the refrigerator, wash the vegetables through the washing machine, wash the rice in the rice machine, cook the meat, and cook the meat in person. The joint efforts of ribs and lean porridge will be done. Waiting for the table, the owner finished eating. The task of the first day of the rice cooker is over. This time he met many partners, thanks to the Internet of Things.

Of course, if the information exchanged by these objects is through the public relations network, it is equivalent to revealing the information of their own home. This is of course not allowed, so we have a private network to protect the privacy and security of our users. I wrote it here first. The next article will detail how the private relationship network works.

My thoughts on the IoT

Recently, I have been studying in the school with heavy tasks. I feel that I have no time to think about it. This is different from the time when I was in junior high school. I have some time to think about things that have nothing to do with learning. After all, I have to think about it.

However, even in such a tight time, I can’t help but spend some time thinking. The content of thinking is what I discussed in this article today.

Overview

The Internet of Things, this evolving thing, will continue to increase the level of informationization in human society in the future. But now, I believe that the domestic Internet of Things is still immature. First, there is no unified agreement. Second, the concept of the Internet of Things is not profound in China. What is the Internet of Things? Let’s take a look at the definition of Wikipedia:

1
The Internet of Things (IoT) is an information carrier such as the Internet and traditional telecommunication networks, enabling all ordinary objects that can perform independent functions to realize interconnection and interoperability.

Thoughts

The key is that all objects that can perform independent functions are interconnected. This shows that on the Internet of Things, all objects connected to the network can be interconnected, exchange information, and then use their own functions and information obtained through the Internet of Things to make the operation more convenient and fast. . Before that, my first thought was smart home. In the smart home, these homes can be controlled by adding communication devices and necessary functional devices to the switches and door locks, and then connecting the wireless host through the mobile phone. In this mode, for security, all communications must be handled by a device like a wireless host. I looked at Taobao, this system and many sellers are selling. Including Xiaomi, etc., have already explored in this regard. But I think that this kind of thinking is actually centering the Internet of Things.

Centralization naturally has the benefits of centralization and its drawbacks. The advantage is that the principle of manipulation through the wireless host is relatively simple, as long as the mobile phone connected to the WIFI is moved over. And relatively safe. However, think about it. If a hacker breaks a wireless host at home, is he equal to manipulating all the smart homes in your home? All your personal information hackers will have an unobstructed view. And in doing so, the size of the Internet of Things network will be limited. If the Internet has a center, will the Internet still reach today’s level of development? Obviously, the Internet of Things should develop rapidly, and decentralization should be a trend. After decentralization, information can be exchanged between two objects that follow a unified protocol. And each object can be extended to expand this network. As with the TCP/IP protocol, each object can send information, accept information, and transmit information. All we have to do is connect this network to the Internet and integrate it with the Internet to become the new terminal of the Internet. If this can be done, then humans’ ability to acquire information and spread will be greatly enhanced. In this way, all human beings can share information about the world. In this case, each object with a specific function is like getting wisdom. They can get enough information before they can get better. They can share information with each other and then serve humanity better. Engineers can use this web to improve and update their intelligence and reduce the rate of item replacement. In this way, the application of the Internet of Things is not limited to smart homes. As the intelligence of the items expands, the Internet of Things will reach out to all corners. Under this network, each item can not only help humans to complete their intended functions, they are also contributors to Internet information, and they contribute information they know to the Internet and contribute to human society. Such an Internet of Things format will greatly enhance the information level of human society, and information exchange will be greatly accelerated, and life will be more convenient. This is the trend of the development of the Internet of Things.

But it is unavoidable that it brings privacy issues, protocol issues, and security issues, but it can be prevented, and I will discuss them in the next few articles.