Photographing method and device
By identifying the target camera in the terminal device, capturing and rendering the video stream, and adding interactive information, the problem of differentiated services limited by the system's camera function is solved, enabling personalized display and accurate analysis results, thus improving the user experience.
Patent Information
- Application Number
- CN202511158720.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-18
- Publication Date
- 2025-11-04
AI Technical Summary
In terminal devices lacking camera functionality, the system's camera function limits differentiated services, making it impossible to achieve personalized display of video streams and impacting user experience.
By identifying the target camera installed on the terminal, the video stream is captured and rendered into the camera frame. An interactive floating frame is added, and the target image is captured in response to the photo-taking command. The image is then sent to the analysis model for processing.
It enables the terminal device to take photos, provides differentiated services, improves user experience, and enhances the accuracy of analysis results.
Smart Images

Figure CN120897121A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of medical health and artificial intelligence, and in particular to a photographing method and device. BACKGROUND
[0002] At present, in some entertainment and medical health scenarios, many terminal applications need to first take pictures and then analyze and process the taken pictures, for example, taking skin measurement or hair density measurement through a mobile phone. In the related art, unlike native applications with camera functions, some terminal applications lacking camera functions usually directly open the system camera function provided by the terminal system through H5 (HTML5) to take pictures. The system camera function limits the terminal applications to provide differentiated services and cannot realize personalized display of video streams, such as being unable to add a picture of a photographed part or a user guide prompt in the displayed video stream, which affects the user experience. SUMMARY
[0003] Therefore, the embodiments of the present application provide a photographing method and device, which can provide differentiated services for terminal applications and realize personalized display of video streams while providing a photographing function, thereby improving the user experience.
[0004] In a first aspect, the embodiments of the present application provide a monitoring method, comprising:
[0005] determining a target camera installed on a terminal;
[0006] collecting a video stream by using the target camera and rendering the collected video stream to a camera frame to display the collected video stream on a screen of the terminal;
[0007] loading the video stream rendered in the camera frame to a canvas;
[0008] in response to receiving a photographing instruction, intercepting a target picture from the video stream loaded from the canvas.
[0009] Optionally, rendering the collected video stream to the camera frame comprises:
[0010] determining interaction information corresponding to a current scene;
[0011] adding a floating box containing the interaction information to the camera frame;
[0012] rendering the collected video stream to the camera frame after the processing;
[0013] In response to receiving the photographing instruction, after intercepting the target picture from the video stream loaded from the canvas, the method further comprises:
[0014] The target picture is sent to the server, so that the server inputs the target picture into an analysis model corresponding to the current scene, and determines an analysis result corresponding to the target picture according to an output result of the analysis model.
[0015] Optionally, the interaction information corresponding to the current scene is determined, including:
[0016] The photographing part picture and the guide prompt information corresponding to the current scene are determined.
[0017] The floating box containing the interaction information is added to the camera frame, including:
[0018] The floating box containing the photographing part picture is generated, and the floating box containing the photographing part picture is added to the camera frame.
[0019] The floating box containing the guide prompt information is generated, and the floating box containing the guide prompt information is added to the camera frame.
[0020] Optionally, after the video stream rendered in the camera frame is loaded onto the canvas, the method further includes:
[0021] The guide strategy information corresponding to the current scene is determined.
[0022] At least one picture to be analyzed is intercepted from the video stream loaded from the canvas.
[0023] In response to the at least one picture to be analyzed meeting verification information in the guide strategy information, the guide prompt information in the interaction strategy is determined, and the guide prompt information is displayed in the camera frame.
[0024] Optionally, the target camera installed in the terminal is determined, including:
[0025] The photographing information corresponding to the current scene is determined.
[0026] At least one camera installed in the terminal is determined.
[0027] According to the photographing information, the target camera is determined from the at least one camera.
[0028] Optionally, after the target camera installed in the terminal is determined, the method further includes:
[0029] A camera switching instruction is received, and at least one camera installed in the terminal is displayed.
[0030] A camera selection instruction is received, and a switching camera corresponding to the camera selection instruction is determined from the at least one camera.
[0031] In response to the switching camera being different from the target camera, the target camera is controlled to stop collecting the video stream; the switching camera is used to collect the video stream, and the video stream collected by the switching camera is rendered into the camera frame.
[0032] Optionally, before loading the video stream rendered in the camera frame onto the canvas, further comprising:
[0033] determining a camera frame size of the camera frame;
[0034] creating the canvas with the camera frame size as the canvas size.
[0035] In a second aspect, an embodiment of the present application provides a photographing apparatus, comprising:
[0036] a camera determining module configured to determine a target camera installed on the terminal;
[0037] a camera frame rendering module configured to collect a video stream by using the target camera, and render the collected video stream into a camera frame, so as to display the collected video stream on a screen of the terminal;
[0038] a canvas loading module configured to load the video stream rendered in the camera frame onto a canvas;
[0039] a picture intercepting module configured to intercept a target picture from the video stream loaded from the canvas in response to receiving a photographing instruction.
[0040] In a third aspect, an embodiment of the present application provides an electronic device, comprising:
[0041] one or more processors;
[0042] a storage device configured to store one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors implement the method of any of the above embodiments.
[0043] In a fourth aspect, an embodiment of the present application provides a computer readable medium, which stores a computer program, when the program is executed by a processor, the method of any of the above embodiments is implemented.
[0044] In a fifth aspect, an embodiment of the present application provides a computer program product, comprising a computer program, when the computer program is executed by a processor, the method of any of the above embodiments is implemented.
[0045] An embodiment of the above application has the following advantages or beneficial effects: the video stream collected by the target camera is rendered into the camera frame, so as to display the collected video stream on the screen of the terminal. Then the video stream rendered in the camera frame is loaded onto the canvas. When the photographing instruction is received, the target picture is intercepted from the video stream loaded from the canvas. Therefore, the scheme of the embodiment of the present application can realize the photographing function.
[0046] In addition, the personalized display of the video stream rendered in the camera frame can be realized by adding a custom attribute on the camera frame, such as adding a photographing part picture or a user guide prompt in the video stream, so as to flexibly provide differentiated services for the terminal and improve the user experience.
[0047] Further effects of the above-described non-conventional optional mode will be described in the following in conjunction with the specific embodiments. BRIEF DESCRIPTION OF DRAWINGS
[0048] The accompanying drawings are used to better understand the present application and do not constitute undue limitations on the present application. Among them:
[0049] Figure 1 is a flowchart of a photographing method provided by an embodiment of the present application;
[0050] Figure 2 is a flowchart of a photographing method provided by another embodiment of the present application;
[0051] Figure 3 is an effect diagram of a camera frame provided by an embodiment of the present application;
[0052] Figure 4 is a flowchart of a photographing method provided by another embodiment of the present application;
[0053] Figure 5 is a structural diagram of a photographing device provided by an embodiment of the present application;
[0054] Figure 6 is a structural diagram of a computer system of a terminal device or a server suitable for implementing the embodiments of the present application. DETAILED DESCRIPTION
[0055] The exemplary embodiments of the present application are described below in conjunction with the accompanying drawings, which include various details of the embodiments of the present application to help understanding, and should be considered as merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present application. Also, for the sake of clarity and conciseness, the description below omits the description of well-known functions and structures.
[0056] It should be noted that the acquisition, storage, use, processing, etc. of data in the technical solutions of the embodiments of the present application comply with the relevant provisions of national laws and regulations.
[0057] Figure 1 is a flowchart of a photographing method provided by an embodiment of the present application. As shown in Figure 1 the method comprises:
[0058] Step 101: determining a target camera installed in the terminal.
[0059] The scheme of the embodiment of the present application is applied to a terminal. In the case that the terminal is installed with only one camera, the camera is determined as the target camera.
[0060] In the case that the terminal is installed with multiple cameras, any camera in an idle state can be selected as the target camera. The target camera can also be manually selected by the user. The shooting information corresponding to the current scene can also be determined, and the target camera is determined from the at least one camera according to the shooting information. The shooting information is the shooting related information required by the current scene. The shooting information can include the shooting direction, resolution and lens focal length of the camera, etc. The shooting direction of the camera can include the front direction and the rear direction.
[0061] If the shooting direction of the camera in the shooting information is the front direction, the target camera is the front camera. If the shooting direction of the camera in the shooting information is the rear direction, the target camera is the rear camera. The resolution of the target camera is not less than the resolution in the shooting information. The lens focal length of the target camera meets the requirement of the lens focal length in the shooting information.
[0062] In one embodiment of the present application, at least one camera installed in the terminal is determined, and a camera list is displayed in the terminal interface, the camera list being used to display each camera installed in the terminal. A camera selection instruction issued by the user for the camera list is received, and the camera corresponding to the camera selection instruction is determined as the target camera. The user can flexibly select the target camera according to the use habit and application needs.
[0063] After the camera corresponding to the selection instruction is determined as the target camera, the user can also issue a camera switching instruction. In response to receiving the camera switching instruction, the terminal displays the camera list. The user reselects the target camera from the camera list through the camera selection instruction. The user can switch different cameras for shooting through the camera switching instruction, further improving the user experience.
[0064] Step 102: collecting a video stream by using the target camera, and rendering the collected video stream to a camera frame to display the collected video stream on the screen of the terminal.
[0065] The camera frame receives the collected video stream, and the processor of the terminal renders the video stream to the camera frame. The rendered camera frame is displayed on the screen of the terminal, so that the collected video stream is displayed on the screen of the terminal.
[0066] A camera frame can be created by selecting different components or tags according to terminal types and host environments. For example, in a browser page, a camera frame can be created by a video tag. The video tag is a tag in accordance with the HTML5 standard. The video tag is used to directly embed video content in a webpage. In an applet, a camera frame can be created by a camera component. The camera component is a core component for accessing a device camera in the applet. The camera component enables developers to implement multiple functions such as photographing, video recording, and code scanning in the applet.
[0067] The creation of a camera frame by a video tag in a browser page is taken as an example for illustration. A full-screen camera frame is created by the video tag. A list of cameras installed in a terminal is obtained to determine a target camera. It is determined whether the target application has the permission to use the camera. If not, the target application is authorized to have the permission to use the camera, or the user is reminded to authorize the target application to have the permission to use the camera.
[0068] A video stream is collected by using the target camera, and the collected video stream is rendered into the camera frame. The collected video stream is played on the terminal screen by the play attribute of the camera frame. Before playing the collected video stream, the inline attribute of the video can be set to force the video to be played in line without switching to full-screen play. The autoplay attribute of the video can also be set to realize the automatic play of the video.
[0069] Step 103: loading the video stream rendered in the camera frame into a canvas.
[0070] The video stream is rendered in the camera frame. The video stream in the camera frame is drawn in the canvas. The camera frame is used to display the video stream on the screen and add custom elements. The custom elements can include a photographing part picture and guide prompt information. The canvas is used to intercept a video frame in the video stream displayed in the canvas to generate a photo.
[0071] In order to completely load the video stream rendered in the camera frame into the canvas, the size of the canvas is not less than the size of the camera frame. In an embodiment of the present application, before loading the video stream rendered in the camera frame into the canvas, the camera frame size of the camera frame is determined, and the camera frame size is used as the canvas size to create the canvas.
[0072] The camera frame size is used as the canvas size to create the canvas. Specifically, the camera frame and the canvas are both rectangles. The length of the camera frame is used as the length of the canvas. The width of the camera frame is used as the width of the canvas. The canvas with the same size as the camera frame is created to completely load the video stream rendered in the camera frame into the canvas.
[0073] Step 104: in response to receiving a photographing instruction, a target picture is intercepted from the video stream loaded in the canvas.
[0074] The target picture is a picture generated in response to the photographing instruction. A preset path can be set, and the target picture is saved to the preset path after being intercepted.
[0075] In the scheme of the embodiment of the present application, the video stream collected by the target camera is rendered into the camera frame to display the collected video stream on the screen of the terminal. The video stream rendered in the camera frame is loaded onto the canvas. When the photographing instruction is received, the target picture is intercepted from the video stream loaded from the canvas. Therefore, the scheme of the embodiment of the present application can realize the function of taking pictures.
[0076] In addition, the personalized display of the video stream rendered in the camera frame can also be realized by adding custom attributes to the camera frame, such as adding a photographing part picture or user guide prompts in the video stream, to flexibly provide differentiated services and improve the user experience.
[0077] It should be noted that the scheme of the embodiment of the present application can be applied in different host environments. The host environment can include an app, a program, a browser, etc. Different components and instructions can be used in each host environment to create a camera frame, render a camera frame, define a canvas, switch a camera, etc. However, in each host environment, the video stream can be rendered in the camera frame, the video stream in the camera frame can be drawn in the canvas, and the video frame in the video stream displayed in the canvas can be intercepted to generate a photo, thereby flexibly realizing the photographing function.
[0078] Figure 2 is a schematic diagram of the flow of a photographing method provided by another embodiment of the present application. As shown in Figure 2 , the method comprises:
[0079] Step 201: determining a target camera installed in a terminal.
[0080] Step 202: collecting a video stream by using the target camera.
[0081] Step 203: determining interactive information corresponding to a current scene; and adding a floating box containing the interactive information to a camera frame.
[0082] The photographing method provided by the embodiment of the present application is applied in a target application to provide a photographing function for a user using the target application. The target application can provide a plurality of application scenarios. The current scene is one of the plurality of application scenarios provided by the target application.
[0083] For example, if the target application is a health detection application. The target application assesses the health condition of the user by taking pictures of various body parts of the user. The application scenarios can correspond to different body parts respectively. The body parts can include tongue fur, skin, hair, hands, face, etc.
[0084] In the scheme of the embodiment of the application, the interaction information corresponding to the current scene is determined, including: determining the photographing part diagram and the guide prompt information corresponding to the current scene; adding the floating box containing the interaction information to the camera frame, including: generating the floating box containing the photographing part diagram, and adding the floating box containing the photographing part diagram to the camera frame; generating the floating box containing the guide prompt information, and adding the floating box containing the guide prompt information to the camera frame.
[0085] The interaction information is the interaction prompt information displayed in the camera frame. The interaction information can include: the photographing part diagram, the guide prompt information, etc. The photographing part diagram is drawn with photographing guide lines corresponding to the body part. For example, the photographing part diagram of the hands is drawn with photographing guide lines corresponding to the hands. The photographing part diagram of the face is drawn with photographing guide lines corresponding to the face. The photographing part diagram facilitates the user to take pictures of suitable body parts. The guide prompt information can be set according to business needs, such as “Please keep still”, “Please move the camera close to the head”, “No body part detected”, etc. For each interaction information, a floating box corresponding to the interaction information is generated, and the interaction information is set in the floating box. Each floating box added with the interaction information is added to the camera frame to display each interaction information in the camera frame. The interaction information displayed in the camera frame can help the user to take suitable pictures, improving the user experience.
[0086] Figure 3 is an effect schematic diagram of a camera frame provided by an embodiment of the application. As shown in Figure 3 The application scenario is used to take pictures of the hair of the user. The photographing part diagram of the hair is added to the camera frame. The photographing part diagram of the hair is drawn with photographing guide lines corresponding to the hair. Figure 3 The “Take the top of the head, please lower your head by 45°”, “Please aim at the photographing guide line for shooting” displayed in the camera frame are guide prompt information. Adding the floating box containing the photographing part diagram of the hair and the guide prompt information to the camera frame can help the user to quickly take target pictures meeting the requirements.
[0087] Step 204: render the collected video stream to the camera frame after the addition processing, to display the collected video stream on the screen of the terminal.
[0088] Step 205: load the video stream rendered in the camera frame to the canvas.
[0089] Step 206: in response to receiving the photographing instruction, a target picture is intercepted from the video stream loaded from the canvas.
[0090] Step 207: the target picture is sent to the server, so that the server inputs the target picture into an analysis model corresponding to the current scene, and determines an analysis result corresponding to the target picture according to an output result of the analysis model.
[0091] Different application scenarios correspond to different interaction information and analysis models. The analysis model is used to obtain an analysis result in a target application scenario based on a target picture. For example, if the target application is a health detection application, the target application sets multiple application scenarios. The application scenarios correspond to body parts to be detected one by one. Different analysis models are set for each application scenario. Specifically, an analysis model corresponding to tongue fur is used to obtain a health analysis result of a user based on a tongue fur picture. An analysis model corresponding to a hand is used to obtain a health analysis result of a user based on a hand picture.
[0092] In the scheme of the embodiment of the application, interaction information and an analysis model corresponding to the current scene are determined. A floating box containing the interaction information is added to the camera frame, so that the user can take a target picture meeting the requirements. Then, the analysis result of the target picture is obtained through the analysis model. The scheme of the embodiment of the application improves the user experience and further improves the accuracy of the analysis result.
[0093] In an embodiment of the application, after the video stream rendered in the camera frame is loaded onto the canvas, the method further includes: determining guidance strategy information corresponding to the current scene; intercepting at least one picture to be analyzed from the video stream loaded from the canvas; and in response to the at least one picture to be analyzed meeting verification information in the guidance strategy information, determining guidance prompt information in the interaction strategy, and displaying the guidance prompt information in the camera frame.
[0094] According to business requirements, at least one guidance strategy information is set. The guidance strategy information includes verification information and guidance prompt information. The at least one picture to be analyzed is analyzed and processed. If the analysis and processing result meets the verification information, it is determined that the at least one picture to be analyzed meets the verification information, and the guidance prompt information is displayed in the camera frame to guide the user to adjust the angle and distance of the camera, etc., to take a target picture meeting the application requirements.
[0095] For example, the analysis and processing result can include: the size of the picture to be analyzed, the pixels of the picture to be analyzed, whether the analysis target is detected in the picture to be analyzed, etc. The guidance prompt information can include: "the size of the picture to be analyzed is too small", "the pixels of the picture to be analyzed are too small", "the tongue fur part is not detected in the picture to be analyzed", "the face is not detected in the picture to be analyzed", etc.
[0096] The photographing position, the guidance prompt information, the photographing direction of the camera, the analysis model, the interaction effect and the guidance strategy information of each application scenario can be different. A corresponding configuration template can be set for each application scenario. The configuration template includes the body part corresponding to the application scenario, the guidance prompt information, the photographing direction of the camera, the analysis model, the interaction effect and the guidance strategy information. Through the configuration template corresponding to the application scenario, the body part corresponding to the application scenario, the interaction prompt script and the photographing direction of the camera can be determined. For example, if the application scenario corresponds to hair, through the configuration template corresponding to the application scenario, it is determined that the photographing direction of the camera in the application scenario is forward. If the application scenario corresponds to height, through the configuration template corresponding to the application scenario, it is determined that the direction of the camera in the application scenario is backward.
[0097] After the target picture is generated, the server can also call different analysis models or interfaces to analyze the target picture and obtain an analysis result.
[0098] The scheme of the embodiment of the application flexibly realizes the photographing analysis capability in different application scenarios and host environments by customizing the camera function and setting the configuration template for each application scenario, can enrich the single and dull photographing scenario, and improves the use experience of the user for the application.
[0099] Figure 4 is a schematic diagram of the flow of a photographing method provided by another embodiment of the application. As shown in Figure 4 , the method comprises:
[0100] Step 401: determining at least one camera installed in a terminal; and determining a target camera from the at least one camera.
[0101] Step 402: collecting a video stream by using the target camera, and rendering the collected video stream to a camera frame to display the collected video stream on the screen of the terminal.
[0102] Step 403: receiving a camera switching instruction, and displaying the at least one camera.
[0103] Step 404: receiving a camera selection instruction, and determining a switching camera corresponding to the camera selection instruction from the at least one camera.
[0104] Step 405: in response to the switching camera being different from the target camera, controlling the target camera to stop collecting the video stream.
[0105] Step 406: collecting a video stream by using the switching camera, and rendering the video stream collected by the switching camera to the camera frame.
[0106] Step 407: loading the video stream rendered in the camera frame to a canvas.
[0107] Step 408: in response to receiving the photographing instruction, the target picture is intercepted from the video stream loaded from the canvas.
[0108] In the scheme of the embodiment of the application, the user can switch different cameras through the camera switching instruction. The system uses the switched camera to collect and display the video stream, and intercepts the target picture in response to the photographing instruction issued by the user.
[0109] Figure 5 is a structural schematic diagram of a photographing device provided by an embodiment of the application. As shown in the figure, the device comprises: Figure 5
[0110] A camera determination module 501 is configured to determine a target camera installed on the terminal.
[0111] A camera frame rendering module 502 is configured to collect a video stream by using the target camera, and render the collected video stream to a camera frame, so as to display the collected video stream on the screen of the terminal.
[0112] A canvas loading module 503 is configured to load the video stream rendered in the camera frame to a canvas.
[0113] A picture intercepting module 504 is configured to intercept a target picture from the video stream loaded from the canvas in response to receiving a photographing instruction.
[0114] Optionally, the camera frame rendering module 502 is specifically configured to:
[0115] determine the interaction information and the analysis model corresponding to the current scene;
[0116] add a floating box containing the interaction information to the camera frame;
[0117] render the collected video stream to the camera frame after the processing;
[0118] Optionally, the camera frame rendering module 502 is specifically configured to:
[0119] determine the photographing part picture and the guide prompt information corresponding to the current scene;
[0120] add a floating box containing the interaction information to the camera frame, comprising:
[0121] generating a floating box containing the photographing part picture, and adding the floating box containing the photographing part picture to the camera frame;
[0122] generating a floating box containing the guide prompt information, and adding the floating box containing the guide prompt information to the camera frame.
[0123] Further comprising:
[0124] The sending module is configured to send the target picture to a server, so that the server inputs the target picture into an analysis model corresponding to the current scene, and determines an analysis result corresponding to the target picture according to an output result of the analysis model.
[0125] Optionally, the method further comprises:
[0126] The guiding module is configured to determine guiding strategy information corresponding to the current scene.
[0127] The at least one picture to be analyzed is cut from the video stream loaded from the canvas.
[0128] In response to the at least one picture to be analyzed meeting verification information in the guiding strategy information, the method further comprises:
[0129] Optionally, the camera determining module 501 is specifically configured to:
[0130] The method further comprises:
[0131] The method further comprises:
[0132] According to the shooting information, the target camera is determined from the at least one camera.
[0133] Optionally, the method further comprises:
[0134] The switching module is configured to receive a camera switching instruction, and display the at least one camera installed on the terminal.
[0135] The method further comprises:
[0136] In response to the switched camera being different from the target camera, the method further comprises:
[0137] Optionally, the canvas loading module 503 is further configured to:
[0138] The method further comprises:
[0139] The method further comprises:
[0140] The electronic device provided by the embodiment of the present application comprises:
[0141] one or more processors;
[0142] The storage device is configured to store one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors implement the method of any of the above embodiments.
[0143] An embodiment of the present application provides a computer program product comprising a computer program which, when executed by a processor, implements the method of any of the above embodiments.
[0144] Reference is made below Figure 6 which shows a structural diagram of a computer system 600 suitable for implementing a terminal device of an embodiment of the present application. Figure 6 The terminal device shown is merely an example and should not impose any limitation on the functions and use range of the embodiments of the present application.
[0145] As shown in Figure 6 , the computer system 600 comprises a central processing unit (CPU) 601 which can perform various appropriate actions and processes according to programs stored in a read-only memory (ROM) 602 or programs loaded from a storage portion 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the system 600 are also stored. The CPU 601, the ROM 602, and the RAM 603 are connected to each other through a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0146] The following components are connected to the I / O interface 605: an input portion 606 comprising a keyboard, a mouse, and the like; an output portion 607 comprising a cathode ray tube (CRT), a liquid crystal display (LCD), and the like, and a speaker, and the like; a storage portion 608 comprising a hard disk, and the like; and a communication portion 609 comprising a network interface card such as a LAN card, a modem, and the like. The communication portion 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as necessary. A removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, and the like is mounted on the drive 610 as necessary, so that a computer program read therefrom is installed in the storage portion 608 as necessary.
[0147] In particular, the processes described above with reference to the flowcharts can be implemented as a computer software program according to the embodiments disclosed herein. For example, the embodiments disclosed herein include a computer program product comprising a computer program carried on a computer readable medium, the computer program containing program code for executing the method shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network by the communication portion 609 and / or installed from the removable medium 611. When the computer program is executed by the central processing unit (CPU) 601, the above-described functions defined in the system of the present application are executed.
[0148] It should be noted that the computer-readable medium shown in the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may, for example, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or component, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, the computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device or component. In the present application, the computer-readable signal medium can include a data signal carried in a baseband or as a part of a carrier wave, which carries computer-readable program code. Such a propagated data signal can take various forms, including but not limited to an electromagnetic signal, an optical signal or any suitable combination of the above. The computer-readable signal medium can also be any computer-readable medium other than the computer-readable storage medium, which can send, propagate or transmit a program for use by or in conjunction with an instruction execution system, device or component. The program code contained on the computer-readable medium can be transmitted by any suitable medium, including but not limited to wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0149] The flow diagrams and block diagrams in the drawings are schematic illustrations of possible architectures, functions and operations of systems, methods and computer program products in accordance with various embodiments of the present application. In this regard, each block in the flow diagrams or block diagrams can represent a module, a segment, or a portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that in some alternative implementations, the functions noted in the blocks can occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently or the blocks may be executed in the reverse order, depending on the functionality involved. It will also be noted that each block of the block diagrams or flow diagrams, and combinations of blocks in the block diagrams or flow diagrams, can be implemented by special purpose hardware-based systems that perform the specified functions or operations, or combinations of special purpose hardware and computer instructions.
[0150] The modules described in the embodiments of the present application can be implemented in the form of software or hardware. The modules described can be arranged in a processor, for example, can be described as a camera determining module, a camera frame rendering module, a canvas loading module and a picture intercepting module. In some cases, the names of these modules do not constitute a limitation on the modules themselves, for example, the camera determining module can also be described as a module for determining a target camera installed on a terminal.
[0151] As another aspect, the present application also provides a computer readable medium, which can be included in the device described in the above embodiments, or can exist independently without being assembled into the device. The computer readable medium carries one or more programs, which, when executed by the device, cause the device to include:
[0152] determining a target camera installed on a terminal;
[0153] collecting a video stream by using the target camera and rendering the collected video stream into a camera frame to display the collected video stream on a screen of the terminal;
[0154] loading the video stream rendered in the camera frame onto a canvas;
[0155] intercepting a target picture from the video stream loaded from the canvas in response to receiving a photographing instruction.
[0156] According to the technical solution of the embodiments of the present application, the video stream collected by the target camera is rendered into a camera frame to display the collected video stream on a screen of the terminal. Then the video stream rendered in the camera frame is loaded onto a canvas. When a photographing instruction is received, a target picture is intercepted from the video stream loaded from the canvas. Therefore, the scheme of the embodiments of the present application can realize the function of photographing pictures.
[0157] In addition, the personalized display of the video stream rendered in the camera frame can be realized by adding custom attributes on the camera frame, such as adding a photographing part picture or user guide prompt in the video stream, flexibly providing differentiated services and improving the user experience.
[0158] The above detailed description does not constitute a limitation on the protection scope of the present application. Those skilled in the art should understand that various modifications, combinations, sub-combinations and substitutions can be made depending on design requirements and other factors. Any modification, equivalent replacement and improvement made within the spirit and principles of the present application should be included in the protection scope of the present application.
Claims
1. A method for taking photos, characterized in that, include: Identify the target camera installed on the terminal; The target camera is used to capture a video stream, and the captured video stream is rendered onto the camera frame to display the captured video stream on the screen of the terminal. Load the video stream rendered in the camera frame onto the canvas; In response to receiving a photo capture command, the target image is extracted from the video stream loaded on the canvas.
2. The method according to claim 1, characterized in that, Render the captured video stream onto the camera frame, including: Determine the interaction information corresponding to the current scene; Add a floating box containing the interactive information to the camera frame; Render the captured video stream onto the processed camera frame; After receiving a photo-taking command and extracting the target image from the video stream loaded on the canvas, the method further includes: The target image is sent to the server, so that the server inputs the target image into the analysis model corresponding to the current scene, and determines the analysis result corresponding to the target image based on the output of the analysis model.
3. The method according to claim 2, characterized in that, Determining the interaction information corresponding to the current scene includes: Determine the corresponding photo-taking area and guidance prompts for the current scene; Adding the floating box containing the interactive information to the camera frame includes: Generate a floating frame containing the image of the photographed part, and add the floating frame containing the image of the photographed part to the camera frame; Generate a floating box containing the guidance prompt information, and add the floating box containing the guidance prompt information to the camera frame.
4. The method according to claim 1, characterized in that, After loading the video stream rendered in the camera frame onto the canvas, the process further includes: Determine the guidance strategy information corresponding to the current scenario; Extract at least one image to be analyzed from the video stream loaded on the canvas; In response to the at least one image to be analyzed matching the verification information in the guidance strategy information, the guidance prompt information in the interaction strategy is determined, and the guidance prompt information is displayed in the camera frame.
5. The method according to claim 1, characterized in that, The determination of the target camera installed on the terminal includes: Determine the shooting information corresponding to the current scene; Identify at least one camera installed on the terminal; Based on the captured information, the target camera is determined from the at least one camera.
6. The method according to claim 1, characterized in that, After determining the target camera installed on the terminal, the process also includes: Receive a camera switching command and display at least one camera installed on the terminal; Receive a camera selection instruction and determine the switching camera corresponding to the camera selection instruction from the at least one camera; In response to the switching camera being different from the target camera, the target camera is controlled to stop acquiring video streams; the switching camera is used to acquire video streams, and the video streams acquired by the switching camera are rendered onto the camera frame.
7. The method according to claim 1, characterized in that, Before loading the video stream rendered in the camera frame onto the canvas, the process further includes: Determine the camera frame size; The canvas is created using the camera frame size as the canvas size.
8. A photographing device, characterized in that, include: The camera identification module is used to identify the target camera installed on the terminal. The camera frame rendering module uses the target camera to capture video streams and renders the captured video streams onto the camera frame to display the captured video streams on the terminal screen. The canvas loading module is used to load the video stream rendered in the camera frame onto the canvas; The image capture module is used to capture a target image from the video stream loaded on the canvas in response to receiving a photo capture command.
9. An electronic device, characterized in that, include: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1-7.
10. A computer-readable medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-7.
11. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1-7.
Citation Information
Patent Citations
Automatic shooting control method, terminal and computer storage medium
CN108063859A
Photographing method and mobile terminal
CN112351185A
Face completion method, device and system for video face-to-face signing and storage medium
CN115375572A
Dental information acquisition method and system
CN117857912A