CN112950514A - Image processing method and device, electronic equipment and readable storage medium - Google Patents

Image processing method and device, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN112950514A
CN112950514A CN202110381810.6A CN202110381810A CN112950514A CN 112950514 A CN112950514 A CN 112950514A CN 202110381810 A CN202110381810 A CN 202110381810A CN 112950514 A CN112950514 A CN 112950514A
Authority
CN
China
Prior art keywords
pixel point
target
judged
image
pixel points
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110381810.6A
Other languages
Chinese (zh)
Inventor
邓新桥
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Anycubic Technology Co Ltd
Original Assignee
Shenzhen Anycubic Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Anycubic Technology Co Ltd filed Critical Shenzhen Anycubic Technology Co Ltd
Priority to CN202110381810.6A priority Critical patent/CN112950514A/en
Publication of CN112950514A publication Critical patent/CN112950514A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/70Denoising; Smoothing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image
    • G06T2207/10012Stereo images

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Image Processing (AREA)

Abstract

The invention provides an image processing method, an image processing device, an electronic device and a readable storage medium, wherein the method comprises the following steps: acquiring target pixel points in each sliced layer image of the three-dimensional printing image; acquiring processing parameters of the target pixel points; sequentially processing target pixel points in each sliced layer image by using the processing parameters to obtain each target sliced layer image; the three-dimensional printing image is formed by the target slice layer images from bottom to top layer by layer; and the target pixel points are pixel points corresponding to the outer surface area of the three-dimensional printing image in each slice layer image. The embodiment of the invention can improve the aesthetic property of the printing model.

Description

Image processing method and device, electronic equipment and readable storage medium
Technical Field
The present invention relates to the field of three-dimensional printing technologies, and in particular, to an image processing method and apparatus, an electronic device, and a readable storage medium.
Background
A 3D printing apparatus, also called a three-dimensional printing apparatus (3D), is a machine of an accumulative manufacturing technique, i.e., a rapid prototyping technique, which is based on a digital model file, and manufactures a three-dimensional object by sequentially printing a plurality of layers of adhesive materials using a special wax material, a powdered metal, or plastic, etc., which are adhesive materials.
At present, a photocuring three-dimensional printer generally displays a plurality of preset slice layer images on a display screen in sequence, each slice layer image corresponds to one layer of slice of a printing model, and a plurality of layers of slices are photocured and formed in sequence, so that the printing model is formed. However, in the existing photocuring three-dimensional printing method, since the sliced layer image is composed of a plurality of pixels, there may be a sawtooth formed at the edge of the sliced layer image due to the boundary of black and white pixels, which may finally cause contour lines on the surface of the formed printing model, and affect the aesthetic property of the printing model.
Disclosure of Invention
The embodiment of the invention provides an image processing method, an image processing device, electronic equipment and a readable storage medium, and aims to solve the problem that the appearance of a printing model is influenced due to the fact that contour lines exist on the surface of the printing model.
In a first aspect, an embodiment of the present invention provides an image processing method, including:
acquiring target pixel points in each sliced layer image of the three-dimensional printing image;
acquiring processing parameters of the target pixel points;
sequentially processing target pixel points in each sliced layer image by using the processing parameters to obtain each target sliced layer image; the three-dimensional printing image is formed by the target slice layer images from bottom to top layer by layer; and the target pixel points are pixel points corresponding to the outer surface area of the three-dimensional printing image in each slice layer image.
In a second aspect, an embodiment of the present invention further provides a three-dimensional printing apparatus, including:
the first acquisition module is used for acquiring target pixel points in each slice layer image of the three-dimensional printing image;
the second acquisition module is used for acquiring the processing parameters of the target pixel points;
the processing module is used for sequentially processing the target pixel points in each sliced layer image by using the processing parameters to obtain each target sliced layer image; the three-dimensional printing image is formed by the target slice layer images from bottom to top layer by layer; and the target pixel points are pixel points corresponding to the outer surface area of the three-dimensional printing image in each slice layer image.
In a third aspect, an embodiment of the present invention provides an electronic device, which includes a processor, a memory, and a program or instructions stored on the memory and executable on the processor, and when executed by the processor, the program or instructions implement the steps of the method according to the first aspect.
In a fourth aspect, embodiments of the present invention provide a readable storage medium, on which a program or instructions are stored, which when executed by a processor implement the steps of the method according to the first aspect.
In the embodiment of the invention, the target pixel points corresponding to the surface area of the three-dimensional printing image in each sliced layer image of the three-dimensional printing image can be obtained, and the target pixel points are processed by using the processing parameters to obtain each target sliced layer image, so that the saw teeth at the edge of the pattern on each sliced layer image can be eliminated to a certain extent, contour lines caused by the saw teeth on the printing model are avoided, the surface effect of the printing model generated based on each target sliced layer image is further improved, and the attractiveness of the printing model is improved.
Additional aspects and advantages of the invention will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the invention.
Drawings
The above and/or additional aspects and advantages of the present invention will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
FIG. 1 is a flow chart of an image processing method provided by an embodiment of the invention;
FIG. 2 is one of the schematic diagrams of slice images provided by embodiments of the present invention;
FIG. 3 is a second schematic diagram of a sliced layer image according to an embodiment of the present invention;
FIG. 4 is a third schematic diagram of a sliced layer image according to an embodiment of the present invention;
FIG. 5 is a fourth schematic diagram of a sliced layer image provided by an embodiment of the present invention;
FIG. 6 is a fifth schematic diagram of a sliced layer image provided by an embodiment of the present invention;
FIG. 7 is a schematic diagram of an image of a target slice layer provided by an embodiment of the invention;
FIG. 8 is a schematic structural diagram of an image processing apparatus according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like reference numerals refer to the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are illustrative only for the purpose of explaining the present invention, and are not to be construed as limiting the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The terms first, second and the like in the description and in the claims of the present invention are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that embodiments of the invention may be practiced otherwise than as specifically illustrated and described herein. In addition, "and/or" in the specification and claims means at least one of connected objects, a character "/" generally means that a preceding and succeeding related objects are in an "or" relationship.
The image processing method provided by the embodiment of the invention is described in detail by specific embodiments and application scenarios thereof with reference to the accompanying drawings.
Referring to fig. 1, fig. 1 is a flowchart of an image processing method according to an embodiment of the present invention, where the method may be applied to an electronic device, and a three-dimensional printing device may receive each target sliced layer image generated by the electronic device, and print based on each target sliced layer image to generate a print model. Certainly, in some embodiments, the electronic device may be a three-dimensional printing device, the three-dimensional printing device processes the slice layer image to generate each target slice layer image, and then performs pattern display in the display area according to pixel point distribution of each target slice layer image, each slice layer image corresponds to one layer of slices of the print model, and multiple layers of slices are sequentially subjected to photocuring molding, so as to form the print model.
In the existing printing mode, the slice layer image is composed of pixel points. Referring to fig. 2, the slice layer image in fig. 2 may be composed of black pixels and white pixels, and it is obvious that the gray value of the black pixels is lower than that of the white pixels. When the black pixel points are displayed on the display area of the three-dimensional printing equipment, the black pixel points are opaque due to the black color, so that the energy at the black pixel points is low, the printing material cannot be solidified and formed, and when the white pixel points are displayed on the display area of the three-dimensional printing equipment, the printing material is solidified and formed due to the action of the transmitted light, so that the model slices corresponding to the slice layer images are formed in the areas of the white pixel points.
As can be seen from fig. 2, since the pixels are arranged in a square shape, there may be sawteeth at the junctions of the black and white pixels, which may finally result in contour lines on the surface of the formed printing model, thereby affecting the aesthetic property of the printing model. Based on this, the embodiment of the invention provides an image processing method, which aims to improve the surface effect of a printing model by processing each sliced layer image in a three-dimensional printing image so as to improve the aesthetic property of the printing model.
As shown in fig. 1, the method includes:
step 101, obtaining target pixel points in each sliced layer image of a three-dimensional printing image;
102, acquiring processing parameters of the target pixel points;
103, sequentially processing target pixel points in each sliced layer image by using the processing parameters to obtain each target sliced layer image; the three-dimensional printing image is formed by the target slice layer images from bottom to top layer by layer; and the target pixel points are pixel points corresponding to the outer surface area of the three-dimensional printing image in each slice layer image.
In step 101, the three-dimensional print image may be a three-dimensional graph generated by the electronic device in advance according to the print model, that is, a three-dimensional graph of the print model, and may be formed by sequentially combining a plurality of slice layer images, where each slice layer image corresponds to one layer of slice of the print model and is composed of pixels in a planar region. The three-dimensional printing equipment can sequentially display the slice layer images to enable the slices of each layer to be sequentially solidified and molded, and obtain a printing model corresponding to the three-dimensional printing image.
The electronic device may acquire each slice layer image in the three-dimensional print image from a memory, or may receive each slice layer image in the three-dimensional print image transmitted by an external device, which is not limited herein. It can be understood that the size of each slice layer image in the three-dimensional printing image is generally the same, that is, the total number of contained pixels is also generally the same, so that each target slice layer image generated based on each slice layer image is sequentially displayed on the same display area of the three-dimensional printing device.
For the step of obtaining the target pixel points in each sliced layer image, the target pixel points can be obtained by scanning the pixel points of each sliced layer image, and it should be understood that, in order to solve the problem of contour lines existing in the printing model in the prior art, the target pixel points can be pixel points corresponding to an external contour in the printing model, which can include pixel points corresponding to an outer surface region of the three-dimensional printing image in each sliced layer image.
And determining the target pixel point by detecting image parameters such as the gray value and/or RGB value of the current pixel point and the gray value and/or RGB value of the pixel point adjacent to the current pixel point. In some embodiments, the electronic device may scan the pixel points in each slice layer image one by one, determine whether the pixel point is a target pixel point according to the image parameter while acquiring the position information of each pixel point, and finally acquire the position information of the target pixel point in each slice layer image.
Specifically, the target pixel points may be divided into outer contour points and upper and lower contour points, and it can be understood that the target pixel points correspond to the surface contour region of the printing model, and therefore the target pixel points need to be pattern pixel points first. Because the gray value of the pattern pixel points is high and the light transmission capability is strong, the final printing model is solidified and molded on the area formed by the pattern pixel points. Specifically, referring to fig. 2 to 7, the pattern pixel points are the pixel points forming the white regions in fig. 2 to 7, and the pixel points forming the black regions in the drawings are the non-pattern pixel points.
Meanwhile, the outline point may be a pixel point located on the outline of the white area among the pixel points of the white area. Referring to fig. 3, the pixel points filled by the oblique lines in fig. 3 are outer contour points, that is, at least one pixel point having the same gray value as the outer contour point and one pixel point having a different gray value from the outer contour point exist in the adjacent pixel points of the outer contour points.
It should be noted that the adjacent pixel points can be understood as four adjacent pixel points, i.e., four adjacent pixel points on the upper side, the lower side, the left side and the right side of the current pixel point. As shown in fig. 2-6, if the pixel point C in fig. 2 is taken as an example, fig. 2 is a sequential X-th slice layer image in each slice layer image, and a pixel point adjacent to the pixel point C has three pixel points with the same gray value as the pixel point C and one pixel point with a different gray value from the pixel point C, then the pixel point C is an outline point and belongs to the target pixel point. Similarly, referring to fig. 3, the pixels filled with the horizontal lines in fig. 3 are all outline pixels, and belong to the target pixel in the above-mentioned X-th layer.
It should be understood that, since the slice has a certain thickness, the target pixel point may also include upper and lower contour points, and the pixel points of the upper and lower contour points at the corresponding vertical projection positions of the adjacent upper and lower slice layer images have pixel points with the same gray values as those of the upper and lower contour points and pixel points with different gray values from those of the upper and lower contour points.
For example, if fig. 2 is taken as the current slice layer image, where there is a pixel point D, and in the upper slice layer image adjacent to the current slice layer image, the pixel point at the vertical projection position corresponding to the pixel point D is a pixel point a, and in the lower slice layer image adjacent to the target slice layer image, the pixel point at the vertical projection position corresponding to the pixel point D is a pixel point B.
With reference to fig. 2, the gray values of the pixels adjacent to the pixel D in fig. 2 are all the same as the gray values of the pixels, so that the pixel D is not an outer contour point. However, the slice layer images adjacent to fig. 2 are respectively fig. 4(X-1 layer) and fig. 5(X +1 layer), the gray value of the pixel point a is the same as that of the pixel point D, the gray value of the pixel point B is different from that of the pixel point D, and at this time, the pixel point D is an upper and lower contour point and belongs to the target pixel point. By analogy, the pixel points in the white area in fig. 6 include the upper and lower contour points and the outer contour point, which can be the target pixel points in the above-mentioned X-th layer.
In the step 103, since there may be a sawtooth (similar to a step portion) shown by a circular dashed line frame in fig. 2 between the region surrounded by the target pixel and the non-pattern pixel, in the embodiment of the present invention, as shown in fig. 7, at least a part of the target pixel in each slice layer image may be processed into the non-pattern pixel through the processing parameters, so as to eliminate the sawtooth to a certain extent, avoid a contour line formed due to the sawtooth from appearing on the printing model, and improve the aesthetic property of the printing model.
The processing parameter may be a random number, a character string composed of random numbers, a preset numerical value, a character string composed of preset numerical values, or the like. It should be understood that, the step of processing the target pixel points by using the processing parameters may be to perform logical operation on the characters corresponding to the target pixel points and the processing parameters after converting the target pixel points into the characters of the same type as the processing parameters one by one.
It should be understood that the above-mentioned process of acquiring the processing parameter may be a process of generating a random number or a random character string, or a process of calling a pre-stored preset numerical value or a pre-stored preset character string from a memory, and is not further limited herein.
After the slice layer images are processed, target slice layer images can be obtained, and the three-dimensional printing images can be formed layer by layer from bottom to top in the target slice layer images. The three-dimensional printing equipment can acquire the images of the target cut layers, and the images of the target cut layers are displayed in sequence in the printing process so as to ensure that the printing model is normally generated.
In the embodiment of the invention, the target pixel points corresponding to the surface area of the three-dimensional printing image in each sliced layer image of the three-dimensional printing image can be obtained, and the target pixel points are processed by using the processing parameters to obtain each target sliced layer image, so that the saw teeth at the edge of the pattern on each sliced layer image can be eliminated to a certain extent, contour lines caused by the saw teeth on the printing model are avoided, the surface effect of the printing model generated based on each target sliced layer image is further improved, and the attractiveness of the printing model is improved.
Optionally, the step 101 may specifically include:
step 1011, scanning each pixel point one by one for each slice layer image, and setting a first pixel point in the slice layer image as a pixel point to be judged, wherein the first pixel point is a pattern pixel point in the slice layer image;
step 1012, judging whether the gray value of the pixel point adjacent to the pixel point to be judged is the same as the gray value of the pixel point to be judged;
and 1013, when at least one pixel point with the same gray value as the pixel point to be judged and at least one pixel point with a different gray value from the pixel point to be judged exist in the pixel points adjacent to the pixel point to be judged, taking the pixel point to be judged as the target pixel point.
According to the above content, the target pixel points are pixel points corresponding to the surface area of the three-dimensional printing image, and may include outer contour points and upper and lower contour points. In the embodiment of the invention, the electronic equipment can scan the pixel points of each slice layer image one by one. Since the target pixel point is required to be a pattern pixel point, the electronic device can determine the pixel point to be judged by scanning the gray value of each pixel point.
It can be understood that, under the condition that each slice layer image includes pattern pixel points and non-pattern pixel points, the electronic device may determine the pixel points with higher gray values as the pixel points to be determined, and determine whether the pixel points to be determined are the target pixel points.
For the embodiment of the present invention, the electronic device may first determine whether the pixel point to be determined is the target pixel point by detecting whether the pixel point to be determined is the outline point. Specifically, the electronic device can acquire the position information of each pixel point during scanning, and detect the gray value of the pixel point adjacent to the pixel point to be determined according to the position information of the pixel point to be determined.
When at least one pixel point with the same gray value as the pixel point to be judged and at least one pixel point with the different gray value from the pixel point to be judged exist in the pixel points adjacent to the pixel point to be judged, the pixel point to be judged is the outer contour point. At this time, the electronic device may determine that the pixel to be determined is a target pixel, and may store the position information of the target pixel, so as to perform image processing on the target pixel based on the position information of the target pixel.
Further, the step 101 may further include:
1014, acquiring an upper sliced layer image and a lower sliced layer image which are adjacent to the sliced layer image for each sliced layer image;
step 1015, determining whether the gray value of the pixel point at the vertical projection position corresponding to the pixel point to be determined in the upper and lower slice layer images is the same as the gray value of the pixel point to be determined;
step 1016, in the upper and lower slice layer images, when there are pixels with the same gray value as the pixels to be judged and pixels with different gray values from the pixels to be judged among the pixels at the vertical projection positions corresponding to the pixels to be judged, the pixels to be judged are taken as the target pixels.
According to the above content, the target pixel points are pixel points corresponding to the surface area of the three-dimensional printing image, and may include outer contour points and upper and lower contour points. In the embodiment of the invention, whether the pixel point to be judged is an upper contour point or a lower contour point can be further judged, so that whether the pixel point is a target pixel point or not is determined.
Because the slice layer images are arranged in sequence, the electronic equipment can acquire upper and lower slice layer images adjacent to the slice layer images according to the slice layer images where the pixel points to be judged are located, and detect the gray values of the pixel points on the vertical projection of the pixel points to be judged in the upper and lower slice layer images according to the position information of the pixel points to be judged.
In other words, under the condition that the position information is the position coordinate, the electronic device may obtain two pixel points with the same position coordinate in the adjacent upper and lower slice layer images according to the position coordinate of the pixel point to be judged, and detect the gray value of the two pixel points.
In the upper and lower sliced layer images, the condition that the pixels at the vertical projection positions corresponding to the pixels to be judged have pixels with the same gray value as the pixels to be judged and pixels with different gray values from the pixels to be judged is that the gray value of one pixel is the same as the gray value of the pixels to be judged and the gray value of the other pixel is different from the gray value of the pixels to be judged in the two pixels. At this time, the pixel point to be judged is the upper and lower contour points, and the electronic device can confirm the pixel point to be judged as the target pixel point and record the position information of the target pixel point, so that the image processing is performed on the target pixel point based on the position information of the target pixel point.
In the embodiment of the invention, the electronic equipment can determine the target pixel point from the pixel points to be judged by scanning the gray values of the pixel points of the slice layer images one by one, and then the electronic equipment can further process the target pixel point by utilizing the processing parameters.
As can be seen from the above, the processing parameter may be a random number, a character string composed of random numbers, a preset numerical value, a character string composed of preset numerical values, or the like. In the embodiment of the present invention, the processing parameter of the target pixel may be a randomly generated number, that is, each target pixel may be processed by one randomly generated number.
It should be noted that, since the processing parameter is a randomly generated numerical value and the target pixel point is an image region, before the processing parameter is used to process the target pixel point, the method may further include:
generating a binary number value corresponding to the pixel point according to the gray value of the pixel point in each sliced layer image; the pattern pixel points correspond to the first numerical values, and the non-pattern pixel points correspond to the second numerical values.
In this step, since each slice layer image may only include pattern pixel points and non-pattern pixel points, the electronic device may generate binary values corresponding to the pixel points according to the gray values of the pixel points in each slice layer image, that is, in the scanning process, the pattern pixel points in the pixel points of each slice layer image may be marked as a first value (e.g., 1), the non-pattern pixel points in the pixel points of each slice layer image may be marked as a second value (e.g., 0), and the marked values and the position information of the pixel points may be stored in association, so as to process the target pixel points subsequently. It should be understood that, since the target pixel is a pattern pixel, the corresponding values are the first values.
Further, the step 103 may specifically include:
and step 1031, performing logical operation on the numerical value corresponding to the target pixel point and the random generated number to obtain an operation result.
And 1032, processing target pixel points corresponding to the operation result into non-pattern pixel points to obtain each target slice layer image when the operation result is the second numerical value.
In the embodiment of the present invention, when the target pixel point is obtained, the position information of the target pixel point and the corresponding numerical value thereof may be stored in an associated manner, and in a case that the processing parameter is a randomly generated number, the electronic device may generate a randomly generated binary number (0 or 1) for each target pixel point, so that a logical operation may be performed on the numerical value corresponding to the target pixel point and the randomly generated number, and an operation result is obtained. The logical operation may include a combination of at least one or more of an and operation, an or operation, and a non-operation, and is not further limited herein.
For example, when the value corresponding to the target pixel point is the first value 1, if the random generated number is 0, the value corresponding to the target pixel point and the random generated number may be subjected to and operation to obtain a calculation result of 0, that is, the second value. If the randomly generated number is 1, the operation result is 1, i.e. the first value.
The electronic device can convert the target pixel points with the operation results of the second numerical values into non-pattern pixel points in an image processing mode, and the operation results may be the first numerical values or the second numerical values.
It can be understood that the processing parameter may also be a character string composed of random numbers, in this case, the electronic device may obtain a target pixel point with the same number as the processing parameter character string each time, combine the numerical values corresponding to the target pixel point to form a character string, perform logical operation on the character string composed of the random numbers, and process the target pixel point on the bit in which the operation result is the second numerical value as a non-pattern pixel point.
Certainly, in other optional embodiments, the electronic device may generate a binary string for each layer of pixel points of the sliced layer image in the scanning process to distinguish pattern pixel points and non-pattern pixel points, and then may correspondingly generate a random string with the same number as the binary string, when the electronic device scans and determines the target pixel points, perform logical operation on the bits corresponding to the target pixel points and the same bits on the random string to obtain corresponding operation results, and process the target pixel points corresponding to the bits with the operation results of the second numerical value as the non-pattern pixel points.
For the above processing flow, in some embodiments, the electronic device may process the obtained target pixel point by using the processing parameter after sequentially scanning the slice image layers. In some embodiments, the electronic device may process the obtained target pixel point by using the processing parameter during the scanning process of each slice image layer, and may specifically perform setting according to actual needs.
Fig. 7 is a target sliced layer image obtained by processing the sliced layer image in fig. 2, and finally, the three-dimensional printing device may print the target sliced layer image to obtain a print model. As can be seen from the figure, by adopting the processing method of the embodiment of the invention, the sawtooth at the junction of the original pattern pixel point and the non-pattern pixel point can be eliminated to a certain extent, the contour line on the surface of the printing model is eliminated, and the aesthetic property of the printing model is further improved.
It should be noted that, various optional implementations described in the embodiments of the present invention may be implemented in combination with each other or implemented separately, and the embodiments of the present invention are not limited thereto.
The following describes an implementation of the present invention in detail by using a specific embodiment when the above processing parameter is a random character string composed of randomly generated numbers. In step 101, if each sliced layer image at least includes J pixel points, the following process steps executed by the electronic device may be included to acquire a specific implementation process of the corresponding target pixel point for each sliced layer image:
step 1017, obtaining the position information and the gray value of each pixel point in the current slice layer image.
Step 1018, based on the position information, performing detection on the pixel points L times to obtain a detection result of the target pixel point.
Step 1019, after the L times of pixel point detection, if there are undetected pixel points, detecting the undetected pixel points, and updating the detection result.
In the L detection detections, the number of the pixels detected in each detection is K, and any two detections do not contain the same pixels; J. k and L are positive integers, and J is greater than or equal to K L and less than K L + K.
In the embodiment of the invention, the electronic device may scan the current slice layer image to obtain the position coordinates and the gray value of each pixel point in the current slice layer image, and detect the pixel point according to the position coordinates, so as to obtain the detection result of the target pixel point.
Specifically, in the detection process, whether pattern pixel points exist in the K pixel points is judged according to the gray values of the K pixel points, then the gray values of adjacent pixel points and/or the gray values of the pixel points of the adjacent sliced layer image at the same coordinate are obtained according to the position information of the pattern pixel points, whether target pixel points exist in the current sliced layer image is judged, and the position information of the target pixel points can be recorded, so that the target pixel points can be processed conveniently. For a specific determination manner, reference may be made to the description of the above embodiments, which is not described herein again.
K pixel points detected each time can be set according to actual needs, for example, in some embodiments, the electronic device can detect the pixel points of the slice layer image line by line, and the K pixel points can be pixel points continuously arranged in a line; in some embodiments, the electronic device may also detect pixel points of the slice layer image one by one, where the area may be a rectangle or a square, and includes K pixel points, and is not further limited herein.
Because current slice layer image includes J pixel at least, under the condition that J equals K × L, all pixel all detect the completion after having carried out L scans, the testing result that obtains this moment can be for whether including the positional information of target pixel and the target pixel that contains in current slice layer image, and electronic equipment can handle target pixel based on the positional information of target pixel. It should be understood that the above detection result may be updated once after each detection, or may be generated after L detections, and is not further limited herein.
Under the condition that J is larger than K x L and smaller than K x L + K, after L times of detection are carried out, undetected pixel points exist in the current sliced layer image, the undetected pixel points can be detected at the moment, the detection result is updated, and therefore whether the current sliced layer image comprises the target pixel points and the position information of the contained target pixel points or not can be obtained.
According to the embodiment of the invention, the detection result of the target pixel point in the current sliced layer image can be obtained through multiple detections, so that the electronic equipment can process the target pixel point based on the detection result.
It should be understood that, if the target pixel point in each slice layer image is to be acquired, the electronic device may execute the steps 1017 to 1019 for each slice layer image, which is not described herein again.
Further, in the step 102, the specific implementation process of obtaining the processing parameter of the target pixel point may include the following steps executed by the electronic device before performing each detection:
step 1021, based on the gray values of the K pixel points detected each time, a binary first character string is generated, each pixel point corresponds to one bit in the first character string, the bit corresponding to the pattern pixel point is a first numerical value, and the bit corresponding to the non-pattern pixel point is a second numerical value.
Step 1022, generating a second character string corresponding to the first character string, where the first character string is a binary sequence, and the second character string is a binary random sequence.
Specifically, the random number (signed short) r _ num may be generated by calling a rand () function in the C language library # include < stdlib.h > and # include < stdio.h >, and then the second character string may be obtained by performing a non-operation on r _ num. Since the generated r _ num is a 16-bit binary random sequence, the value of K may also be set to 16, thereby facilitating processing.
Further, the specific implementation flow of step 1031 may include the following steps executed by the electronic device in each detection process:
step 10311, if the target pixel point is detected, performing logical operation on a bit corresponding to the target pixel point on the first character string and a bit corresponding to the target pixel point on the second character string to obtain an operation result.
For example, if K is 4, the first numerical value is 1, the second numerical value is 0, and the first character string is 0110, and the pixel points corresponding to the second bit and the third bit of the first character string are all target pixel points, a random sequence such as 1010 may be generated, and the second bit and the third bit of the first character string and the second character string are respectively and-operated, so as to obtain operation results 0 and 1.
Accordingly, the specific implementation flow of step 1032 may include the following steps executed by the electronic device in each detection process:
step 10321, under the condition that the operation result is the second numerical value, processing the target pixel points corresponding to the operation result as non-pattern pixel points, performing logical operation on the first character strings corresponding to all the pixel points in the slice layer image, and processing the target pixel points corresponding to the second numerical value as the non-pattern pixel points to obtain the target slice layer image.
In the embodiment of the present invention, the processing parameter may be a random character string composed of randomly generated numbers, and the processing on the target pixel point may be implemented through a logical operation between character strings, so as to improve the processing efficiency.
It is understood that the second character string may be a fixed character string set in advance, and temporary random generation is not required, so that a certain processing time may be reduced, but randomness may be reduced, and the final processing effect may be slightly inferior to the method of randomly generating the second character string.
It should be noted that, in the image processing method provided in the embodiment of the present invention, the execution subject may be an image processing apparatus, or a control module in the image processing apparatus for executing the loaded image processing method. In the embodiment of the present invention, an image processing apparatus executes a loaded image processing method as an example, and the image processing method provided in the embodiment of the present invention is described.
Referring to fig. 8, fig. 8 is a structural diagram of an image processing apparatus according to an embodiment of the present invention, and as shown in fig. 8, an image processing apparatus 800 includes:
a first obtaining module 801, configured to obtain a target pixel point in each slice layer image of a three-dimensional printed image;
a second obtaining module 802, configured to obtain a processing parameter of the target pixel;
the processing module 803 is configured to sequentially process the target pixel points in each sliced layer image by using the processing parameters to obtain each target sliced layer image; the three-dimensional printing image is formed by the target slice layer images from bottom to top layer by layer; and the target pixel points are pixel points corresponding to the outer surface area of the three-dimensional printing image in each slice layer image.
Optionally, the first obtaining module includes:
the scanning unit is used for scanning each pixel point one by one for each sliced layer image and setting a first pixel point in the sliced layer image as a pixel point to be judged, wherein the first pixel point is a pattern pixel point in the sliced layer image;
the first judgment unit is used for judging whether the gray value of the pixel point adjacent to the pixel point to be judged is the same as the gray value of the pixel point to be judged;
the first determining unit is used for taking the pixel point to be judged as the target pixel point when at least one pixel point with the same gray value as the pixel point to be judged and at least one pixel point with different gray values from the pixel point to be judged exist in the pixel points adjacent to the pixel point to be judged.
Optionally, the first obtaining module further includes:
the acquisition unit is used for acquiring upper and lower slice layer images adjacent to the slice layer images for each slice layer image;
the second judging unit is used for judging whether the gray value of a pixel point at the vertical projection position corresponding to the pixel point to be judged in the upper and lower slice layer images is the same as the gray value of the pixel point to be judged;
and the second determining unit is used for taking the pixel point to be judged as the target pixel point when the pixel point with the same gray value as the pixel point to be judged exists in the pixel points at the vertical projection positions corresponding to the pixel point to be judged in the upper and lower slice layer images and the pixel point with the different gray value from the pixel point to be judged.
Optionally, the processing parameter of the target pixel point is a randomly generated number.
Optionally, the apparatus further comprises:
the generating module is used for generating binary numerical values corresponding to the pixel points according to the gray values of the pixel points in the slice layer images; the pattern pixel points correspond to first numerical values, and the non-pattern pixel points correspond to second numerical values;
the processing module 803 includes:
the arithmetic unit is used for carrying out logical operation on the numerical value corresponding to the target pixel point and the random generated number to obtain an operation result;
and the processing unit is used for processing the target pixel points corresponding to the operation result into non-pattern pixel points to obtain each target slice layer image when the operation result is the second numerical value.
According to the embodiment of the invention, the target pixel points in each sliced layer image of the three-dimensional printing image are acquired through the first acquisition module 801, the processing parameters of the target pixel points are acquired through the second acquisition module 802, and then the target pixel points in each sliced layer image are sequentially processed through the processing parameters through the processing module 803 to obtain each target sliced layer image, so that the saw teeth at the edge of the pattern on the sliced layer image can be eliminated to a certain extent, the appearance of contour lines caused by the saw teeth on the printing model is avoided, the surface effect of the printing model generated based on the second image set is improved, and the attractiveness of the printing model is improved.
The image processing apparatus in the embodiment of the present invention may be an apparatus, or may be a component, an integrated circuit, or a chip in a terminal. The device can be mobile electronic equipment or non-mobile electronic equipment. By way of example, the mobile electronic device may be a mobile phone, a tablet computer, a notebook computer, a palm top computer, a vehicle-mounted electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook or a Personal Digital Assistant (PDA), and the like, and the non-mobile electronic device may be a server, a Network Attached Storage (NAS), a Personal Computer (PC), a Television (TV), a teller machine or a self-service machine, and the like, and the embodiment of the present invention is not particularly limited.
The image processing apparatus in the embodiment of the present invention may be an apparatus having an operating system. The operating system may be a Windows operating system, an Android (Android) operating system, an ios operating system, or other possible operating systems, and the embodiment of the present invention is not particularly limited.
The image processing apparatus provided in the embodiment of the present invention can implement each process implemented by the image processing method in the method embodiments of fig. 1 to fig. 7, and is not described herein again to avoid repetition.
Optionally, an embodiment of the present invention further provides an electronic device, which includes a memory 901, a processor 902, and a program or an instruction stored in the memory 901 and executable on the processor 902, where the program or the instruction is executed by the processor 902 to implement each process of the above-mentioned embodiment of the image processing method, and can achieve the same technical effect, and in order to avoid repetition, details are not described here again.
It should be noted that the electronic device in the embodiment of the present invention includes the mobile electronic device and the non-mobile electronic device described above.
The embodiment of the present invention further provides a readable storage medium, where a program or an instruction is stored on the readable storage medium, and when the program or the instruction is executed by a processor, the program or the instruction implements each process of the embodiment of the image processing method, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here.
The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and so on.
The embodiment of the present invention further provides a chip, where the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is configured to execute a program or an instruction to implement each process of the above-mentioned embodiment of the image processing method, and can achieve the same technical effect, and is not described here again to avoid repetition.
It should be understood that the chips mentioned in the embodiments of the present invention may also be referred to as a system-on-chip, a system-on-chip or a system-on-chip, etc.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element. Further, it should be noted that the scope of the methods and apparatus of embodiments of the present invention is not limited to performing functions in the order illustrated or discussed, but may include performing functions in a substantially simultaneous manner or in a reverse order based on the functions involved, e.g., the methods described may be performed in an order different than that described, and various steps may be added, omitted, or combined. In addition, features described with reference to certain examples may be combined in other examples.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
While the present invention has been described with reference to the embodiments shown in the drawings, the present invention is not limited to the embodiments, which are illustrative and not restrictive, and it will be apparent to those skilled in the art that various changes and modifications can be made therein without departing from the spirit and scope of the invention as defined in the appended claims.

Claims (12)

1. An image processing method, comprising:
acquiring target pixel points in each sliced layer image of the three-dimensional printing image;
acquiring processing parameters of the target pixel points;
sequentially processing target pixel points in each sliced layer image by using the processing parameters to obtain each target sliced layer image; the three-dimensional printing image is formed by the target slice layer images from bottom to top layer by layer; and the target pixel points are pixel points corresponding to the outer surface area of the three-dimensional printing image in each slice layer image.
2. The method of claim 1, wherein the obtaining of the target pixel point in each slice layer image of the three-dimensional printed image comprises:
scanning each pixel point one by one for each slice layer image, and setting a first pixel point in the slice layer image as a pixel point to be judged, wherein the first pixel point is a pattern pixel point in the slice layer image;
judging whether the gray value of the pixel point adjacent to the pixel point to be judged is the same as the gray value of the pixel point to be judged;
and when at least one pixel point with the same gray value as the pixel point to be judged and at least one pixel point with the different gray value from the pixel point to be judged exist in the pixel points adjacent to the pixel point to be judged, taking the pixel point to be judged as the target pixel point.
3. The method of claim 2, wherein obtaining target pixel points in each slice layer image of the three-dimensional printed image further comprises:
for each slice layer image, acquiring an upper slice layer image and a lower slice layer image which are adjacent to the slice layer image;
judging whether the gray value of a pixel point at the vertical projection position corresponding to the pixel point to be judged in the upper and lower slice layer images is the same as the gray value of the pixel point to be judged;
and in the upper and lower slice layer images, when pixels with the same gray value as that of the pixels to be judged exist in the pixels at the vertical projection positions corresponding to the pixels to be judged and pixels with different gray values from that of the pixels to be judged, the pixels to be judged are taken as the target pixels.
4. The method of claim 1, wherein the processing parameter of the target pixel is a randomly generated number.
5. The method according to claim 4, wherein before the processing parameters are used to sequentially process the target pixel points in each sliced layer image to obtain each target sliced layer image, the method further comprises:
generating a binary number value corresponding to the pixel point according to the gray value of the pixel point in each sliced layer image; the pattern pixel points correspond to first numerical values, and the non-pattern pixel points correspond to second numerical values;
the processing parameters are used for sequentially processing the target pixel points in each sliced layer image to obtain each target sliced layer image, and the processing parameters comprise:
performing logical operation on the numerical value corresponding to the target pixel point and the random generated number to obtain an operation result;
and for each sliced layer image, when the operation result is the second numerical value, processing target pixel points corresponding to the operation result into non-pattern pixel points to obtain each target sliced layer image.
6. An image processing apparatus characterized by comprising:
the first acquisition module is used for acquiring target pixel points in each slice layer image of the three-dimensional printing image;
the second acquisition module is used for acquiring the processing parameters of the target pixel points;
the processing module is used for sequentially processing the target pixel points in each sliced layer image by using the processing parameters to obtain each target sliced layer image; the three-dimensional printing image is formed by the target slice layer images from bottom to top layer by layer; and the target pixel points are pixel points corresponding to the outer surface area of the three-dimensional printing image in each slice layer image.
7. The apparatus of claim 6, wherein the first obtaining module comprises:
the scanning unit is used for scanning each pixel point one by one for each sliced layer image and setting a first pixel point in the sliced layer image as a pixel point to be judged, wherein the first pixel point is a pattern pixel point in the sliced layer image;
the first judgment unit is used for judging whether the gray value of the pixel point adjacent to the pixel point to be judged is the same as the gray value of the pixel point to be judged;
the first determining unit is used for taking the pixel point to be judged as the target pixel point when at least one pixel point with the same gray value as the pixel point to be judged and at least one pixel point with different gray values from the pixel point to be judged exist in the pixel points adjacent to the pixel point to be judged.
8. The apparatus of claim 7, wherein the first obtaining module further comprises:
the acquisition unit is used for acquiring upper and lower slice layer images adjacent to the slice layer images for each slice layer image;
the second judging unit is used for judging whether the gray value of a pixel point at the vertical projection position corresponding to the pixel point to be judged in the upper and lower slice layer images is the same as the gray value of the pixel point to be judged;
and the second determining unit is used for taking the pixel point to be judged as the target pixel point when the pixel point with the same gray value as the pixel point to be judged exists in the pixel points at the vertical projection positions corresponding to the pixel point to be judged in the upper and lower slice layer images and the pixel point with the different gray value from the pixel point to be judged.
9. The apparatus of claim 6, wherein the processing parameter of the target pixel is a randomly generated number.
10. The apparatus of claim 9, further comprising:
the generating module is used for generating binary numerical values corresponding to the pixel points according to the gray values of the pixel points in the slice layer images; the pattern pixel points correspond to first numerical values, and the non-pattern pixel points correspond to second numerical values;
the processing module comprises:
the arithmetic unit is used for carrying out logical operation on the numerical value corresponding to the target pixel point and the random generated number to obtain an operation result;
and the processing unit is used for processing the target pixel points corresponding to the operation result into non-pattern pixel points to obtain each target slice layer image when the operation result is the second numerical value.
11. An electronic device comprising a processor, a memory, and a program or instructions stored on the memory and executable on the processor, which when executed by the processor, implements the method steps of any of claims 1 to 5.
12. A readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method steps of any one of claims 1 to 5.
CN202110381810.6A 2021-04-09 2021-04-09 Image processing method and device, electronic equipment and readable storage medium Pending CN112950514A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110381810.6A CN112950514A (en) 2021-04-09 2021-04-09 Image processing method and device, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110381810.6A CN112950514A (en) 2021-04-09 2021-04-09 Image processing method and device, electronic equipment and readable storage medium

Publications (1)

Publication Number Publication Date
CN112950514A true CN112950514A (en) 2021-06-11

Family

ID=76231278

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110381810.6A Pending CN112950514A (en) 2021-04-09 2021-04-09 Image processing method and device, electronic equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN112950514A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170102679A1 (en) * 2015-10-07 2017-04-13 Autodesk, Inc. Sub-pixel grayscale three-dimensional printing
CN106903877A (en) * 2017-02-18 2017-06-30 无锡金谷三维科技有限公司 A kind of photocuring 3D printing antialiasing optimization method of the LCD based on RGB arrangements
US20170249440A1 (en) * 2014-09-15 2017-08-31 Conformis, Inc. 3d printing surgical repair systems
CN110103465A (en) * 2019-05-17 2019-08-09 江西迈亚科技有限公司 Image-recognizing method and application during a kind of photocuring is three-dimensionally shaped
CN110435154A (en) * 2019-08-12 2019-11-12 爱迪特(秦皇岛)科技股份有限公司 For the image processing method of 3D printing, device, electronic equipment and storage medium
CN112008980A (en) * 2020-02-24 2020-12-01 清锋(北京)科技有限公司 3D printing model processing method and system
CN112102460A (en) * 2020-09-17 2020-12-18 上海复志信息技术有限公司 3D printing slicing method, device, equipment and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170249440A1 (en) * 2014-09-15 2017-08-31 Conformis, Inc. 3d printing surgical repair systems
US20170102679A1 (en) * 2015-10-07 2017-04-13 Autodesk, Inc. Sub-pixel grayscale three-dimensional printing
CN106903877A (en) * 2017-02-18 2017-06-30 无锡金谷三维科技有限公司 A kind of photocuring 3D printing antialiasing optimization method of the LCD based on RGB arrangements
CN110103465A (en) * 2019-05-17 2019-08-09 江西迈亚科技有限公司 Image-recognizing method and application during a kind of photocuring is three-dimensionally shaped
CN110435154A (en) * 2019-08-12 2019-11-12 爱迪特(秦皇岛)科技股份有限公司 For the image processing method of 3D printing, device, electronic equipment and storage medium
CN112008980A (en) * 2020-02-24 2020-12-01 清锋(北京)科技有限公司 3D printing model processing method and system
CN112102460A (en) * 2020-09-17 2020-12-18 上海复志信息技术有限公司 3D printing slicing method, device, equipment and storage medium

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
MISAL等: "Implementation of 3D Scanning Technique for Object Model Replication and Customization Using Rapid Prototyping", 《 2019 INTERNATIONAL CONFERENCE ON ENGINEERING AND EMERGING TECHNOLOGIES (ICEET)》 *
吴静雯: "基于三维打印工艺的多材料零件数字化处理研究", 《 中国优秀硕士学位论文全文数据库 工程科技Ⅱ辑》 *
谭艳丽;赵永强;: "3D打印几何外形三维图像优化分割研究", 计算机仿真, no. 08 *

Similar Documents

Publication Publication Date Title
Ju et al. Gamma-correction-based visibility restoration for single hazy images
CN110009712B (en) Image-text typesetting method and related device thereof
CN111583381B (en) Game resource map rendering method and device and electronic equipment
JP2002202838A (en) Image processor
CN111192190B (en) Method and device for eliminating image watermark and electronic equipment
CN115812221A (en) Image generation and coloring method and device
CN112651953B (en) Picture similarity calculation method and device, computer equipment and storage medium
CN111563908A (en) Image processing method and related device
CN111311528A (en) Image fusion optimization method, device, equipment and medium
CN111461070B (en) Text recognition method, device, electronic equipment and storage medium
CN113313027A (en) Image processing method, image processing device, electronic equipment and storage medium
CN111787240B (en) Video generation method, apparatus and computer readable storage medium
CN109753957B (en) Image significance detection method and device, storage medium and electronic equipment
CN108804978B (en) Layout analysis method and device
US20110187721A1 (en) Line drawing processing apparatus, storage medium storing a computer-readable program, and line drawing processing method
CN112950514A (en) Image processing method and device, electronic equipment and readable storage medium
CN115345895B (en) Image segmentation method and device for visual detection, computer equipment and medium
CN112927321B (en) Intelligent image design method, device, equipment and storage medium based on neural network
CN115829929A (en) Method, device and equipment for detecting defects of product surface image and storage medium
CN110619597A (en) Semitransparent watermark removing method and device, electronic equipment and storage medium
CN112598692A (en) Remote sensing image segmentation post-processing algorithm based on marked pixel matrix
CN106934814B (en) Background information identification method and device based on image
CN114677319A (en) Stem cell distribution determination method and device, electronic equipment and storage medium
JP5672168B2 (en) Image processing apparatus, image processing method, and program
JP6613625B2 (en) Image processing program, image processing apparatus, and image processing method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination