Object display page generation method and device, electronic equipment and storage medium
By determining a target template based on color depth and brightness in HSV or HSL color spaces, the method improves the display effect of object display pages by ensuring accurate color matching.
Patent Information
- Application Number
- CN202310641803.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-31
- Publication Date
- 2024-12-03
AI Technical Summary
Existing methods for generating object display pages often use fixed templates that do not match the image elements, leading to suboptimal display effects due to the inability to distinguish color depth and brightness, particularly with neutral colors.
The method determines a target template based on first color information in a color space like HSV or HSL, considering color depth and brightness, to generate a target rendering element that accurately matches the object image, thereby improving the display effect.
The approach enhances the display effect by ensuring that the display elements closely match the object image's color, depth, and brightness, resulting in a more accurate and visually appealing object display page.
Smart Images

Figure CN119065554A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the technical field of electronic devices, and specifically relates to a method, device, electronic device and storage medium for generating an object display page. Background Art
[0002] In the related art, when displaying image elements such as commodities, objects or design solutions, the display effect can be improved by displaying these image elements in a manner of generating an object display page.
[0003] However, when generating an object display page, a fixed template is generally used. Sometimes the template does not match the image to be displayed, resulting in that the display effect of the object display page cannot meet the requirements. Summary of the invention
[0004] The purpose of the embodiments of the present application is to provide a method, device, electronic device and storage medium for generating an object display page, which can at least partially solve the above-mentioned technical problems.
[0005] In a first aspect, an embodiment of the present application provides a method for generating an object display page, comprising:
[0006] Determine a target template according to first color information of an object image of an object to be displayed in a first color space;
[0007] A target rendering element associated with the object to be displayed is generated according to the object image and the target template, and the target rendering element is used to instruct the target terminal to render an object display page of the object to be displayed according to the target rendering element.
[0008] In a second aspect, an embodiment of the present application provides a device for generating an object display page, including:
[0009] A determination module, configured to determine a target template according to first color information of an object image of an object to be displayed in a first color space;
[0010] The generating module is used to generate a target rendering element associated with the object to be displayed according to the object image and the target template, and the target rendering element is used to instruct the target terminal to render the object display page of the object to be displayed according to the target rendering element.
[0011] In a third aspect, an embodiment of the present application provides an electronic device, including a processor and a memory, wherein the memory stores programs or instructions that can be executed on the processor, and when the programs or instructions are executed by the processor, the steps of the method of the first aspect are implemented.
[0012] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method of the first aspect are implemented.
[0013] In a fifth aspect, an embodiment of the present application provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the steps of the method of the first aspect.
[0014] In a sixth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the method of the first aspect.
[0015] In an embodiment of the present application, when generating an object display page, the most suitable target template is matched according to the first color information of the object image of the object to be displayed in the first color space containing color depth and brightness information. The target template can match the color, color depth and brightness of the object to be displayed. By using the target template to generate the object display page of the object to be displayed, the display elements of the object display page can be more matched with the object image of the object to be displayed, thereby improving the display effect of the object display page. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 A flow chart showing a method for generating an object display page according to an embodiment of the present application is shown;
[0017] Figure 2 A schematic diagram of the HSV color space according to an embodiment of the present application is shown;
[0018] Figure 3 A schematic diagram showing the matching relationship between the second color information and the target template according to an embodiment of the present application is shown;
[0019] Figure 4 A schematic diagram of an object display page according to an embodiment of the present application is shown;
[0020] Figure 5 A structural block diagram of a device for generating an object display page according to an embodiment of the present application is shown;
[0021] Figure 6 A structural block diagram of an electronic device according to an embodiment of the present application is shown;
[0022] Figure 7 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of the present application. DETAILED DESCRIPTION
[0023] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.
[0024] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0025] In conjunction with the accompanying drawings, the object display page generation method, device, electronic device and storage medium provided in the embodiments of the present application are described in detail through specific embodiments and their application scenarios.
[0026] In some embodiments of the present application, a method for generating an object display page is provided. Figure 1 A flow chart of a method for generating an object display page according to an embodiment of the present application is shown. Figure 1 As shown, the method for generating an object display page includes:
[0027] Step 102, determining a target template according to first color information of an object image of an object to be displayed in a first color space;
[0028] Step 104 , generating a target rendering element associated with the object to be displayed according to the object image and the target template, wherein the target rendering element is used to instruct the target terminal to render an object display page of the object to be displayed according to the target rendering element.
[0029] In the embodiment of the present application, when generating an object display page of the object to be displayed, the most suitable target template is matched according to the first color information of the object image of the object to be displayed in the first color space containing color depth and brightness information.
[0030] In the related art, when generating an object display page, it is generally done by applying a fixed template. Specifically, by calculating the hue of the image to be displayed, the hue value is used to match the template in the fixed template. Since this method intelligently distinguishes colors, it cannot distinguish between color depth and brightness, and cannot distinguish between neutral colors (such as black, white, gray, etc.), so the display effect of the generated object display page is not good.
[0031] In response to this situation, the present application will match the most suitable target template based on the first color information of the object image of the object to be displayed in the first color space containing color depth and brightness information. The first color information matches the color, color depth and brightness of the object to be displayed, that is, the saturation information and transparency information are also retained at the same time, so it can accurately express the image's color, color purity, color brightness and other data.
[0032] Therefore, by matching the target template with the first color, it is possible to further distinguish the color depth and color brightness of the object image of the object to be displayed while distinguishing the color (hue), and at the same time accurately determine the neutral color. By using the target template to associate the target rendering element with the object to be displayed, the display element of the object display page generated by the terminal according to the target rendering element is more matched with the object image of the object to be displayed.
[0033] Among them, the target rendering element is the UI (User Interface) element. According to the determined target template, the corresponding target rendering element is determined, such as gradient background, bullet screen color, projection color, mask color, etc., and these target rendering elements and the object image to be displayed are configured and sent to the application client to generate an object display page.
[0034] The embodiment of the present application matches the most suitable target template based on the first color information that can reflect the color, color depth and brightness of the original object to be displayed, and generates an object display page for the object to be displayed through the target template, which can make the display elements of the object display page more matched with the object image of the object to be displayed, thereby improving the display effect of the object display page.
[0035] In some embodiments of the present application, the first color space is an HSV color space or an HSL color space.
[0036] In an embodiment of the present application, the first color space can retain information such as color brightness and color depth. Specifically, the first color space can be an HSV (Hue-Saturation-Value) color space or an HSL (Hue-Saturation-Lightness) color space.
[0037] Specifically, the first color space is the HSV color space. The HSV color space is Hue (hue)-Saturation (saturation)-Value (color brightness). The HSV color space can be represented by a cylinder, wherein the cross section of the cylinder can be regarded as a polar coordinate system, H (hue) is represented by the polar angle of the polar coordinate, S (saturation) is represented by the polar axis length of the polar coordinate, and V (value) is represented by the height of the center axis of the cylinder.
[0038] The mathematical model of HSV is a single cone, where H is measured in angles ranging from 0° to 360°, representing color information, that is, the position of the spectral color.
[0039] S is the horizontal component, indicating the color purity. The value range of S is 0% to 100%, which can be understood as the amount of white mixed in. The larger the value of S, the less white there is, the higher the purity, and the closer it is to the spectral color. The smaller the value of S, the more white there is, the lower the purity, the lighter the color, and the closer it is to the neutral color (black, white, and gray).
[0040] V is the vertical component. The value range of V is 0% to 100%, which can be understood as the amount of black mixed in. The larger the value of V, the less black, the higher the lightness, and the brighter the color. The lower the value of V, the more black, the lower the lightness, and the darker the color. When the lightness V is 0, it is pure black.
[0041] The first color space may also be an HSL color space, specifically, the HSL color space is Hue (hue)-Saturation (saturation)-Lightness (brightness). The mathematical model of the HSV color space can be interpreted as a double cone, wherein the cross section can be regarded as a polar coordinate system, H is represented by the polar angle of the polar coordinate, S is represented by the polar axis length of the polar coordinate, and L is represented by the height of the axis.
[0042] Among them, H is measured in angles, ranging from 0° to 360°, and represents color information, that is, the position of the spectral color.
[0043] S is the horizontal component, indicating the color purity. The value range of S is 0% to 100%, which can be understood as the amount of white mixed in. The larger the value of S, the less white there is, the higher the purity, and the closer it is to the spectral color. The smaller the value of S, the more white there is, the lower the purity, the lighter the color, and the closer it is to the neutral color (black, white, and gray).
[0044] L is the vertical component, which represents brightness and is used to determine the degree of black and white of the color in the color space. The value range of L is 0%-100%. The higher the brightness, the whiter the color; the lower the brightness, the darker the color. 0% brightness indicates pure black, and 100% brightness indicates pure white. The HSV color space and HSL color space retain the color information of the original object to be displayed, as well as the color depth information and brightness information. Therefore, by matching the target template through the first color information under the HSV color space or the HSL color space, the display elements of the object display page can be more matched with the object image of the object to be displayed, thereby improving the display effect of the object display page.
[0045] In some embodiments of the present application, the object image includes a target image area, the object display page includes a target display area, the target image area corresponds to the target display area, and the first color information corresponds to the target image area.
[0046] In an embodiment of the present application, the object display page includes one or more target display areas, and the one or more target display areas correspond to one or more target image areas in the object image.
[0047] Exemplarily, the object display page includes a bottom background area, a top mask area, and a bullet screen display area, etc. Among them, the bottom background area is adjacent to the bottom area of the object image, the top mask area is adjacent to the top area of the object image, and the bullet screen area can be close to the lower left corner of the object image.
[0048] Therefore, the bottom area of the object image, such as the bottom 2% to 50% of the image area, can be determined as the target image area corresponding to the bottom background area, the top 2% to 50% of the image area can be determined as the target image area corresponding to the top mask area, and the fixed range area in the lower left corner of the object image can be determined as the target image area corresponding to the barrage area.
[0049] The embodiment of the present application matches the first color information according to a specific target image area in the object image, so that the target template obtained by matching the first color information is consistent with the color style of the original object to be displayed, so that the final object display page can meet the display requirements.
[0050] In some embodiments of the present application, before the step of determining the target template according to the first color information of the object image of the object to be displayed in the first color space, the method further includes:
[0051] Determine the RGB value of each pixel in the target image area to obtain multiple RGB values;
[0052] Determine the number of pixels corresponding to each RGB value in a plurality of RGB values;
[0053] Determine second color information according to the target RGB value with the largest number of corresponding pixels, where the second color information is color information in the RGB color space;
[0054] The first color information is determined according to the second color information.
[0055] In the embodiment of the present application, the second color information is specifically color information in the RGB color space. The RGB color space, i.e., the three optical primary colors, represents color through a linear combination of three color components, which specifically include red, green, and blue. Any color in the RGB space is related to the components of these three colors. The three color components are highly correlated, i.e., as long as the brightness changes, the three components will change accordingly.
[0056] Get the RGB values of all pixel values in the target image area. Some areas in the target image area may have the same color, and count the number of pixels under each RGB value.
[0057] After counting the number of pixels under each RGB value, the RGB value corresponding to the largest number of pixels is determined as the target RGB value, which is the second color information corresponding to the target image area.
[0058] Exemplarily, assuming that the RGB values in the target image area include (R=Ra, G=Ga, B=Ba) and (R=Rb, G=Gb, B=Bb), the number of pixels with RGB values of (R=Ra, G=Ga, B=Ba) and (R=Rb, G=Gb, B=Bb) and the number of pixels with RGB values of (R=Rb, G=Gb, B=Bb) are counted respectively. Wherein, Ra, Ga, Ba, Rb, Gb and Bb are all natural numbers greater than or equal to 0 and less than or equal to 255.
[0059] Assuming that the number of pixels with RGB values of (R=Ra, G=Ga, B=Ba) is 100, and the number of pixels with RGB values of (R=Rb, G=Gb, B=Bb) is 10, then (R=Ra, G=Ga, B=Ba) is determined as the target RGB value, that is, the second color information.
[0060] After obtaining the second color information in the RGB color space, the first color information in the HSV color space or the HSL color space is determined according to the second color information, so as to match a suitable target template according to the first color information.
[0061] The embodiment of the present application determines the first color information of the target image area according to the RGB value with the largest number of pixels, which can improve the color matching degree between the matched target template and the color of the object image actually to be displayed, and improve the display effect of the object display page.
[0062] In some embodiments of the present application, the RBG value includes a red intensity value, a blue intensity value, and a green intensity value;
[0063] The step of determining the first color information according to the second color information comprises:
[0064] Normalize the red intensity value, the blue intensity value, and the green intensity value;
[0065] Determine the corresponding hue value, saturation value and color brightness value according to the normalized red intensity value, blue intensity value and green intensity value;
[0066] The first color information is determined according to the hue value, the saturation value, and the color lightness value, and the first color information is color information in the HSV color space or the HSL color space.
[0067] In the embodiment of the present application, the RBG value specifically includes a red intensity value (R value), a blue intensity value (B value) and a green intensity value (G value).
[0068] The embodiment of the present application converts the second color information in the second color space (RGB) into the first color information in the first color space (HSV or HSL).
[0069] Specifically, since the human eye has different sensitivities to the three color components of red, green and blue, and in monochrome, the human eye is least sensitive to red and most sensitive to blue, the RGB color space is a color space with poor uniformity. For a certain color, the RGB color space has no intuitive logic to express, so it is difficult to infer the more accurate values of the three components, and the RGB color space is difficult to measure the brightness and vividness of the color.
[0070] For the HSV color space, Figure 2 A schematic diagram of the HSV color space according to an embodiment of the present application is shown, as shown in Figure 2 As shown, on the color selector, when the H value (hue value) is fixed, the color can be divided into a two-dimensional coordinate through the S value (saturation value) and the V value (color brightness value).
[0071] In this two-dimensional coordinate, according to human eye perception, colors can be divided into dark color area, light color area, dark gray area, light gray area and black area, which is convenient for adapting color templates according to different areas.
[0072] Therefore, the H value is used to characterize colors as red, orange, green, blue, etc., and the S and V ranges are used to divide color depth, black and gray.
[0073] That is to say, by dividing the ranges of H value, S value and V value, multiple sets of color templates can be dynamically defined, so that the templates can be more closely matched with the object image to be displayed.
[0074] When the first color information is converted from the RGB color space to the HSV color space, since the numerical range of the R value, the G value, and the B value is 0 to 255, they are first normalized to adjust the numerical range to the range of 0 to 1.
[0075] Specifically, assuming that the red intensity value is R, the blue intensity value is B, and the green intensity value is G, normalization can be performed in the following way:
[0076] R'=R÷255;
[0077] G'=G÷255;
[0078] B' = B ÷ 255;
[0079] Among them, R', G' and B' are normalized RGB values.
[0080] Furthermore, suppose:
[0081] Cmax = max(R', G', B');
[0082] Cmin=min(R', G', B');
[0083] Δ=Cmax–Cmin;
[0084] The H value (hue value), S value (saturation value) and V value (color brightness value) can be calculated by the following formula:
[0085]
[0086]
[0087] V = Cmax;
[0088] Among them, H is the hue value, S is the saturation value, V is the color brightness value, R' is the normalized red intensity value, G' is the normalized green intensity value, B' is the normalized blue intensity value, Cmax = max(R', G', B'), Cmin = min(R', G', B'), Δ = Cmax-Cmin.
[0089] The embodiment of the present application converts color information in the RGB color space into color information in the HSV color space. The obtained first color information can intuitively express the hue, vividness, and brightness of the color. By matching the target template with the first color information, the target template can be matched with the actual object image to be displayed, thereby improving the display effect of the object display page.
[0090] In some embodiments of the present application, determining a target template according to first color information of an object image of an object to be displayed in a first color space includes:
[0091] According to the comparison result of the hue value with the preset hue value range, the comparison result of the saturation value with the preset saturation value interval, and the comparison result of the color lightness value with the preset color lightness value interval, the target template is determined in the preset template set.
[0092] In an embodiment of the present application, after obtaining the first color information, specifically the hue value, saturation value and color-lightness value corresponding to the target image area, the corresponding target template is determined based on the comparison results of the hue value with the preset hue value interval, the comparison results of the saturation value with the preset saturation interval, and the comparison results of the color-lightness value with the preset color-lightness interval.
[0093] For example, assuming that the preset template set includes a black template, a light gray template, a dark gray template, a light red template, a dark red template, a light orange template, a dark orange template, a light green template, a dark green template, etc., Figure 3 A schematic diagram showing the matching relationship between the first color information and the target template according to an embodiment of the present application is shown. Figure 3 As shown, first determine whether the object image is color or neutral.
[0094] If it is determined to be a neutral color and the V value is less than V1, the black template is matched.
[0095] If it is determined to be a neutral color and the S value is less than S1, when the V value is in the interval of (V2, V3], the light gray template is matched; when the V value is in the interval of [V1, V2], the dark gray template is matched.
[0096] If it is determined to be colored, then:
[0097] When the H value is in the interval [H1, H2], the red template is matched. Furthermore, if the S value is less than S2 and V is greater than V4, the light red template is matched, otherwise the dark red template is matched.
[0098] When the H value is in the interval of (H2, H3], the orange template is matched. Furthermore, if the S value is less than S2 and V is greater than V4, the light orange template is matched, otherwise the dark orange template is matched.
[0099] When the H value is in the interval of (H3, H4], the green template is matched. Further, if the S value is less than S2 and V is greater than V4, the light green template is matched, otherwise the dark green template is matched.
[0100] Among them, V1, V2, V3, and V4 are all natural numbers from 0 to 100, and V1<V2<V4<V3; S1 and S2 are natural numbers from 0 to 100, and S1<S2; H1, H2, H3, and H4 are natural numbers from 0 to 360, and H1<H2<H3<H4.
[0101] The embodiment of the present application matches the target template according to the comparison results of the H value, S value and V value with the preset interval, so that the target template can be matched with the real object image, thereby improving the display effect of the display page.
[0102] In some embodiments of the present application, the generating method further includes:
[0103] The target rendering element is sent to the target terminal so that the target terminal renders and displays the object display page.
[0104] In the embodiment of the present application, after the target rendering element is generated, the target rendering element is sent to the target terminal, and the target terminal renders and displays the generated object display page according to the received target rendering element. Figure 4 A schematic diagram of an object display page according to an embodiment of the present application is shown. Figure 4 As shown, the object display page 400 includes an object image 402. The image elements of the object display page 400 are consistent with the color, color depth, color brightness and other styles of the object image, which can effectively improve the display effect of the object display page.
[0105] The object display page generation method provided in the embodiment of the present application can be executed by a device for generating an object display page. In the embodiment of the present application, the method for generating an object display page by a device for generating an object display page is taken as an example to illustrate the device for generating an object display page provided in the embodiment of the present application.
[0106] In some embodiments of the present application, a device for generating an object display page is provided. Figure 5 A structural block diagram of a device for generating an object display page according to an embodiment of the present application is shown. Figure 5 As shown, the object display page generation device 500 includes:
[0107] A determination module 502, configured to determine a target template according to first color information of an object image of an object to be displayed in a first color space;
[0108] The generating module 504 is used to generate a target rendering element associated with the object to be displayed according to the object image and the target template, and the target rendering element is used to instruct the target terminal to render an object display page of the object to be displayed according to the target rendering element.
[0109] The embodiment of the present application matches the most suitable target template based on the first color information that can reflect the color, color depth and brightness of the original object to be displayed, and generates an object display page for the object to be displayed through the target template, which can make the display elements of the object display page more matched with the object image of the object to be displayed, thereby improving the display effect of the object display page.
[0110] In some embodiments of the present application, the first color space is an HSV color space or an HSL color space.
[0111] In the embodiment of the present application, the HSV color space and the HSL color space retain the color information of the original object to be displayed while also retaining the color depth information and brightness information. Therefore, by matching the target template through the first color information under the HSV color space or the HSL color space, the display elements of the object display page can be more closely matched with the object image of the object to be displayed, thereby improving the display effect of the object display page.
[0112] In some embodiments of the present application, the object image includes a target image area, the object display page includes a target display area, the target image area corresponds to the target display area, and the first color information corresponds to the target image area.
[0113] The embodiment of the present application matches the first color information according to a specific target image area in the object image, so that the target template obtained by matching the first color information is consistent with the color style of the original object to be displayed, so that the final object display page can meet the display requirements.
[0114] In some embodiments of the present application, the determination module is specifically used to:
[0115] Determine the RGB value of each pixel in the target image area to obtain multiple RGB values;
[0116] Determine the number of pixels corresponding to each RGB value in a plurality of RGB values;
[0117] Determine second color information according to the target RGB value with the largest number of corresponding pixels, where the second color information is color information in the RGB color space;
[0118] The first color information is determined according to the second color information.
[0119] The embodiment of the present application determines the first color information of the target image area according to the RGB value with the largest number of pixels, which can improve the color matching degree between the matched target template and the color of the object image actually to be displayed, and improve the display effect of the object display page.
[0120] In some embodiments of the present application, the RBG value includes a red intensity value, a blue intensity value, and a green intensity value;
[0121] The processing module is specifically used to: normalize the red intensity value, the blue intensity value and the green intensity value; determine the corresponding hue value, saturation value and color lightness value according to the normalized red intensity value, the blue intensity value and the green intensity value; determine the first color information according to the hue value, the saturation value and the color lightness value, and the first color information is the color information in the HSV color space or the HSL color space.
[0122] The embodiment of the present application converts color information in the RGB color space into color information in the HSV color space. The obtained first color information can intuitively express the hue, vividness, and brightness of the color. By matching the target template with the first color information, the target template can be matched with the actual object image to be displayed, thereby improving the display effect of the object display page.
[0123] In some embodiments of the present application, the determination module is also used to determine the target template in the preset template set based on the comparison results of the hue value with the preset hue value range, the comparison results of the saturation value with the preset saturation value interval, and the comparison results of the lightness value with the preset lightness value interval.
[0124] The embodiment of the present application matches the target template according to the comparison results of the H value, S value and V value with the preset interval, so that the target template can be matched with the real object image, thereby improving the display effect of the display page.
[0125] In some embodiments of the present application, the object display page generation device further includes:
[0126] The sending module is used to send the target rendering element to the target terminal so that the target terminal can render and display the object display page.
[0127] In an embodiment of the present application, after the target rendering element is generated, the target rendering element is sent to the target terminal so that the target terminal renders and displays the generated object display page. The image elements of the object display page are consistent with the color, color depth, color brightness and other styles of the object image, which can effectively improve the display effect of the object display page.
[0128] The object display page generation device in the embodiment of the present application can be an electronic device, or a component in the electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or it can be other devices other than the terminal. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, a car electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmented reality, AR) / virtual reality (virtual reality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc., and can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.
[0129] The object display page generation device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.
[0130] The object display page generation device provided in the embodiment of the present application can implement each process implemented in the above method embodiment. To avoid repetition, it will not be repeated here.
[0131] Optionally, an embodiment of the present application further provides an electronic device, Figure 6 A structural block diagram of an electronic device according to an embodiment of the present application is shown. Figure 6 As shown, the electronic device 600 includes a processor 602, a memory 604, and a program or instruction stored in the memory 604 and executable on the processor 602. When the program or instruction is executed by the processor 602, each process of the above-mentioned method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.
[0132] It should be noted that the electronic devices in the embodiments of the present application include the above-mentioned mobile electronic devices and non-mobile electronic devices.
[0133] Figure 7 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of the present application.
[0134] The electronic device 700 includes but is not limited to: a radio frequency unit 701, a network module 702, an audio output unit 703, an input unit 704, a sensor 705, a display unit 706, a user input unit 707, an interface unit 708, a memory 709, a processor 710 and other components.
[0135] Those skilled in the art will appreciate that the electronic device 700 may also include a power source (such as a battery) for supplying power to each component, and the power source may be logically connected to the processor 710 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Figure 7 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.
[0136] Among them, the processor 710 is used to determine the target template according to the first color information of the object image of the object to be displayed in the first color space; generate a target rendering element associated with the object to be displayed according to the object image and the target template, and the target rendering element is used to instruct the target terminal to render the object display page of the object to be displayed according to the target rendering element.
[0137] The embodiment of the present application matches the most suitable target template based on the first color information that can reflect the color, color depth and brightness of the original object to be displayed, and generates an object display page for the object to be displayed through the target template, which can make the display elements of the object display page more matched with the object image of the object to be displayed, thereby improving the display effect of the object display page.
[0138] Optionally, the first color space is an HSV color space or an HSL color space.
[0139] In the embodiment of the present application, the HSV color space and the HSL color space retain the color information of the original object to be displayed while also retaining the color depth information and brightness information. Therefore, by matching the target template through the first color information under the HSV color space or the HSL color space, the display elements of the object display page can be more closely matched with the object image of the object to be displayed, thereby improving the display effect of the object display page.
[0140] Optionally, the object image includes a target image area, the object display page includes a target display area, the target image area corresponds to the target display area, and the first color information corresponds to the target image area.
[0141] The embodiment of the present application matches the first color information according to a specific target image area in the object image, so that the target template obtained by matching the first color information is consistent with the color style of the original object to be displayed, so that the final object display page can meet the display requirements.
[0142] Optionally, the processor 710 is also used to determine the RGB value of each pixel in the target image area to obtain multiple RGB values; determine the number of pixels corresponding to each RGB value in the multiple RGB values; determine the second color information based on the target RGB value with the largest number of corresponding pixels, the second color information being the color information in the RGB color space; and determine the first color information based on the second color information.
[0143] The embodiment of the present application determines the first color information of the target image area according to the RGB value with the largest number of pixels, which can improve the color matching degree between the matched target template and the color of the object image actually to be displayed, and improve the display effect of the object display page.
[0144] Optionally, the RBG value includes a red intensity value, a blue intensity value, and a green intensity value;
[0145] Processor 710 is also used to normalize the red intensity value, the blue intensity value and the green intensity value; determine the corresponding hue value, saturation value and color-lightness value according to the normalized red intensity value, the blue intensity value and the green intensity value; determine the first color information according to the hue value, the saturation value and the color-lightness value, and the first color information is color information in the HSV color space or the HSL color space.
[0146] The embodiment of the present application converts color information in the RGB color space into color information in the HSV color space. The obtained first color information can intuitively express the hue, vividness, and brightness of the color. By matching the target template with the first color information, the target template can be matched with the actual object image to be displayed, thereby improving the display effect of the object display page.
[0147] Optionally, the processor 710 is further used to determine a target template in a preset template set based on a comparison result between a hue value and a preset hue value range, a comparison result between a saturation value and a preset saturation value interval, and a comparison result between a lightness value and a preset lightness value interval.
[0148] The embodiment of the present application matches the target template according to the comparison results of the H value, S value and V value with the preset interval, so that the target template can be matched with the real object image, thereby improving the display effect of the display page.
[0149] Optionally, the label template includes a target rendering element, and the target rendering element corresponds to the target display area;
[0150] Optionally, the display unit 706 is configured to send the target rendering element to the target terminal, so that the target terminal renders and displays the object display page.
[0151] In an embodiment of the present application, after the target rendering element is generated, the target rendering element is sent to the target terminal so that the target terminal renders and displays the generated object display page. The image elements of the object display page are consistent with the color, color depth, color brightness and other styles of the object image, which can effectively improve the display effect of the object display page.
[0152] It should be understood that in the embodiment of the present application, the input unit 704 may include a graphics processor (Graphics Processing Unit, GPU) 7041 and a microphone 7042, and the graphics processor 7041 processes the image data of the static picture or video obtained by the image capture device (such as a camera) in the video capture mode or the image capture mode. The display unit 706 may include a display panel 7061, and the display panel 7061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 707 includes a touch panel 7071 and at least one of other input devices 7072. The touch panel 7071 is also called a touch screen. The touch panel 7071 may include two parts: a touch detection device and a touch controller. Other input devices 7072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.
[0153] The memory 709 can be used to store software programs and various data. The memory 709 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory 709 may include a volatile memory or a non-volatile memory, or the memory 709 may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM) and a direct memory bus random access memory (DRRAM). The memory 709 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.
[0154] The processor 710 may include one or more processing units; optionally, the processor 710 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor 710.
[0155] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the various processes of the above-mentioned method embodiment are implemented and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0156] The processor is the processor in the electronic device in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0157] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface and the processor are coupled, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0158] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0159] An embodiment of the present application provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the above-mentioned method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0160] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0161] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods of each embodiment of the present application.
[0162] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. A method for generating an object display page, characterized in that: include: Determine a target template according to first color information of an object image of an object to be displayed in a first color space; A target rendering element associated with the object to be displayed is generated according to the object image and the target template, and the target rendering element is used to instruct a target terminal to render an object display page of the object to be displayed according to the target rendering element.
2. The generation method according to claim 1, characterized in that: The first color space is an HSV color space or an HSL color space.
3. The generation method according to claim 1, characterized in that: The object image includes a target image area, the object display page includes a target display area, the target image area corresponds to the target display area, and the first color information corresponds to the target image area.
4. The generation method according to claim 3, characterized in that: Before the step of determining the target template according to the first color information of the object image of the object to be displayed in the first color space, the method further includes: Determine the RGB value of each pixel in the target image area to obtain multiple RGB values; Determine the number of pixels corresponding to each RGB value in the plurality of RGB values; Determine second color information according to the target RGB value with the largest number of corresponding pixels, where the second color information is color information in the RGB color space; The first color information is determined according to the second color information.
5. The generation method according to claim 4, characterized in that: The RBG value includes a red intensity value, a blue intensity value and a green intensity value; The step of determining the first color information according to the second color information comprises: Normalizing the red intensity value, the blue intensity value, and the green intensity value; Determine the corresponding hue value, saturation value and color brightness value according to the normalized red intensity value, the blue intensity value and the green intensity value; The first color information is determined according to the hue value, the saturation value, and the color lightness value, and the first color information is color information in an HSV color space or an HSL color space.
6. The generation method according to claim 5, characterized in that: The step of determining a target template according to first color information of an object image of an object to be displayed in a first color space comprises: The target template is determined in a preset template set according to the comparison result of the hue value with a preset hue value range, the comparison result of the saturation value with a preset saturation value interval, and the comparison result of the color lightness value with a preset color lightness value interval.
7. The generation method according to any one of claims 1 to 6, characterized in that: The generating method further comprises: The target rendering element is sent to the target terminal, so that the target terminal renders and displays the object display page.
8. A device for generating an object display page, characterized in that: include: A determination module, configured to determine a target template according to first color information of an object image of an object to be displayed in a first color space; A generating module is used to generate a target rendering element associated with the object to be displayed according to the object image and the target template, wherein the target rendering element is used to instruct a target terminal to render an object display page of the object to be displayed according to the target rendering element.
9. An electronic device, characterized in that: It comprises a processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the method for generating an object display page as described in any one of claims 1 to 7 are implemented.
10. A readable storage medium, characterized in that: The readable storage medium stores a program or an instruction, and when the program or the instruction is executed by the processor, the steps of the method for generating an object display page according to any one of claims 1 to 7 are implemented.
