Method for photographing images with a camera and display device
By obtaining the port information and screen status of the display device, the number and type of ports for inserting cameras are determined, solving the problem of camera image rotation in rotating TV monitors, realizing normal image display on the monitor, and improving the user experience.
Patent Information
- Application Number
- CN202111275375.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-29
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2041-10-29
AI Technical Summary
When a rotating TV's display uses two camera ports simultaneously, the images captured by the cameras are prone to rotation, resulting in a poor user experience.
By obtaining the port information and screen status of the display device, the number and type of ports to which the camera is inserted are determined. Based on the screen status, the camera on the corresponding port is turned on, and the image is controlled to be displayed normally on the monitor, avoiding rotation.
This ensures that images captured by the camera are displayed correctly on the monitor, avoiding image rotation issues and improving the user experience.
Smart Images

Figure CN114007120B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of camera technology, and in particular to a method for capturing images with a camera and a display device. Background Art
[0002] In the related art, the display of a rotating TV is used in a variety of usage scenarios because it can rotate. To facilitate user use, the current rotating TV has a port that can be connected to an external camera, and the port includes a first port and a second port. The first port is located at the upper end of the display when the display is in a horizontal screen, and the second port is located at the upper end of the display when the display is in a vertical screen, that is, one side of the display when the display is in a horizontal screen. When the two ports are plugged with cameras at the same time, the image captured by the camera is often displayed on the display and rotated, which brings a bad user experience. Summary of the invention
[0003] The embodiments of the present application provide a method for capturing images with a camera and a display device, so that images captured with the camera can be normally displayed on a display.
[0004] In a first aspect, a display device is provided, comprising:
[0005] A display, for displaying a user interface;
[0006] A user interface for receiving an input signal;
[0007] A controller connected to the display and the user interface, respectively, for executing:
[0008] Receive an instruction to start a preset application, and obtain port information of a display device and a screen status of the display, wherein the port information is used to indicate a port into which a camera is inserted, and the screen status is used to indicate whether the screen is placed horizontally or vertically;
[0009] Determine the number of ports into which the camera is inserted according to the port information;
[0010] If the number of ports for inserting cameras is not less than two, the cameras on the corresponding ports are turned on according to the screen status, and the images are controlled to be displayed on the display.
[0011] In some embodiments, the controller is further used to execute: if the number of ports into which the camera is inserted is one, then the camera is turned on, and according to the screen status and port information, an image captured by the camera is processed, and the processed image is displayed on the control display.
[0012] In some embodiments, there are two ports for inserting the camera, which are a first port and a second port; the controller is configured to execute the following steps to turn on the camera on the corresponding port according to the screen status: when the screen status is a horizontal status, turn on the camera inserted on the first port; when the screen status of the display device is a vertical status, turn on the camera inserted on the second port.
[0013] In some embodiments, the controller is configured to perform the following steps to start the camera on the corresponding port according to the screen status:
[0014] Determine a first identifier of a camera to be turned on according to the screen state;
[0015] According to the first identifier, a corresponding camera path is mapped to obtain a file corresponding to the camera path;
[0016] Through the first system function, the file is opened and the corresponding handle is obtained;
[0017] The property information supported by the camera corresponding to the handle is obtained through the second system function, wherein the property information includes the preview size supported by the camera.
[0018] In some embodiments, the controller is configured to control the display of an image on the display according to the following steps: obtaining a preview stream through a camera; and rendering a corresponding image according to the preview stream.
[0019] In some embodiments, the controller is configured to obtain a preview stream through a camera according to the following steps: determining shooting parameters of the camera; and obtaining preview data corresponding to the shooting parameters.
[0020] In some embodiments, the controller is configured to perform the following steps to determine the shooting parameters of the camera:
[0021] Receive the set shooting parameters;
[0022] Determine whether the set shooting parameters are the preview size supported by the camera;
[0023] If the preview size is supported by the camera, the shooting parameters of the camera are determined to be the set shooting parameters.
[0024] In some embodiments, the controller is configured to perform the following steps to render a corresponding image according to the preview stream:
[0025] Create a display window based on the image display method;
[0026] Create a preview image rendering environment, obtain preview data, and determine the preview direction;
[0027] In the created preview image rendering environment, an image is rendered in a display window based on the acquired preview data and preview direction.
[0028] In a second aspect, a method for capturing an image with a camera is provided, comprising:
[0029] Receive an instruction to start a preset application, and obtain port information of a display device and a screen status of the display, wherein the port information is used to indicate a port into which a camera is inserted, and the screen status is used to indicate whether the screen is placed horizontally or vertically;
[0030] Determine the number of ports into which the camera is inserted according to the port information;
[0031] If the number of ports for inserting cameras is not less than two, the cameras on the corresponding ports are turned on according to the screen status, and the images are controlled to be displayed on the display.
[0032] In some embodiments, the step of turning on the camera on the corresponding port according to the screen state includes: when the screen state is a horizontal state, turning on the camera inserted into the first port; when the screen state of the display device is a vertical state, turning on the camera inserted into the second port.
[0033] In the above embodiment, a method for capturing images with a camera and a display device are provided. The embodiment of the present application determines the camera to be turned on according to whether the screen is in a horizontal or vertical state, and ensures that the image captured by the camera is displayed normally on the display without flipping. The method includes: receiving an instruction to start a preset application, obtaining the port information of the display device and the screen status of the display, wherein the port information is used to indicate the port into which the camera is inserted, and the screen status is used to indicate whether the screen is placed horizontally or vertically; determining the number of ports into which the camera is inserted according to the port information; if the number of ports into which the camera is inserted is not less than two, turning on the camera on the corresponding port according to the screen status, and controlling the display of the image. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1A An application scenario diagram of a display device provided in some embodiments of the present application;
[0035] Figure 1B A rear view of a display device provided in some embodiments of the present application;
[0036] Figure 2 A hardware configuration block diagram of the control device 100 in FIG. 1 provided for some embodiments of the present application;
[0037] Figure 3 A hardware configuration block diagram of the display device 200 in FIG. 1 provided for some embodiments of the present application;
[0038] Figure 4 A block diagram of the architecture configuration of an operating system in the memory of a display device 200 provided in some embodiments of the present application;
[0039] Figure 5-Figure 6 exemplarily shows a schematic diagram of an image captured by a camera in the related art;
[0040] Figure 7 Schematic diagram of a plug-in camera is shown as an example;
[0041] Figure 8 A flow chart of a method for capturing images with a camera is exemplarily shown in FIG.
[0042] Figure 9-10 A user interface schematic diagram is exemplarily shown in FIG. DETAILED DESCRIPTION
[0043] In order to enable those skilled in the art to better understand the technical solutions in this application, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this application.
[0044] A rotating TV is a new type of smart TV, which mainly includes a display and a rotating component. The display is fixed to a wall or a bracket through a rotating component, and the display placement angle can be adjusted through the rotating component to achieve the purpose of rotation to adapt to display images with different aspect ratios. For example, in most cases, the display is placed horizontally to display video images with aspect ratios of 16:9, 18:9, etc. When the aspect ratio of the video screen is 9:16, 9:18, etc., the horizontally placed display needs to scale the screen and display black areas on both sides of the display. Therefore, the display can be placed vertically through the rotating component to adapt to video images with ratios of 9:16, 9:18, etc.
[0045] In order to facilitate users to display target media asset details pages in different horizontal and vertical screen states of the display, and to improve the user viewing experience when the display device is in different viewing states, the embodiment of the present application provides a display device, a details page display method and a computer storage medium, and the display device is such as a rotating TV. It should be noted that the method provided in this embodiment is not only applicable to rotating TVs, but also to other display devices, such as computers, tablet computers, etc.
[0046] The term "module" used in the embodiments of the present application may refer to any known or later developed hardware, software, firmware, artificial intelligence, fuzzy logic, or a combination of hardware and / or software code that can perform the functions associated with the element.
[0047] The term "remote control" used in the embodiments of the present application refers to a component of an electronic device (such as the display device disclosed in the present application), which can usually wirelessly control the electronic device within a short distance. The component can generally use infrared and / or radio frequency (RF) signals and / or Bluetooth to connect to the electronic device, and can also include functional modules such as WiFi, wireless USB, Bluetooth, motion sensors, etc. For example: a handheld touch remote control replaces most of the physical built-in hard keys in a general remote control device with a user interface in a touch screen.
[0048] The term "gesture" used in the embodiments of the present application refers to a user's behavior of expressing an intended idea, action, purpose, or result through a change in hand shape or hand movement.
[0049] The term "hardware system" used in the embodiments of the present application may refer to a physical component with computing, control, storage, input and output functions, which is composed of mechanical, optical, electrical and magnetic devices such as integrated circuits (ICs) and printed circuit boards (PCBs). In the embodiments of the present application, the hardware system is also usually referred to as a motherboard, a main chip or a controller.
[0050] See also Figure 1A , is an application scenario diagram of a display device provided in some embodiments of the present application. Figure 1A As shown, the control device 100 and the display device 200 can communicate with each other in a wired or wireless manner.
[0051] The control device 100 is configured to control the display device 200, which can receive operation instructions input by the user and convert the operation instructions into instructions that the display device 200 can recognize and respond to, playing the role of an intermediary for the interaction between the user and the display device 200. For example, the user operates the channel increase and decrease keys on the control device 100, and the display device 200 responds to the channel increase and decrease operations.
[0052] The control device 100 may be a remote controller 100A, including infrared protocol communication or Bluetooth protocol communication, and other short-range communication methods, etc., to control the display device 200 wirelessly or by wire. The user may input user commands through buttons on the remote controller, voice input, input on the control panel, etc. to control the display device 200. For example, the user may input corresponding control commands through the volume plus and minus keys, channel control keys, up / down / left / right movement keys, voice input keys, menu keys, power on / off keys, etc. on the remote controller to realize the function of controlling the display device 200.
[0053] The control device 100 may also be a smart device, such as a mobile terminal 100B, a tablet computer, a computer, a laptop computer, etc. For example, an application running on the smart device is used to control the display device 200. The application can be configured to provide the user with various controls through an intuitive user interface (UI) on a screen associated with the smart device.
[0054] Exemplarily, the mobile terminal 100B can install software applications with the display device 200, and realize connection communication through a network communication protocol to achieve the purpose of one-to-one control operation and data communication. For example, the mobile terminal 100B can establish a control command protocol with the display device 200, and realize the functions of the physical buttons arranged on the remote control 100A by operating various function keys or virtual controls of the user interface provided on the mobile terminal 100B. The audio and video content displayed on the mobile terminal 100B can also be transmitted to the display device 200 to realize the synchronous display function.
[0055] The display device 200 may provide a network TV function of a broadcast receiving function and a computer support function. The display device may be implemented as a digital TV, a network TV, an Internet Protocol TV (IPTV), etc.
[0056] The display device 200 may be a liquid crystal display, an organic light emitting display, or a projection device, and the specific type, size, and resolution of the display device are not limited.
[0057] The display device 200 also communicates data with the server 300 through a variety of communication methods. Here, the display device 200 may be allowed to communicate and connect via a local area network (LAN), a wireless local area network (WLAN), and other networks. The server 300 may provide various content and interactions to the display device 200. For example, the display device 200 may send and receive information, such as receiving electronic program guide (EPG) data, receiving software program updates, or accessing a remotely stored digital media library. The server 300 may be a group or multiple groups, and may be one or more types of servers. Other network service content such as video on demand and advertising services may be provided through the server 300.
[0058] In some embodiments, Figure 1B As shown, the display device 200 includes a rotating component 276, a controller 250, a display 275, and a rotating component 276 connected to the back panel. The rotating component 276 can rotate the display screen. From the perspective of viewing from the front of the display device, the rotating component 276 can rotate the display screen to a vertical state, that is, a state in which the vertical side length of the screen is greater than the horizontal side length, and can also rotate the screen to a horizontal state, that is, a state in which the horizontal side length of the screen is greater than the vertical side length.
[0059] Figure 2 exemplarily shows a configuration block diagram of the control device 100. Figure 2 As shown, the control device 100 includes a controller 110 , a memory 120 , a communicator 130 , a user input interface 140 , a user output interface 150 , and a power supply 160 .
[0060] Figure 3 exemplarily shows a hardware configuration block diagram of the display device 200. Figure 3 As shown, the display device 200 may include a tuner and demodulator 210, a communicator 220, a detector 230, an external device interface 240, a controller 250, a memory 260, a user interface 265, a video processor 270, a display 275, a rotating component 276, a monitoring component 277, an audio processor 280, an audio output interface 285, and a power supply 290.
[0061] The monitoring component 277 may be independently arranged or arranged in the controller.
[0062] The rotating assembly 276 may include components such as a driving motor and a rotating shaft. The driving motor may be connected to the controller 250 and output a rotation angle under the control of the controller 250; one end of the rotating shaft is connected to the power output shaft of the driving motor, and the other end is connected to the display 275, so that the display 275 can be fixedly mounted on a wall or a bracket through the rotating assembly 276.
[0063] The rotating assembly 276 may also include other components, such as a transmission component, a detection component, etc. Among them, the transmission component can adjust the speed and torque output by the rotating assembly 276 through a specific transmission ratio, and can be a gear transmission method; the detection component can be composed of sensors arranged on the rotating shaft, such as an angle sensor, a posture sensor, etc. These sensors can detect parameters such as the rotation angle of the rotating assembly 276, and send the detected parameters to the controller 250, so that the controller 250 can judge or adjust the state of the display device 200 according to the detected parameters. In practical applications, the rotating assembly 276 may include but is not limited to one or more of the above components.
[0064] The monitoring component 277 is used to monitor the component rotation information of the rotating component 276 and output the component rotation information to the controller.
[0065] The tuner-demodulator 210 receives broadcast television signals by wired or wireless means, and can perform modulation and demodulation processing such as amplification, mixing and resonance, and is used to demodulate the audio and video signals carried in the frequency of the TV channel selected by the user, as well as additional information (such as EPG data) from multiple wireless or wired broadcast television signals.
[0066] In some other exemplary embodiments, the tuner 210 may also be in an external device, such as an external set-top box, etc. In this way, the set-top box outputs a television signal after modulation and demodulation, and the television signal is input into the display device 200 through the external device interface 240 .
[0067] The communicator 220 is a component for communicating with an external device or an external server according to various communication protocol types. For example, the display device 200 can send content data to an external device connected via the communicator 220, or browse and download content data from an external device connected via the communicator 220. The communicator 220 can include a network communication protocol module or a near field communication protocol module such as a WIFI module 221, a Bluetooth communication protocol module 222, and a wired Ethernet communication protocol module 223, so that the communicator 220 can receive a control signal of the control device 100 according to the control of the controller 250, and implement the control signal as a WIFI signal, a Bluetooth signal, a radio frequency signal, etc.
[0068] The detector 230 is a component of the display device 200 for collecting signals of the external environment or interacting with the outside. The detector 230 may include a sound collector 231, such as a microphone, which can be used to receive the user's voice, such as a voice signal of a control instruction of the user controlling the display device 200; or, it can collect environmental sounds for identifying the type of environmental scene, so that the display device 200 can adapt to the environmental noise.
[0069] In some other exemplary embodiments, the detector 230 may also include an image collector 232, such as a camera, a webcam, etc., which can be used to collect external environment scenes to adaptively change the display parameters of the display device 200; and to collect user attributes or interactive gestures with the user to realize the function of interaction between the display device and the user.
[0070] In some other exemplary embodiments, the detector 230 may also include a temperature sensor, such as by sensing the ambient temperature, the display device 200 may adaptively adjust the display color temperature of the image. For example, when the temperature is high, the display device 200 may adjust the color temperature of the image displayed to be cooler; when the temperature is low, the display device 200 may adjust the color temperature of the image displayed to be warmer.
[0071] The external device interface 240 is a component that provides the controller 250 with control of data transmission between the display device 200 and an external device. The external device interface 240 can be connected to an external device such as a set-top box, a game device, a notebook computer, etc. in a wired / wireless manner, and can receive data such as video signals (such as moving images), audio signals (such as music), additional information (such as EPG), etc. from the external device.
[0072] Among them, the external device interface 240 may include: a high-definition multimedia interface (HDMI) terminal 241, a composite video blanking synchronization (CVBS) terminal 242, an analog or digital component terminal 243, a universal serial bus (USB) terminal 244, a component terminal (not shown in the figure), a red, green and blue (RGB) terminal (not shown in the figure), etc. Any one or more.
[0073] The controller 250 controls the operation of the display device 200 and responds to the user's operation by running various software control programs (such as an operating system and various application programs) stored in the memory 260.
[0074] like Figure 3 As shown, the controller 250 includes a random access memory (RAM) 251, a read-only memory (ROM) 252, a graphics processor 253, a CPU processor 254, a communication interface 255, a communication bus 256, a rotation processor 257, and an animation processor 258. Among them, the RAM 251, the ROM 252, the graphics processor 253, the CPU processor 254 communication interface 255, the rotation processor 257, and the animation processor 258 are connected via the communication bus 256. The functions of the rotation processor 257 and the animation processor 258 will be described in detail in the subsequent embodiments.
[0075] The controller 250 may control the overall operation of the display device 200. For example, in response to receiving a user input command for selecting a GUI object displayed on the display 275, the controller 250 may perform an operation related to the object selected by the user input command.
[0076] The object may be any one of the selectable objects, such as a hyperlink or an icon. The operation related to the selected object may be, for example, an operation of displaying a page, document, image, etc. connected to the hyperlink, or an operation of executing a process corresponding to the object. The user input command for selecting the GUI object may be a command inputted through various input devices (e.g., a mouse, a keyboard, a touch pad, etc.) connected to the display device 200, or a voice command corresponding to a voice spoken by the user.
[0077] The memory 260 is used to store various types of data, software programs or applications for driving and controlling the operation of the display device 200. The memory 260 may include volatile and / or non-volatile memory. The term "memory" includes the memory 260, the RAM 251 and the ROM 252 of the controller 250, or a memory card in the display device 200.
[0078] In some embodiments, the memory 260 is specifically used to store the running program that drives the controller 250 in the display device 200; store various application programs built into the display device 200 and downloaded by the user from an external device; store data such as visual effect images used to configure various GUIs provided by the display 275, various objects related to the GUI, and selectors for selecting GUI objects.
[0079] In some embodiments, the memory 260 is specifically used to store drivers and related data for the tuner-demodulator 210, the communicator 220, the detector 230, the external device interface 240, the video processor 270, the display 275, the audio processor 280, etc., such as external data received from the external device interface (e.g., audio and video data) or user data received by the user interface (e.g., key information, voice information, touch information, etc.).
[0080] Figure 4 exemplarily shows a block diagram of the architecture configuration of the operating system in the memory of the display device 200. The operating system architecture is composed of an application layer, a middleware layer and a kernel layer from top to bottom.
[0081] The application layer includes both built-in applications and non-system-level applications. It is responsible for direct interaction with users. The application layer can include multiple applications, such as settings applications, e-mail applications, media center applications, etc. These applications are mainly developed based on the Android system, and the development language can be Java / C++. These applications can also be implemented as Web applications, which are executed based on the WebKit engine, and can be developed and executed based on HTML5, Cascading Style Sheets (CSS) and JavaScript.
[0082] The middleware layer can provide some standardized interfaces to support the operation of various environments and systems. For example, the middleware layer can be implemented as the Multimedia and Hypermedia Information Coding Experts Group (MHEG) middleware related to data broadcasting, as the DLNA middleware related to external device communication, or as the middleware that provides the browser environment for the application programs in the display device to run.
[0083] The kernel layer provides core system services, such as file management, memory management, process management, network management, system security permission management, etc. The kernel layer can be implemented as a kernel based on various operating systems, for example, a kernel based on the Linux operating system.
[0084] The kernel layer also provides communication between system software and hardware, and provides device driver services for various hardware, such as: providing a display driver for the display 275, a camera driver for the camera, a key driver for the remote control, a WiFi driver for the WIFI module, an audio driver for the audio output interface, and a power management driver for the power management (PM) module.
[0085] Figure 3 In the embodiment, the user interface 265 receives various user interactions. Specifically, it is used to send the user's input signal to the controller 250, or transmit the output signal from the controller 250 to the user. Exemplarily, the remote controller 100A can send the user's input signal such as power switch signal, channel selection signal, volume adjustment signal, etc. to the user interface 265, and then the user interface 265 forwards it to the controller 250; or, the remote controller 100A can receive the output signal such as audio, video or data output from the user interface 265 after being processed by the controller 250, and display the received output signal or output the received output signal in the form of audio or vibration.
[0086] In some embodiments, the user may input a user command in a graphical user interface (GUI) displayed on the display 275, and the user interface 265 receives the user input command through the GUI. Specifically, the user interface 265 may receive a user input command for controlling the position of a selector in the GUI to select different objects or items. Among them, "user interface" is a medium interface for interaction and information exchange between an application or an operating system and a user, which realizes the conversion between the internal form of information and the form acceptable to the user. A commonly used form of user interface is a graphical user interface (GUI), which refers to a user interface related to computer operation displayed in a graphical manner. It can be an interface element such as an icon, a window, a control, etc. displayed on a display screen of an electronic device, wherein the control may include visual interface elements such as icons, controls, menus, tabs, text boxes, dialog boxes, status bars, channel bars, widgets, etc.
[0087] Alternatively, the user may input a user command by inputting a specific sound or gesture, and the user interface 265 recognizes the sound or gesture through a sensor to receive the user input command.
[0088] The video processor 270 is used to receive external video signals and perform video data processing such as decompression, decoding, scaling, noise reduction, frame rate conversion, resolution conversion, and image synthesis according to the standard codec protocol of the input signal to obtain a video signal that can be directly displayed or played on the display 275.
[0089] The display 275 is used to receive the image signal input from the video processor 270 and display the video content, image and menu operation interface. The displayed video content may be the video content in the broadcast signal received by the tuner demodulator 210, or the video content input from the communicator 220 or the external device interface 240. The display 275 also displays the user operation interface UI generated in the display device 200 and used to control the display device 200.
[0090] Furthermore, the display 275 may include a display screen component for presenting images and a driving component for driving image display. Alternatively, if the display 275 is a projection display 275, it may also include a projection device and a projection screen.
[0091] The controller can send a control signal to the rotating component 276 to rotate the display 275 .
[0092] The monitoring component 277 is used to monitor the component rotation information of the rotating component 276 and output the component rotation information to the controller.
[0093] The audio processor 280 is used to receive external audio signals, and perform decompression and decoding according to the standard codec protocol of the input signal, as well as audio data processing such as noise reduction, digital-to-analog conversion, and amplification processing to obtain an audio signal that can be played in the speaker 286.
[0094] Exemplarily, the audio processor 280 may support various audio formats, such as MPEG-2, MPEG-4, Advanced Audio Coding (AAC), High Efficiency AAC (HE-AAC), and the like.
[0095] The audio output interface 285 is used to receive the audio signal output by the audio processor 280 under the control of the controller 250. The audio output interface 285 may include a speaker 286, or an external audio output terminal 287 of a generating device for outputting to an external device, such as an earphone output terminal.
[0096] The power supply 290 is used to provide power supply support for the display device 200 with power input from an external power source under the control of the controller 250. The power supply 290 can be a built-in power supply circuit installed inside the display device 200, or a power supply installed outside the display device 200.
[0097] In the related art, the display of a rotating TV is used in a variety of usage scenarios because it can rotate. To facilitate user use, the current rotating TV has a port that can be connected to an external camera, and the port includes a first port and a second port. The first port is located at the upper end of the display when the display is in a horizontal screen, and the second port is located at the upper end of the display when the display is in a vertical screen, that is, one side of the display when the display is in a horizontal screen. When the two ports are plugged with cameras at the same time, the image captured by the camera is often displayed on the display and rotated, which brings a bad user experience.
[0098] For example, if the camera located at the first port is used to capture an image, when the screen is in a vertical state, the image displayed on the display will be rotated, such as Figure 5 For example, when the camera of the second port is used to capture an image, the screen state is in the horizontal state, and the image display on the monitor may be rotated. Figure 6 It should be noted that Figure 5 and Figure 6 The image flipping direction of the abnormal situation in the above is only an example. In some embodiments, the abnormal situation may also include other flipping directions, for example, Figure 5 As shown, the direction of the camera on the display device is taken as the positive direction. Figure 5 The direction of the head of the portrait is located in the opposite direction of the camera relative to the display device. In some embodiments, the direction of the head of the portrait is located in the same direction as the direction of the camera relative to the display device.
[0099] Therefore, how to select a camera and how to ensure that the image captured by the camera is displayed on the display without rotation have become problems that need to be solved urgently by those skilled in the art.
[0100] The embodiment of the present application is a solution for inserting a direct-insertion camera into a port, such as Figure 7 As shown, the plug-in type camera 71 refers to a camera that rotates along with the display.
[0101] In order to solve the above technical problems, an embodiment of the present application provides a method for capturing images with a camera. When multiple cameras are inserted into a display device, the method can normally display the images captured by the cameras on the display. At this time, the images are not rotated when displayed on the display.
[0102] The method, such as Figure 8 As shown, it includes: S100, receiving an instruction to start a preset application, obtaining port information of a display device and a screen status of a display, wherein the port information is used to indicate a port into which a camera is inserted, and the screen status is used to indicate whether the screen is placed horizontally or vertically.
[0103] In some embodiments, the preset application may be a camera application. The focus on the display device is moved by the control device to the control of the preset application, and a confirmation key on the control device is pressed to generate an instruction to start the preset application. After the preset application is started, the user interface displays the following: Fig. 9 As shown, the image captured by the camera is displayed in the preview frame of the user interface. In some embodiments, the user can move the focus to the photo control through the control device to achieve the purpose of taking photos.
[0104] In some embodiments, before obtaining the port information of the display device and the screen status of the display, the method further includes: determining whether a camera is inserted into the display device.
[0105] In some embodiments, it is detected that a camera is inserted into a display device, and a first preset file is generated. The step of determining whether a camera is inserted into the display device includes: determining whether the first preset file exists; if the first preset file exists, determining that a camera is inserted into the display device; if the first preset file does not exist, determining that a camera is not inserted into the display device. In an embodiment of the present application, when a camera is inserted into a display device, a first preset file is automatically generated. When executing the step of determining whether a camera is inserted into a display device, it is directly determined whether the first preset file exists. If it exists, it is determined that a camera is inserted into the display device; if it does not exist, it is determined that a camera is not inserted into the display device. The present application may also use other methods to determine whether a camera is inserted into a display device, and the present application does not specifically limit this method.
[0106] If there is no camera inserted into the display device, the display is controlled to display a prompt message for inserting a camera. The prompt message may be in any form, such as a picture, text or sound. For example, Fig.10 As shown, the prompt message is that the camera is not detected. Please check whether the current camera is connected.
[0107] In some embodiments, if a camera is plugged into the display device, the port information of the display device and the screen status of the display are obtained.
[0108] In some embodiments, the display device detects that a camera is inserted into the display device and generates a second preset file. The second preset file includes a first identifier. When the camera is inserted into the display device, the camera is configured with the first identifier in the order of insertion. For example, when the first camera is inserted into the display device, the camera is configured with the first identifier (videox) as 0. When the second camera is inserted into the display device, the camera is configured with the first identifier as 1. When the first camera is unplugged from the display device, the camera is configured with the first identifier as -1. When the third camera is inserted into the display device, the camera is configured with the first identifier as 2.
[0109] The port on the display device is configured with a second identifier, the second identifier (logicalID) is determined according to the first identifier (videox) of the camera inserted into the port, the second identifier includes a third identifier LandscapeID and a fourth identifier PortraitID, the third identifier is the identifier of the first port, and the fourth identifier is the identifier of the second port. Exemplarily, the port into which the camera with the first identifier of 0 is inserted is the first port, at which time the third identifier LandscapeID is 0, and the port into which the camera with the first identifier of 1 is inserted is the second port, at which time the fourth identifier PortraitID is 1.
[0110] The port information of the display device can be determined according to the third identifier and the fourth identifier. When the third identifier and the fourth identifier are non-negative numbers, it is determined that the first port and the second port are both plugged into the camera. When the third identifier is a negative number and the fourth identifier is non-negative, it is determined that the second port is plugged into the camera.
[0111] It should be noted that the present application does not limit the steps of determining the port information of the display device, and any method that can achieve the determination of the port information is acceptable.
[0112] In some embodiments, the screen state of the display can be determined based on system parameters. For example, the system parameters can be configuration system functions, where configuration.orientation_Landscape indicates that the TV screen displays a horizontal screen state, and configuration.orientation_portrait indicates that the TV screen displays a vertical screen state.
[0113] In some embodiments, S200, according to the port information, determine the number of ports into which the camera is inserted. In the embodiment of the present application, in order to ensure that the image displayed on the display is not flipped, when the number of ports into which the camera is inserted is different, the display device will have different processing flows when displaying the image. In the embodiment of the present application, if the port information includes the first port or the second port, it is determined that the number of ports into which the camera is inserted is one. If the port information includes the first port and the second port, it is determined that the number of ports into which the camera is inserted is two.
[0114] The following first describes in detail how the display device displays images when the number of ports into which cameras are inserted is not less than two.
[0115] S300: If the number of ports for inserting cameras is not less than two, then according to the screen state, the camera on the corresponding port is turned on to control the display to display an image. In the embodiment of the present application, there is no restriction on the number of ports on the display device that can be inserted with cameras. In some embodiments, the display device may be provided with multiple ports for inserting cameras. For example, the number of ports may be four, and the four ports are provided on the four sides corresponding to the display device.
[0116] For ease of description, the technical solution in the embodiments of the present application is developed for a display device that has only two ports into which cameras can be inserted.
[0117] When the number of ports for inserting cameras is two, the two ports are the first port and the second port; the step of turning on the camera on the corresponding port according to the screen state includes: when the screen state is in a horizontal state, turning on the camera inserted on the first port; when the screen state of the display device is in a vertical state, turning on the camera inserted on the second port. In the embodiment of the present application, in order to prevent the image captured by the camera from rotating when displayed on the display, when the screen state of the display device is in a vertical state, turning on the camera inserted on the second port. When the screen state of the display device is in a horizontal state, turning on the camera inserted on the first port.
[0118] In some embodiments, the step of opening the camera inserted into the port can be completed by calling a camera opening function. Exemplarily, the camera opening function can be uvcOpenCamera(int videoId), where videoID is the first identifier.
[0119] In some embodiments, according to the screen status, the step of starting the camera inserted into the port includes:
[0120] A first identifier of a camera to be turned on is determined according to the screen status.
[0121] In the embodiment of the present application, if the screen state is a landscape state, the camera to be turned on is the camera inserted into the first port, and the first identifier of the camera inserted into the first port is determined at this time. Exemplarily, if the screen state is a landscape state, the third identifier is obtained, and when the third identifier LandscapeID is 2, the first identifier is 2. If the screen state is a portrait state, the camera to be turned on is the camera inserted into the second port, and the first identifier of the camera inserted into the second port is determined at this time. Exemplarily, if the screen state is a portrait state, the fourth identifier is obtained, and when the fourth identifier PortraitID is 3, the first identifier is 3.
[0122] According to the first identifier, the corresponding camera path is mapped to obtain the file corresponding to the camera path. According to the first identifier, the logical ID is determined and mapped to the specific camera path path = / dev / VidoeX, where X represents the specific logical ID, ranging from 0 to 9, and the logical ID is equal to the first identifier.
[0123] The file is opened through the first system function and the corresponding handle is obtained. Specifically, the file is opened through the system function open interface and the corresponding handle fd is obtained.
[0124] The attribute information supported by the camera corresponding to the handle is obtained through the second system function, wherein the attribute information includes: camera support capabilities, data formats supported by the camera, and preview sizes supported by the camera.
[0125] Specifically, the attribute information supported by the camera is obtained through the system function ioctl. Obtaining the camera support capability can be implemented through the following code: ioctl (cam->fd, VIDIOC_QUERYCAP, &cap) obtains the camera support capability. For example, it determines whether the camera supports the video capture capability V4L2_CAP_VIDEO_CAPTURE. Obtain the data format supported by the camera. For example, the supported camera data format list can be obtained through ioctl (cam->fd, VIDIOC_ENUM_FMT, &fmtList), and the list includes all the data formats supported by the camera. Obtain the preview size supported by the camera. For example, the preview size list supported by the camera can be obtained through ioctl (cam->fd, VIDIOC_ENUM_FRAMESIZES, &sizeList), and the preview size list includes all the preview sizes supported by the camera.
[0126] In some embodiments, the step of controlling the image displayed on the display includes: acquiring a preview stream through a camera; and rendering a corresponding image according to the preview stream.
[0127] Among them, obtaining the preview stream through the camera can be completed by calling the function of starting the camera preview stream. For example, the function uvcStartPreview(int width, int height) is to start the camera preview stream function, width is the width of the image in the preview stream, and height is the height of the image in the preview stream.
[0128] According to the preview stream, rendering the corresponding image can be completed by calling a display texture creation function. Exemplarily, the function uvcSetSurface(SurfaceHolder hold) is a display texture creation function.
[0129] In some embodiments, the step of obtaining a preview stream through a camera includes: determining shooting parameters of the camera; and obtaining preview data corresponding to the shooting parameters.
[0130] In the embodiment of the present application, the shooting parameters of the camera can be determined by setting. For example, the shooting parameters can be set through the user interface, and the shooting parameters include the width and height of the image. Since the camera has a fixed supported preview size, after setting the shooting parameters of the camera, it is determined whether the shooting parameters are the preview size supported by the camera; if it is the preview size supported by the camera, the preview data corresponding to the set shooting parameters is obtained.
[0131] If the set shooting parameters are not the preview size supported by the camera, the shooting parameters can be determined according to VGA (computer display standard), and the preview stream can be obtained using the shooting parameters. If the shooting parameters cannot be determined according to VGA, a preview size supported by a camera can be arbitrarily selected, and the preview stream can be obtained according to the preview size supported by the selected camera. In some embodiments, a preview size supported by a camera can also be selected according to priority. For example, one close to the set shooting parameters can be selected, and the preview stream can be obtained through the close preview size.
[0132] In some embodiments, obtaining the preview data corresponding to the shooting parameters may be achieved by starting a preview thread, and exemplarily, the preview thread may be a preview thread. The preview data is obtained from the camera through the system function ioctl interface VIDIOC_DQBUF.
[0133] In an embodiment of the present application, before starting the preview thread, memory is also applied for the preview data obtained by the camera to save the preview data. For example, the system function ioctl interface VIDIOC_QBUF is used to apply for memory data for the camera to fill the data. In some embodiments, after receiving an instruction to start a preset application, a property value is set. When the property value is polled, the preview thread is started. For example, the property value VIDIOC_STREAMON is set. When the property value is polled, the preview thread is started.
[0134] In some embodiments, according to the preview stream, the step of rendering the corresponding image includes:
[0135] Based on the display image mode (view), a display window is created. Exemplarily, the display window is created by the ANativeWindow_fromSurface method.
[0136] Create a preview image rendering environment. In some embodiments, the preview image rendering environment can be created by starting the preview rendering thread RendorThread. Specifically, the platform display device is obtained through eglGetDisplay (EGL_DEFAULT_DISPLAY), the EGL environment is created through eglCreateContext, and a specific surface is created through eglCreateWindowSurface.
[0137] Get preview data. In the embodiment of the present application, the preview data can be waited for to be filled, and the system function ioctl interface VIDIOC_DQBUF can also return the preview data to the preview rendering thread Rendor Thread for data rendering.
[0138] In the created preview image rendering environment, the image is rendered in the display window based on the acquired preview data and preview direction. In an embodiment of the present application, the preview direction refers to the rotation angle of the image. After the image is rotated according to the rotation angle, it is displayed on the display, so that the image does not flip on the display. Specifically, the preview direction can be determined according to the port information and the screen state. Exemplarily, when the port information includes the first port and the second port, the preview direction is 0°. Since the port information includes two ports, the scheme in the embodiment of the present application will correspond to the camera on the open port according to the screen state, so no flipping will occur, so the preview direction is 0° at this time. When the port information includes the first port or the second port, the preview direction needs to be set according to the actual situation, which is described in detail below.
[0139] When receiving an instruction to close the preset application, close the camera preview and then close the camera.
[0140] In some embodiments, the camera preview can be closed by calling the function uvcStopPreview() to close the camera preview stream. The camera preview stream is stopped by setting the attribute value VIDIOC_STREAMOFF through the system function ioctl, and the Preview Thread and the Rendor Thread are stopped. The camera can be closed by calling the function uvcCloseCamera(), and the close(fd) process is performed based on the obtained handle fd.
[0141] The following describes how the display device displays images when only one camera port is plugged in.
[0142] When the number of ports into which the camera is inserted is one, the camera is turned on, and according to the screen state and the port information, the image captured by the camera is processed, and the processed image is displayed on the control display.
[0143] In some embodiments, when the number of ports into which the camera is inserted is one, determining whether the screen state is a horizontal screen state, and if it is a horizontal screen state, determining whether the port information is a first port;
[0144] If it is in a horizontal screen state and the port information is the first port, the preview direction is set to 0°; if it is in a horizontal screen state and the port information is not the first port, the preview direction is set to 90°; if it is in a vertical screen state, determine whether the port is the first port; if it is in a vertical screen state and the port information is the first port, the preview direction is set to 90°; if it is in a vertical screen state and the port information is not the first port, the preview direction is set to 0°.
[0145] In some embodiments, the display device is in landscape mode, the PortraitID value exists, the camera preview angle is set using uvcSetPreviewRotate(90), the LandscapeID value exists, the camera preview angle is set using uvcSetPreviewRotate(0); the display device is in portrait mode, the PortraitID value exists, the camera preview angle is set using uvcSetPreviewRotate(0), the LandscapeID value exists, the camera preview angle is set using uvcSetPreviewRotate(90).
[0146] The step of processing the image captured by the camera and controlling the display to display the processed image includes: rotating the image in the preview stream according to the preview direction, and controlling the display to display the rotated image. In some embodiments, the image can be flipped according to the preview direction by calling the function uvcSetPreviewRotate(int rotate).
[0147] The process of the display device displaying an image when the number of ports inserted with the camera is one, the specific process of turning on the camera, and the specific process of controlling the image displayed on the monitor have been described in detail in the process of the display device displaying an image when the number of ports is two, and will not be repeated here.
[0148] In the above embodiment, a method for capturing images with a camera and a display device are provided. The embodiment of the present application determines the camera to be turned on according to whether the screen is in a horizontal or vertical state, and ensures that the image captured by the camera is displayed normally on the display without flipping. The method includes: receiving an instruction to start a preset application, obtaining the port information of the display device and the screen status of the display, wherein the port information is used to indicate the port into which the camera is inserted, and the screen status is used to indicate whether the screen is placed horizontally or vertically; determining the number of ports into which the camera is inserted according to the port information; if the number of ports into which the camera is inserted is not less than two, turning on the camera on the corresponding port according to the screen status, and controlling the display of the image.
[0149] 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 it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
[0150] For the convenience of explanation, the above description has been made in conjunction with specific embodiments. However, the above exemplary discussion is not intended to be exhaustive or limit the embodiments to the specific forms disclosed above. Based on the above teachings, various modifications and variations can be obtained. The selection and description of the above embodiments are to better explain the principles and practical applications, so that those skilled in the art can better use the embodiments and various different variations of the embodiments suitable for specific use considerations.
Claims
1. A display device, characterized in that: include: A display, for displaying a user interface; A user interface for receiving an input signal; A controller connected to the display and the user interface, respectively, for executing: Receive an instruction to start a preset application, and obtain port information of a display device and a screen status of the display, wherein the port information is used to indicate a port into which a camera is inserted, and the screen status is used to indicate whether the screen is placed horizontally or vertically; Determine the number of ports into which the camera is inserted according to the port information; If the number of ports into which the cameras are inserted is not less than two, the cameras on the corresponding ports are turned on according to the screen status, and a preview stream is obtained through the cameras; Based on the image display mode, a display window is created; a preview image rendering environment is created, preview data is acquired, and a preview direction is determined; in the created preview image rendering environment, an image is rendered in the display window based on the acquired preview data and the preview direction; wherein the preview direction is a first angle; If the number of ports for inserting the camera is one, turn on the camera and obtain a preview stream through the camera; rotate the image in the preview stream according to the preview direction, and control the display to display the rotated image; wherein, if the screen state is a horizontal screen state, the preview direction is set to a first angle when the port information is a first port, and the preview direction is set to a second angle when the port information is not the first port; if the screen state is a vertical screen state, the preview direction is set to a second angle when the port information is a first port, and the preview direction is set to a first angle when the port information is not the first port; the first port is located at the upper end of the display when the display is in a horizontal screen state.
2. The display device according to claim 1, characterized in that The controller is further used to execute: if the number of ports into which the camera is inserted is one, then the camera is turned on, and according to the screen status and port information, an image captured by the camera is processed, and the processed image is displayed on the control display.
3. The display device according to claim 1, characterized in that There are two ports for inserting cameras, which are a first port and a second port; the controller is configured to execute the following steps to turn on the camera on the corresponding port according to the screen status: when the screen status is a horizontal status, turn on the camera inserted on the first port; when the screen status of the display device is a vertical status, turn on the camera inserted on the second port.
4. The display device according to claim 1, characterized in that The controller is configured to execute the following steps to start the camera on the corresponding port according to the screen status: Determine a first identifier of a camera to be turned on according to the screen state; According to the first identifier, mapping the corresponding camera path, obtaining a file corresponding to the camera path; Through the first system function, the file is opened and the corresponding handle is obtained; The attribute information supported by the camera corresponding to the handle is obtained through the second system function, wherein the attribute information includes the preview size supported by the camera.
5. The display device according to claim 4, characterized in that The controller is configured to obtain a preview stream through a camera according to the following steps: determining shooting parameters of the camera; and obtaining preview data corresponding to the shooting parameters.
6. The display device according to claim 5, characterized in that The controller is configured to determine the shooting parameters of the camera according to the following steps: Receive the set shooting parameters; Determine whether the set shooting parameters are the preview size supported by the camera; If the preview size is supported by the camera, the shooting parameters of the camera are determined to be the set shooting parameters.
7. A method for capturing images with a camera, characterized in that: include: Receive an instruction to start a preset application, and obtain port information of a display device and a screen status of the display, wherein the port information is used to indicate a port into which a camera is inserted, and the screen status is used to indicate whether the screen is placed horizontally or vertically; Determine the number of ports into which the camera is inserted according to the port information; If the number of ports into which the cameras are inserted is not less than two, the cameras on the corresponding ports are turned on according to the screen status, and a preview stream is obtained through the cameras; Based on the image display mode, a display window is created; a preview image rendering environment is created, preview data is acquired, and a preview direction is determined; in the created preview image rendering environment, an image is rendered in the display window based on the acquired preview data and the preview direction; wherein the preview direction is a first angle; If the number of ports for inserting the camera is one, the image in the preview stream is rotated according to the preview direction, and the display is controlled to display the rotated image; wherein, if the screen state is a horizontal screen state, the preview direction is set to a first angle when the port information is a first port, and the preview direction is set to a second angle when the port information is not the first port; if the screen state is a vertical screen state, the preview direction is set to a second angle when the port information is a first port, and the preview direction is set to a first angle when the port information is not the first port; the first port is located at the upper end of the display when the display is in a horizontal screen state.
8. The method according to claim 7, characterized in that The step of turning on the camera on the corresponding port according to the screen state includes: when the screen state is a horizontal state, turning on the camera inserted on the first port; when the screen state of the display device is a vertical state, turning on the camera inserted on the second port.
