An image acquisition method and apparatus
By displaying a reference baseline on the shooting interface and matching the boundary contour with a preset material library to determine the target layout framework, the problem of insufficient user experience in existing technologies is solved, the shooting effect is optimized, and the technical gap between photography novices and shooting experts is narrowed.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING JINGDONG YUANSHENG TECH CO LTD
- Filing Date
- 2024-11-22
- Publication Date
- 2026-05-22
AI Technical Summary
Existing technologies have failed to effectively improve user experience when optimizing shooting effects, resulting in a significant skill gap between photography novices and experienced photographers.
By displaying a reference baseline in the layout frame on the shooting interface, the system assists users in selecting a better shooting angle and distance. It uses the boundary contour to match the preset material library to determine the target layout frame and provides a reference baseline to adjust the camera to acquire images.
Optimize the user shooting process, improve the quality of original and final images, narrow the technical gap between photography novices and experienced photographers, and enhance the user experience.
Smart Images

Figure CN122073643A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of camera technology, and more particularly to an image acquisition method and apparatus. Background Technology
[0002] With the development of electronic devices such as mobile phones and tablets, photography has become an important function for users. To optimize shooting results, camera lens design can be adopted, such as designing ultra-wide-angle and macro lenses, or image processing algorithms such as portrait beautification technology can be used. Camera hardware and software can be combined, such as designing camera startup speed and focusing speed, or image feature detection methods can be implemented during shooting.
[0003] However, the above methods only optimize the original image and cannot improve the final product, thus reducing the user experience. Summary of the Invention
[0004] In view of this, embodiments of the present invention provide an image acquisition method and apparatus that can assist users in selecting a better shooting angle and distance by displaying a reference baseline in the layout frame of the shooting interface, thereby facilitating user framing and improving the final image quality and user experience.
[0005] To achieve the above objectives, according to one aspect of the present invention, an image acquisition method is provided, comprising:
[0006] In response to the detection that the camera's viewfinder is in a framing state, the target image in the viewfinder at the current moment is acquired;
[0007] Extract the boundary contour from the target image;
[0008] The boundary contour is matched with a preset material library to determine a target layout frame from various layout frames in the preset material library; the target layout frame includes one or more reference baselines;
[0009] The reference baseline is displayed on the shooting interface corresponding to the viewfinder, so that the user can adjust the camera to obtain the corresponding image based on the reference baseline.
[0010] Optionally, extracting the boundary contour from the target image includes:
[0011] Enhance the color contrast of the target image;
[0012] The target image with enhanced color contrast is blurred, and the boundary contour is extracted from the blurred target image.
[0013] Optionally, the target image after color contrast enhancement is blurred, and the boundary contour is extracted from the blurred target image, including:
[0014] Obtain the first pixel value of each pixel in the contrast-adjusted target image and the second pixel value of each pixel's corresponding neighboring pixels;
[0015] For each pixel, if the difference between the first pixel value and the second pixel value is less than a preset threshold, the first pixel value is updated to the second pixel value, or the second pixel value is updated to the first pixel value, thereby obtaining the blurred target image;
[0016] Each target pixel is extracted from the blurred target image to obtain the boundary contour composed of the target pixels, and the pixel values of the target pixels are all the same.
[0017] Optionally, the boundary contour is matched with a preset material library to determine the target layout frame from various layout frames in the preset material library, including:
[0018] For each layout frame in the preset material library, calculate the overlap degree between the boundary contour and each layout frame, and use the overlap degree as the comparison result between the boundary contour and each layout frame;
[0019] The target layout frame is selected from the various layout frames based on the degree of overlap.
[0020] Optionally, calculating the overlap between the boundary contour and each layout frame includes:
[0021] Adjust the boundary contour to the same size as each layout frame;
[0022] Calculate the number of pixels that overlap between the boundary contour and each layout frame;
[0023] The number of overlapping pixels is used as the degree of overlap between the boundary contour and each layout frame.
[0024] Optionally, selecting a target layout frame from the various layout frames based on the overlap degree includes:
[0025] Multiple candidate layout frames are selected based on their degree of overlap, from largest to smallest.
[0026] The multiple candidate layout frames are displayed at the top of the viewfinder;
[0027] In response to receiving a selection instruction for any candidate layout frame, the candidate layout frame is selected as the target layout frame.
[0028] Optionally, before matching the boundary contour with a preset material library, the method further includes:
[0029] Acquire multiple images;
[0030] Each image is subjected to color contrast adjustment and blurring to obtain the layout framework corresponding to each image;
[0031] The layout framework corresponding to each image is stored in the preset material library, and the preset material library is saved to local memory so as to retrieve the preset material library from local memory.
[0032] According to another aspect of the present invention, an image acquisition apparatus is provided, comprising:
[0033] The acquisition module, in response to detecting that the camera's viewfinder is in a framing state, acquires the target image in the viewfinder at the current moment;
[0034] The extraction module extracts the boundary contours from the target image;
[0035] The matching module matches the boundary contour with a preset material library to determine a target layout frame from various layout frames in the preset material library; the target layout frame includes one or more reference baselines.
[0036] The display module displays the reference baseline on the shooting interface corresponding to the viewfinder, so that the user can adjust the camera to obtain the corresponding image based on the reference baseline.
[0037] According to another aspect of the present invention, an electronic device is provided, comprising:
[0038] One or more processors;
[0039] Storage device for storing one or more programs.
[0040] When the one or more programs are executed by the one or more processors, the one or more processors implement the image acquisition method provided by the present invention.
[0041] According to another aspect of the present invention, a computer-readable medium is provided having a computer program stored thereon, which, when executed by a processor, implements the image acquisition method provided by the present invention.
[0042] One embodiment of the above invention has the following advantages or beneficial effects: The image acquisition method of this invention acquires the target image in the viewfinder at the current moment when the camera's viewfinder is detected to be in a framing state; then, it extracts the boundary contour from the target image; matches the boundary contour with a preset material library, determines the target layout frame based on the matching result, and displays the reference baseline in the target layout frame in the viewfinder, allowing the user to adjust the camera to acquire the corresponding image based on the reference baseline. This method obtains a reference baseline by extracting the boundary contour from the target image and matching it with the layout frame in the preset material library. The reference baseline is then used to determine the shooting angle and distance, thereby optimizing the user's shooting process, improving the quality of the original image, narrowing the technical gap between photography novices and experienced photographers, and enhancing the user experience.
[0043] The further effects of the aforementioned unconventional alternative methods will be explained below in conjunction with specific implementation methods. Attached Figure Description
[0044] The accompanying drawings are provided to better understand the invention and are not intended to unduly limit the scope of the invention. Wherein:
[0045] Figure 1 This is a schematic diagram of the main flow of an image acquisition method according to an embodiment of the present invention;
[0046] Figure 2 This is a schematic diagram of the main flow of another image acquisition method according to an embodiment of the present invention;
[0047] Figure 3 This is a schematic diagram of an image layout frame according to an embodiment of the present invention;
[0048] Figure 4 This is a flowchart illustrating an image acquisition method according to an embodiment of the present invention;
[0049] Figure 5 This is a schematic diagram of the main modules of an image acquisition device according to an embodiment of the present invention;
[0050] Figure 6 This is an exemplary system architecture diagram in which embodiments of the present invention can be applied;
[0051] Figure 7 This is a schematic diagram of the structure of a computer system suitable for implementing terminal devices or servers of the present invention. Detailed Implementation
[0052] The following description, in conjunction with the accompanying drawings, illustrates exemplary embodiments of the present invention, including various details to aid understanding. These details should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the invention. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0053] Figure 1 This is a schematic diagram of the main flow of an image acquisition method according to an embodiment of the present invention, as shown below. Figure 1 As shown, the method includes the following steps:
[0054] Step S101: In response to detecting that the camera's viewfinder is in a framing state, acquire the target image in the viewfinder at the current moment;
[0055] Step S102: Extract the boundary contour from the target image;
[0056] Step S103: Match the boundary contour with the preset material library to determine the target layout frame from each layout frame in the preset material library; the target layout frame includes one or more reference baselines;
[0057] Step S104: Display the reference baseline on the shooting interface corresponding to the viewfinder so that the user can adjust the camera to obtain the corresponding image based on the reference baseline.
[0058] In this embodiment of the invention, the image acquisition method can be applied to taking photos or videos. The camera's viewfinder is activated after the user opens the camera application on the electronic device or turns on the camera. When the viewfinder is detected to be in the activated state or after being triggered, the viewfinder enters the framing state and acquires the target image within the viewfinder at the current moment. Specifically, when acquiring the target image within the viewfinder at the current moment, it can be first determined whether it is necessary to obtain various layout frames from a preset material library in real time in the background. If so, a screenshot of the viewfinder at the current moment is triggered to acquire the target image within the viewfinder at the current moment; otherwise, the target image at the current moment is directly acquired from the viewfinder.
[0059] In this embodiment of the invention, after acquiring the target image, the boundary contour is extracted from the target image. The target image can be a landscape image, and it includes one or more objects. The boundary contour can be the contour of each object in the target image, and it is a curve connecting all continuous points (along the boundary) with the same color or grayscale. Extracting the boundary contour from the target image can be achieved using methods such as contour detection algorithms.
[0060] In embodiments of the present invention, such as Figure 2As shown, the boundary contour is extracted from the target image, including:
[0061] Step S201: Enhance the color contrast of the target image;
[0062] Step S202: Blur the target image after color contrast enhancement, and extract the boundary contour from the blurred target image.
[0063] In this embodiment of the invention, when extracting boundary contours from a target image, the color contrast of the target image can be enhanced first, and then the enhanced target image can be blurred to extract the boundary contours. The color contrast of the target image can be enhanced using methods such as linear transformation, histogram normalization, gamma transformation, global histogram equalization, and contrast-limited adaptive histogram equalization. Alternatively, the image brightness can be adjusted using the unadjustment tool in image processing software to enhance the contrast of the target image.
[0064] In this embodiment of the invention, the target image after color contrast enhancement is blurred, and the boundary contour is extracted from the blurred target image, including:
[0065] Obtain the first pixel value of each pixel in the contrast-adjusted target image and the second pixel value of each pixel's corresponding neighboring pixels;
[0066] For each pixel, if the difference between the first pixel value and the second pixel value is less than a preset threshold, the first pixel value is updated to the second pixel value, or the second pixel value is updated to the first pixel value, thereby obtaining the blurred target image;
[0067] Each target pixel is extracted from the blurred target image to obtain the boundary contour composed of the target pixels, and the pixel values of the target pixels are all the same.
[0068] In this embodiment of the invention, to perform blurring processing on the target image after color contrast enhancement, the first pixel value of each pixel in the target image and the second pixel value of each pixel's neighboring pixels can be obtained first. The neighboring pixels of each pixel can be the 4-neighborhood or 8-neighborhood of each pixel.
[0069] If the target image is a grayscale image, the first pixel value is the first grayscale value, and the second pixel value is the second grayscale value. If the difference between the first pixel value and the second pixel value is less than or equal to a preset threshold, the colors of the two pixels are adjusted to the same color, such as adjusting the first pixel value to the second pixel value or vice versa, thus achieving blurring of the target image. If the target image is a color image, the pixel value of each pixel is obtained by weighted averaging of the three color channel components of each pixel, such as pixel value = (wR*R + wG*G + wB*B) / (wR + wG + wB), where wR, wG, and wB represent the weights of the three components R, G, and B, respectively. Then, it is determined whether the difference between the first pixel value of each pixel and the second pixel value of its neighboring pixels is less than a preset threshold. If so, the first pixel value is updated to the second pixel value or the second pixel value is updated to the first pixel value, that is, the colors of pixels whose pixel value difference is less than the preset threshold are adjusted to the same color, resulting in the blurred target image.
[0070] For the blurred target image, color regions can be obtained based on the pixel values of each pixel. Each color region consists of multiple pixels with the same pixel value. For each color region, other color regions adjacent to it are identified. Then, the pixels in each color region that are adjacent to the other adjacent color regions are used as target pixels. These target pixels form the boundary contour of the blurred target image. This boundary contour is the boundary between each color region and its neighboring color regions. The boundary contour between these neighboring color regions is not subsequently determined again. Alternatively, for each color region, the edge pixels of that color region can be used as target pixels. Or, for any two adjacent color regions, the edge pixels of either color region can be used as target pixels.
[0071] In this embodiment of the invention, matching the boundary contour with a preset material library to determine a target layout frame from various layout frames in the preset material library includes:
[0072] For each layout frame in the preset material library, calculate the overlap between the boundary contour and each layout frame, and use the overlap as the comparison result between the boundary contour and each layout frame.
[0073] The target layout frame is selected from various layout frames based on the degree of overlap.
[0074] In this embodiment of the invention, after extracting the boundary contour from the target image, each layout frame in the preset material library is obtained. The layout frames in the preset material library can be obtained from local memory, from background storage, or dynamically obtained in real time.
[0075] In this embodiment of the invention, before matching the boundary contour with a preset material library, the method further includes:
[0076] Acquire multiple images;
[0077] Each image is subjected to color contrast adjustment and blurring to obtain the layout framework corresponding to each image;
[0078] Store the layout framework corresponding to each image in a preset material library, save the preset material library to local memory, and retrieve the preset material library from local memory.
[0079] In this embodiment of the invention, before obtaining each layout frame from the preset material library, multiple images are first acquired. These multiple images can be a large number of high-quality finished product materials, i.e., a large number of images with high finished product quality. For each image, the color contrast of each image is enhanced, and the image after color contrast enhancement is blurred to obtain the layout frame corresponding to each image, i.e., the boundary contour of each image. The method for enhancing color contrast and blurring each image is the same as that for the target image. Then, the layout frame of each image is stored in the preset material library, which is stored in local memory or background storage. Figure 3 (a), (b), (c), and (d) are schematic diagrams of multiple layout frames obtained from multiple images. It can be seen that the layout frames can be boundary contours such as polylines, rings, and arcs. Each layout frame includes one or more reference baselines. For example, in (d), the layout frame is a circular contour. When this layout frame is the target layout frame, a circular dotted line, i.e., the reference baseline, can be displayed on the shooting interface. This allows the user to adjust the shooting angle and shooting distance to align the object in the viewfinder with the circular dotted line for shooting, thereby improving the shooting effect.
[0080] After obtaining the layout frames from the preset material library, the boundary contours are matched with each layout frame to obtain the matching results. The degree of overlap between the boundary contour and each layout frame can be calculated as the matching result. The target layout frame is then selected from the various layout frames based on this overlap; for example, the layout frame with the highest overlap with the boundary contour can be selected as the target layout frame. Alternatively, when matching the boundary contours with the preset material library, machine learning can be used to determine the target layout frame from the various layout frames. For instance, a machine learning model can be trained based on the preset material library, and then the boundary contours can be input into the machine learning model to obtain the target layout frame corresponding to the boundary contours. Alternatively, template matching can also be used to determine the target layout frame from the various layout frames.
[0081] In this embodiment of the invention, calculating the overlap between the boundary contour and each layout frame includes:
[0082] Adjust the boundary outline to the same size as each layout frame;
[0083] Calculate the number of pixels that overlap between the boundary contour and each layout frame;
[0084] The number of overlapping pixels is used as the degree of overlap between the boundary contour and each layout frame.
[0085] Specifically, for each layout frame, when calculating the overlap between the boundary contour and the layout frame, the boundary contour and the layout frame can first be adjusted to the same size. For example, the scaling ratio of the boundary contour can be determined based on the size of the boundary contour and the layout frame so that the boundary contour is updated to the same size as the layout frame according to the scaling ratio. Then, the boundary contour is adjusted up, down, left, and right to adjust the number of pixels that overlap between the boundary contour and the layout frame. The maximum number of overlapping pixels is taken as the number of overlapping pixels between the boundary contour and the layout frame, that is, the overlap between the two, and the adjustment direction of the boundary contour is determined at the same time.
[0086] In this embodiment of the invention, selecting a target layout frame from various layout frames based on overlap includes:
[0087] Multiple candidate layout frames are selected based on their degree of overlap, from largest to smallest.
[0088] Display multiple candidate layout frames at the top of the viewfinder;
[0089] In response to receiving a selection instruction for any candidate layout frame, the candidate layout frame is selected as the target layout frame.
[0090] In this embodiment of the invention, after calculating the overlap degree between the boundary contour and each layout frame, the layout frames can be sorted according to the overlap degree from largest to smallest. The one with the largest overlap degree can be selected as the target layout frame. Alternatively, multiple candidate layout frames can be selected from the top of the sorted list and then displayed as thumbnails at the top of the viewfinder. The thumbnails can be semi-transparent. If multiple thumbnails exceed the viewfinder, they can be displayed by sliding from the top. The user can select any layout frame from the displayed thumbnails. When a user's acceptance command for any layout frame is received, that layout frame is determined to be the target layout frame. The target layout frame includes one or more reference baselines.
[0091] After the target layout framework is determined, a reference baseline is displayed on the shooting interface. Users can use this baseline to select an optimal shooting angle and distance. By moving the camera to adjust the shooting angle and distance, users can capture better original footage and improve the final image quality. The target layout framework indicates the target scaling ratio and the target adjustment direction. The target scaling ratio determines the shooting distance, and the target adjustment direction determines the shooting angle.
[0092] In this embodiment of the invention, during the shooting process based on the reference baseline, it can be determined whether the user combines other photo optimization methods. If not, the user can click to take a picture and obtain the original photo; if so, the user can choose other photo optimization methods for processing, such as using image processing algorithms for portrait beautification, using night mode, adjusting the continuous shooting speed, etc., and then click to take a picture and obtain the original photo.
[0093] Figure 4 This is a flowchart illustrating an image acquisition method according to an embodiment of the present invention. The user opens a camera or shooting software to frame the image. After detecting that the viewfinder is in framing mode, it is determined whether to acquire a layout frame from a preset material library in real time via the background. If yes, a screenshot of the current viewfinder is triggered to obtain the target image. Then, the target image undergoes color contrast enhancement and blurring processing to extract the boundary contour of the target image. The boundary contour is then compared with each layout frame in the preset material library, either acquired later or in real time, to obtain multiple candidate layout frames sorted by overlap. If no, the target image captured by the viewfinder at the current moment undergoes color contrast enhancement and blurring processing to extract the boundary contour of the target image. The boundary contour is then compared with each layout frame in the locally stored preset material library to obtain multiple candidate layout frames sorted by overlap.
[0094] Determine whether to offer options to the user. If yes, slide multiple candidate layout frames as semi-transparent thumbnails at the top of the viewfinder for the user to choose from. Once the user selects one of the candidate layout frames, determine that the selected candidate layout frame as the target layout frame. If not, select the candidate layout frame with the highest overlap as the target layout frame. Display the reference baseline of the target layout frame on the camera interface for the user's reference.
[0095] Determine if the user is using other photo optimization methods. If so, apply other photo optimization techniques. If not, click to take a picture once the user is satisfied with the image in the current viewfinder, and the photo will be taken.
[0096] The image acquisition method of this invention acquires the target image within the viewfinder at the current moment when the camera's viewfinder is detected to be in a framing state. Then, it extracts the boundary contour from the target image. The boundary contour is batch-matched with a preset material library, and a target layout frame is selected based on the matching results. A reference baseline within the target layout frame is displayed in the viewfinder, allowing the user to adjust the camera based on the reference baseline to acquire the corresponding image. This method extracts the boundary contour from the target image and matches it with layout frames in a preset material library to obtain a reference baseline. The reference baseline is then used to determine the shooting angle and distance, thereby optimizing the user's shooting process, improving the quality of the final image, narrowing the technical gap between photography novices and experienced photographers, and enhancing the user experience.
[0097] According to another aspect of the embodiments of the present invention, such as Figure 5 As shown, an image acquisition device 500 is provided, comprising:
[0098] The acquisition module 501, in response to detecting that the camera's viewfinder is in a framing state, acquires the target image in the viewfinder at the current moment;
[0099] Extraction module 502 extracts the boundary contour from the target image;
[0100] The matching module 503 matches the boundary contour with a preset material library to determine a target layout frame from each layout frame in the preset material library; the target layout frame includes one or more reference baselines.
[0101] The display module 504 displays the reference baseline on the shooting interface corresponding to the viewfinder, so that the user can adjust the camera to obtain the corresponding image based on the reference baseline.
[0102] In this embodiment of the invention, the extraction module 502 is further configured to: enhance the color contrast of the target image; perform blurring processing on the target image after color contrast enhancement, and extract the boundary contour from the blurred target image.
[0103] In this embodiment of the invention, the extraction module 502 is further configured to: obtain the first pixel value of each pixel in the contrast-adjusted target image and the second pixel value of each pixel's neighboring pixels; for each pixel, if the difference between the first pixel value and the second pixel value is less than a preset threshold, update the first pixel value to the second pixel value, or update the second pixel value to the first pixel value, thereby obtaining the blurred target image; extract each target pixel from the blurred target image to obtain the boundary contour composed of each target pixel, wherein the pixel values of the target pixels are all the same.
[0104] In this embodiment of the invention, the matching module 503 is further configured to: calculate the overlap degree between the boundary contour and each layout frame in the preset material library, and use the overlap degree as the comparison result between the boundary contour and each layout frame; and select the target layout frame from each layout frame according to the overlap degree.
[0105] In this embodiment of the invention, the matching module 503 is further configured to: adjust the boundary contour and each layout frame to the same size; calculate the number of overlapping pixels between the boundary contour and each layout frame; and use the number of overlapping pixels as the degree of overlap between the boundary contour and each layout frame.
[0106] In this embodiment of the invention, the matching module 503 is further configured to: select multiple candidate layout frames in descending order of overlap; display the multiple candidate layout frames at the top of the viewfinder; and, in response to receiving a selection instruction for any candidate layout frame, use any candidate layout frame as the target layout frame.
[0107] In this embodiment of the invention, the matching module 503 is further configured to: acquire multiple images before comparing the boundary contour with each layout frame in the preset material library; perform color contrast adjustment and blurring on each image to obtain the layout frame corresponding to each image; store the layout frame corresponding to each image in the preset material library; and save the preset material library to local memory so as to retrieve the preset material library from the local memory.
[0108] According to another aspect of the present invention, an electronic device is provided, comprising: one or more processors; and a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the image acquisition method provided by the present invention.
[0109] According to another aspect of the present invention, a computer-readable medium is provided having a computer program stored thereon, which, when executed by a processor, implements the image acquisition method provided by the present invention.
[0110] Figure 6 An exemplary system architecture 600 is shown that can be applied to the image acquisition method or image acquisition apparatus of the present invention.
[0111] like Figure 6 As shown, system architecture 600 may include terminal devices 601, 602, and 603, a network 604, and a server 605. Network 604 serves as the medium for providing communication links between terminal devices 601, 602, and 603 and server 605. Network 604 may include various connection types, such as wired or wireless communication links or fiber optic cables, etc.
[0112] Users can use terminal devices 601, 602, and 603 to interact with server 605 via network 604 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 601, 602, and 603, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social media platform software, etc. (for example only).
[0113] Terminal devices 601, 602, and 603 can be various electronic devices with displays and web browsing capabilities, including but not limited to smartphones, tablets, laptops, and desktop computers.
[0114] Server 605 can be a server that provides various services, such as a backend management server that supports shopping websites browsed by users using terminal devices 601, 602, and 603 (for example only). The backend management server can analyze and process data such as received product information query requests, and feed back the processing results (such as target push information, product information - for example only) to the terminal devices.
[0115] It should be noted that the image acquisition method provided in the embodiments of the present invention is generally executed by server 605, and correspondingly, the display device for the reference baseline is generally set in server 605.
[0116] It should be understood that Figure 6 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.
[0117] The following is for reference. Figure 7 It shows a schematic diagram of the structure of a computer system 700 suitable for implementing a terminal device of the present invention. Figure 7 The terminal device shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.
[0118] like Figure 7 As shown, the computer system 700 includes a central processing unit (CPU) 701, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 702 or programs loaded from storage section 708 into random access memory (RAM) 703. The RAM 703 also stores various programs and data required for the operation of the system 700. The CPU 701, ROM 702, and RAM 703 are interconnected via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0119] The following components are connected to the I / O interface 705: an input section 706 including a keyboard, mouse, etc.; an output section 707 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN card, modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. A removable medium 711, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 710 as needed so that computer programs read from it can be installed into the storage section 708 as needed.
[0120] In particular, according to the embodiments disclosed in this invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 709, and / or installed from removable medium 711. When the computer program is executed by central processing unit (CPU) 701, it performs the functions defined above in the system of this invention.
[0121] It should be noted that the computer-readable medium shown in this invention can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this invention, a 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, apparatus, or device. In this invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0122] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0123] The modules described in the embodiments of the present invention can be implemented in software or hardware. The described modules can also be housed in a processor; for example, a processor can be described as including an acquisition module, an extraction module, a matching module, and a display module. The names of these modules do not necessarily limit the module itself; for example, the acquisition module can also be described as "a module that acquires the target image in the viewfinder at the current moment in response to detecting that the viewfinder of the camera is open."
[0124] In another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiments; or it may exist independently and not assembled into the device. The computer-readable medium carries one or more programs that, when executed by the device, cause the device to include: in response to detecting that the viewfinder of the camera is open, acquiring a target image in the viewfinder at the current moment; extracting a boundary contour from the target image; comparing the boundary contour with each layout frame in a preset material library, and selecting a target layout frame from the layout frames based on the comparison result; the target layout frame includes one or more reference baselines; displaying the reference baselines on the shooting interface corresponding to the viewfinder, so that the user adjusts the camera according to the reference baselines to acquire the corresponding image.
[0125] According to the technical solution of this embodiment of the invention, the reference baseline display method involves acquiring the target image in the viewfinder at the current moment when the camera's viewfinder is detected to be in a framing state; then extracting the boundary contour from the target image; matching the boundary contour with a preset material library; filtering out a target layout frame based on the matching result; and displaying the reference baseline in the target layout frame in the viewfinder, allowing the user to adjust the camera to acquire the corresponding image based on the reference baseline. This method obtains a reference baseline by extracting the boundary contour from the target image and comparing it with a layout frame in a preset material library. The reference baseline is then used to determine the shooting angle and distance, thereby optimizing the user's shooting process, improving the quality of the original image, narrowing the technical gap between photography novices and experienced photographers, and enhancing the user experience.
[0126] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. An image acquisition method, characterized in that, include: In response to the detection that the camera's viewfinder is in a framing state, the target image in the viewfinder at the current moment is acquired; Extract the boundary contour from the target image; The boundary contour is matched with a preset material library to determine a target layout frame from various layout frames in the preset material library; the target layout frame includes one or more reference baselines; The reference baseline is displayed on the shooting interface corresponding to the viewfinder, so that the user can adjust the camera to obtain the corresponding image based on the reference baseline.
2. The method according to claim 1, characterized in that, Extracting the boundary contour from the target image includes: Enhance the color contrast of the target image; The target image with enhanced color contrast is blurred, and the boundary contour is extracted from the blurred target image.
3. The method according to claim 2, characterized in that, The process involves blurring the target image after color contrast enhancement and extracting the boundary contour from the blurred target image, including: Obtain the first pixel value of each pixel in the contrast-adjusted target image and the second pixel value of each pixel's corresponding neighboring pixels; For each pixel, if the difference between the first pixel value and the second pixel value is less than a preset threshold, the first pixel value is updated to the second pixel value, or the second pixel value is updated to the first pixel value, thereby obtaining the blurred target image; The boundary contour is extracted from pixels with the same pixel value in the blurred target image. Each target pixel is extracted from the blurred target image to obtain the boundary contour composed of the target pixels, and the pixel values of the target pixels are all the same.
4. The method according to claim 1, characterized in that, Matching the boundary contour with a preset material library to determine the target layout frame from various layout frames in the preset material library includes: For each layout frame in the preset material library, calculate the overlap between the boundary contour and each layout frame; The target layout frame is selected from the various layout frames based on the degree of overlap.
5. The method according to claim 4, characterized in that, Calculating the overlap between the boundary contour and each layout frame includes: Adjust the boundary contour to the same size as each layout frame; Calculate the number of overlapping pixels between the boundary contour and each layout frame, and use the number of overlapping pixels as the degree of overlap between the boundary contour and each layout frame.
6. The method according to claim 4, characterized in that, The target layout frame is selected from each layout frame based on the overlap degree, including: Multiple candidate layout frames are selected based on their degree of overlap, from largest to smallest. The multiple candidate layout frames are displayed at the top of the viewfinder; In response to receiving a selection instruction for any candidate layout frame, the candidate layout frame is selected as the target layout frame.
7. The method according to claim 1, characterized in that, Before matching the boundary contour with the preset material library, the process also includes: Acquire multiple images; Each image is subjected to color contrast adjustment and blurring to obtain the layout framework corresponding to each image; The layout framework corresponding to each image is stored in the preset material library, and the preset material library is saved to local memory so as to retrieve the preset material library from local memory.
8. An image acquisition device, characterized in that, include: The acquisition module, in response to detecting that the camera's viewfinder is in a framing state, acquires the target image in the viewfinder at the current moment; The extraction module extracts the boundary contours from the target image; The matching module matches the boundary contour with a preset material library to determine a target layout frame from various layout frames in the preset material library; the target layout frame includes one or more reference baselines. The display module displays the reference baseline on the shooting interface corresponding to the viewfinder, so that the user can adjust the camera to obtain the corresponding image based on the reference baseline.
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.