Camera equipment adaptation method, device and system and electronic equipment

By constructing a multi-layer packaging library to interact with the software development toolkit and external libraries corresponding to the camera, the problem that correction software in the prior art is not compatible with multiple cameras is solved, and higher compatibility is achieved.

CN119421043APending Publication Date: 2025-02-11XIAN QINGSONG PHOTOELECTRIC TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310929061.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-07-26
Publication Date
2025-02-11

AI Technical Summary

Technical Problem

Existing LED screen correction software cannot be compatible with multiple cameras of different models and brands at the same time, resulting in insufficient compatibility.

Method used

By building at least two first-layer packaging libraries and second-layer packaging libraries, interact with the software development toolkit and external libraries corresponding to the camera, and call the operation interfaces of these libraries through the upper layer interface to achieve compatibility with multiple cameras sex.

Benefits of technology

Improved compatibility of the calibration software for different camera devices, making the software compatible with multiple camera models and brands simultaneously.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119421043A_ABST
    Figure CN119421043A_ABST
Patent Text Reader

Abstract

The invention relates to the field of computer system software, and discloses an adaptation method, device and system of camera equipment and electronic device.The adaptation method comprises the steps that at least two first-layer packaging libraries are constructed, and the first-layer packaging libraries are used for importing a software development kit and an external library corresponding to the camera equipment, the software development kit is used for interacting with the camera equipment; constructing at least two second-layer packaging libraries, wherein the second-layer packaging libraries call the external library through the standard interface of the first-layer packaging library; and constructing an upper-layer interface which is used for quoting the second-layer packaging library so as to call an operation interface of the second-layer packaging library to operate the camera equipment. By constructing the two layers of packaging libraries and the upper layer interface, the software development kit required by different cameras and the version of the external library are packaged, so that the correction software can be compatible with different camera devices, and the compatibility of the correction software to the different camera devices is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of computer system software, and in particular to an adaptation method, device, system and electronic device for a camera device. Background Art

[0002] With the rapid development of the LED display screen industry, LED screen calibration software has also emerged. More and more users are using LED screen calibration software to connect cameras or other acquisition devices.

[0003] LED screen calibration software usually needs to adapt to different cameras, such as cameras of different types, brands, and models. Different cameras need to use corresponding software development kits (SDKs) or other control modules when connected and controlled. Each manufacturer's customized SDK has different standards, such as some use C interfaces, some use C++ interfaces, and some use QT interfaces. When referencing SDKs, other external libraries may also need to be used, such as the commonly used OpenCV libraries and Json libraries. At the same time, the versions of other external libraries used by different cameras may be different, which brings many problems to the adaptation of LED screen calibration software to multiple different cameras.

[0004] At present, the commonly used adaptation method of calibration software is usually to adapt it in a one-to-one correspondence between one calibration software and one camera. The same software cannot be compatible with multiple cameras at the same time, resulting in insufficient software compatibility. Summary of the invention

[0005] In order to solve the above technical problems, the embodiments of the present application provide an adaptation method, device, system and electronic device for a camera device to solve the problem that the correction software cannot be compatible with multiple cameras at the same time, so as to improve the compatibility of the correction software.

[0006] In order to solve the above technical problems, the embodiments of the present application provide the following technical solutions:

[0007] In a first aspect, an embodiment of the present application provides an adaptation method for a camera device, comprising:

[0008] Construct at least two first-layer encapsulation libraries, wherein each first-layer encapsulation library corresponds to a camera device one by one, and the first-layer encapsulation library is used to import a software development kit and an external library corresponding to the camera device, and the software development kit is used to interact with the camera device;

[0009] Construct at least two second-layer encapsulation libraries, wherein each second-layer encapsulation library corresponds to a first-layer encapsulation library one by one, and the second-layer encapsulation library calls the external library through the standard interface of the first-layer encapsulation library;

[0010] An upper-level interface is constructed, and the upper-level interface is used to reference the second-level encapsulation library to call the operation interface of the second-level encapsulation library to operate the camera device.

[0011] In some embodiments, building at least two first-layer encapsulation libraries includes:

[0012] An operation interface and a standard interface are encapsulated for each first-layer encapsulation library, wherein the operation interface of the first-layer encapsulation library is used to interact with a software development kit corresponding to the camera device, and the standard interface of the first-layer encapsulation library is used to interact with a second-layer encapsulation library.

[0013] In some embodiments, building at least two second-layer encapsulation libraries further includes:

[0014] A plurality of operation interfaces are encapsulated for each second-layer encapsulation library, wherein the plurality of operation interfaces of the second-layer encapsulation library are the same as the plurality of operation interfaces of the upper-layer interface.

[0015] In some embodiments, the method further comprises:

[0016] Switch the current camera device to another camera device, including:

[0017] Release the second-layer encapsulation library corresponding to the current camera device, and load the second-layer encapsulation library corresponding to another camera device.

[0018] In some embodiments, the method further comprises:

[0019] A plurality of second-layer package libraries are loaded simultaneously, wherein the second-layer package library includes a camera library.

[0020] In some embodiments, the method further comprises:

[0021] If a new camera device is added, a first-layer encapsulation library and a second-layer encapsulation library are constructed for the new camera device.

[0022] In some embodiments, the method further comprises:

[0023] Video equipment includes cameras;

[0024] Each external library corresponds to a version. Different first-layer encapsulation libraries import the same or different versions of external libraries. The external libraries include a graphics processing library.

[0025] In a second aspect, an embodiment of the present application provides an adaptation device for a camera device, including:

[0026] A first construction module is used to construct at least two first-layer encapsulation libraries, wherein each first-layer encapsulation library corresponds to a camera device one by one, and the first-layer encapsulation library is used to import a software development kit and an external library corresponding to the camera device, and the software development kit is used to interact with the camera device;

[0027] A second construction module is used to construct at least two second-layer encapsulation libraries, wherein each second-layer encapsulation library corresponds to a first-layer encapsulation library one by one, and the second-layer encapsulation library calls the external library through the standard interface of the first-layer encapsulation library;

[0028] The interface construction module is used to construct an upper-level interface, and the upper-level interface is used to reference the second-level encapsulation library to call the operation interface of the second-level encapsulation library to operate the camera device.

[0029] In a third aspect, an embodiment of the present application provides an electronic device, including:

[0030] At least one processor and at least one memory, wherein the memory stores a computer program, and when the program is executed by the processor, the processor executes the adaptation method of the camera device of the first aspect.

[0031] In a fourth aspect, an embodiment of the present application provides an adaptation system for a camera device, including:

[0032] The electronic device of the first aspect;

[0033] Multiple camera devices and communication-connected electronic devices.

[0034] In a fifth aspect, an embodiment of the present application provides a non-volatile computer-readable storage medium, which stores computer-executable instructions, and the computer-executable instructions are used to enable an electronic device to execute the adaptation method of the camera device as in the first aspect.

[0035] The beneficial effects of the implementation of the present application are as follows: Different from the prior art, the implementation of the present application provides an adaptation method for a camera device, the method comprising: constructing at least two first-layer encapsulation libraries, wherein each first-layer encapsulation library corresponds to a camera device one-to-one, the first-layer encapsulation library is used to import the software development kit and external library corresponding to the camera device, and the software development kit is used to interact with the camera device; constructing at least two second-layer encapsulation libraries, wherein each second-layer encapsulation library corresponds to a first-layer encapsulation library one-to-one, and the second-layer encapsulation library calls the external library through the standard interface of the first-layer encapsulation library; constructing an upper-layer interface, the upper-layer interface is used to reference the second-layer encapsulation library to call the operation interface of the second-layer encapsulation library to operate the camera device. By constructing two layers of encapsulation libraries and an upper-layer interface, the versions of the software development kits and other external libraries required by different camera devices can be encapsulated, so that the correction software can be compatible with different camera devices, and the compatibility of the correction software with different camera devices is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] One or more embodiments are exemplarily described by corresponding drawings, which do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and the figures in the drawings do not constitute proportional limitations unless otherwise stated.

[0037] Figure 1 is a schematic diagram of an application environment provided by an embodiment of the present application;

[0038] Figure 2 is a schematic diagram of another application environment provided by an embodiment of the present application;

[0039] Figure 3 It is a schematic diagram of the architecture of a two-layer encapsulation library and an upper-layer interface provided in an embodiment of the present application;

[0040] Figure 4 It is a flowchart of an adaptation method of a camera device provided in an embodiment of the present application;

[0041] Figure 5 yes Figure 4 A detailed flow chart of step S401 in FIG.

[0042] Figure 6 yes Figure 4 A detailed flow chart of step S402 in FIG.

[0043] Figure 7 is a schematic diagram of a process for switching camera devices provided in an embodiment of the present application;

[0044] Figure 8 is a schematic diagram of a process for loading multiple camera devices provided in an embodiment of the present application;

[0045] Fig. 9 It is a schematic diagram of the process of adding a camera device provided in an embodiment of the present application;

[0046] Fig.10 It is a structural schematic diagram of an adaption device for a camera device provided in an embodiment of the present application;

[0047] Fig.11 is a structural schematic diagram of an electronic device provided in an embodiment of the present application;

[0048] Fig.12 It is a structural schematic diagram of an adaptation system for a camera device provided in an embodiment of the present application.

[0049] Description of Figure Numbers:

[0050]

[0051] DETAILED DESCRIPTION

[0052] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0053] It should be noted that, if there is no conflict, the various features in the embodiments of the present application can be combined with each other, all within the scope of protection of the present application. In addition, although the functional modules are divided in the device schematic and the logical order is shown in the architecture schematic, in some cases, the first-layer encapsulation library and the second-layer encapsulation library in the architecture schematic can be added. Furthermore, the words "first", "second", etc. used in this application do not limit the data, but only divide the same items or similar items with basically the same functions and effects.

[0054] The technical solution of the present application is described in detail below in conjunction with the accompanying drawings:

[0055] See also Figure 1 , Figure 1 is a schematic diagram of an application environment provided by an embodiment of the present application;

[0056] like Figure 1As shown, the application environment 100 includes: a camera device 10, an electronic device 20 and a display device 30, wherein the camera device 10 and the electronic device 20 can be connected via a wired interface or a wireless network, and the electronic device 20 and the display device 30 are connected via a wired interface. It can be understood that the camera device includes a camera, a video camera, a webcam and other devices capable of taking pictures, the electronic device includes a mobile phone, a tablet computer, a computer terminal and other network-capable devices, the display device 30 includes a liquid crystal display, an LED screen and other devices capable of displaying images, the wired interface includes USB, HDMI, VGA, DVI, DisplayPort and other interfaces, and the wireless network includes Bluetooth, a wireless LAN and other wireless networks.

[0057] In the embodiment of the present application, the camera device used includes a camera, a webcam, or other device capable of taking or recording video, and the camera includes cameras of different brands, types, and models. The camera provides a communication interface for the electronic device 20 so that the electronic device 20 can obtain and identify the parameter information of the camera, thereby enabling the electronic device to control the camera.

[0058] In the embodiment of the present application, the electronic device 20 is communicatively connected to the display device 30 , and a display screen of the electronic device 20 is transmitted to the display device 30 by a sending card installed in the electronic device.

[0059] See also Figure 2 , Figure 2 is a schematic diagram of another application environment provided by an embodiment of the present application;

[0060] like Figure 2 As shown, the application environment includes a camera device, correction software for the electronic device, a sending card, and a display device, wherein the correction software is installed in the electronic device, the correction software of the electronic device obtains information of the camera device and is connected to the camera device, and the correction software of the electronic device sends the display screen of the electronic device to the display device through the sending card installed in the electronic device, so that the display device displays the display screen, such as: camera screen. It can be understood that the sending card includes an interface, a frame writing module, a frame rate comparison module, a frame rate control module, and a storage module, and the function of the sending card is to package image information and send the image information to the display device.

[0061] In the embodiment of the present application, the sending card includes but is not limited to a display screen sending card, for example: an LED display screen sending card. It can be understood that the LED display screen sending card is a control card software, which is used to convert the audio and video signals of the electronic device and transmit them to the LED display screen. The LED display screen sending card is also called a control system. The LED display screen sending card is used to package the image information and send it to the receiving card, which performs image processing after unpacking. The control area of ​​each receiving card is certain and is related to the pixel point. The LED display screen needs to receive the instructions sent by the correction software. Therefore, the LED display screen is provided with a receiving card for decoding the received instructions to control the lighting of different LED lamp beads.

[0062] In an embodiment of the present application, the correction software includes but is not limited to image correction software, camera correction software and other software. The correction software is used to send instructions to the sending card to control the display of the display device, for example: controlling the on and off of different LED lamp beads.

[0063] See also Figure 3 , Figure 3 It is a schematic diagram of the architecture of a two-layer encapsulation library and an upper-layer interface provided in an embodiment of the present application;

[0064] like Figure 3 As shown, the architecture of the two-layer encapsulation library and the upper-layer interface includes: an upper-layer interface, at least two second-layer encapsulation libraries, at least two first-layer encapsulation libraries, at least two software development kits, and at least two graphics processing libraries. For example, at least two software development kits include software development kit 1 and software development kit 2, and at least two external libraries include external library 1 and external library 2.

[0065] Among them, the software development kit is used to provide an interface for operating the camera device and expand the functions of the camera device, and the graphics processing library is used to provide various image processing algorithms.

[0066] Among them, the first-layer encapsulation library is used to import the software development kit and graphics processing library of the camera device, and further call the functions in the first-layer encapsulation library in the second-layer encapsulation library. Finally, the second-layer encapsulation library is loaded in the upper interface to successfully connect a camera device.

[0067] Among them, one camera device corresponds to one first-layer package library, and one second-layer package library corresponds to one first-layer package library. Therefore, when multiple cameras need to be connected, you only need to add the first-layer package library and the second-layer package library corresponding to the new camera device. The package libraries of the same layer are independent of each other. When different versions of external libraries imported into different camera devices are different, it will not affect the system.

[0068] The external library includes a graphics processing library, for example, external library 1 is graphics processing library 1, and external library 2 is graphics processing library 2. It is understandable that different first-layer encapsulation libraries may correspond to the same graphics processing library, but the same graphics processing library may include different versions, or different first-layer encapsulation libraries may correspond to different graphics processing libraries.

[0069] In an embodiment of the present application, by constructing two layers of encapsulation libraries and one layer of upper interface, the SDK and external library versions required by different cameras are encapsulated, so that the correction software can be compatible with different camera devices, thereby improving the compatibility of the correction software with the camera devices.

[0070] See also Figure 4 , Figure 4 It is a flowchart of an adaptation method of a camera device provided in an embodiment of the present application;

[0071] The adaptation method of the camera device is applied to an electronic device. Specifically, the execution subject of the adaptation method of the camera device is one or at least two processors of the electronic device.

[0072] like Figure 4 As shown, the method includes:

[0073] Step S401: construct at least two first-layer encapsulation libraries, wherein each first-layer encapsulation library corresponds to one camera device, and the first-layer encapsulation library is used to import a software development kit and an external library corresponding to the camera device, and the software development kit is used to interact with the camera device;

[0074] In the embodiment of the present application, the software development kit (SDK) includes different versions, wherein different versions of SDK include release version and debug version. Generally, the external SDK only has release version and does not provide debug version. SDK also has its own log, which records the information when the program is running in the form of a file. The role of SDK is to provide developers with an interface for operating the camera device. It is understandable that manufacturers of different camera devices usually provide SDKs corresponding to their camera devices to distinguish them from other camera devices.

[0075] In an embodiment of the present application, the external library includes a graphics processing library (OpenCV), which includes different versions. The role of OpenCV is to provide various image processing algorithms for the camera device. Specifically, when the electronic device is connected to a camera device, a first-layer encapsulation library (Adapter_DLL) is constructed, and the first-layer encapsulation library is used to import the SDK and OpenCV corresponding to the camera device. Each first-layer encapsulation library is independent of each other, that is, each first-layer encapsulation library corresponds to a camera device one by one. When the electronic device is connected to multiple camera devices, multiple first-layer encapsulation libraries are constructed.

[0076] Specifically, when building multiple first-layer encapsulation libraries, it is necessary to import OpenCV corresponding to multiple camera devices. The OpenCV versions corresponding to different camera devices may be different. Each camera device can only correspond to one version of OpenCV. Since each first-layer encapsulation library is independent of each other, importing different versions of OpenCV will not cause errors such as mismatches between header files and dynamic link libraries (DLL), and thus can successfully interact with the camera devices. For example, the camera device calls the interface in the software development kit to implement the functions of the camera device, such as focus, exposure, taking pictures, setting brightness, setting chroma, and other functions.

[0077] In the embodiment of the present application, it is usually necessary to connect with multiple camera devices, so it is necessary to build at least two first-layer encapsulation libraries to enable communication with at least two camera devices.

[0078] Please refer to Figure 5 , Figure 5 yes Figure 4 A detailed flow chart of step S401 in FIG.

[0079] like Figure 5 As shown, step S401 includes:

[0080] Step S4011: encapsulate an operation interface and a standard interface for each first-layer encapsulation library, wherein the operation interface of the first-layer encapsulation library is used to interact with the software development kit corresponding to the camera device, and the standard interface of the first-layer encapsulation library is used to interact with the second-layer encapsulation library.

[0081] Specifically, the standard interface in the first-layer encapsulation library is a standard C interface, which is an interface of a pure C function and is used to interact with the second-layer encapsulation library.

[0082] Specifically, the camera device includes a camera, and the operation interface of the first-layer encapsulation library includes a camera application programming interface (Camera API). The function of the Camera API is to allow an application to interact with the camera in a programming manner.

[0083] Specifically, to interact with the camera, it is necessary to encapsulate the Camera API in the first-layer encapsulation library. The first-layer encapsulation library connects to the camera through the Camera API, and further imports the camera SDK and OpenCV.

[0084] Specifically, the interface opened by the camera SDK contains variables, structures and class information in OpenCV. The first-level encapsulation library needs to import the OpenCV corresponding to the camera and further access the camera SDK to obtain the camera information.

[0085] Specifically, because each first-layer encapsulation library is independent and does not affect each other, when connecting multiple camera devices, it is necessary to encapsulate the Camera API and the standard C interface for each first-layer encapsulation library.

[0086] In the embodiment of the present application, the first-layer encapsulation library also encapsulates the dynamic link library required internally. The dynamic link library and the SDK and OpenCV of the imported camera device need to be compiled by a unified compiler so that the electronic device can recognize it. Therefore, it is necessary to provide a compilation environment in the first-layer encapsulation library. The compilation environment can be determined according to the development tools, such as the specific version of the C++ development tool (Microsoft Visual C++, MSVC) and the dynamic link library on which MSVC depends. The compilation environment can also be determined according to the specific version of the computer application software (Minimalist GNU for Windows, minGW) and the dynamic link library on which minGW depends. Among them, the development tools and the dynamic link library are encapsulated in the first-layer encapsulation library, wherein the development tool corresponds to a specific version.

[0087] In the embodiment of the present application, a compiler such as the application development framework (QT) can also be selected. It is understandable that the specific compilation environment needs to be selected according to the version of the library imported by the first-layer encapsulation library.

[0088] In an embodiment of the present application, a first-layer encapsulation library is constructed according to at least two camera devices that communicate with the electronic device. It is necessary to construct at least two first-layer encapsulation libraries, each of which corresponds to a camera device one by one. Each camera device has a corresponding version of OpenCV, and the OpenCVs of different camera devices may be different. Each first-layer encapsulation library is independent of each other, so importing different versions of OpenCV will not cause conflicts, which solves the problem of conflicts between different versions of OpenCV, and can further realize the connection of multiple camera devices.

[0089] Step S402: construct at least two second-layer encapsulation libraries, wherein each second-layer encapsulation library corresponds to a first-layer encapsulation library one by one, and the second-layer encapsulation library calls the external library through the standard interface of the first-layer encapsulation library;

[0090] Specifically, there is a first-layer encapsulation library corresponding to a camera device, and a second-layer encapsulation library is constructed based on the first-layer encapsulation library. The second-layer encapsulation library calls the external library in the first-layer encapsulation library through the standard C interface in the first-layer encapsulation library, further obtains the information of the camera device, and encapsulates the required functions of the camera device according to the information of the camera device. Among them, the camera device includes a camera, and the information of the camera device includes camera information, for example: camera parameters, such as: camera sensor type, effective pixels, processor model and other parameters.

[0091] Specifically, the second-layer encapsulation library is constructed based on the first-layer encapsulation library, that is, each second-layer encapsulation library corresponds to a first-layer encapsulation library one by one, and each second-layer encapsulation library is independent of each other and does not affect each other.

[0092] Specifically, the second-layer encapsulation library calls the external library in the first-layer encapsulation library. The versions of each external library in the first-layer encapsulation library may be different, and each second-layer encapsulation library is independent of each other. Therefore, calling different versions of external libraries will not cause conflicts.

[0093] In the embodiment of the present application, the compiler or compiler version used by the second-layer encapsulation library may be different from that of the first-layer encapsulation library. Since the first-layer encapsulation library only provides functions and interfaces for the second-layer encapsulation library, the two layers are independent of each other. Therefore, the second-layer encapsulation library using different compilers and different versions of compilers will not affect the first-layer encapsulation library. The compiler can also be in different release states, such as debug state and release state. Further, the debugging between layers will not affect each other. It can be understood that although different compilers use different compilation methods and standard libraries, as long as they implement the same functions and interfaces, they can call and use each other.

[0094] In the embodiment of the present application, it is usually necessary to connect with multiple camera devices, so at least two first-layer encapsulation libraries need to be built, and at least two second-layer encapsulation libraries also need to be built, so as to be able to communicate with at least two camera devices.

[0095] Please refer to Figure 6 , Figure 6 yes Figure 4 A detailed flow chart of step S402 in FIG.

[0096] like Figure 6 As shown, step S402 includes:

[0097] Step S4021: encapsulating multiple operation interfaces for each second-layer encapsulation library, wherein the multiple operation interfaces of the second-layer encapsulation library are the same as the multiple operation interfaces of the upper-layer interface;

[0098] Specifically, the multiple operation interfaces of the second-layer encapsulation library are functional interfaces corresponding to the required functions of the camera device, which include camera's own interface settings, focus, exposure, obtaining exposure time, obtaining photos after taking, supporting all operations for brightness or chromaticity settings, etc. The functional interfaces corresponding to the required functions include callback functions, pure virtual function classes and other interfaces.

[0099] Specifically, there are at least two second-layer encapsulation libraries, each of which encapsulates multiple corresponding functional interfaces according to the required functions of the corresponding camera device, and the multiple functional interfaces of the second-layer encapsulation library are the same as the multiple functional interfaces of the upper interface.

[0100] Specifically, if the multiple operation interfaces of the second-layer encapsulation library are the same as the multiple operation interfaces of the upper-layer interface, the compilation environment used by the second-layer encapsulation library needs to be the same as the compilation environment of the upper-layer interface.

[0101] In the embodiment of the present application, each second-layer encapsulation library is independent of each other and does not affect each other. Therefore, the second-layer encapsulation library calling the external library in the first-layer encapsulation library will not cause conflicts between different versions of the external library, and the second-layer encapsulation library encapsulates the required functions of the camera device, then multiple second-layer encapsulation libraries encapsulate the required functions of multiple different camera devices, meeting the functional requirements of different users for different camera devices.

[0102] Step S403: constructing an upper-layer interface, where the upper-layer interface is used to reference the second-layer encapsulation library to call the operation interface of the second-layer encapsulation library to operate the camera device;

[0103] Specifically, the camera device includes cameras, video cameras, and camcorders. Preferably, the camera device is a camera, and the multiple operation interfaces encapsulated by the second-layer encapsulation library are multiple functional interfaces of the camera. The multiple functional interfaces constitute a camera library, that is, the second-layer encapsulation library includes the camera library, and the camera library includes a camera open source library, such as: CameraView open source library, CameraFragment open source library and other open source libraries.

[0104] Specifically, a corresponding upper-level interface is constructed according to the second-level encapsulation library. The upper-level interface actively loads the camera library in the second-level encapsulation library and implements the interface of the specific camera library. Then, according to the implemented interface of the camera library, the camera is operated on the upper-level interface, for example, setting the camera parameters, taking specified photos as required, and other operations.

[0105] Specifically, the upper-level interface is the user interface (UI) of the correction software to control the camera device. The UI is used to implement the functional interface of the camera device in the second-level encapsulation library and provide specific operating functions for the user. That is, the UI loads the functional interface of the camera device in the second-level encapsulation library, that is, the multiple functional interfaces of the second-level encapsulation library are the same as the multiple functional interfaces of the upper-level interface.

[0106] In the embodiment of the present application, an upper-level interface is constructed and an operation interface of the second-level encapsulation library is implemented on the upper-level interface, so that the user can operate the camera device on the upper-level interface and thus interact with the camera device.

[0107] Please refer to Figure 7 , Figure 7 is a schematic diagram of a process for switching camera devices provided in an embodiment of the present application;

[0108] like Figure 7 As shown, the process of switching the camera device includes:

[0109] Step S701: releasing the second-layer encapsulation library corresponding to the current camera device, and loading the second-layer encapsulation library corresponding to another camera device;

[0110] Specifically, each first-layer encapsulation library corresponds to a camera device, and each second-layer encapsulation library corresponds to a first-layer encapsulation library. When it is necessary to switch the camera device currently connected to the correction software to another camera device, the upper-layer interface releases the second-layer encapsulation library corresponding to the current camera device, loads the second-layer encapsulation library of another camera device and implements the required functions of the camera device, wherein the second-layer encapsulation library of another camera device has been built in advance and can be directly loaded when used.

[0111] Please refer to Figure 8 , Figure 8is a schematic diagram of a process for loading multiple camera devices provided in an embodiment of the present application;

[0112] like Figure 8 As shown, the process of loading multiple camera devices includes:

[0113] Step S801: loading multiple second-layer encapsulation libraries simultaneously, wherein the second-layer encapsulation library includes a camera library;

[0114] Specifically, the camera library (Camera_DLL) is a library composed of multiple functional interfaces of the camera.

[0115] Specifically, when it is necessary to connect to multiple cameras, multiple upper-level interfaces are constructed according to multiple second-level encapsulation libraries. The upper-level interfaces use a dynamic loading method or a static loading method to simultaneously load multiple second-level encapsulation libraries, wherein the second-level encapsulation library includes a camera library. For example, when there are two cameras, the dynamic loading method is used to simultaneously load two camera libraries, for example: the first camera library (Camera1_DLL) and the second camera library (Camera2_DLL). Camera1_DLL and Camera2_DLL are independent of each other and will not affect each other.

[0116] In the embodiments of the present application, two specific dynamic loading methods are provided:

[0117] The first dynamic loading method: call a library loader (QLibrary) in the application development framework (QT) in the program, and use the function in the QLibrary to pass the functional interface of the second-layer encapsulation library to be loaded to the upper interface. The specific steps are: use the load() function in QLibrary to load the second-layer encapsulation library, and use the isLoaded() function to check whether the second-layer encapsulation library is loaded successfully. If successful, directly pass the loaded second-layer encapsulation library to the upper interface. Multiple Library instances are allowed in the program, so multiple QLibrary instances can be used to load the second-layer encapsulation libraries corresponding to different cameras at the same time, and multiple upper interfaces can be built at the same time and the corresponding second-layer encapsulation libraries can be loaded.

[0118] The second dynamic loading method: call the LoadLibrary function in the Microsoft Foundation Classes (MFC) in the program. The LoadLibrary function loads the second-layer encapsulation library into a resource handle, which points to the address of the second-layer encapsulation library. The upper interface obtains the address of the external function of the second-layer encapsulation library based on the address, obtains the camera library of the second-layer encapsulation library through the address of the function, and implements the interface of the camera library in the upper interface. This dynamic loading method can call the LoadLibrary function in the program to load multiple other second-layer encapsulation libraries for use by the upper interface.

[0119] The above-mentioned dynamic loading methods are only two of the dynamic loading methods in the embodiments of the present application. The embodiments of the present application may also include static loading methods and other dynamic loading methods, which are not limited here.

[0120] The adaptation method of the camera device provided in the embodiment of the present application can adapt to different cameras and can realize loading multiple different cameras at the same time. Loading multiple different cameras at the same time requires loading multiple second-layer encapsulation libraries corresponding to the cameras at the same time. A dynamic loading method or a static loading method can be used. Since which cameras need to be adapted is based on the specific needs of the user to build a camera library and further operate the camera, the camera library of the camera is dynamically loaded when needed. Through the dynamic loading method, the needs of the user can be met, thereby improving the user's usage experience.

[0121] Please refer to Fig. 9 , Fig. 9 It is a schematic diagram of the process of adding a camera device provided in an embodiment of the present application;

[0122] like Fig. 9 As shown, the process of adding a new camera device includes:

[0123] Step S901: if a new camera device is added, a first-layer encapsulation library and a second-layer encapsulation library are constructed for the newly added camera device;

[0124] Specifically, each first-layer encapsulation library corresponds to a camera device, and each second-layer encapsulation library corresponds to a first-layer encapsulation library. If a new camera device is added, it is necessary to rebuild a first-layer encapsulation library and a second-layer encapsulation library corresponding to the new camera device, and then build a new upper-layer interface to implement the functional interface in the second-layer encapsulation library and be able to operate the camera device in the upper-layer interface. In this way, a new camera device is successfully added.

[0125] In an embodiment of the present application, a method for adapting a camera device is provided, the method comprising: constructing at least two first-layer encapsulation libraries, wherein each first-layer encapsulation library corresponds to a camera device one-to-one, the first-layer encapsulation library is used to import the software development kit and external library corresponding to the camera device, and the software development kit is used to interact with the camera device; constructing at least two second-layer encapsulation libraries, the second-layer encapsulation library calls the external library through the standard interface of the first-layer encapsulation library; constructing an upper-layer interface, the upper-layer interface is used to reference the second-layer encapsulation library to call the operation interface of the second-layer encapsulation library to operate the camera device. By constructing two layers of encapsulation libraries and one layer of upper-layer interface, the SDK and external library of each camera device are independently encapsulated, thereby being able to solve the problem of conflicts between different versions of the same external library, further enabling the correction software to interact with multiple camera devices, and improving the compatibility of the correction software with different camera devices.

[0126] Please refer to Fig.10 , Fig.10 It is a structural schematic diagram of an adaption device for a camera device provided in an embodiment of the present application;

[0127] The adapting device of the camera device is applied to an electronic device. Specifically, the camera device includes a camera, and the adapting device of the camera device is applied to one or at least two processors.

[0128] like Fig.10 As shown, the adapting device 1001 of the camera device includes:

[0129] A first construction module 1002 is used to construct at least two first-layer encapsulation libraries, wherein each first-layer encapsulation library corresponds to a camera device one by one, and the first-layer encapsulation library is used to import a software development kit and an external library corresponding to the camera device, and the software development kit is used to interact with the camera device;

[0130] The second construction module 1003 is used to construct at least two second-layer encapsulation libraries, wherein each second-layer encapsulation library corresponds to a first-layer encapsulation library one by one, and the second-layer encapsulation library calls the external library through the standard interface of the first-layer encapsulation library;

[0131] The interface construction module 1004 is used to construct an upper-layer interface, and the upper-layer interface is used to reference the second-layer encapsulation library to call the operation interface of the second-layer encapsulation library to operate the camera device.

[0132] In the embodiment of the present application, the first building module 1002 is specifically used for:

[0133] When connecting to a camera device, a first-layer encapsulation library is constructed. The first-layer encapsulation library is used to import a software development kit and an external library corresponding to the camera device. The first-layer encapsulation library interacts with the camera device through the software development kit.

[0134] When connecting with multiple camera devices, multiple first-layer encapsulation libraries are constructed. Because each first-layer encapsulation library corresponds to one camera device, that is, each first-layer encapsulation library is independent of each other, importing external libraries of different versions will not cause conflicts.

[0135] In the embodiment of the present application, the second building module 1003 is specifically used for:

[0136] Construct at least two second-layer encapsulation libraries. The second-layer encapsulation library interacts with the first-layer encapsulation library through the standard interface in the first-layer encapsulation library, and then calls the functions in the first-layer encapsulation library to obtain the information of the camera device, encapsulates the required functions of the camera device to form multiple operation interfaces, and the second-layer encapsulation library interacts with the upper-layer interface through the operation interface.

[0137] Each second-layer encapsulation library corresponds to a first-layer encapsulation library one-to-one, and each first-layer encapsulation library interacts with a camera device. When switching to another camera device, you only need to release the second-layer encapsulation library corresponding to the current camera device and load the second-layer encapsulation library corresponding to another camera device. The encapsulation libraries on the same layer are independent of each other and do not affect each other.

[0138] In the embodiment of the present application, the interface construction module 1004 is specifically used for:

[0139] Build the upper-level interface, which actively loads the interface in the second-level encapsulation library to obtain the information of the camera device and implement the required functions of the camera device, successfully interacts with the camera and loads multiple second-level encapsulation libraries at the same time.

[0140] The adapting device of the camera device in the embodiment of the present application can be a device or a computer terminal. The device can be a mobile electronic device or a non-mobile electronic device. For example, the mobile electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, an ultra-mobile personal computer (UMPC), etc., and the non-mobile electronic device can be a server, a personal computer (PC), etc., which is not specifically limited in the embodiment of the present application.

[0141] The adapter device of the camera device in the embodiment of the present application may be a device with an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems. The embodiment of the present application is not specifically limited. The adapter device of the camera device provided in the embodiment of the present application can realize Figure 4 To avoid repetition, the various implementation processes will not be described here.

[0142] It should be noted that the above-mentioned camera device adaptation device can execute the camera device adaptation method provided in the embodiment of the present application, and has the corresponding functional modules and beneficial effects of the execution method. For technical details not fully described in the embodiment of the camera device adaptation device, reference can be made to the camera device adaptation method provided in the above embodiment.

[0143] In an embodiment of the present application, an adaptation device for a camera device is provided, the device comprising: a first construction module, used to construct at least two first-layer encapsulation libraries, wherein each first-layer encapsulation library corresponds to a camera device one-to-one, the first-layer encapsulation library is used to import a software development kit and an external library corresponding to the camera device, and the software development kit is used to interact with the camera device; a second construction module, used to construct at least two second-layer encapsulation libraries, wherein each second-layer encapsulation library corresponds to a first-layer encapsulation library one-to-one, and the second-layer encapsulation library calls the external library through the standard interface of the first-layer encapsulation library; an interface construction module, used to construct an upper-layer interface, the upper-layer interface is used to reference the second-layer encapsulation library to call the operation interface of the second-layer encapsulation library to operate the camera device. The present application can adapt to multiple types of camera devices, and can load multiple camera devices at the same time, and the camera devices will not conflict due to version issues of the external library, and will not affect each other.

[0144] Please refer to Fig.11 , Fig.11 is a structural schematic diagram of an electronic device provided in an embodiment of the present application;

[0145] like Fig.11 As shown, the electronic device 110 includes one or more processors 111 and a memory 112. Fig.11 A processor 111 is taken as an example.

[0146] The processor 111 and the memory 112 may be connected via a bus or other means. Fig.11 The example of connecting through bus is taken in the following.

[0147] The processor 111 is used to provide computing and control capabilities to control the electronic device 110 to perform corresponding tasks, for example, to control the electronic device 110 to perform the adaptation method of the camera device in any of the above method embodiments, including: constructing at least two first-layer encapsulation libraries, wherein each first-layer encapsulation library corresponds to a camera device one-to-one, and the first-layer encapsulation library is used to import the software development kit and external library corresponding to the camera device, and the software development kit is used to interact with the camera device; constructing at least two second-layer encapsulation libraries, wherein each second-layer encapsulation library corresponds to a first-layer encapsulation library one-to-one, and the second-layer encapsulation library calls the external library through the standard interface of the first-layer encapsulation library; constructing an upper-layer interface, and the upper-layer interface is used to reference the second-layer encapsulation library to call the operation interface of the second-layer encapsulation library to operate the camera device.

[0148] By building a two-layer encapsulation library and an upper-layer interface, the software development kits and external library versions required by different camera devices can be encapsulated, making the correction software compatible with different camera devices and improving the compatibility of the correction software with different camera devices.

[0149] The processor 111 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), a hardware chip or any combination thereof; it may also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a programmable logic device (PLD) or a combination thereof. The above-mentioned PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof.

[0150] The memory 112 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as program instructions / modules corresponding to the adaptation method of the camera device in the embodiment of the present invention. The processor 111 executes various functional applications and data processing of the electronic device by running the non-volatile software programs, instructions and modules stored in the memory 112, that is, implements the adaptation method of the camera device in the above method embodiment.

[0151] The memory 112 may include a volatile memory (VM), such as a random access memory (RAM); the memory 112 may also include a non-volatile memory (NVM), such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD) or other non-transitory solid-state storage device; the memory 112 may also include a combination of the above-mentioned types of memory.

[0152] The memory 112 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 112 may optionally include a memory remotely arranged relative to the processor 111, and these remote memories may be connected to an adapted device of the camera device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0153] One or more modules are stored in the memory 112, and when executed by one or more processors 111, the adaptation method of the camera device in any of the above method embodiments is executed, for example, the above described Figure 4 The steps shown can also be implemented Fig.10 The functions of each module.

[0154] In the embodiment of the present application, the electronic device 110 may also have components such as a wired or wireless network interface, a keyboard, and an input / output interface for input and output. The electronic device 110 may also include other components for realizing device functions, which will not be described in detail here.

[0155] Please refer to Fig.12 , Fig.12 is a structural schematic diagram of an adaptation system for a camera device provided in an embodiment of the present application;

[0156] like Fig.12 As shown, the camera device adaptation system 120 is applied to an electronic device, including a display device 121, an electronic device 122 and a plurality of camera devices 123.

[0157] In an embodiment of the present application, multiple camera devices 123 are all communicatively connected to the electronic device 122, and the electronic device 122 can operate multiple camera devices 123 simultaneously; the electronic device 122 is communicatively connected to the display device 121 through the interface of the display device 121, and the images captured by the camera device 123 are sent to the display device 121 through a sending card (not shown) installed in the electronic device 121.

[0158] It should be noted that the electronic device 122 in the adaptation system 120 of the camera device can implement the adaptation method of the camera device in the above method embodiment, and then realize the above functions. For related contents, please refer to the contents mentioned in the above embodiment, which will not be repeated here.

[0159] The embodiment of the present application also provides a non-volatile computer-readable storage medium, such as a memory including a program code, and the program code can be executed by a processor to complete the adaptation method of the camera device in the above embodiment. For example, the non-volatile computer-readable storage medium can be a read-only memory (ROM), a random access memory (RAM), a compact disc read-only memory (CDROM), a magnetic tape, a floppy disk, an optical data storage device, etc.

[0160] An embodiment of the present application also provides a computer program product, which includes one or more program codes, and the program code is stored in a non-volatile computer-readable storage medium. The processor of the electronic device reads the program code from the non-volatile computer-readable storage medium, and the processor executes the program code to complete the method steps of the adaptation method of the camera device provided in the above embodiment.

[0161] Through the description of the above implementation methods, ordinary technicians in this field can understand that all or part of the steps of implementing the above embodiments can be completed by hardware, or by hardware related to program code, and the program can be stored in a non-volatile computer-readable storage medium. The above-mentioned storage medium can be a read-only memory, a disk or an optical disk, etc.

[0162] Through the description of the above implementation methods, a person of ordinary skill in the art can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, can also be implemented by hardware. A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.

[0163] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Under the concept of the present application, the technical features in the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other changes in different aspects of the present application as mentioned above, which are not provided in detail for the sake of simplicity. Although the present application has been described in detail with reference to the aforementioned embodiments, a person of ordinary skill in the art should understand that the technical solutions described in the aforementioned embodiments can still be modified, or some of the technical features can be replaced by equivalents. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for adapting a camera device, characterized in that: The method comprises: Construct at least two first-layer encapsulation libraries, wherein each first-layer encapsulation library corresponds to a camera device one by one, and the first-layer encapsulation library is used to import a software development kit and an external library corresponding to the camera device, and the software development kit is used to interact with the camera device; Constructing at least two second-layer encapsulation libraries, wherein each of the second-layer encapsulation libraries corresponds to a first-layer encapsulation library one by one, and the second-layer encapsulation library calls the external library through a standard interface of the first-layer encapsulation library; An upper layer interface is constructed, where the upper layer interface is used to reference the second layer encapsulation library to call the operation interface of the second layer encapsulation library to operate the camera device.

2. The method according to claim 1, characterized in that The constructing of at least two first-layer encapsulation libraries includes: An operation interface and a standard interface are encapsulated for each first-layer encapsulation library, wherein the operation interface of the first-layer encapsulation library is used to interact with a software development kit corresponding to the camera device, and the standard interface of the first-layer encapsulation library is used to interact with the second-layer encapsulation library.

3. The method according to claim 1 or 2, characterized in that: The constructing of at least two second-layer encapsulation libraries comprises: A plurality of operation interfaces are encapsulated for each second-layer encapsulation library, wherein the plurality of operation interfaces of the second-layer encapsulation library are the same as the plurality of operation interfaces of the upper-layer interface.

4. The method according to claim 1, characterized in that The method further comprises: Switch the current camera device to another camera device, including: Release the second-layer encapsulation library corresponding to the current camera device, and load the second-layer encapsulation library corresponding to another camera device.

5. The method according to claim 1, characterized in that The method further comprises: A plurality of second-layer package libraries are loaded simultaneously, wherein the second-layer package libraries include a camera library.

6. The method according to claim 1, characterized in that The method further comprises: If a new camera device is added, a first-layer encapsulation library and a second-layer encapsulation library are constructed for the new camera device.

7. The method according to claim 1, characterized in that The imaging device comprises a camera; Each of the external libraries corresponds to a version, and the versions of the external libraries imported by different first-layer encapsulation libraries are the same or different, and the external libraries include a graphics processing library.

8. An adaption device for a camera device, characterized in that: The device comprises: A first construction module is used to construct at least two first-layer encapsulation libraries, wherein each first-layer encapsulation library corresponds to a camera device one by one, and the first-layer encapsulation library is used to import a software development kit and an external library corresponding to the camera device, and the software development kit is used to interact with the camera device; A second construction module is used to construct at least two second-layer encapsulation libraries, wherein each of the second-layer encapsulation libraries corresponds to a first-layer encapsulation library one by one, and the second-layer encapsulation library calls the external library through a standard interface of the first-layer encapsulation library; The interface construction module is used to construct an upper-layer interface, wherein the upper-layer interface is used to reference the second-layer encapsulation library to call the operation interface of the second-layer encapsulation library to operate the camera device.

9. An electronic device, characterized in that: include: At least one processor and at least one memory, wherein the memory stores a computer program, and when the program is executed by the processor, the processor executes the steps of the method according to any one of claims 1 to 7.

10. An adaptation system for a camera device, characterized in that: The system comprises: The electronic device as claimed in claim 9; A plurality of camera devices are communicatively connected to the electronic device.