Self-adaptive layout method and device for smile scoring qualified pictures and storage medium
By using an adaptive layout method to dynamically calculate grid cells and topological shapes, the problems of low screen adaptation efficiency and insufficient interactivity of electronic photo walls are solved, enabling rapid adjustment and efficient space utilization, and enhancing the visual effects and interactivity of educational scenarios.
Patent Information
- Application Number
- CN202510964650.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-14
- Publication Date
- 2025-10-24
AI Technical Summary
In existing technologies, electronic photo walls suffer from low screen adaptation efficiency, distorted content cropping, insufficient interactivity, and an inability to dynamically optimize space utilization.
An adaptive layout method is adopted, which dynamically calculates the number of columns and rows of grid cells, combines the topology shape to generate paths, optimizes the image layout, achieves screen ratio adaptation, and allows users to manually select the topology shape.
It improved the efficiency of layout adjustments from hours to milliseconds, increased space utilization by 40%, and enhanced the interactivity and emotional motivation of educational scenarios.
Smart Images

Figure CN120833628A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of computer vision and interactive display technology, in particular to an adaptive method and display device for dynamically adjusting photo layout based on screen ratio, especially suitable for the adaptive method and device of the smile check-in wall system in the campus mental health education scene. BACKGROUND
[0002] The applicant has submitted a patent application entitled "Smile Image Recognition System", with publication number CN119625807A and publication date March 14, 2025. The content of this application is incorporated herein in its entirety.
[0003] This application proposes a smile image recognition system, which includes a smile display module, the smile display module includes a smile collection submodule, a smile recognition submodule, a smile scoring submodule and a display submodule; wherein the smile collection submodule is configured to collect target objects; the smile recognition submodule is configured to recognize the collected smile images to obtain the expression features in the smile images; the smile scoring submodule is configured to score each smile image according to a predetermined method; the display submodule is configured to provide the scored smile images to the display device according to a predetermined rule. The present application can display the smile of students, thereby reflecting the psychological situation of students, and the school can observe the smile display of students in the system through the present application, and carry out targeted psychological counseling, thereby promoting the improvement of the psychological health level of students.
[0004] However, there is still room for improvement in the following aspects of the system: screen adaptation problem: traditional electronic photo wall uses fixed layout template, and manual redesign is required when replacing screen ratio, which is low in efficiency. Content cropping distortion: direct stretching of background picture leads to deformation of key elements (such as school emblem, slogan), affecting visual effect. Insufficient interactivity: static layout cannot dynamically optimize space utilization according to the number of photos and the quality of expressions. SUMMARY
[0005] The purpose of the present application is to provide a layout method suitable for the smile scoring system to solve the above-mentioned screen adaptation defects, and / or content cropping distortion, and / or insufficient interactivity problems.
[0006] Some embodiments of the present application propose a method for adaptive layout of smile score qualified pictures, comprising the following steps: determining a background picture; obtaining a width of a display screen and a height of the display screen; calculating a base size based on the width of the display screen and the height of the display screen; when the calculated base size is smaller than a preset minimum size threshold, taking the preset minimum size threshold as the determined base size, and if it is greater than the preset minimum size threshold, taking the calculated base size as the determined base size; dynamically calculating a grid layout, including calculating the number of columns and the number of rows of the layout of grid cells based on the determined base size; creating a topology shape for each of the grid cells based on the calculated number of columns and the number of rows, including calculating the width and height of each grid cell, determining the topology shape, and then determining the size of the topology shape based on the width and height of the grid cell; determining the center point of the grid cell based on the width and height of the grid cell, the number of columns and the number of rows; generating a path of the topology shape based on the topology shape and the center point of each of the grid cells; performing layout of the smile score qualified pictures inside the topology shape, including calculating a set of picture position coordinates inside the topology path according to the path of the topology shape; filling the smile score qualified pictures to the picture positions determined by the set of picture position coordinates; and synthesizing the background picture and the smile score qualified pictures and outputting a final display image.
[0007] In some embodiments, the base size base_size = min(w, h) * k1, where k1 is a proportionality coefficient, and takes a value of 0.3-0.5; the calculation of the number of columns and the number of rows of the grid layout includes: the number of columns columns = max(1, int(w / (base_size * k2))), where k2 is a column width coefficient of 1.8-2.2, and the number of rows rows = max(1, int(h / (base_size * k3))), where k3 is a row height coefficient of 1.3-1.7.
[0008] In some embodiments, the calculation of the width of the grid cell and the height of the grid cell includes: the width of the grid cell heart_width = w / columns, and the height of the grid cell heart_height = h / rows; the determination of the size of the topology shape includes: the size of the topology shape shape_size = min(heart_width, heart_height) * k4, where k4 is a filling coefficient, and takes a value of 0.6-0.8.
[0009] In some embodiments, further comprising a screen ratio adaptation optimization in the dynamic grid layout calculation, including: calculating a screen aspect ratio aspect_ratio = w / h according to a width w of the display screen and a height h of the display screen; when the screen aspect ratio is greater than a first aspect ratio preset value, then increasing a coefficient k2 to increase the number of columns; when the screen aspect ratio is less than a second aspect ratio preset value, then increasing a coefficient k3 to increase the number of rows.
[0010] In some embodiments, determining the topology shape path according to the screen aspect ratio: when the value of the screen aspect ratio is between a third aspect ratio preset value and a fourth aspect ratio preset value, then determining a first shape as the topology shape and determining a first preset topology path as the topology path; when the value of the screen aspect ratio is greater than a fifth preset value, then determining a second shape as the topology shape and determining a second preset topology path as the topology path; when the value of the screen aspect ratio is less than a second preset value, then determining a third shape as the topology shape and determining a third preset topology path as the topology path.
[0011] In some embodiments, further comprising providing a topology shape selection module to allow a user to determine the topology shape by manual selection to replace the first preset topology path, the second preset topology path, and the third preset topology path. For example, providing an interface for a user to manually switch between a star shape, a rectangle shape, and a hexagon shape to determine the corresponding topology path.
[0012] In some embodiments, the layout of the smile score qualified pictures in the interior of the topology shape includes: filling the edge positions of the topology shape with pictures collected at a relatively new time first; and / or arranging pictures with the same score in a reverse order of collection time; and / or releasing the center area position to pictures collected at a relatively new time at a daily timing; and / or dynamically scaling the size of the pictures according to the size of the topology shape.
[0013] In some embodiments, further comprising a security area protection, including identifying a first area at a first distance H1 from the top of the display screen and determining it as an information display area; identifying a second area at a second distance H2 from the bottom of the display screen and determining it as a control bar area; and removing the first area and the second area when calculating the grid layout.
[0014] Some other embodiments of the present application propose a smile score qualified adaptive layout device, including: an image collection module configured to collect the; an expression recognition module configured to score the collected images to generate the smile score qualified pictures; a layout engine module configured to perform display layout of the smile score qualified pictures on a display screen according to any one of the above methods; and a display output module configured to provide a display screen to display the smile score qualified pictures according to the display layout.
[0015] Some embodiments of the present application provide a computer readable storage medium storing a computer program, which, when executed by a processor, implements any of the above methods.
[0016] The technical effects of the technical solutions provided by the present application include: 1. Adaptation efficiency is improved: the layout adjustment time is reduced from the manual hour level to the millisecond level, and in some embodiments, the measured data shows that the response of 1080p to 4K screen switching is less than 200ms; 2. Space utilization is optimized: the photo filling density is improved by 40% compared with the fixed grid layout; 3. The educational value is strengthened: the dynamic heart-shaped topology enhances emotional motivation. BRIEF DESCRIPTION OF DRAWINGS
[0017] Figure 1 A flowchart of a method of adaptive layout of a smile score qualified picture according to an embodiment of the present application.
[0018] Figure 2 A flowchart of screen ratio driven background processing of a method according to an embodiment of the present application.
[0019] Figure 3 A partial sub-flowchart of screen ratio driven background processing of a method according to an embodiment of the present application.
[0020] Figure 4 A partial sub-flowchart of screen ratio driven background processing of a method according to an embodiment of the present application.
[0021] Figure 5 A partial sub-flowchart of screen ratio driven background processing of a method according to an embodiment of the present application.
[0022] Figure 6 A flowchart of topology adaptive arrangement processing of a method according to an embodiment of the present application.
[0023] Figure 7 A sub-flowchart of topology adaptive arrangement processing of a method according to an embodiment of the present application.
[0024] Figure 8 A flowchart of dynamic calculation of grid cell layout in topology adaptive arrangement processing of a method according to an embodiment of the present application.
[0025] Figure 9 A flowchart of an embodiment of dynamic calculation of grid cell layout of a method according to an embodiment of the present application.
[0026] Figure 10 A schematic diagram of layout effect before using a method according to an embodiment of the present application.
[0027] Figure 11 Layout effect after using the method according to the embodiment of the present application. DETAILED DESCRIPTION
[0028] The embodiments of the present application will be described in detail below with reference to the accompanying drawings.
[0029] The adaptive layout method of smile score qualified pictures proposed in the embodiments of the present application is used for the smile score qualified pictures obtained by the smile image scoring module or system scoring the collected facial images of the subjects, such as students, with a smiling expression.
[0030] The smile photos can be collected by an image collection module. The image collection module can be any module with image collection function, or a module that can perform double-channel image collection and screening, for example, as described below. Such a module cooperates with a gate access / integrated machine hardware, for example, the gate camera captures the facial image of the student when the student passes through the gate access channel. Alternatively, the image collection module can also actively collect the expression of the student in the channel, for example, the student smiles at the integrated machine, and the integrated machine continuously takes three frames and selects the frame with the largest mouth corner arc as the output for subsequent scoring processing.
[0031] The scoring processing can be performed in an expression recognition module. The expression recognition module calculates a smile score value through a real-time smile recognition model (HOG+CNN), and only when the score value is greater than or equal to a preset value, for example, greater than or equal to 60, the facial image is output for subsequent layout processing, for example, uploaded to a layout engine module for layout processing and obtaining a final display image. Finally, the formed final display image is output to an LED screen or a smart terminal display device through a display output module for display. The specific functions of the expression recognition module are described in detail in the aforementioned patent application CN119625807A, which will not be repeated here.
[0032] The steps of layout processing in the layout engine module to generate the final display image and its variants will be described in detail below.
[0033] As shown in Figure 1 The method and core of the present application lie in the layout processing of the layout engine module, which includes processing of the background, step S1; layout design and filling of the smile score qualified pictures, step S2; and fusion of the smile score qualified pictures and the background to form the final display image, step S3.
[0034] As shown in Figure 2 , Figure 4 , Figure 4 and Figure 5As shown, in step 1, the processing of the background can include screen ratio driven background processing, i.e. background picture processing based on screen ratio, to ensure that the background image can adapt to the window size and provide good visual effects. This process is completed through the following sub-steps, combined with user interface (UI) events and image processing techniques, to dynamically adjust the display mode of the background.
[0035] It includes step S11, loading background image: First, the system attempts to load the specified background image file. If the file path (self.background_image_path) exists and is valid, the image is loaded using QImage. If the loading fails (e.g. file is corrupted or format is not supported), self.background_image is set to None, and an error message ("Failed to load background image") is output. If the file does not exist, a warning ("Background image not found") is output. This step ensures the robustness of image loading and lays the foundation for subsequent processing. Step S12, implementing background image scaling in response to window redraw events: When the window needs to be redrawn, the system handles the display of the background through the paintEvent method. It can include, step S121, creating a painter object using QPainter, checking if there is a scaled background image (self.background_scaled); step S122, if it exists and is valid, the background image will be displayed centered, with the position calculated by the width difference (bg_x) and height difference (bg_y), ensuring that the image is aligned in the center of the window. If there is no valid scaled background, the entire window rectangle area is filled with pure white (Qt.white) as the default background. This process ensures that the window has visual feedback in any case. Step S123, dynamically scaling the background image: In paintEvent, if the original background image (self.background_image) is valid, the system converts it to QPixmap format. Then, step S1231, based on the current window size (self.size()), two scaling options are performed: step S1231, keep aspect ratio scaling: using Qt.AspectRatioMode.KeepAspectRatioByExpanding and SmoothTransformation, the image is expanded to fill the window while preserving the original aspect ratio, avoiding distortion. Not keeping aspect ratio scaling: using Qt.AspectRatioMode.IgnoreAspectRatio, the image is directly stretched to completely adapt to the window size (alternative solutions are provided in the comments); step S1232, the scaled image (scaled) is displayed centered by calculating the center point (x and y, based on the half of the window width and height and the difference between the image width and height), using painter.drawPixmap to draw. This step ensures that the background image dynamically matches the window size, providing flexible display options.
[0036] Background update when resizing window: including step S1233, when the window size changes, the resizeEvent method is triggered, calling resize_background_image to update the background image. The method checks whether the original background picture is valid, step S1234, if valid, then create a QPixmap from the QImage, and resize the image to fit the new window size completely using the scaling mode that ignores aspect ratio (IgnoreAspectRatio), step S1235. The result of the scaling is stored in self.background_scaled for updating, step S1236. If the picture is invalid, set self.background_scaled to None to avoid drawing incorrect content. This process ensures that the background is real-time adapted when the window is resized.
[0037] Overall flow coordination: the entire background processing process is implemented through event-driven. resizeEvent responds to window size changes, resize_background_image performs scaling calculation, and paintEvent is responsible for drawing. load_background_image is used as an initialization step to ensure that the picture resource is available. Superclass methods (super().paintEvent and super().resizeEvent) are called to retain the default behavior and ensure compatibility with the Qt framework.
[0038] As shown in Figure 6 S2, the topology adaptive arrangement can include the following sub-steps: step S21, providing a layout template library: pre-storing heart-shaped, square, tree-shaped and other layout templates, each layout template being associated with a screen width-height ratio applicable range, for example, the screen width-height ratio of a heart-shaped layout template is 1:1-1:1.8, the screen width-height ratio of a double heart-shaped layout template is 1:1.8-1:3, etc.; step S22, dynamically selecting a layout template and determining layout information, and step S23, filling the smile score qualified picture into the picture position determined in the layout template according to the layout information.
[0039] As shown in Figure 7 S22, the dynamic selection of the layout template and the determination of the layout information specifically include:
[0040] Step S221, initializing the hearts list;
[0041] Step S222, obtaining the screen width and height;
[0042] Step S223, calculating the base size, for example, 16:9;
[0043] Step S224, determining whether the base size is less than a predetermined value, for example 80, if less than 80, the predetermined value is determined as the base size, if greater than the predetermined value, the actual value is determined as the base size;
[0044] Step S225, dynamically calculating the grid cell layout based on the base size, facilitating numerical analysis and graphic rendering. The core of dynamic meshing technology lies in its adaptability and flexibility, which can dynamically adjust the density and distribution of the mesh during the calculation process to ensure the accuracy and efficiency of the calculation. Unlike static meshing, dynamic meshing can update the structure of the mesh in real time according to the complexity of the physical phenomenon, boundary changes or material deformation, etc. For example, columns = max(1, int(w / (base_size*k2)))(k2 is a column width coefficient of 1.8-2.2); rows = max(1, int(h / (base_size*k3)))(k3 is a row height coefficient of 1.3-1.7). A topological shape needs to be created for each grid cell. The grid cell is a small independent area formed by dividing the screen display area (based on the obtained screen width and height) according to the dynamically calculated number of columns and rows, and is the basic "container" that carries the picture content in the layout. It is used to standardize the layout position of the picture content, so that the system can accurately place the smile score related pictures in each cell according to the unified rules, realize adaptive and orderly typesetting, and make the layout present neatly on different size screens.
[0045] As shown in Figure 8 Step S225, dynamically calculating the grid cell layout based on the base size, facilitating numerical analysis and graphic rendering. The core of dynamic meshing technology lies in its adaptability and flexibility, which can dynamically adjust the density and distribution of the mesh during the calculation process to ensure the accuracy and efficiency of the calculation. Unlike static meshing, dynamic meshing can update the structure of the mesh in real time according to the complexity of the physical phenomenon, boundary changes or material deformation, etc. For example, columns = max(1, int(w / (base_size*k2)))(k2 is a column width coefficient of 1.8-2.2); rows = max(1, int(h / (base_size*k3)))(k3 is a row height coefficient of 1.3-1.7). A topological shape needs to be created for each grid cell. The grid cell is a small independent area formed by dividing the screen display area (based on the obtained screen width and height) according to the dynamically calculated number of columns and rows, and is the basic "container" that carries the picture content in the layout. It is used to standardize the layout position of the picture content, so that the system can accurately place the smile score related pictures in each cell according to the unified rules, realize adaptive and orderly typesetting, and make the layout present neatly on different size screens.
[0046] For example, shape selection is performed; shape size is determined by the width and height of the unit, which is used to adapt to different screens, and the unit size is dynamically adjusted according to the screen and layout rules. For example, if a heart shape is selected, a heart-shaped path is created; if a star shape is selected, a star-shaped path is created; if a rectangle is selected, a rectangular path is created; and if a hexagon is selected, a hexagonal path is created. An example of generating a corresponding topological shape path at the center point (center_x, center_y) of the unit is as follows: assuming that the screen width w = 1920 and the screen height h = 1080, the number of columns columns = 10 and the number of rows rows = 5 are calculated. Then, heart_width = 1920 / 10 = 192, and heart_height = 1080 / 5 = 216. At this time, the grid unit is a rectangular area with a width of 192 and a height of 216, and subsequent pictures will be laid out in this area according to the topological shape rule (such as a heart-shaped path).
[0047] The topological shape and the topological path can be determined according to the screen aspect ratio: when the value of the screen aspect ratio is between a third preset aspect ratio value and a fourth preset aspect ratio value, a first shape is determined as the topological shape, and the topological path is determined as a first preset topological path; when the value of the screen aspect ratio is greater than a fifth preset value, a second shape is determined as the topological shape, and the topological path is determined as a second preset topological path; and when the value of the screen aspect ratio is less than a second preset value, a third shape is determined as the topological shape, and the topological path is determined as a third preset topological path. For example, when the screen aspect ratio satisfies 0.8≤aspect_ratio≤1.2, a heart-shaped path is automatically selected; when aspect_ratio>2.0, a double-heart-shaped parallel path is automatically selected; and when aspect_ratio<0.5, a vertical heart-shaped path is automatically selected.
[0048] The topological shape selection module is also provided to allow the user to manually determine the topological shape instead of the first preset topological path, the second preset topological path, and the third preset topological path. For example, an interface is provided for the user to manually switch between a star-shaped topological shape, a rectangular topological shape, and a hexagonal topological shape to determine the corresponding topological path.
[0049] Thereafter, in step S23, the smile score qualified pictures are filled into the picture positions determined by the set of picture position coordinates. Available picture filling rules include: newer pictures are preferentially filled into edge positions of the topological shape; and / or pictures with the same score are arranged in reverse order of acquisition time; and / or a central area position is released to a newer picture according to a daily timing; and / or the size of the picture is dynamically scaled according to the size of the topological shape.
[0050] Technical effects of the method of the present application include: improved adaptation efficiency: layout adjustment time is reduced from manual hour level to millisecond level, in some embodiments, the measured data is less than 200ms for 1080p to 4K screen switching response; optimized space utilization: photo filling density is improved by 40% compared with fixed grid layout; enhanced educational value: dynamic heart-shaped topology enhances emotional motivation.
[0051] The following are specific experimental examples obtained according to the method of the present application:
[0052] Scene 1 (square screen, 1:1 ratio): the background picture is cut to retain the center school badge area, the number of photos constituting a single picture can be freely set, and the top displays "smile check-in wall". Scene 2 (long strip screen, 1:3 ratio): the background picture can be cut according to saliency protection, the photos are divided into three independent heart-shaped arrays, and a dynamic encouragement is inserted in the middle. Among them, saliency protection cutting is an intelligent image processing technology, the core of which is to preferentially identify and protect the visual saliency regions (Salient Regions) in the image when the size of the background picture is adaptively adjusted, so as to avoid the destruction of key information (such as school badge, slogan, face) in the cutting process. This technology realizes content-aware intelligent cutting by combining computer vision and image analysis algorithms. The initial state and result state of background intelligent cutting are shown in Figure 10 、 Figure 11 .
[0053] Figure 9 An embodiment of adaptive layout is shown in Figure 9As shown, it includes acquiring the width w and height h of the display screen; calculating the base size: base_size = min(w, h) * k1 (where k1 is a proportionality coefficient of 0.3-0.5); when base_size < S_min, set base_size = S_min (S_min is a preset minimum size threshold); dynamically calculate the grid layout: column calculation: columns = max(1, int(w / (base_size*k2))) (k2 is a column width coefficient of 1.8-2.2) row calculation: rows = max(1, int(h / (base_size*k3))) (k3 is a row height coefficient of 1.3-1.7); create a topology shape for each grid cell: calculate the cell size: heart_width = w / columns, heart_height = h / rows; determine the shape size shape: shape_size = min(heart_width, heart_height) * k4 (k4 is a filling coefficient of 0.6-0.8); based on the shape selection instruction, generate the corresponding topology shape path at the cell center point (center_x, center_y) (where center_x = (col+0.5)*heart_width, center_y = (row+0.5)*heart_height); picture layout inside the topology shape: calculate the internal picture position coordinate set according to the topology shape path; fill the smile score qualified picture to the coordinate position.
[0054] For example, when the screen aspect ratio aspect_ratio > T1 (T1 = 1.5), increase the coefficient k2 to make columns = columns * 1.2; when the screen aspect ratio aspect_ratio < T2 (T2 = 0.5), increase the coefficient k3 to make rows = rows * 1.2.
[0055] For example, when 0.8 ≤ aspect_ratio ≤ 1.2, automatically select the heart-shaped path; when aspect_ratio > 2.0, automatically select the double-heart-shaped parallel path; when aspect_ratio < 0.5, automatically select the vertical heart-shaped path; support user manual switching of star-shaped, rectangular, and hexagonal paths.
[0056] For example, it can also include security area protection: identify the top H1 (H1 = 10% h) of the screen as an information display area; identify the bottom H2 (H2 = 5% h) of the screen as a control bar area; when calculating the grid layout, adjust the effective height to: h_eff = h-(H1+H2).
[0057] The method of the present application can be implemented in a corresponding virtual device, i.e. it comprises corresponding computer program modules. Alternatively it can be implemented as computer program code which, when executed by a processor, implements any of the methods presented in the present application.
[0058] In other embodiments, the above computer program code can be stored by a computer readable medium, which, when executed by a processor, implements any of the methods presented in the present application.
[0059] According to certain embodiments, data processing uses a digital processing system (DPS). The DPS can be configured to store, process, and communicate a plurality of various types of digital information including digital images and videos.
[0060] As discussed above, embodiments of the present application can employ a DPS or device having digital processing capabilities. Example components of such a system include a central processing unit (CPU) and a signal processor coupled to a main memory, a static memory, and a mass storage device. The main memory can store various applications for implementing the operations of the present application, while the mass storage device can store various digital content.
[0061] The DPS can also be coupled to input / output (I / O) devices and audio / video devices. The CPU can be used to process information and / or signals for the processing system. The main memory can be a random access memory (RAM) or some other dynamic storage device used for storing information or instructions (program code) used by the CPU. The static memory can be a read only memory (ROM) and / or other static storage device used for storing information or instructions that can also be used by the CPU. The mass storage device can be, for example, a hard disk drive, an optical disk drive, or a firmware for storing information or instructions used by the processing system.
[0062] Embodiments of the present application have been described as including various operations. Many of the processes described are implemented as a set of instructions that is executable by a computer processor, and which instructs the computer processor to perform an operation. However, it is important to note that this is merely an implementation and is not exclusive of other structures or techniques for implementing the present application.
[0063] The operations of the present application can be performed by a hardware component or can be embodied in machine-executable instructions, which can be used to program a general-purpose or special-purpose processor or logic circuitry to perform the operations. Alternatively, the steps can be performed by a combination of hardware and software. The present application can be provided as a computer program product, which can include a machine-readable medium having stored thereon instructions that can be used to program a computer (or other electronic device) to perform processes in accordance with the present application. The machine-readable medium can include, but is not limited to, floppy diskettes, optical disks, CD-ROMs, and magneto-optical disks, ROMs, RAMs, EPROMs, EEPROMs, magnet or optical cards, flash memory, or other type of media / machine-readable medium suitable for storing electronic instructions. Additionally, the present application can be downloaded as a computer program product, wherein the program can be transferred from a remote computer to a requesting computer by way of data signals embodied in a carrier wave or other propagation medium via a communication link (e.g., a modem or network connection). All or part of the operations of the present application can be performed in a same central site, or alternatively, one or more operations can be performed at another location.
Claims
1. A method for adaptive layout of smile score pass pictures, characterized in that The method comprises the following steps: determining a background picture; obtaining the width w of the display screen and the height h of the display screen; calculating a base size based on the width w of the display screen and the height h of the display screen; when the calculated base size is smaller than a preset minimum size threshold, taking the preset minimum size threshold as the determined base size, and if it is greater than the preset minimum size threshold, taking the calculated base size as the determined base size; dynamically calculating a grid layout, including calculating the number of columns and the number of rows of the layout of grid units based on the determined base size; creating a topology shape for each grid unit based on the calculated number of columns and the number of rows, including calculating the width and height of each grid unit, determining a topology shape, and then determining the size of the topology shape based on the width and height of the grid unit; determining the center point of the grid unit based on the width and height of the grid unit, the number of columns and the number of rows; generating the path of the topology shape based on the topology shape and the center point of each grid unit: performing the layout of the smile score qualified picture inside the topology shape, which includes calculating a set of picture position coordinates inside the topology path according to the path of the topology shape; filling the smile score qualified picture to the picture position determined by the set of picture position coordinates; and combining the background picture and the smile score qualified picture to output a final display image. The base size base_size = min(w, h) * k1, where k1 is a proportionality coefficient, and the value is 0.3-0.5; the calculation of the number of columns and the number of rows of the grid layout includes: the number of columns columns = max(1, int(w / (base_size * k2))), where k2 is a column width coefficient of 1.8-2.2, and the number of rows rows = max(1, int(h / (base_size * k3))), where k3 is a row height coefficient of 1.3-1.
7.
2. The method of claim 1, wherein: The calculation of the width of the grid unit and the height of the grid unit includes: heart_width = w / columns, heart_height = h / rows; the determination of the size of the topology shape includes: shape_size = min(heart_width, heart_height) * k4, where k4 is a filling coefficient, and the value is 0.6-0.
8.
3. The method of claim 1, wherein: It also includes screen ratio adaptive optimization during dynamic calculation of the grid layout, including:
4. The method of claim 1, wherein: calculating the screen aspect ratio based on the width w of the display screen and the height h of the display screen aspect_ratio = w / h; when the screen aspect ratio is greater than a first aspect ratio preset value, then increase the coefficient k2 to increase the number of columns; when the screen aspect ratio is less than a second aspect ratio preset value, then increase the coefficient k3 to increase the number of rows. determining the topology shape and topology path based on the screen aspect ratio:
5. The method of claim 4, wherein: when the value of the screen aspect ratio is between the third preset aspect ratio value and the fourth preset aspect ratio value, the first shape is determined as a topology shape, and the topology path is determined as a first preset topology path; when the value of the screen aspect ratio is greater than the fifth preset value, the second shape is determined as a topology shape, and the topology path is determined as a second preset topology path; when the value of the screen aspect ratio is less than the second preset value, the third shape is determined as a topology shape, and the topology path is determined as a third preset topology path.
6. The method of claim 6, wherein: Further comprising providing a topology shape selection module to allow a user to determine the topology shape by manual selection instead of the first preset topology path, the second preset topology path, and the third preset topology path. For example, providing an interface for a user to manually switch between a star shape, a rectangle shape, and a hexagon shape to determine the corresponding topology path.
7. The method of claim 1, wherein: The layout of the smile qualified pictures inside the topology shape comprises: newer pictures are preferentially filled in edge positions of the topology shape; and / or pictures of the same smile score are arranged in reverse order of collection time; and / or a central position is released to newer pictures on a daily basis; and / or picture sizes are dynamically scaled with the size of the topology shape.
8. The method of claim 1, wherein Further comprising a security area protection: a first area at a first distance H1 from the top of the display screen is identified and determined as an information display area; a second area at a second distance H2 from the bottom of the display screen is identified and determined as a control bar area; when calculating the grid layout, the first area and the second area are removed.
9. An adaptive layout device for pictures with qualified smile scores, characterized in that Comprise: an image collection module configured to collect the; an expression recognition module configured to generate the smile qualified pictures; a layout engine module configured to perform display layout of the smile qualified pictures on a display screen according to the method of any one of claims 1 to 8; a display output module providing a display screen to display the smile qualified pictures according to the display layout.
10. A computer readable storage medium storing a computer program, characterized in that: The computer program is executed by a processor to implement the method of any one of claims 1 to 8. The computer program is executed by a processor to implement the method of any one of claims 1 to 8.
Citation Information
Patent Citations
Smile image recognition system
CN119625807A