Image processing method and device, electronic equipment and storage medium
By generating images with reassigned grayscale values and removing the target removal location, the problem of poor user experience caused by objects being too close to the clipping surface in 3D interfaces is solved, and natural clipping of the transition texture of the object surface is achieved, thus improving the user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-09
- Publication Date
- 2026-03-31
AI Technical Summary
In 3D interfaces, hiding objects too close to the camera before the clipping plane appears results in a poor user experience and feels too abrupt.
By acquiring image data of a preset grayscale image and the image to be processed, determining the mapping threshold and generating a reassigned grayscale value, removing the image at the target removal location, and generating the processed image, the transition texture of the object surface is clipped, reducing the impact of near-clipping sections.
While ensuring that objects are rendered normally at long distances, the system achieves natural transitions between local dynamic visibility and concealment, thus improving the user experience.
Smart Images

Figure CN119963448B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, and in particular to an image processing method, apparatus, electronic device and storage medium. Background Technology
[0002] With the increasing popularity of 3D interfaces, more and more new energy vehicle central control screens are starting to use 3D interfaces. In recent years, one-shot camera techniques have been increasingly used in scenarios such as car manufacturers' advanced demonstrations. However, with this camera technique, clipping is difficult to avoid during camera movement, and obvious clipping affects the aesthetics of the interface and interrupts the user's immersive experience.
[0003] While the 3D interface for in-vehicle systems allows for setting trajectories to prevent the camera from penetrating the model's interior during perspective transitions between inside and outside the vehicle, the compact structure of the vehicle's interior makes it impossible to avoid model sections caused by the camera's proximity to the clipping plane during view frustum culling calculations. Although related technologies can hide objects before they become clipping planes due to their proximity to the camera, this approach appears abrupt and results in a poor user experience. Summary of the Invention
[0004] This application provides an image processing method, apparatus, electronic device, and storage medium to solve the technical problem in the related art where objects are directly hidden before a cropping surface appears when they are too close to the camera, but this appears too abrupt and results in a poor user experience.
[0005] This application provides an image processing method, which includes: acquiring image data of a preset grayscale image and an image to be processed, wherein the image data includes at least the current distance and observation display position of the target material observation point, the preset grayscale image is filled with multiple identical sub-grayscale images, each sub-grayscale image includes multiple preset points with different grayscale values, and the image size of the preset grayscale image and the image size of the image to be processed are determined based on the display area size of the display device; determining a mapping threshold based on the current distance, thereby obtaining a mapping threshold for each target material observation point; and determining the mapping threshold based on the target material... The mapping threshold of the quality observation point determines the relationship between the gray values of preset points in the preset grayscale image corresponding to the observation display position of the target material observation point, and thus determines the reassigned gray values of preset points corresponding to the observation display position of the target material observation point, thereby obtaining the reassigned gray values of each preset point in the preset grayscale image; the current grayscale image is generated based on the reassigned gray values of each preset point in the preset grayscale image; the image to be processed is removed from the target removal position to obtain the processed image, wherein the target removal position is the location of the preset point in the current grayscale image with the target gray value.
[0006] In one embodiment of this application, the method for generating a preset grayscale image includes: creating a two-dimensional coordinate system based on the display area of the display device, and setting the preset origin coordinates, the extreme values of the first color component and the extreme values of the second color component of the two-dimensional coordinate system to obtain the initial coordinates of each preset point in the display area, wherein the horizontal coordinate of the two-dimensional coordinate system is the value of the first color component and the vertical coordinate of the two-dimensional coordinate system is the value of the second color component; converting the initial coordinates of each preset point in the display area into mapped coordinates based on the aspect ratio of the display area and a preset influence coefficient; performing decimal value processing on each mapped coordinate to obtain the decimal coordinates of each preset point in the display area, forming multiple sub-grayscale image areas; determining the grayscale distance between the preset point inside each sub-grayscale image area and the center point of the sub-grayscale image area, and determining the grayscale value of each preset point based on the grayscale distance; and generating the preset grayscale image based on the grayscale values of each preset point.
[0007] In one embodiment of this application, the preset influence coefficient is determined based on a preset tiling pattern density, wherein the preset tiling pattern density represents the number of sub-grayscale images included in the display area.
[0008] In one embodiment of this application, determining a mapping threshold based on the current distance includes: obtaining a preset first distance threshold and a preset second distance threshold, wherein the preset first threshold is less than the preset second distance threshold, the preset first threshold is greater than a first distance between the image acquisition device used to acquire the image to be processed and the near cropping plane, and the preset second threshold is less than a second distance between the image acquisition device and the far cropping plane; performing a cropping mapping process on the current distance based on the first distance threshold and the preset second distance threshold to obtain a cropping mapping result; and determining the mapping threshold based on the cropping mapping result.
[0009] In one embodiment of this application, determining the reassigned grayscale value of a preset point corresponding to the observation display position of the target material observation point based on the magnitude relationship between the grayscale values of preset points in the preset grayscale image corresponding to the observation display position of the target material observation point and the mapping threshold of the target material observation point includes: if the mapping threshold of the target material observation point is greater than or equal to the grayscale value of the preset point in the preset grayscale image corresponding to the observation display position of the target material observation point, the reassigned grayscale value of the preset point corresponding to the observation display position of the target material observation point is determined as a first preset grayscale value; if the mapping threshold of the target material observation point is less than the grayscale value of the preset point in the preset grayscale image corresponding to the observation display position of the target material observation point, the reassigned grayscale value of the preset point corresponding to the observation display position of the target material observation point is determined as a second preset grayscale value, wherein the second preset grayscale value is not equal to the first preset grayscale value.
[0010] In one embodiment of this application, before removing the image to be processed from the target removal position, the method includes: determining the second preset grayscale value as the target grayscale value.
[0011] In one embodiment of this application, after obtaining the processed image, the method further includes: displaying the processed image through the display device.
[0012] This application embodiment also provides an image processing apparatus, the image processing apparatus comprising: an acquisition module, configured to acquire image data of a preset grayscale image and an image to be processed, the image data including at least the current distance and observation display position of the target material observation point, the preset grayscale image being filled with multiple identical sub-grayscale images, each sub-grayscale image including multiple preset points with different grayscale values, the image size of the preset grayscale image and the image size of the image to be processed being determined based on the display area size of the display device; a remapping module, configured to determine a mapping threshold based on the current distance, thereby obtaining a mapping threshold for each target material observation point; and a reassignment module, configured to... The reassigned grayscale values of the preset points corresponding to the observation display positions of the target material observation points are determined based on the mapping threshold of the target material observation points and the magnitude relationship between the grayscale values of the preset points in the preset grayscale image and the observation display positions of the target material observation points. This process yields the reassigned grayscale values of each preset point in the preset grayscale image. An image generation module is used to generate a current grayscale image based on the reassigned grayscale values of each preset point in the preset grayscale image. A removal module is used to remove the image to be processed from the target removal position to obtain a processed image. The target removal position is the location of the preset point in the current grayscale image where the grayscale value is the target grayscale value.
[0013] This application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the method as described in any of the above embodiments.
[0014] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method of any of the above embodiments.
[0015] In the image processing method, apparatus, electronic device, and storage medium provided above, the method acquires image data of a preset grayscale image and an image to be processed. This image data includes at least the current distance and observation display position of the target material observation point. Then, a mapping threshold is determined based on the current distance, thereby obtaining the mapping threshold for each target material observation point. Finally, the reassigned grayscale value of the preset point is determined by the relationship between the mapping threshold and the grayscale value of the corresponding preset point in the preset grayscale image, thus obtaining the reassigned grayscale values of each preset point in the preset grayscale image. The image capture device calculates the target grayscale value and generates the current grayscale image. The location of the preset point in the current grayscale image that has the target grayscale value is taken as the target removal position. The image to be processed is removed from the target removal position to obtain the processed image. This completes the processing of the image to be processed. In this way, based on the current distance between the image acquisition device and the surface of the object being captured, the images that meet the standard can be removed. This achieves the purpose of cropping the transition texture of the object surface before the cropping plane appears, thereby reducing the impact of the near cropping section. This ensures that the object can be rendered normally at a greater distance, and also ensures that the local dynamics of the object appearing and disappearing and the transition is natural when the object is close. Attached Figure Description
[0016] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments of this application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0017] Figure 1 This is an exemplary system architecture diagram for image processing that can be applied to embodiments of this application;
[0018] Figure 2 A schematic flowchart of an image processing method provided in an embodiment of this application;
[0019] Figure 3 A schematic diagram illustrating the creation of a two-dimensional coordinate system for a display area, provided in an embodiment of this application;
[0020] Figure 4 A schematic diagram of mapped screen coordinates provided in an embodiment of this application;
[0021] Figure 5 A schematic diagram of screen coordinates after decimalization provided in an embodiment of this application;
[0022] Figure 6 A schematic diagram of a preset grayscale image provided in an embodiment of this application;
[0023] Figure 7 A schematic diagram of the visual cone provided in an embodiment of this application;
[0024] Figure 8 A schematic diagram of the current grayscale image provided in the embodiments of this application;
[0025] Figure 9 A schematic diagram of the image to be processed provided in an embodiment of this application;
[0026] Figure 10 A schematic diagram illustrating the overlay of a current grayscale image onto an image to be processed, provided as an embodiment of this application;
[0027] Figure 11 A schematic diagram of a grayscale processed image provided in an embodiment of this application;
[0028] Figure 12 Another schematic diagram illustrating the overlay of the current grayscale image onto the image to be processed, provided as an embodiment of this application;
[0029] Figure 13 The embodiments provided in this application provide for the application of the following: Figure 11 A schematic diagram of the result of remapping the image in the image;
[0030] Figure 14 Another schematic diagram illustrating the overlay of the current grayscale image onto the image to be processed, provided as an embodiment of this application;
[0031] Figure 15 This is a schematic diagram illustrating how the current grayscale image is superimposed onto the image to be processed after adjusting the preset influence coefficient, as provided in an embodiment of this application.
[0032] Figure 16 This is a schematic diagram of a processed image provided in an embodiment of this application;
[0033] Figure 17 Provided for the embodiments of this application Figure 16 A schematic diagram of the processed image based on the camera movement process;
[0034] Figure 18 A schematic diagram of the structure of an image processing apparatus provided in an embodiment of this application;
[0035] Figure 19 A schematic diagram of the structure of an electronic device in one embodiment of this application;
[0036] Figure 20 Another schematic diagram of the structure of an electronic device in one embodiment of this application. Detailed Implementation
[0037] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0038] This embodiment will be described from the perspective of an image processing device, which can be integrated into an electronic device. Specifically, the image processing method of this embodiment can be executed by an electronic device, such as a terminal or vehicle. The terminal can be a mobile phone, tablet computer, smart Bluetooth device, laptop computer, touchscreen, game console, personal computer (PC), in-vehicle terminal, etc. The server can be a single server or a server cluster composed of multiple servers. The image processing device can be integrated into multiple servers or multiple electronic devices. Alternatively, the image processing device can be integrated into both a server and a terminal. In this case, the server executes the image processing method provided in this embodiment to obtain a processed image, and then sends the processed image to the terminal for display. For example, the image to be processed can be multiple consecutive video frames, thereby enabling video processing.
[0039] As an example, the image processing method provided in this application embodiment can be applied to, for example, Figure 1The image processing system shown includes a terminal 101 and a server 102. Terminal 101 can be a mobile phone, tablet, laptop, in-vehicle computer, etc. Terminal 101 and server 102 can communicate bidirectionally via a network. Server 102 can store preset grayscale images and related data. Terminal 101 obtains the preset grayscale images and related data from the server via the network and processes the image using its processor (such as a CPU (Central Processing Unit) or GPU (Graphics Processing Unit)). The terminal and server can interact with each other unidirectionally or bidirectionally via the network. Server 102 can be a standalone server, a server network, or a server cluster, including but not limited to computers, network hosts, single network servers, multiple network server sets, or cloud servers composed of multiple servers. Cloud servers consist of a large number of computers or network servers based on cloud computing. For example, the terminal 101 can acquire image data of a preset grayscale image and an image to be processed; determine a mapping threshold based on the current distance, and then obtain the mapping threshold for each target material observation point; determine the reassigned grayscale value of the preset point corresponding to the observation display position of the target material observation point based on the size relationship between the grayscale values of the preset points in the preset grayscale image and the observation display position of the target material observation point, and then obtain the reassigned grayscale value of each preset point in the preset grayscale image; generate the current grayscale image based on the reassigned grayscale values of each preset point in the preset grayscale image; remove the image to be processed at the target removal position to obtain the processed image, where the target removal position is the location of the preset point in the current grayscale image with the target grayscale value.
[0040] In some embodiments, the electronic device executing the image processing method of this embodiment integrates a display screen. The electronic device can execute the image processing method of this embodiment and output the corresponding processed image through the display screen integrated in the electronic device. As another example, in some embodiments, the electronic device executing the game screen rendering method of this embodiment does not integrate a display screen. The electronic device can execute the image processing method of this embodiment and output the corresponding processed image through a display screen integrated in another device connected to the electronic device.
[0041] The following detailed description, in conjunction with the accompanying drawings, is provided. It should be noted that the order of description of the embodiments below is not intended to limit the preferred order of the embodiments. Although a logical order is shown in the flowcharts, in some cases, the steps shown or described may be performed in a different order than that shown in the drawings.
[0042] For example, when this image processing method is applied to an in-vehicle terminal, the vehicle can be a gasoline-powered vehicle, an electric vehicle (EV), a hybrid electric vehicle, a plug-in hybrid electric vehicle (HEV), a range-extended electric vehicle (EV), a hybrid electric vehicle (HEV), a natural gas vehicle, a methanol vehicle, a solar-powered vehicle, or other new energy vehicles. The vehicle can be a passenger car such as a sedan, a sport utility vehicle (SUV), or a multi-purpose vehicle (MPV), or it can be a bus, a truck, a semi-trailer, etc. This application does not impose specific limitations in this regard.
[0043] Please see Figure 2 As shown, Figure 2 A flowchart illustrating an image processing method provided in an embodiment of this application is shown. The method includes the following steps:
[0044] Step S210: Obtain image data of the preset grayscale image and the image to be processed.
[0045] The image data includes at least the current distance and the observation display position of the target material observation point. As an example, the current distance represents the distance between the object location where the target material observation point is located and the image acquisition device, and the observation display position represents the display position of the target material observation point on the display device. The image to be processed may include one or more object images, and each object surface may have one or more materials. In this embodiment, the object materials in the image can be identified in a manner known to those skilled in the art, thereby obtaining the preset target material observation point on the target material in the image to be processed. The target material can be one or more, and is not limited here. The target material observation point can be set using the pixel or pixel point where the target material is located as the observation point, or it can be selected according to other rules preset by those skilled in the art. As another example, the coordinate system of the observation display position and the coordinate system of the preset point of the subsequent preset grayscale image can be the same coordinate system, or they can be different coordinate systems but the coordinate transformation relationship between the two coordinate systems is known in advance, thereby achieving a positional correspondence between the preset points in the two coordinate systems and the target material observation point. As another example, if the image to be processed contains object structures that are not the target material, the current distance to these parts can be uniformly preset to a certain value to ensure that they are not mistakenly removed during subsequent image culling. Alternatively, the current distance to these parts can be omitted, and the image culling decision can be made based solely on the area covered by the target material in the image to be processed, determining whether culling is necessary. Of course, other methods known to those skilled in the art can also be used to process images of object structures that are not the target material, which will not be elaborated here.
[0046] The preset grayscale image is filled with multiple identical sub-grayscale images. Each sub-grayscale image includes multiple preset points with different grayscale values. The image size of the preset grayscale image and the image size of the image to be processed are determined based on the display area size of the display device. It can be understood that both the preset grayscale image and the image to be processed serve the same display area requirements, therefore the positions of their pixels can correspond one-to-one.
[0047] In one embodiment, the method for generating a preset grayscale image includes: creating a two-dimensional coordinate system based on the display area of the display device, and setting the preset origin coordinates, the extreme values of the first color component and the extreme values of the second color component of the two-dimensional coordinate system to obtain the initial coordinates of each preset point in the display area, wherein the horizontal coordinate of the two-dimensional coordinate system is the value of the first color component and the vertical coordinate of the two-dimensional coordinate system is the value of the second color component; converting the initial coordinates of each preset point in the display area into mapped coordinates based on the aspect ratio of the display area and a preset influence coefficient; performing decimal value processing on each mapped coordinate to obtain the decimal coordinates of each preset point in the display area, forming multiple sub-grayscale image areas; determining the grayscale distance between the preset point inside each sub-grayscale image area and the center point of the sub-grayscale image area, and determining the grayscale value of each preset point based on the grayscale distance; and generating a preset grayscale image based on the grayscale values of each preset point.
[0048] Following the above embodiments, the preset influence coefficient is determined based on the preset tiling pattern density, which represents the number of sub-grayscale images included in the display area.
[0049] The preset tiling density can be any value set by those skilled in the art that is not zero. It can be a value where there is only one or 0.5 sub-grayscale images in the specified display area. In this case, there will be a large range of rejection during the subsequent rejection process, which is generally not effective. In order to achieve a better display effect, the preset tiling density is usually set to a value greater than 1, tiling more sub-grayscale images on the screen, so as to improve the display effect of the image after subsequent processing.
[0050] In this system, the first and second color components can be any two of the three RGB (red, green, blue) color components. The default origin coordinates can be (0, 0), and the extreme values of both the first and second color components can be 1. As an example, OpenGL uses a two-dimensional Cartesian coordinate system for screen (display area) mapping, with the lower left corner as the origin, the x-axis to the right, and the y-axis upwards. The upper right corner coordinates are (1, 1). The x-axis values are represented by the R (red) channel, and the y-axis values by the G (green) channel. The coordinates of the entire screen are mapped as follows: Figure 3 The image shown. Please see [link / reference]. Figure 3 , Figure 3 A schematic diagram illustrating the creation of a two-dimensional coordinate system for the display area provided in this application embodiment, as shown below. Figure 3 As shown, the lower left corner is the preset origin (0, 0), and the upper right corner has coordinates (1, 1).
[0051] Because the aspect ratio of a typical screen is not 1:1, and as... Figure 3The aspect ratio of the example screen shown is not 1:1. In the above image, we only marked the coordinates of the upper right corner as (1, 1). Therefore, to obtain a square-bound tiled pattern, the aspect ratio of the screen also needs to be calculated. In addition, the tiled pattern density can be introduced as an influence coefficient, denoted as patternDensity. Mapping the original coordinates (1, 1) to the new coordinates:
[0052]
[0053] Where patternDensity is the preset influence coefficient, screenWidth is the screen width (display area width), and screenHeight is the screen height (display area height).
[0054] for Figure 3 For the coordinate mapping of other preset points, the above mapping method can be used as follows: multiply the x-coordinate of the initial coordinates by a preset influence coefficient, then multiply by the screen width, and divide the resulting value by the screen height to obtain the x-coordinate of the mapped coordinates. Similarly, multiply the y-coordinate of the initial coordinates by the preset influence coefficient to obtain the y-coordinate of the mapped coordinates. Please refer to [link to documentation]. Figure 4 , Figure 4 A schematic diagram of the mapped screen coordinates provided in the embodiments of this application, as shown below. Figure 4 As shown, Figure 3 The scene focused on Figure 4 The bottom left corner.
[0055] Next, by performing a decimal operation on all coordinate positions, we obtain... Figure 5 The image shows a tiled area of small squares, where the value at the bottom left corner of each square is (0, 0) and the value at the top right corner is (1, 1). Each tiled area can be considered a sub-grayscale image region. Please refer to [link / reference]. Figure 5 , Figure 5 This is a schematic diagram of screen coordinates after decimalization provided in an embodiment of this application, as shown below. Figure 5 As shown, Figure 4 The bottom left corner Figure 3 The image's mapped coordinates are rounded down to a decimal value to obtain decimal coordinates, and then a [database name] is generated based on these decimal coordinates. Figure 5 The effect of a tiled small square area is obtained by filling the display area with this tiled small square area effect image. Figure 5 The image.
[0056] When calculating the mapped coordinates, for example, if the mapped ordinate value is 3.15, then the decimal value of the mapped ordinate is 0.15. Or, for example, if the mapped ordinate value is 3.0, then the decimal value of the mapped ordinate is 0.0. Of course, it can also be stipulated that the mapped ordinate value is 1.0 in this case; the specific setting can be determined by those skilled in the art as needed.
[0057] The grayscale distance is determined by the distance between a preset point and the center point within a sub-grayscale image region. For an example, please refer to [link to example]. Figure 5 Let (a, b) be the preset point within a tiled area of small squares. Since the value of the lower left corner of each small square is (0, 0) and the value of the upper right corner is (1, 1), its center point is recorded as (0.5, 0.5). The grayscale distance is then determined in the following ways:
[0058]
[0059] Where Distance is the grayscale distance, a is the x-coordinate of a preset point within a sub-grayscale image region, b is the y-coordinate of a preset point within a sub-grayscale image region, and 0.5 is the x-coordinate and y-coordinate of the center point within a sub-grayscale image region.
[0060] The above example uses a square shape, but those skilled in the art can also set other shapes for tiling. The center point of the sub-grayscale image region of other shapes can be set based on the settings of those skilled in the art. The specific method for determining the grayscale distance can be referred to the above formula (1), and will not be elaborated further.
[0061] As an example, grayscale distance can be directly used as the grayscale value, or it can be proportionally enlarged or reduced based on the grayscale distance to obtain the grayscale value. Taking the direct use of grayscale distance as the grayscale value as an example, reflecting the value of Distance in grayscale (Gray) yields... Figure 6 Please see Figure 6 , Figure 6 A schematic diagram of a preset grayscale image provided in an embodiment of this application, as shown below. Figure 6 As shown, within a sub-grayscale image region (a small square region), 0 (Gray=0) is black and 1 (Gray=1) is white. The center grayscale of the four sides (top, bottom, left, and right) is 0.5 (Gray=0.5).
[0062] The above provides an example of how to generate a preset grayscale image. Those skilled in the art can use other methods to generate preset grayscale images as needed, and this is not limited to this one case.
[0063] As another example, a person skilled in the art can directly draw a preset grayscale image based on the display area. It is only necessary to ensure that the preset grayscale image includes multiple sub-grayscale images, that these sub-grayscale images can fill the display area, and that each sub-grayscale image contains pixels with different grayscale gradients, so that subsequent processing can proceed. For example, the above embodiment provides a circular dark area; a person skilled in the art can also modify the shape of this dark area to a square, rectangle, or other arbitrary shape.
[0064] As an example, if it is necessary to adjust the size, density, etc. of the displayed hollow area, this can be achieved by adjusting the preset influence coefficient.
[0065] Step S220: Determine the mapping threshold based on the current distance, and then obtain the mapping threshold for each target material observation point.
[0066] It's understandable that not all parts of the target material in the image need to be removed. It depends on the distance between them. If they are far away, they do not need to be removed. Only parts within a certain distance range need to be removed to achieve the pseudo-perspective effect.
[0067] In one embodiment, determining the mapping threshold based on the current distance includes: obtaining a preset first distance threshold and a preset second distance threshold, wherein the preset first threshold is less than the preset second distance threshold, the preset first threshold is greater than a first distance between the image acquisition device used to acquire the image to be processed and the near cropping plane, and the preset second threshold is less than a second distance between the image acquisition device and the far cropping plane; performing truncation mapping processing on the current distance based on the first distance threshold and the preset second distance threshold to obtain a truncation mapping result; and determining the mapping threshold based on the truncation mapping result.
[0068] Please see Figure 7 , Figure 7 A schematic diagram of the visual cone provided in the embodiments of this application, as shown below. Figure 7 As shown, in 3D rendering, the concept of a view frustum is proposed to alleviate the rendering burden of converting 3D space to the screen's 2D space. The view frustum is surrounded by six planes, all called clipping planes. The plane closest to the camera (an example of an image acquisition device) is the near clipping plane. Only the spatial region enclosed by these clipping planes is rendered onto the screen. If an object lies on a clipping plane, it will be clipped. Since the near clipping plane faces the camera and is very close, the cross-section of the object clipped by the near clipping plane is rendered. See also... Figure 7 With the origin of the coordinate system ( Figure 7Taking the coordinate system shown in the image as the camera's location, and the vehicle image in the picture as an example of the image to be processed, the distance of the metallic points on the vehicle image from the camera can be considered as the current distance. The cross-sections corresponding to the preset first distance threshold and the preset second distance threshold are both between the near clipping plane and the far clipping plane. An example positional relationship can be, in sequence, camera, near clipping plane, cross-section corresponding to the preset first distance threshold, cross-section corresponding to the preset second distance threshold, and far clipping plane. To make the display transition smoother, the cross-section corresponding to the preset second distance threshold can be set closer to the near clipping plane.
[0069] As an example, the current distance is truncated and mapped according to a preset first distance threshold and a preset second distance threshold to obtain the truncated mapping result, including: if the current distance is less than the preset first distance threshold, the value 0 is determined as the truncated mapping result; if the current distance is greater than the preset second distance threshold, the value 1 is determined as the truncated mapping result; if the current distance is greater than or equal to the preset first distance threshold and less than or equal to the preset second distance threshold, the following processing is performed: the difference between the current distance and the preset first distance threshold is taken as the first difference, the difference between the preset second distance threshold and the preset first distance threshold is taken as the second difference, and the quotient of the first difference and the second difference is determined as the truncated mapping result.
[0070] As an example, determining the mapping threshold based on the truncated mapping result includes: using the truncated mapping result as the mapping threshold, or smoothing the truncated mapping result to obtain the mapping threshold.
[0071] As an example, the mapping threshold is obtained by smoothing the truncated mapping result, including: determining the square value and the 2-fold value of the truncated mapping result, determining the difference between 3 and the 2-fold value as the third difference, multiplying the square value and the third difference, and using the product as the mapping threshold.
[0072] In practice, one example of how to solve the mapped threshold is through the `smoothstep` function, which redefines the range of 0-1. The code for the `smoothstep` function is as follows:
[0073] float smoothstep(float t1,float t2,float x){
[0074] x=clamp((x-t1) / (t2-t1),0.0,1.0);
[0075] return x*x*(3-2*x);
[0076] }
[0077] By using the above method, different thresholds can be set based on different distances at different locations. As a result, when removing images, the size of the area to be removed will vary depending on the distance, making the image more vivid.
[0078] Step S230: Based on the mapping threshold of the target material observation point, determine the reassigned gray values of the preset points in the preset grayscale image corresponding to the observation display position of the target material observation point according to the size relationship between the gray values of the preset points in the preset grayscale image corresponding to the observation display position of the target material observation point, and then obtain the reassigned gray values of each preset point in the preset grayscale image.
[0079] In one embodiment, determining the reassigned grayscale value of the preset point corresponding to the observation display position of the target material observation point based on the magnitude relationship between the grayscale values of preset points in the preset grayscale image corresponding to the observation display position of the target material observation point and the mapping threshold of the target material observation point includes: if the mapping threshold of the target material observation point is greater than or equal to the grayscale value of the preset point in the preset grayscale image corresponding to the observation display position of the target material observation point, the reassigned grayscale value of the preset point corresponding to the observation display position of the target material observation point is determined as a first preset grayscale value; if the mapping threshold of the target material observation point is less than the grayscale value of the preset point in the preset grayscale image corresponding to the observation display position of the target material observation point, the reassigned grayscale value of the preset point corresponding to the observation display position of the target material observation point is determined as a second preset grayscale value, wherein the second preset grayscale value is not equal to the first preset grayscale value.
[0080] As an example, the first preset grayscale value can be 0, and the second preset grayscale value can be 1. Taking a mapping threshold of 0.3 for all target material observation points as an example, if the grayscale value is limited to a certain threshold (0.3 is selected for demonstration here), then the grayscale value is set to 0; if it is less than 0.3, then the grayscale value is set to 1. The pseudocode is as follows:
[0081] if (gray > 0.3) gray = 0;
[0082] else gray = 1;
[0083] The above example uses a first preset grayscale value of 0 and a second preset grayscale value of 1. Those skilled in the art can also use other values, such as the first preset grayscale value being 1, the second preset grayscale value being 0, or other values. The values in the above embodiments are only examples.
[0084] Step S240: Generate the current grayscale image based on the reassigned grayscale values of each preset point in the preset grayscale image.
[0085] To Figure 6Taking the reassignment of grayscale values to an image as an example, we can obtain... Figure 8 The image shown. Please refer to [link / reference]. Figure 8 , Figure 8 A schematic diagram of the current grayscale image provided in the embodiments of this application, such as... Figure 8 As shown, when all target material observation points are on the same plane and the current distances are equal, the resulting white circles are of uniform size. However, if the target material observation points are not on the same plane, meaning there are differences in the current distances, then the mapping threshold will differ, resulting in white circles of varying diameters appearing on the white circles.
[0086] It's easy to see that the chosen threshold of 0.3 determines the size of the dots. These dots are evenly distributed on the screen, unaffected by the object's surface parameters.
[0087] Step S250: Remove the image at the target removal position from the image to be processed to obtain the processed image.
[0088] The target removal position is the location of a preset point in the current grayscale image where the grayscale value is the target grayscale value.
[0089] In one embodiment, before removing the image at the target removal location from the image to be processed, the method includes: determining a second preset grayscale value as the target grayscale value.
[0090] It should be noted that the above is only an example. Those skilled in the art can also use the first preset grayscale value as the target grayscale value, but at this time the amount of image content removed is relatively small, which may result in poor visual quality and effect.
[0091] The removal can be implemented using techniques known to those skilled in the art, and no limitation is made here.
[0092] As an example, this solution only removes the portion of the image containing the target material; the portion containing non-target materials is not removed. Therefore, the selection of the removal location is based on the area displayed by the target material, not the entire image.
[0093] Please see Figure 9 , Figure 9 A schematic diagram of the image to be processed provided in the embodiments of this application, such as... Figure 9 As shown, the image on the left shows the extent of the visual cone from a third-party perspective, while the image on the right shows an example of the image to be processed. The leather material of the seat is our target material and needs to be processed during the presentation.
[0094] Please see Figure 10 , Figure 10This is a schematic diagram illustrating the overlay of the current grayscale image onto the image to be processed, as provided in an embodiment of this application. Figure 10 As shown, only the target material portion is overlaid, while non-target material portions are not overlaid.
[0095] As an example, before removing the image at the target removal location from the image to be processed, the method further includes overlaying the current grayscale image onto the target material area of the image to be processed, deleting the current grayscale image portion of the image to be processed that is not in the target material area, and determining the target removal location based on the deleted current grayscale image portion.
[0096] The section resulting from the near clipping plane is generated on the surface of the object closest to the camera. Each pixel in screen space has a corresponding mapping point on the actual object's surface. The distance from the object's surface to the camera is calculated using a distance formula in 3D space. A distance of 0 corresponds to a grayscale value of 0, displayed as black. Distances greater than or equal to 1 are displayed as white. An example grayscale image can be found here. Figure 11 . Figure 11 This is a schematic diagram of a grayscale processed image of the image to be processed, provided in an embodiment of this application.
[0097] The current distance can be directly obtained from grayscale values using the method described above. It should be noted that the current distance can also be obtained using other methods known to those skilled in the art; the above is merely one example.
[0098] If based on Figure 11 The mapping threshold is recalculated based on the current distance displayed, resulting in white circles of varying diameters in the current grayscale image. The effect of overlaying this grayscale image onto the image to be processed can be seen in [reference needed]. Figure 12 Please see. Figure 12 , Figure 12 Another schematic diagram illustrating the overlay of the current grayscale image onto the image to be processed, as provided in this application embodiment, is shown below. Figure 12 As shown, the diameter of the white circles is related to the current distance. White circles closer to the viewer have a larger diameter, while those farther away have a smaller diameter. Distance can be measured by the current distance.
[0099] In determining the mapping threshold for the current distance of the target material observation point, taking a mapping threshold range of [0,1] as an example, the image is re-rendered using the remapped mapping threshold. Please refer to [link to relevant documentation]. Figure 13 , Figure 13 The embodiments provided in this application provide for the application of the following: Figure 11 This is a schematic diagram illustrating the result of remapping the image. As the camera position moves, the current distance also changes; please refer to [link / reference needed]. Figure 14 , Figure 14 This is another schematic diagram of superimposing the current grayscale image onto the image to be processed, provided in an embodiment of this application. It can be seen that (current distance) has a certain influence on the shape of the dot matrix (the distribution of the white circular image).
[0100] In another dimension, the density of the preset tiling pattern can also be adjusted. For example, increasing the preset tiling pattern density, which is equivalent to increasing the preset influence coefficient, will result in a higher density of the dot matrix. Figure 6 The small squares shown have smaller sides and are more numerous. See also... Figure 15 , Figure 15 This is a schematic diagram illustrating how the current grayscale image is superimposed onto the image to be processed after adjusting the preset influence coefficient, as provided in an embodiment of this application.
[0101] Taking the location of a preset point containing the black portion as the target removal location as an example, the processed image is obtained after removing the portion of the image to be processed from the target removal location. Please refer to [link to image]. Figure 16 , Figure 16 This is a schematic diagram of a processed image provided in an embodiment of this application. Please refer to... Figure 17 , Figure 17 Provided for the embodiments of this application Figure 16 This is a schematic diagram of the processed image based on the camera movement process. Figure 16 and Figure 17 You can intuitively feel that as the viewpoint moves forward or backward, the perspective effect adjusts according to the distance, making the picture more vivid and the user experience better.
[0102] See also Figure 16 By removing the black portions of the pixel array and then rendering the remaining parts normally, the final result can be obtained. As the camera approaches the object, a pixelated pattern appears on the object's surface. As the camera moves away from the object, the pixelated pattern gradually disappears. The gradient range of the pixel array can be adjusted by remapping the distance between the camera and the object's surface (based on a mapping threshold obtained from the current distance). A pixelated pattern begins to appear when a certain surface of the object is less than a set value from the camera; when it is greater than a set value, the object is fully displayed. The visual effect is improved after the cross-sections created by the original near-clipping plane are removed through the gradient pixel array calculated by the program.
[0103] By refining the area of an object near the clipping plane, this algorithm creates a smooth transition in this area as the camera moves closer to the object, improving the unpleasant visual effect of the cut-off section. Compared to directly developing the object, this algorithm produces a more natural and seamless dynamic effect. Furthermore, once the parameters are determined, no additional parameter adjustments are needed during camera movement to generate dynamic changes, making it convenient to use.
[0104] The image processing method provided in the above embodiments generates procedural textures using screen space coordinates. Combined with the distance between the camera and the object's surface, a transitional texture is clipped onto the object's surface before the camera's clipping plane appears. This reduces the impact of the camera's near-clipping section, ensuring normal rendering of objects at greater distances while maintaining natural transitions and dynamic visibility when objects are close to the camera. During camera operation, the transparency of the surface is clipped based on the object's distance from the camera, achieving a smooth transition between visible and hidden areas and avoiding the abrupt visual effect of directly revealing or hiding objects.
[0105] In one embodiment, after obtaining the processed image, the method further includes: displaying the processed image via a display device.
[0106] The image processing method described above acquires image data of a preset grayscale image and an image to be processed. This image data includes at least the current distance and observation display position of the target material observation point. Then, a mapping threshold is determined based on the current distance, thereby obtaining the mapping threshold for each target material observation point. The reassigned grayscale value of the preset point is determined by the relationship between the mapping threshold and the grayscale value of the corresponding preset point in the preset grayscale image. This process yields the reassigned grayscale values for each preset point in the preset grayscale image and generates a current grayscale image. The location of the preset point in the current grayscale image with the target grayscale value is used as the target culling position. The image to be processed at the target culling position is then culled to obtain the processed image. This completes the processing of the image to be processed. In this way, based on the current distance between the image acquisition device and the surface of the object being photographed, images that meet the standards can be culled. This achieves the goal of cropping the transition texture of the object surface before the cropping plane appears, thereby reducing the impact of the near cropping section. This ensures that the object can be rendered normally at a greater distance and that the local dynamics of the object appearing and disappearing and the transition are natural when the object is close.
[0107] In one embodiment, an image processing apparatus is provided for performing the image processing method provided in any of the above embodiments. See also... Figure 18 , Figure 18 A schematic diagram of the structure of the image processing apparatus provided in the embodiments of this application is shown below. Figure 18As shown, the image processing device 1800 includes an acquisition module 1801, a remapping module 1802, a reassignment module 1803, an image generation module 1804, and a culling module 1805. The acquisition module 1801 acquires image data of a preset grayscale image and an image to be processed. The image data includes at least the current distance and observation display position of the target material observation point. The preset grayscale image is filled with multiple identical sub-grayscale images, each sub-grayscale image including multiple preset points with different grayscale values. The image size of the preset grayscale image and the image size of the image to be processed are determined based on the display area size of the display device. The remapping module 1802 determines a mapping threshold based on the current distance, thereby obtaining the image data for each target material. The system includes: a mapping threshold for observation points; a reassignment module 1803, which determines the reassigned grayscale values of preset points corresponding to the observation display positions of the target material observation points in the preset grayscale image based on the mapping threshold of the target material observation points and the relationship between the grayscale values of these preset points; an image generation module 1804, which generates the current grayscale image based on the reassigned grayscale values of each preset point in the preset grayscale image; and a removal module 1805, which removes the image to be processed from the target removal position to obtain the processed image. The target removal position is the location of the preset point in the current grayscale image with the target grayscale value.
[0108] In one embodiment, the device further includes a preprocessing module, configured to create a two-dimensional coordinate system based on the display area of the display device, and set the preset origin coordinates, the extreme values of the first color component and the second color component of the two-dimensional coordinate system to obtain the initial coordinates of each preset point in the display area, wherein the horizontal coordinate of the two-dimensional coordinate system is the value of the first color component and the vertical coordinate of the two-dimensional coordinate system is the value of the second color component; convert the initial coordinates of each preset point in the display area into mapped coordinates based on the aspect ratio of the display area and a preset influence coefficient; perform decimalization processing on each mapped coordinate to obtain the decimal coordinates of each preset point in the display area, forming multiple sub-grayscale image areas; determine the grayscale distance between the preset point inside each sub-grayscale image area and the center point of the sub-grayscale image area, and determine the grayscale value of each preset point based on the grayscale distance; and generate a preset grayscale image based on the grayscale values of each preset point.
[0109] In one embodiment, the device further includes a sending module for sending the processed image to a display device after obtaining the processed image, so as to display the processed image through the display device.
[0110] For specific limitations regarding the image processing apparatus, please refer to the limitations regarding the image processing method above, which will not be repeated here. Each module in the aforementioned image processing apparatus can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in hardware within or independently of the processor in the electronic device, or stored in software within the memory of the electronic device, so that the processor can call and execute the operations corresponding to each module.
[0111] In this embodiment, the image processing device is essentially configured with multiple modules to execute the image processing method in any of the above embodiments. The specific functions and technical effects can be referred to in the above embodiments, and will not be repeated here.
[0112] In one embodiment, an electronic device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 19 As shown, the electronic device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile and / or volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The network interface is used to communicate with external clients via a network connection. When the computer program is executed by the processor, it implements the functions or steps of the server-side method described above.
[0113] In one embodiment, an electronic device is provided, which may be a client, and its internal structure diagram may be as follows: Figure 20 As shown, the electronic device includes a processor, memory, network interface, display screen, and input device connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage medium. The network interface is used to communicate with an external server via a network connection. When the computer program is executed by the processor, it implements the functions or steps of the client side of the above-described method.
[0114] In one embodiment, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it performs the following steps: acquiring image data of a preset grayscale image and an image to be processed; the image data includes at least the current distance and observation display position of the target material observation point; the preset grayscale image is filled with multiple identical sub-grayscale images, each sub-grayscale image including multiple preset points with different grayscale values; the image size of the preset grayscale image and the image size of the image to be processed are determined based on the display area size of the display device; and determining a mapping threshold based on the current distance, thereby obtaining... The mapping threshold for each target material observation point; based on the mapping threshold of the target material observation point, the gray value of the preset point corresponding to the observation display position of the target material observation point in the preset grayscale image is determined according to the size relationship between the gray values of the preset points in the preset grayscale image and the gray values of the preset points corresponding to the observation display position of the target material observation point, thereby obtaining the reassigned gray values of each preset point in the preset grayscale image; the current grayscale image is generated based on the reassigned gray values of each preset point in the preset grayscale image; the image to be processed is removed from the target removal position to obtain the processed image, where the target removal position is the location of the preset point in the current grayscale image with the target gray value.
[0115] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, it performs the following steps: acquiring image data of a preset grayscale image and an image to be processed, wherein the image data includes at least the current distance and observation display position of the target material observation point, the preset grayscale image is filled with multiple identical sub-grayscale images, each sub-grayscale image includes multiple preset points with different grayscale values, and the image size of the preset grayscale image and the image size of the image to be processed are determined based on the display area size of the display device; determining a mapping threshold based on the current distance, thereby obtaining a mapping threshold for each target material observation point; determining a reassigned grayscale value for the preset points corresponding to the observation display position of the target material observation point based on the size relationship between the grayscale values of the preset points in the preset grayscale image corresponding to the observation display position of the target material observation point according to the mapping threshold of the target material observation point, thereby obtaining the reassigned grayscale value of each preset point in the preset grayscale image; generating a current grayscale image based on the reassigned grayscale values of each preset point in the preset grayscale image; and removing the image to be processed at the target removal position to obtain a processed image, wherein the target removal position is the location of the preset point in the current grayscale image with the target grayscale value.
[0116] It should be noted that the functions or steps that can be implemented by the computer-readable storage medium or electronic device described above can be referred to the relevant descriptions on the server side and client side in the foregoing method embodiments. To avoid repetition, they will not be described one by one here.
[0117] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0118] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the above-described device or system can be divided into different functional units or modules to complete all or part of the functions described above.
[0119] The embodiments provided above are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. An image processing method, characterized by, The image processing method comprises: Obtaining image data of a preset gray image and a to-be-processed image, the image data comprising at least a current distance and an observation display position of a target material observation point, the preset gray image being paved with a plurality of identical sub-gray images, each sub-gray image comprising a plurality of preset points with different gray values, the image size of the preset gray image and the image size of the to-be-processed image being determined based on the display area size of a display device; Determining a mapping threshold value according to the current distance, and then obtaining a mapping threshold value of each target material observation point, wherein determining the mapping threshold value according to the current distance comprises: obtaining a preset first distance threshold value and a preset second distance threshold value, the preset first distance threshold value being smaller than the preset second distance threshold value, the preset first distance threshold value being greater than a first distance between an image acquisition device used for acquiring the to-be-processed image and a near clipping plane, and the preset second distance threshold value being smaller than a second distance between the image acquisition device and a far clipping plane; if the current distance is smaller than the preset first distance threshold value, determining the value 0 as a clipping mapping result; if the current distance is greater than the preset second distance threshold value, determining the value 1 as the clipping mapping result; if the current distance is greater than or equal to the preset first distance threshold value and smaller than or equal to the preset second distance threshold value, performing the following processing: taking the difference between the current distance and the preset first distance threshold value as a first difference value, taking the difference between the preset second distance threshold value and the preset first distance threshold value as a second difference value, and determining the quotient of the first difference value and the second difference value as the clipping mapping result, and determining the mapping threshold value based on the clipping mapping result; Determining a re-assigned gray value of a preset point corresponding to the observation display position of the target material observation point in the preset gray image according to the size relationship between the gray values of the preset points, and then obtaining the re-assigned gray values of the preset points in the preset gray image; Generating a current gray image based on the re-assigned gray values of the preset points in the preset gray image; Performing clipping on the picture at a target clipping position of the to-be-processed image to obtain a processed image, the target clipping position being the position of a preset point with a target gray value in the current gray image.
2. The image processing method of claim 1, wherein, The generation method of the preset gray image comprises: Creating a two-dimensional coordinate system according to the display area of the display device, and setting a preset origin coordinate, a first color component extreme value and a second color component extreme value of the two-dimensional coordinate system to obtain initial coordinates of each preset point in the display area, wherein the horizontal coordinate of the two-dimensional coordinate system is a first color component value, and the vertical coordinate of the two-dimensional coordinate system is a second color component value; Converting the initial coordinates of each preset point in the display area into mapping coordinates based on the aspect ratio of the display area and a preset influence coefficient; Performing decimal value processing on each mapping coordinate to obtain a decimal coordinate of each preset point in the display area, and forming a plurality of sub-gray image regions. determine a gray scale distance between each preset point inside a sub-gray scale image region and a center point of the sub-gray scale image region, and determine a gray scale value of each preset point according to the gray scale distance; generate the preset gray scale image according to the gray scale values of the preset points.
3. The image processing method of claim 2, wherein, The preset influence coefficient is determined according to a preset tiling pattern density, and the preset tiling pattern density represents a number of the sub-gray scale images included in the display region.
4. The image processing method of claim 1, wherein, determine a re-assignment gray scale value of a preset point corresponding to an observation display position of a target material observation point according to a size relationship between a mapping threshold of the target material observation point and a gray scale value of the preset point in the preset gray scale image, including: if the mapping threshold of the target material observation point is greater than or equal to the gray scale value of the preset point in the preset gray scale image corresponding to the observation display position of the target material observation point, determine the re-assignment gray scale value of the preset point corresponding to the observation display position of the target material observation point as a first preset gray scale value; if the mapping threshold of the target material observation point is less than the gray scale value of the preset point in the preset gray scale image corresponding to the observation display position of the target material observation point, determine the re-assignment gray scale value of the preset point corresponding to the observation display position of the target material observation point as a second preset gray scale value, and the second preset gray scale value is not equal to the first preset gray scale value.
5. The image processing method of claim 4, wherein, Before the image data of the target image is processed, the method includes: determine the second preset gray scale value as the target gray scale value.
6. The image processing method of any one of claims 1-4, wherein, After obtaining the processed image, the method further includes: display the processed image by the display device.
7. An image processing apparatus characterized by comprising: The image processing device includes: an acquisition module, configured to acquire image data of a preset gray scale image and a target image, the image data including at least a current distance and an observation display position of a target material observation point, the preset gray scale image being tiled by a plurality of identical sub-gray scale images, each sub-gray scale image including a plurality of preset points with different gray scale values, and an image size of the preset gray scale image and an image size of the target image being determined based on a display region size of a display device; The remapping module is configured to determine a mapping threshold according to the current distance, and then determine a mapping threshold of each target material observation point, wherein the determination of the mapping threshold according to the current distance comprises: obtaining a preset first distance threshold and a preset second distance threshold, the preset first distance threshold is smaller than the preset second distance threshold, the preset first distance threshold is greater than a first distance between an image acquisition device used for acquiring the image to be processed and a near clipping plane, and the preset second distance threshold is smaller than a second distance between the image acquisition device and a far clipping plane; if the current distance is smaller than the preset first distance threshold, a value 0 is determined as a clipping mapping result; if the current distance is greater than the preset second distance threshold, a value 1 is determined as the clipping mapping result; if the current distance is greater than or equal to the preset first distance threshold and smaller than or equal to the preset second distance threshold, the following processing is performed: a difference between the current distance and the preset first distance threshold is taken as a first difference, a difference between the preset second distance threshold and the preset first distance threshold is taken as a second difference, a quotient of the first difference and the second difference is determined as the clipping mapping result, and the mapping threshold is determined based on the clipping mapping result; The reassignment module is configured to determine a reassignment gray value of a preset point in the preset gray image corresponding to an observation display position of a target material observation point according to a size relationship between the gray value of the preset point and the mapping threshold of the target material observation point, and then determine reassignment gray values of all preset points in the preset gray image. The image generation module is configured to generate a current gray image based on the reassignment gray values of all preset points in the preset gray image. The rejection module is configured to reject a picture of the image to be processed at a target rejection position, and then obtain a processed image, wherein the target rejection position is a position of a preset point with a target gray value in the current gray image.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, The processor executes the computer program to implement the method of any one of claims 1-6.
9. A computer-readable storage medium storing a computer program, the computer program comprising instructions that, when executed by a computer, cause the computer to perform the method of any one of claims 1 to 8. The computer program is executed by the processor to implement the method of any one of claims 1-6.
Citation Information
Patent Citations
Map display method and device, equipment and storage medium
CN115908676A
Color gamut mapping method and color gamut mapping device
US20200036867A1