Image display method, device, electronic device and readable medium
By traversing the pixel points of the base image, determining the area to be displayed and scaling the image, the problem of mismatched product image display in web design is solved, and adaptive display that automatically adapts to the base image area is realized.
Patent Information
- Application Number
- CN201810813973.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2018-07-23
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2038-07-23
AI Technical Summary
In the existing technology, in web design, the display method of product images in the base map is limited, it cannot be automatically scaled to adapt to the size of the display area of the base map, and the position of the display area in the base map is limited.
By obtaining the pixels of the base map and integrating them into a pixel array, multiple horizontal lines and vertical axes of the area to be displayed are determined, lines that do not meet the conditions are eliminated, the vertex comparison method is used to determine the area to be displayed, and the target image is scaled according to this area. deal with.
It realizes the automatic acquisition of the position of the display area in the base map, automatically scales the image to fit the base map area, solves the problem of unclear display area position and mismatched image size, and provides a one-click adaptive display solution for product images.
Smart Images

Figure CN110825989B
Abstract
Description
Technical Field
[0001] The present application relates to the field of Internet technology, and in particular to a picture display method, device, electronic device and computer-readable medium. Background Art
[0002] With the intelligent development of Internet technology, in web design, the method of displaying product images on the base map is increasingly required to be implemented intelligently. Especially when the position of the display area in the base map is not clearly stated, the method of displaying the product images to be displayed in the base map needs to be improved. The existing implementation methods can be divided into the following two types: fixing the display area of the base map, selecting product images of the same size as the display area in the base map for display; or directly displaying the product image in full screen. If the produced product image is larger than the base map, it will directly cover the base map. The above two methods have the following technical defects:
[0003] (1) Limits the location of the display area within the base map.
[0004] (2) The product image cannot be automatically scaled to fit the base image display area. Summary of the invention
[0005] In view of this, the present application provides a picture display method, device, electronic device and computer-readable medium, which can automatically obtain the display area position in the base map and scale the target picture so that its size is adapted to the display area of the base map.
[0006] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the present application.
[0007] According to a first aspect of an embodiment of the present application, a method for displaying an image is proposed, the method comprising: obtaining a target image and a base map to be displayed; traversing the pixels of the base map to be displayed to determine an area to be displayed on the base map to be displayed based on the pixels; performing size processing on the target image based on the area to be displayed; and displaying the target image after size processing on the base map to be displayed.
[0008] In an exemplary embodiment of the present application, obtaining the target image and the base map to be displayed includes: obtaining the target image and the base map to be displayed according to the paths of the target image and the base map to be displayed, wherein the path is an HTML path.
[0009] In an exemplary embodiment of the present application, traversing the pixels of the base map to be displayed to determine the area to be displayed on the base map to be displayed based on the pixels includes: obtaining pixel points of the base map to be displayed; integrating the pixel points into a pixel array through a three-primary color space; and determining the area to be displayed on the base map to be displayed through the color of each element in the pixel array.
[0010] In an exemplary embodiment of the present application, determining the area to be displayed on the base map to be displayed through the color of each element in the pixel array includes: determining multiple horizontal lines and multiple vertical axis lines on the base map to be displayed through the color of each element in the pixel array; determining two horizontal lines and two vertical axis lines from the multiple horizontal lines and the multiple vertical axis lines; and determining the area to be displayed based on the two horizontal lines and the two vertical axis lines.
[0011] In an exemplary embodiment of the present application, determining two horizontal lines and two longitudinal axes from the multiple horizontal lines and the multiple longitudinal axes includes: eliminating horizontal lines and / or longitudinal axes that do not meet a length threshold from the multiple horizontal lines and the multiple longitudinal axes; eliminating horizontal lines and / or longitudinal axes that do not meet color requirements from the multiple horizontal lines and the multiple longitudinal axes; and eliminating horizontal lines and / or longitudinal axes that do not meet a length range from the multiple horizontal lines and the multiple longitudinal axes.
[0012] In an exemplary embodiment of the present application, determining two horizontal lines and two longitudinal axis lines from the plurality of horizontal lines and longitudinal axis lines further comprises: determining two horizontal lines and two longitudinal axis lines by a vertex comparison method.
[0013] In an exemplary embodiment of the present application, it further includes: when the to-be-displayed area cannot be determined, directly displaying the target image on the to-be-displayed base map.
[0014] According to the second aspect of an embodiment of the present application, a picture display device is proposed, which includes: an acquisition module, used to acquire a target picture and a base map to be displayed; a traversal module, used to traverse the pixels of the base map to be displayed to determine the to-be-displayed area on the base map to be displayed based on the pixels; a processing module, used to size the target picture according to the to-be-displayed area; and a display module, used to display the target picture after size processing on the base map to be displayed.
[0015] According to the third aspect of an embodiment of the present application, an electronic device is proposed, which includes: one or more processors; a storage device for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors implement any of the above-mentioned picture display methods.
[0016] According to a fourth aspect of an embodiment of the present application, a computer-readable medium is provided, on which a computer program is stored, wherein when the program is executed by a processor, the image display method as described in any one of the above items is implemented.
[0017] According to the image display method, device, electronic device and computer-readable medium of the present application, it is possible to automatically obtain the display area position in the base map, and scale the target image so that its size fits the display area of the base map.
[0018] It is to be understood that the foregoing general description and the following detailed description are exemplary only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present application, and together with the specification are used to explain the principles of the present application. The drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0020] Figure 1 The present invention is a system block diagram showing a method and device for displaying pictures according to an exemplary embodiment.
[0021] Figure 2 The figure is a flowchart of a method for displaying a picture according to an exemplary embodiment.
[0022] Figure 3 The figure is a flowchart of a method for displaying a picture according to an exemplary embodiment.
[0023] Figure 4 The figure is a flowchart of a method for displaying a picture according to an exemplary embodiment.
[0024] Figure 5 The figure is a flowchart of a method for displaying a picture according to an exemplary embodiment.
[0025] Figure 6 The figure is a flowchart of a picture display method according to another exemplary embodiment.
[0026] Figure 7 This is an example diagram showing a method for displaying a picture according to another exemplary embodiment.
[0027] Figure 8 The figure is a block diagram of a picture display device according to an exemplary embodiment.
[0028] Fig. 9 It is a block diagram of an electronic device for picture display according to another exemplary embodiment. DETAILED DESCRIPTION
[0029] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that the present invention will be comprehensive and complete and fully convey the concepts of the example embodiments to those skilled in the art. The same reference numerals in the figures represent the same or similar parts, and thus their repeated description will be omitted.
[0030] The described features, structures or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present invention. However, those skilled in the art will appreciate that the technical solution of the present invention may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known methods, devices, implementations or operations are not shown or described in detail to avoid blurring various aspects of the present invention.
[0031] The accompanying drawings are only schematic illustrations of the present invention, and the same reference numerals in the drawings represent the same or similar parts, so their repeated description will be omitted. Some block diagrams shown in the accompanying drawings do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0032] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and steps, nor must they be executed in the order described. For example, some steps can be decomposed, and some steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0033] Exemplary embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0034] Figure 1 The present invention is a system block diagram showing a method and device for displaying pictures according to an exemplary embodiment.
[0035] The server 105 may be a server that provides various services, such as a background management server (only for example) that provides support for the picture display system operated by the user using the terminal devices 101, 102, and 103. The background management server may analyze and process the received picture display request and other data, and feed back the processing results (such as the coordinates of the area to be displayed, the zoom ratio of the target picture - only for example) to the terminal device.
[0036] The server 105 may, for example, obtain a target image and a base map to be displayed; the server 105 may, for example, traverse the pixels of the base map to be displayed to determine the area to be displayed on the base map to be displayed according to the pixels; the server 105 may, for example, perform size processing on the target image according to the area to be displayed; the server 105 may, for example, display the target image after size processing on the base map to be displayed. The server 105 may, for example, display the target image directly on the base map to be displayed when the area to be displayed cannot be determined.
[0037] The server 105 may be a physical server, or may be composed of a plurality of servers, a part of the server 105 may be used as the image display task submission system in the present application, for obtaining the task to execute the image display command; and a part of the server 105 may be used as the image display system in the present application, for traversing the pixels of the base map to be displayed, so as to determine the area to be displayed on the base map to be displayed according to the pixels; perform size processing on the target image according to the area to be displayed; and display the target image after size processing on the base map to be displayed.
[0038] It should be noted that the method for displaying pictures provided in the embodiment of the present application can be executed by the server 105, and accordingly, the apparatus for displaying pictures can be arranged in the server 105. The request end provided to the user for submitting picture display tasks and obtaining picture display results is generally located in the terminal devices 101, 102, and 103.
[0039] Figure 2 is a flowchart of a method for displaying pictures according to an exemplary embodiment. Figure 2 The method for displaying an image shown can automatically obtain the position of the display area in the base map, and scale the target image so that its size fits the display area of the base map.
[0040] Next, we will refer to Figure 2 , the picture display method in the exemplary embodiment of the present application is explained.
[0041] In step S210, the target image and the base map to be displayed are obtained. The base map refers to the background image placed at the bottom of multiple layers during the mapping process. After the base map is obtained, the elements related to it, i.e., the data sets, can be orderly superimposed on the base map in the form of layers. The base map to be displayed can be a background image used in an online shopping page, or a background image for a poster for advertising, etc., and this application does not make special restrictions on this. The target image is the image object that will be superimposed on the base map in the form of layers.
[0042] According to an example embodiment, the target image and the base map to be displayed can be obtained according to the path of the target image and the base map to be displayed, and the path is an HTML path. Among them, the HTML path can record the storage location of an object (text, picture, video, etc. in any format) on the Internet in the server. In this application, the HTML path can be used to record the storage path of the target image and the base map to be displayed.
[0043] In step S220, the pixels of the base image to be displayed are traversed to determine the area to be displayed on the base image to be displayed according to the pixels. Pixels refer to the smallest unit or smallest element that constitutes an image. Each smallest element has a clear position and an assigned color value, and the color and position of these smallest elements will determine the appearance of the image.
[0044] According to an exemplary embodiment, step S220 may include: obtaining pixel points of the base map to be displayed; integrating the pixel points into a pixel array through the three-primary color space; and determining the area to be displayed on the base map to be displayed by the color of each element in the pixel array. The three-primary color space may adopt the color space of the RGB model or the color space of the RGBA model, and the present invention does not specifically limit this. RGB represents the three colors of red, green, and blue, which almost include all the colors that can be perceived by human vision and are one of the most widely used color systems. RGBA adds an additional Alpha parameter, i.e., opacity, to the RGB model. If the alpha channel value of a pixel is 0%, it is completely transparent (i.e., invisible), while a value of 100% means a completely opaque pixel (traditional digital image). Values between 0% and 100% allow the pixel to be displayed through the background, just like through glass (translucency), an effect that cannot be achieved by simple binary transparency (transparent or opaque). It makes digital synthesis easy. Catmull and Smith proposed this indispensable alpha value between 1971 and 1972, making alpha rendering and alpha compositing possible.
[0045] According to an example embodiment, determining the area to be displayed on the base map to be displayed by the color of each element in the pixel array may include: determining multiple horizontal lines and multiple vertical axis lines on the base map to be displayed by the color of each element in the pixel array; determining two horizontal lines and two vertical axis lines from the multiple horizontal lines and the multiple vertical axis lines; and determining the area to be displayed according to the two horizontal lines and the two vertical axis lines. Among them, the area to be displayed can be a rectangular range defined by a rectangular frame. When searching for the area to be displayed in reverse, the rectangular frame can be found by searching for the two horizontal lines and two vertical axis lines that constitute the rectangular frame. When the color of the rectangular frame lines is fixed, the relevant content can be configured in the configuration file. When determining multiple horizontal lines and multiple vertical axis lines on the base map to be displayed by the color of each primary color in the pixel array, it is only necessary to find the specified RGBA color value.
[0046] According to an exemplary embodiment, determining two horizontal lines and two longitudinal axes from a plurality of horizontal lines and longitudinal axes includes: removing horizontal lines and / or longitudinal axes that do not meet the length threshold from a plurality of horizontal lines and longitudinal axes; removing horizontal lines and / or longitudinal axes that do not meet the color requirements from a plurality of horizontal lines and longitudinal axes; and removing horizontal lines and / or longitudinal axes that do not meet the length range from a plurality of horizontal lines and longitudinal axes. Among them, in addition to the rectangular frame for marking the area to be displayed, there may be other horizontal lines and / or longitudinal axes used to draw other patterns in the base map, but they are all considered to be possible borders of the area to be displayed. Therefore, it is necessary to remove interfering lines by a certain method. For example, it is possible to consider removing horizontal lines and / or longitudinal axes that do not meet the length threshold (i.e., the length is too short); it is possible to consider removing lines whose colors are different from other horizontal lines and / or longitudinal axes; it is possible to consider removing lines whose lengths are different from other horizontal lines and / or longitudinal axes within the length error range. When the line color of the rectangular frame of the area to be displayed is determined, it is not necessary to remove lines whose colors are different from other horizontal lines and / or longitudinal axes. After elimination, one or more pairs of horizontal lines and / or vertical axis lines with the same color, length or height (or within the allowable error range) can be obtained.
[0047] According to an exemplary embodiment, determining two horizontal lines and two longitudinal axes from a plurality of horizontal lines and longitudinal axes further comprises: determining the two horizontal lines and two longitudinal axes by a vertex comparison method. The vertex comparison method refers to confirming the area to be displayed by comparing whether the respective endpoints of a plurality of pairs of horizontal lines and / or longitudinal axes are the same. For example, when facing a pair of horizontal lines a and b, and a pair of longitudinal axes c and d, when it is confirmed by comparison that the left endpoint of a is the same as the upper endpoint of c, and the right endpoint of b is the same as the lower endpoint of d, it can be confirmed that the four lines can form the area to be displayed.
[0048] In step S230, the target image is resized according to the area to be displayed. When the area to be displayed is determined, the size of the area to be displayed, such as length and width, can be obtained. Then the target image is scaled to the size of the area to be displayed so that it can just fit into the area to be displayed.
[0049] In step S240, the target image after size processing is displayed on the displayed base image.
[0050] According to an example embodiment, when the area to be displayed cannot be determined, the target image is directly displayed on the base map to be displayed. When the lines that can form the area to be displayed cannot be found, the existing technology can be directly used to display the image directly on the base map.
[0051] According to the image display method of the present application, by traversing the base map to be displayed, determining the area to be displayed, and processing the target image according to the size of the area to be displayed, the position of the display area in the base map can be automatically obtained, and the target image can be scaled so that its size is adapted to the display area of the base map.
[0052] Figure 3 is a flowchart of a method for displaying a picture according to an exemplary embodiment. Figure 3 , the image display methods can include:
[0053] Step S310, obtaining the pixel points of the base map to be displayed. The pixel points can be in RGB color mode or RGBA color mode. The specific color mode can be obtained by judging the image information.
[0054] Step S320, integrate the pixels into a pixel array through the three-primary color space. The pixel is the smallest square that the image can be divided into. The arrangement of the pixels in the image can be regarded as a two-dimensional pixel array with the pixels as elements. The number of rows of the pixel array is the same as the number of pixels arranged on the vertical axis of the image to be displayed, and the number of columns is the same as the number of pixels arranged on the horizontal axis of the image to be displayed.
[0055] Step S330, determine the area to be displayed on the base map to be displayed by the color of each element in the pixel array. Each element in the pixel array can record the three primary colors (RGB) color value or the three primary colors and transparency (RGBA) value of its corresponding pixel point. When the base map to be displayed is in other formats or is more complex, the specific parameters in the array element shall be based on the specific parameters of the pixel points of the base map to be displayed obtained in step S310.
[0056] Figure 4 is a flowchart of a method for displaying a picture according to an exemplary embodiment. Figure 4 , the image display methods can include:
[0057] Step S410: Determine multiple horizontal lines and multiple vertical axes on the base map to be displayed based on the color of each element in the pixel array. Herein, the area to be displayed may be a rectangular frame represented by a specified color. By searching for the horizontal or vertical axes of the specified color, a set of horizontal and vertical axes that form the rectangular frame can be obtained.
[0058] Step S420: Determine two horizontal lines and two vertical axes from the multiple horizontal lines and multiple vertical axes. The lines obtained in Step S410 may include interfering lines. Among them, in addition to the rectangular frame marking the area to be displayed in the base map, there may be other horizontal and / or vertical axes for drawing other patterns, but they are all considered as possible borders of the area to be displayed. Therefore, it is necessary to remove the interfering lines by a certain method.
[0059] According to the exemplary embodiment, two horizontal lines and two vertical axes can be determined by the vertex comparison method. The vertex comparison method determines two horizontal lines and two vertical axes by comparing whether the vertices of multiple pairs of horizontal lines and multiple pairs of vertical axes coincide (or within the allowable error range). For example, when facing a pair of horizontal lines a, b and a pair of vertical axes c, d, when it is confirmed by comparison that the left endpoint of a is the same as the upper endpoint of c and the right endpoint of b is the same as the lower endpoint of d, it can be confirmed that these four lines can form the area to be displayed. However, the technical solution of the present invention is not limited thereto, and the left and right endpoints of a, b can also be sequentially compared with the upper and lower endpoints of c, d to determine two horizontal lines and two vertical axes.
[0060] Step S430: Determine the area to be displayed according to the two horizontal lines and two vertical axes.
[0061] Figure 5 is a flowchart of a picture display method shown according to an exemplary embodiment. Refer to Figure 5 , the picture display method may include:
[0062] Step S510: Remove the horizontal and / or vertical axes that do not meet the length threshold from the multiple horizontal lines and multiple vertical axes. For example, when the horizontal line set contains 3 horizontal lines, one of the horizontal lines may be the character "one" drawn in the base map. Since its length is too small, this horizontal line can be removed. The processing method for the vertical axis set is the same, but it should be understood that this is only an example, and the technical solution of the present invention is not limited thereto.
[0063] Step S520, horizontal lines and / or vertical axis lines that do not meet the color requirements are eliminated from the plurality of horizontal lines and the plurality of vertical axis lines. For example, when the horizontal line set includes three horizontal lines, two of which have the same color, and the other horizontal line has a different color from the two horizontal lines, the other horizontal line with a different color can be eliminated. The vertical axis line set is processed in the same way, but it should be understood that this is only an example, and the technical solution of the present invention is not limited to this.
[0064] Step S530, horizontal lines and / or longitudinal axis lines that do not meet the length range are eliminated from the plurality of horizontal lines and the plurality of longitudinal axis lines. For example, when the horizontal line set includes three horizontal lines, two of which have the same length (or within the allowable error range), and the other has a length significantly greater than the above two horizontal lines, the horizontal line with the longest length can be eliminated. The longitudinal axis line set is processed in the same manner, but it should be understood that this is only an example, and the technical solution of the present invention is not limited to this.
[0065] Figure 6 The figure is a flowchart of a picture display method according to another exemplary embodiment. Figure 6 The display method can be written as a javascript script. When using it, developers only need to introduce the javascript script and add new special attributes when using tags such as img to display the base image and product image on the page. Among them, JavaScript is a literal scripting language, a dynamic type, weak type, prototype-based language, and built-in support type. Figure 6 , the image display methods can include:
[0066] Step S610, obtaining the base image to be displayed and the target image, which can be obtained through the base image to be displayed and the target image path (HTML relative path) of the current page, of course, HTML absolute path can also be used, and the present invention does not make special restrictions on this.
[0067] Step S620, obtaining a pixel array of the base image to be displayed. The pixel array of this embodiment is in RGBA color mode, or it can be in RGB color mode, but the present invention is not limited thereto. The number of rows and columns of the pixel array is based on the width and height of the base image to be displayed.
[0068] Step S630, determining whether RGBA is specified in the configuration file. The configuration file may also specify an approximate appearance range of a to-be-displayed area, or the line thickness of a border of the to-be-displayed area, etc., but the present invention is not limited thereto.
[0069] Step S640, when RGBA is specified, obtain the coordinates, width and height sets of the horizontal and vertical axis lines of the specified RGBA. For example, with the upper left corner of the base map to be displayed as the origin, traverse the entire two-dimensional pixel array, and obtain each straight line or dotted line Horizontal:[[x,y,width,height],…] (upper left corner coordinates and width, height) on the horizontal axis and each straight line or dotted line Vertical:[[x,y,width,height],…] (upper left corner coordinates and width, height) on the vertical axis.
[0070] Step S650, when RGBA is not specified, obtain the coordinates, width and height sets of all horizontal and vertical axis lines. For example, with the upper left corner of the base map to be displayed as the origin, traverse the entire two-dimensional pixel array, and obtain each straight line or dotted line on the horizontal axis Horizontal: [[x, y, width, height, rgba], ...] (upper left corner coordinates and width, height, rgba), and each straight line or dotted line on the vertical axis Vertical: [[x, y, width, height, rgba], ...] (upper left corner coordinates and width, height, rgba).
[0071] In step S640 and step S650, when a set of horizontal lines and a set of vertical axis lines are obtained, interference lines can be removed by a certain method. For example, for the horizontal line, if the width is too small, the set of data is directly discarded; for another example, for the vertical axis, if the height is too small, the set of data is directly discarded. For another example, 3. The generated new arrays Horizontal and Vertical are processed separately, and only two sets of values with the same color and equal width and height values or within the allowable error range are retained in the same array.
[0072] Step S660, compare the multiple groups of horizontal lines obtained in step S640 or S650 with the multiple groups of vertical axis lines, and the aforementioned vertex comparison method may be used. For example, in Horizontal, a:[x1,y1,width,height,rgba] matches b:[x2,y2,width,height,rgba], and in Vertical, c:[x3,y3,width,height,rgba] matches d:[x4,y4,width,height,rgba]); then compare the upper left corner coordinates of a and c, and obtain the lower right corner coordinates of c and d for comparison; as long as it is proved that the two are the same, or are within the allowable error range (that is, the two points of the diagonal are determined), it can be confirmed that the four lines form the designated display area. The schematic diagram is as follows Figure 7 shown.
[0073] Step S670, when the matching in step S660 is successful, the target image can be scaled according to the size of the area to be displayed, so that the target image can be automatically displayed in the designated area of the base image to be displayed.
[0074] Step S670: When the matching in step S660 fails, it is considered that the to-be-displayed area is not specified in the to-be-displayed base map. At this time, the target image is directly displayed in the to-be-displayed base map without any processing.
[0075] According to the image display method of the present application, the position of the selected area of the base map to be displayed can be obtained by automatically obtaining, accurately, reasonably and quickly matching according to the image pixels, so as to set the size ratio of the target image display and the display position relative to the page. In summary, the image display method of the present application realizes a one-click adaptive display solution for product images while still maintaining the independence of the product image and the base map. That is, the display area position outlined in the base map is automatically obtained, and the product image is automatically scaled to be displayed in the specified area of the base map.
[0076] Figure 8 is a block diagram of a picture display device according to an exemplary embodiment. Figure 8 The picture display device may include: an acquisition module 810, a traversal module 820, a processing module 830 and a display module 840.
[0077] In the image display device, the acquisition module 810 is used to acquire the target image and the base image to be displayed. For example, the target image and the base image to be displayed can be acquired according to their HTML paths.
[0078] The traversal module 820 is used to traverse the pixels of the base map to be displayed to determine the area to be displayed on the base map to be displayed according to the pixels. The pixel mode of the base map to be displayed can be, for example, a three-primary color (RGB) color space mode, or can be, for example, a three-primary color and opacity (RGBA) color space mode. The present application is not limited thereto.
[0079] According to an example embodiment, the traversal module 820 can be used to obtain pixel points of the base map to be displayed; the traversal module 820 can be used to integrate the pixel points into a pixel array through a three-primary color space; the traversal module 820 can be used to determine the area to be displayed on the base map to be displayed through the color of each element in the pixel array.
[0080] According to an example embodiment, when the traversal module 820 determines the area to be displayed on the base map to be displayed by the color of each element in the pixel array, it can be used to determine multiple horizontal lines and multiple vertical axis lines on the base map to be displayed by the color of each element in the pixel array; the traversal module 820 can also be used to determine two horizontal lines and two vertical axis lines from the multiple horizontal lines and the multiple vertical axis lines. The traversal module 820 can also be used to determine the area to be displayed according to the two horizontal lines and the two vertical axis lines.
[0081] According to an example embodiment, when the traversal module 820 determines two horizontal lines and two longitudinal axes from a plurality of horizontal lines and a plurality of longitudinal axes, it can be used to remove horizontal lines and / or longitudinal axes that do not meet a length threshold from the plurality of horizontal lines and a plurality of longitudinal axes. The traversal module 820 can also be used to remove horizontal lines and / or longitudinal axes that do not meet a color requirement from the plurality of horizontal lines and a plurality of longitudinal axes. The traversal module 820 can also be used to remove horizontal lines and / or longitudinal axes that do not meet a length range from the plurality of horizontal lines and a plurality of longitudinal axes.
[0082] According to an exemplary embodiment, the traversal module 820 may be used to determine two horizontal lines and two vertical axis lines by using a vertex comparison method, wherein the vertex comparison method refers to confirming the area to be displayed by comparing whether the respective endpoints of multiple pairs of horizontal lines and / or vertical axis lines are the same.
[0083] The processing module 830 is used to process the size of the target image according to the area to be displayed. When the area to be displayed is determined, the processing module 830 can be used to obtain the size of the area to be displayed, such as length and width. Then the target image is scaled to the size of the area to be displayed so that it can just fit into the area to be displayed.
[0084] The display module 840 is used to display the target image after size processing on the base map to be displayed. When the area to be displayed cannot be determined, the target image is directly displayed on the base map to be displayed.
[0085] According to the image display device provided by the present application, by traversing the pixels of the base map to be displayed, determining the area to be displayed, and processing the target image according to the size of the area to be displayed, it is possible to automatically obtain the position of the display area in the base map, and adapt the image to be displayed to the display area of the base map. In summary, the image display device of the present application realizes a one-click adaptive display solution for the product image while still maintaining the independence of the product image and the base map. That is, the position of the display area outlined in the base map is automatically obtained, and the product image is automatically scaled to be displayed in the specified area of the base map.
[0086] Fig. 9 It is a block diagram of an electronic device for displaying pictures according to an exemplary embodiment.
[0087] Refer to the following Fig. 9hereinafter describes an electronic device 900 according to this embodiment of the present application. Fig. 9 The electronic device 900 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0088] like Fig. 9 As shown, the computer system 900 includes a central processing unit (CPU) 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage part 908 to a random access memory (RAM) 903. For example, the central processing unit 901 can perform the following operations: Figure 2 , Figure 3 , Figure 4 . Figure 5 , Figure 6 1 or more of the steps shown.
[0089] In RAM 903, various programs and data required for system operation, such as the pixel array of the base map to be displayed and the size of the picture to be displayed, are also stored. CPU 901, ROM 902 and RAM 903 are connected to each other via bus 904. Input / output (I / O) interface 905 is also connected to bus 804.
[0090] The following components are connected to the I / O interface 905: an input section 906 including a touch screen, a keyboard, etc.; an output section 907 including a liquid crystal display (LCD), etc. and a speaker, etc.; a storage section 908 including a flash memory, etc.; and a communication section 909 including a wireless network card, a high-speed network card, etc. The communication section 909 performs communication processing via a network such as the Internet. A drive 910 is also connected to the I / O interface 905 as needed. A removable medium 911, such as a semiconductor memory, a magnetic disk, etc., is installed on the drive 910 as needed, so that a computer program read therefrom is installed into the storage section 908 as needed.
[0091] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution of the embodiment of the present invention can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.), including a number of instructions for a computing device (which can be a personal computer, a server, a mobile terminal, or a smart device, etc.) to execute the method according to the embodiment of the present invention, for example Figure 2 , Figure 3 Figure 4 , Figure 5 , Figure 6 One or more of the steps shown.
[0092] In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to an exemplary embodiment of the present invention, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.
[0093] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present invention that follow the general principles of the present invention and include common knowledge or customary techniques in the art that are not claimed by the present invention. The specification and examples are to be considered exemplary only, and the true scope and spirit of the present invention are indicated by the claims.
[0094] It should be understood that the present invention is not limited to the detailed structures, drawings or implementations shown herein, but rather the present invention is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.
Claims
1. A method for displaying a picture, characterized in that: include: Get the target image and the base image to be displayed; Traversing the pixels of the base map to be displayed to determine the to-be-displayed area on the base map to be displayed according to the pixels; Performing size processing on the target image according to the area to be displayed; Displaying the target image after size processing on the base image to be displayed; The step of traversing the pixels of the base map to be displayed to determine the area to be displayed on the base map to be displayed according to the pixels includes: Obtaining pixel points of the base map to be displayed; Integrate the pixel points into a pixel array through a three-primary color space; Determine a plurality of horizontal lines and a plurality of vertical axis lines on the base map to be displayed by the color of each element in the pixel array; Determining two horizontal lines and two longitudinal axes from the plurality of horizontal lines and the plurality of longitudinal axes; Determine a rectangular frame according to the two horizontal lines and the two longitudinal axes, so as to determine the rectangular range defined by the rectangular frame as the area to be displayed; Wherein, determining two horizontal lines and two longitudinal axis lines from the plurality of horizontal lines and longitudinal axis lines comprises: Eliminating horizontal lines and / or vertical axis lines whose length is less than a threshold value from the plurality of horizontal lines and the plurality of vertical axis lines, wherein the threshold value is determined according to the size of the text in the base map to be displayed; Eliminating the horizontal lines and / or the vertical axis lines that do not meet the color requirements from the plurality of horizontal lines and the plurality of vertical axis lines, so that the two determined horizontal lines have the same color and the two determined vertical axis lines have the same color; and Horizontal lines and / or longitudinal axis lines that do not meet the length range are eliminated from the plurality of horizontal lines and the plurality of longitudinal axis lines, so that the determined lengths of the two horizontal lines are within the error range and the lengths of the two longitudinal axis lines are within the error range.
2. The method according to claim 1, characterized in that Obtaining the target image and the base map to be displayed includes: The target image and the base image to be displayed are obtained according to the paths of the target image and the base image to be displayed, wherein the path is an HTML path.
3. The method according to claim 1, characterized in that Determining two horizontal lines and two longitudinal axes from the plurality of horizontal lines and longitudinal axes further comprises: The two horizontal lines and the two vertical axis lines are determined by the vertex comparison method.
4. The method according to claim 1, characterized in that Also includes: When the area to be displayed cannot be determined, the target image is directly displayed on the base map to be displayed.
5. A picture display device, characterized in that: include: The acquisition module is used to obtain the target image and the base image to be displayed; A traversal module, used for traversing the pixels of the base map to be displayed, so as to determine the to-be-displayed area on the base map to be displayed according to the pixels; A processing module, used for processing the size of the target image according to the area to be displayed; A display module, used for displaying the target image after size processing on the base image to be displayed; The traversal module traverses the pixels of the base map to be displayed to determine the area to be displayed on the base map to be displayed according to the pixels, including: Obtaining pixel points of the base map to be displayed; Integrate the pixel points into a pixel array through a three-primary color space; Determine a plurality of horizontal lines and a plurality of vertical axis lines on the base map to be displayed by the color of each element in the pixel array; Determining two horizontal lines and two longitudinal axes from the plurality of horizontal lines and the plurality of longitudinal axes; Determine a rectangular frame according to the two horizontal lines and the two longitudinal axes, so as to determine the rectangular range defined by the rectangular frame as the area to be displayed; The traversal module determines two horizontal lines and two longitudinal axis lines from the plurality of horizontal lines and longitudinal axis lines, comprising: Eliminating horizontal lines and / or vertical axis lines whose length is less than a threshold value from the plurality of horizontal lines and the plurality of vertical axis lines, wherein the threshold value is determined according to the size of the text in the base map to be displayed; Eliminating the horizontal lines and / or the vertical axis lines that do not meet the color requirements from the plurality of horizontal lines and the plurality of vertical axis lines, so that the two determined horizontal lines have the same color and the two determined vertical axis lines have the same color; and Horizontal lines and / or longitudinal axis lines that do not meet the length range are eliminated from the plurality of horizontal lines and the plurality of longitudinal axis lines, so that the determined lengths of the two horizontal lines are within the error range and the lengths of the two longitudinal axis lines are within the error range.
6. An electronic device, characterized in that: include: one or more processors; A storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 4.
7. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.
