Algorithm opencv for identification and detection of lack of border protection on construction sites

The lack of border protection detection system on the construction site uses the opencv+python network model technology, and the detection algorithm for the lack of border protection on the construction site detects that the border protection equipment is not placed as required, and will automatically send out an alarm to remind the on-site management personnel to take timely measures. Python is an interpreted scripting language, which translates programs into machine language at runtime; programs in interpreted languages ​​do not need to be compiled before execution, but are translated when the program is run. A special interpreter is responsible for each statement The program code is interpreted during execution, so the interpreted language needs to be translated every time it is executed, and there is also a compiled language corresponding to it. Python is a programming language for cross-platform, scripting, and application development. Cross-platform: The concept of cross-platform is an important concept in software development, that is, it does not depend on the operating system or the hardware environment. An application developed under one operating system (such as Windows) can still run under another operating system (such as Linux). 

OpenCV is implemented based on C++ and provides interfaces for languages ​​such as python, Ruby, and Matlab. OpenCV-Python is OpenCV's Python API, which combines the best features of OpenCV C++ API and Python language. OpenCV is available on different system platforms including Windows, Linux, OS, X, Android and iOS. High-speed GPU operation interfaces based on CUDA and OpenCL are also under active development. The full name of OpenCV is Open Source Computer Vision Library, which is a cross-platform open source software library for computer vision processing. It is initiated, participated and maintained by the Russian team of Intel Corporation. It supports many algorithms related to computer vision and machine learning, with BSD license Released under license, free for commercial and research use. OpenCV can be used to develop real-time image processing, computer vision and pattern recognition programs, and the library can also use Intel's IPP for accelerated processing.

Python is a general-purpose programming language developed by Guido van Rossum, which quickly became very popular mainly because of its simplicity and code readability. It enables programmers to express ideas in fewer lines of code without loss of readability. Python is slow compared to languages ​​like C/C++. That said, Python can be easily extended using C/C++, which allows us to write computationally intensive code in C/C++ and create Python wrappers that can be used as Python modules. This gives us two benefits: first, the code is as fast as raw C/C++ code (since it's actual C++ code working behind the scenes), and second, it's easier to write code in Python than in C/C++. OpenCV-Python is a Python wrapper around the original OpenCV C++ implementation. OpenCV-Python uses Numpy, a highly optimized database manipulation library with MATLAB-style syntax. All OpenCV array structures are converted to Numpy arrays. This also makes it easier to integrate with other libraries that use Numpy, such as SciPy and Matplotlib.


 

The Adapter interface defines the following methods:

public abstract void registerDataSetObserver (DataSetObserver observer)

Adapter represents a data source. This data source may change, such as adding data, deleting data, and modifying data. When the data changes, it must notify the corresponding AdapterView to make corresponding changes. In order to realize this function, the Adapter uses the observer mode. The Adapter itself is equivalent to the observed object, and the AdapterView is equivalent to the observer. Register the observer for the Adapter by calling the registerDataSetObserver method.

public abstract void unregisterDataSetObserver (DataSetObserver observer)

Unregister the observer by calling the unregisterDataSetObserver method.

public abstract int getCount () returns the number of data in the Adapter.

public abstract Object getItem (int position)

The data in the Adapter is similar to an array, and each item in it corresponds to a piece of data, and each piece of data has an index position, that is, position, and the corresponding data item in the Adapter can be obtained according to the position.

public abstract long getItemId (int position)

Get the id of the specified position data item, usually the position will be used as the id. In Adapter, relatively speaking, position is used more frequently than id.

public abstract boolean hasStableIds ()

hasStableIds indicates whether the id of the original data item will change when the data source changes. If it returns true, it means the Id remains unchanged, and if it returns false, it means it may change. The hasStableIds method of Adapter subclasses (including direct subclasses and indirect subclasses) provided by Android all return false.

public abstract View getView (int position, View convertView, ViewGroup parent)

getView is a very important method in Adapter, which will create corresponding UI items for AdapterView according to the index of the data item.

Guess you like

Origin blog.csdn.net/KO_159/article/details/131294826