Color / texture extraction method, device, system and electronic device
Through the combination of stylus and external cameras, the problem of obtaining the color and texture of the target object is solved, and efficient and accurate color/texture extraction is achieved, simplifying user operations and reducing equipment costs.
Patent Information
- Application Number
- CN202010605825.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-06-29
- Publication Date
- 2024-11-19
- Estimated Expiration
- 2040-06-29
AI Technical Summary
When users use electronic devices to perform image processing, it is difficult to obtain the real color and texture of the target object simply and conveniently, resulting in cumbersome operation of the user and poor results.
Using a combination of stylus and external cameras, the nib of the stylus touches the color/texture position of the target object through the stylus' pen tip, and uses the camera to take pictures or scan the color/texture of the object, which reduces equipment costs and improves operational flexibility and accuracy. Spend.
It enables the acquisition of the color/texture of the target object without additional camera or color sensor, reducing equipment costs, improving operational flexibility and accuracy, and simplifying user operations.
Smart Images

Figure CN113934345B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of intelligent terminal technology, and in particular to a color / texture extraction method, device, system and electronic device. Background Art
[0002] In application scenarios where users use electronic devices to process images, it is often necessary to obtain the color / texture of the target object. For example, when using a stylus to hand-draw an apple on an electronic drawing board, the color / texture of the apple needs to be obtained when coloring / adding texture to the hand-drawn apple; for another example, when using image modification software to color / add texture to the clothes of people in old black-and-white photos, the color / texture of the clothes of the people needs to be obtained.
[0003] In the prior art, the color of the target object can be generated by the user manipulating the color palette based on visual observation, but manipulating the color palette to generate the color that the user visually observes requires the user to have quite proficient color adjustment skills. When the user's color adjustment skills are not proficient enough, manipulating the color palette to generate color not only requires a lot of work, but also there is often a large deviation between the color generated by the color palette and the actual color of the target object, and the expected effect of the user cannot be achieved.
[0004] In the prior art, the texture of the target object can be obtained by downloading from the Internet, but the Internet download can only obtain pre-generated textures. There are a large number of textures available for download on the Internet, and searching for the required texture among a large number of textures will inevitably consume a lot of work. In addition, it cannot be ensured that the pre-generated textures on the Internet contain textures that are completely consistent with the actual texture of the target object. Usually, users can only download texture replacements that are similar to the actual texture of the target object, which greatly affects the final image effect.
[0005] Therefore, in application scenarios where users use electronic devices to perform image processing, a simple and easy method is needed to obtain the true color / texture of the target object to reduce the user's workload and enable the user to achieve the expected image effect. Summary of the invention
[0006] In response to the problem that the color / texture of a target object cannot be easily and conveniently obtained in application scenarios where electronic devices are used for image processing under the prior art, the present application provides a color / texture extraction method, device, system and electronic device. The present application also provides a computer-readable storage medium.
[0007] The present application embodiment adopts the following technical solutions:
[0008] In a first aspect, the present application provides a color / texture extraction method, characterized by comprising:
[0009] First shooting focus setting: identifying the tip of the pen-like object to confirm the position of the tip, and setting the shooting focus of the camera to the position of the tip, wherein the tip of the pen-like object points to the color / texture position of the target object;
[0010] First image acquisition: performing image acquisition based on the camera whose shooting focus is set to the position of the pen tip, and obtaining a first image acquisition result;
[0011] Confirming a color / texture region in the first image acquisition result, wherein the color / texture region is an image region in the first image acquisition result corresponding to a color / texture position of the target object;
[0012] Get the color value / texture of the color / texture area.
[0013] In a feasible implementation manner of the first aspect above, the first shooting focus setting includes:
[0014] Second image acquisition: performing image acquisition based on the camera, obtaining a second image acquisition result, and identifying the pen tip from the second image acquisition result to confirm the position of the pen tip;
[0015] Second shooting focus setting: when the shooting focus when acquiring the second image acquisition result and the pen tip position confirmed based on the second image acquisition result are greater than a preset distance, the shooting focus of the camera is set to the pen tip position confirmed based on the second image acquisition result;
[0016] The second image acquisition and the second shooting focus setting are executed in a loop until the distance between the shooting focus when acquiring the second image acquisition result and the pen tip position confirmed based on the second image acquisition result is less than or equal to a preset distance.
[0017] In a feasible implementation manner of the first aspect, the confirming the color / texture region in the first image acquisition result includes:
[0018] identifying the pen tip from the first image acquisition result to confirm an image area of the pen tip;
[0019] The color / texture area is confirmed according to the image area of the pen tip, wherein the color / texture area is connected to the image area of the pen tip.
[0020] In a feasible implementation manner of the first aspect, the confirming the color / texture region in the first image acquisition result includes:
[0021] identifying the pen tip from the first image acquisition result to confirm an image area of the pen tip;
[0022] identifying the target object from the first image acquisition result to confirm an image region of the target object;
[0023] The color / texture area is confirmed according to the image area of the pen tip and the image area of the target object, wherein the color / texture area is a sub-area in the image area of the target object, and the sub-area is connected to the image area of the pen tip.
[0024] In a feasible implementation manner of the first aspect above, the color / texture area is an image area in the pointing direction of the pen tip.
[0025] In a feasible implementation manner of the first aspect, the confirming the color / texture region in the first image acquisition result includes:
[0026] Identifying the pen tip from the first image acquisition result to confirm an image area of the pen tip and a pointing direction of the pen tip;
[0027] identifying the target object from the first image acquisition result to confirm an image region of the target object;
[0028] The color / texture area is confirmed based on the image area of the pen tip, the pointing direction of the pen tip, and the image area of the target object, wherein the color / texture area is a sub-area in the image area of the target object, and the sub-area is the image area in the image area of the target object that is closest to the pen tip in the pointing direction of the pen tip.
[0029] In a feasible implementation of the first aspect above:
[0030] Before the first shooting focus is set, the method further includes: judging whether to enter a color picking / texture mode according to a control instruction, and when it is judged that the color picking / texture mode is entered, executing the first shooting focus setting, the first image acquisition and subsequent operations.
[0031] In a feasible implementation of the first aspect above:
[0032] Before the first shooting focus is set, the method further includes: judging whether to enter a color picking / texture mode according to a control instruction, and executing the first shooting focus setting when it is judged that the color picking / texture mode is entered;
[0033] Before the first image acquisition, the method further includes: loopingly executing the first shooting focus setting until it is determined to execute the first image acquisition and subsequent operations according to a control instruction.
[0034] In a feasible implementation of the first aspect above:
[0035] In the process of acquiring the color value / texture of the color / texture region, acquiring a plurality of different color values / textures of the color / texture region;
[0036] After acquiring the color value / texture of the color / texture area, the method further includes: displaying the multiple different color values / textures to the user for the user to select.
[0037] In a second aspect, the present application provides a color / texture extraction device, comprising:
[0038] A shooting focus setting module, which is used to identify the tip of the pen-like object to confirm the position of the tip, and set the shooting focus of the camera to the position of the tip, wherein the tip of the pen-like object points to the color / texture position of the target object;
[0039] An image acquisition module, which is used to obtain a first image acquisition result, wherein the first image acquisition result is an image acquisition result generated by acquiring an image based on the camera whose shooting focus is set to the position of the pen tip;
[0040] A color / texture region confirmation module, which is used to confirm the color / texture region in the first image acquisition result, wherein the color / texture region is an image region in the first image acquisition result corresponding to the color / texture position of the target object;
[0041] The color / texture extraction module is used to obtain the color value / texture of the color / texture extraction area.
[0042] In a third aspect, the present application provides a color picking / texture system, comprising a camera, a color picking pen, and the color picking / texture device as described in the second aspect.
[0043] In a fourth aspect, the present application provides an electronic device, comprising a memory for storing computer program instructions and a processor for executing the program instructions, wherein when the computer program instructions are executed by the processor, the electronic device is triggered to execute the method steps described in the embodiments of the present application.
[0044] In a fifth aspect, the present application provides a computer-readable storage medium, in which a computer program is stored. When the computer-readable storage medium is run on a computer, the computer executes the method of the embodiment of the present application.
[0045] According to the above technical solution proposed in the embodiment of the present application, at least the following technical effects can be achieved:
[0046] According to the method of an embodiment of the present application, color / texture picking can be achieved without adding a camera or color sensor to the pen-like object used to point to the color / texture picking position, which greatly reduces the hardware cost of the color picking device and avoids the user's hand-holding problem caused by the pen-like object used to point to the color / texture picking position being too heavy or too large.
[0047] Furthermore, according to the method of an embodiment of the present application, in the process of realizing color / texture picking, any pen-like object with a tip structure that can point to the color / texture picking position can be used, which greatly improves the operational flexibility of color / texture picking;
[0048] Furthermore, according to a method of an embodiment of the present application, the shooting focus of the camera is set to the tip position of the pen-like object pointing to the color / texture picking position, which greatly improves the accuracy of the color / texture picking operation. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 The figure is a flow chart of a color / texture extraction method according to an embodiment of the present application;
[0050] Figure 2 Shown is a partial flow chart of a color / texture extraction method according to an embodiment of the present application;
[0051] Figure 3 Shown is a partial flow chart of a color / texture extraction method according to an embodiment of the present application;
[0052] Figure 4 The figure is a flow chart of a color / texture extraction method according to an embodiment of the present application;
[0053] Figure 5 The figure is a flow chart of a color / texture extraction method according to an embodiment of the present application;
[0054] Figure 6 The figure shows an application scenario diagram according to an embodiment of the color / texture extraction method of the present application;
[0055] Figure 7 The figure shows a schematic diagram of a photographing result according to an embodiment of the color / texture extraction method of the present application;
[0056] Figure 8 Shown is a structural diagram of an embodiment of a color extraction / texture device according to the present application. DETAILED DESCRIPTION
[0057] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.
[0058] The terms used in the implementation section of this application are only used to explain the specific embodiments of this application and are not intended to limit this application.
[0059] In response to the problem that it is impossible to simply and conveniently obtain the color / texture of the target object in the application scenarios where electronic devices are used for image processing under the prior art, the present application provides a color / texture extraction method. In order to propose the method of the embodiment of the present application, the inventor first analyzes the scene details of the application scenarios where electronic devices are used for image processing under the prior art.
[0060] In actual application scenarios, whether using a palette to generate colors or obtaining textures through network downloads, one of the problems is that the colors / textures are not directly collected from the object, which makes it impossible to ensure that the acquired colors / textures are completely consistent with the actual colors / textures of the target object, thereby affecting the final image effect. Therefore, in a feasible solution, take a photo of the target object, import the photo of the target object into an electronic device, and then use relevant drawing software to extract the color / texture. However, the execution process of the above solution is cumbersome, and the user needs to have proficient photography and drawing software operation capabilities. In addition, the photography effect of the target object and the extraction algorithm of the drawing software will directly affect the color / texture extraction results. When the photo of the target object has problems such as overexposure, underexposure, and focus error, the final extracted color / texture will not achieve the expected effect of the user.
[0061] In order to achieve simple and fast acquisition of color / texture, in a feasible solution, a stylus is used to extract color / texture. For example, a camera is added to the stylus, and the user uses the stylus to aim at the target object when extracting color / texture, and the stylus directly extracts the color / texture of the object by taking a photo or scanning with the camera on the stylus. For another example, a color sensor is added to the stylus, and the user uses the stylus to aim at the target object when extracting color / texture, and the stylus directly extracts the color of the object through the color sensor. In the above solutions, whether a camera or a color sensor is used, the cost of the stylus will increase; and the camera or color sensor will also increase the weight of the stylus and change the appearance of the stylus, thereby affecting user use.
[0062] In view of the above problems, in one embodiment of the present application, a stylus pen is combined with an external camera to realize color / texture extraction. Specifically, the tip of the stylus pen is used to contact the color / texture position of the target object; an external camera is used to take a photo of the stylus pen and the target object; the tip of the stylus pen is identified in the photo obtained by taking the photo to confirm the color / texture position contacted by the tip of the stylus pen; and finally, the color / texture of the color / texture position is extracted. In this way, color / texture extraction can be realized without adding an additional camera or color sensor to the stylus pen, which greatly reduces the cost of the stylus pen. And the stylus pen can be configured with a shape and weight based on the user's holding habits to avoid affecting the user's holding due to the stylus pen being too heavy or too large. Further, in the process of realizing color / texture extraction, since the function of the stylus pen is only to contact the color / texture position, in the process of realizing color / texture extraction, it is not limited to using a stylus pen. Any pen-shaped object with a tip structure similar to a pen tip and the tip structure can be used to indicate the color / texture position can be used to realize color / texture extraction. This greatly improves the flexibility of color / texture implementation.
[0063] Furthermore, in the application scenario of color / texture extraction, the shooting effect in the image captured by the camera will directly affect the accuracy of color / texture extraction. Considering that in the actual shooting process, the captured images generated for the same shooting scene are different according to the different shooting focuses of the camera, for example, the clarity of the object at the shooting focus is better than the clarity of the object at the non-shooting focus. Therefore, in one embodiment of the present application, when taking pictures of the stylus and the target object, the shooting focus is set to the color / texture extraction position, thereby improving the accuracy of color / texture extraction.
[0064] The technical solutions provided by various embodiments of the present application are described in detail below in conjunction with the accompanying drawings.
[0065] Figure 1 The flowchart of the color / texture extraction method according to one embodiment of the present application is shown. Figure 1 As shown, the following steps are performed during the implementation of the color / texture method:
[0066] Step 100, first shooting focus setting: identifying the tip of the pen-like object to confirm the position of the tip, and setting the shooting focus of the camera to the position of the tip, wherein the tip of the pen-like object points to the color / texture position of the target object;
[0067] Step 110, first image acquisition: performing image acquisition based on a camera whose shooting focus is set to the position of the pen tip, and obtaining a first image acquisition result;
[0068] Step 120, confirming the color / texture region in the first image acquisition result, wherein the color / texture region is an image region in the first image acquisition result corresponding to the color / texture position of the target object;
[0069] Step 130, obtaining the color value / texture of the color / texture area in the first image acquisition result.
[0070] according to Figure 1 The method of the embodiment shown can realize color / texture picking without adding an additional camera or color sensor to the stylus, which greatly reduces the cost of the stylus and avoids the user's hand-holding problem caused by the stylus being too heavy or too large. Furthermore, in the process of realizing color / texture picking, any pen-like object with a tip structure that can point to the color / texture picking position can be used, which greatly improves the operational flexibility of color / texture picking.
[0071] Further, according to Figure 1 The method of the illustrated embodiment sets the shooting focus of the camera to the position of the pen tip of the pen-like object pointing to the color / texture picking position, thereby improving the accuracy of the color / texture picking operation.
[0072] Furthermore, Figure 1 Each step of the illustrated embodiment may have a variety of different implementation methods.
[0073] Specifically, considering that when actually picking colors / textures, the placement / orientation of the camera may not match the placement of the target object, that is, the target object may not be within the detection range of the camera. Therefore, in one implementation of step 100, in the process of identifying the tip of the pen-like object to confirm the position of the tip, it is determined whether the tip can be identified. If the tip cannot be identified, an error prompt message is output.
[0074] Furthermore, in one embodiment of the present application, a vibration module and / or indicator light is configured on the pen-like object used to point to the color / texture position, and error prompt information is output through the vibration module and / or indicator light. For example, when the pen tip cannot be identified, the pen-like object vibrates; or, when the pen tip cannot be identified, the indicator light of the pen-like object flashes.
[0075] Further, in one embodiment of the present application, during the execution of step 100 and step 110, the detection range of the camera is always kept fixed. Specifically, during the execution of step 100 and step 110, the position and shooting direction of the camera are kept fixed. That is, after the shooting focus setting is determined in step 100, in step 110, the position and direction of the camera in step 100 are maintained unchanged, and image acquisition is performed directly. Since the pen tip has been identified in step 100 and the shooting focus of the camera is set to the pen tip position, when image acquisition is performed in step 110, the image acquisition result acquired must include the image corresponding to the pen tip of the pen-like object and the color / texture position of the target object, and there is no need to consider the framing problem when performing image acquisition in step 110.
[0076] Furthermore, in an implementation of step 100, the shooting focus is set in a dynamic cycle. Specifically, step 100 includes:
[0077] Second image acquisition: performing image acquisition based on a camera, obtaining a second image acquisition result, and identifying the pen tip from the second image acquisition result to confirm the position of the pen tip;
[0078] Second shooting focus setting: when the distance between the shooting focus when acquiring the second image acquisition result and the pen tip position confirmed based on the second image acquisition result is greater than a preset distance, the shooting focus of the camera is set to the pen tip position confirmed based on the second image acquisition result;
[0079] The second image acquisition and the second shooting focus setting are executed cyclically until the distance between the shooting focus when acquiring the second image acquisition result and the pen tip position confirmed based on the second image acquisition result is less than or equal to the preset distance.
[0080] Figure 2 FIG. 1 is a partial flow chart of a color / texture extraction method according to an embodiment of the present application. Figure 2 As shown, in step 100, the following steps are performed:
[0081] Step 210, second image acquisition: performing image acquisition based on a camera, obtaining a second image acquisition result, and identifying the pen tip from the second image acquisition result to confirm the position of the pen tip;
[0082] Secondary shooting focus settings, including:
[0083] Step 221, determining whether the distance between the shooting focus when acquiring the second image acquisition result and the pen tip position confirmed based on the second image acquisition result is greater than a preset distance;
[0084] Step 230, when the distance between the shooting focus when collecting the second image acquisition result and the pen tip position confirmed based on the second image acquisition result is greater than the preset distance, set the shooting focus of the camera to the pen tip position confirmed based on the second image acquisition result, and return to Step 210;
[0085] Step 240, when the distance between the shooting focus when collecting the second image acquisition result and the pen tip position confirmed based on the second image acquisition result is less than or equal to the preset distance, the shooting focus setting is completed.
[0086] Specifically, in an application scenario, Figure 3 The following shows a partial flowchart of the color picking / texture method according to an embodiment of the present application. In an embodiment of the present application, as Figure 3 shown, the following steps are performed during the color picking / texture method:
[0087] Loop Step 300
[0088] Step 310, determine that the focus position of the camera is N1;
[0089] Step 311, transfer the screen content within the detection range of the camera to the computing unit (such as NPU, etc.);
[0090] Step 312, dynamically identify the position N2 of the pen tip of the stylus through the computing unit (such as NPU, etc.). After determining the pen tip position, send a focus position instruction to the camera, and set the position N2 of the pen tip as the current focus of the camera: N1 = N2;
[0091] Step 313, then dynamically identify the position of the stylus through the computing unit (such as NPU, etc.), and further identify and determine the position N3 of the pen tip of the stylus. If |N3 - N2| > N, continue to execute the loop Step 300 (Steps 310 - 313) until |N(n) - N(n - 1)| < N, then stop executing the loop Step 300.
[0092] Furthermore, considering that in some application scenarios, there is more than one color value / texture in the color picking / texture area. Therefore, in an embodiment of the present application, during the process of obtaining the color value / texture of the color picking / texture area, multiple different color values / textures of the color picking / texture area are obtained. After obtaining the color value / texture of the color picking / texture area, the method further includes: presenting the obtained multiple different color values / textures to the user for selection.
[0093] Furthermore, in an actual application scenario, when performing color picking / texture, the color picking / texture range is related to the strong ability of the front camera of the electronic device: If the wide angle of the front camera of the electronic device is R and the depth of field is L, color picking / texture is achieved within the range where the physical object has a wide angle of R and a distance of L above the electronic device.
[0094] Specifically, in an actual application scenario, the tip of the pen-like object contacts the color / texture position of the target object. Thus, in the first image acquisition result obtained in step 110, the color / texture area corresponding to the color / texture position is a certain area adjacent to the pen tip position. Therefore, in an implementation of step 120, the color / texture area is an image area of a preset size. Specifically, in one embodiment, the color / texture area is an image area of a preset size centered on the pen tip position in the first image acquisition result.
[0095] Furthermore, since the image area around the pen tip position also includes the image area of the pen tip, in one implementation of step 120, the color / texture area is an image area of a preset size centered on the pen tip position in the first image acquisition result. When performing color / texture extraction, multiple different color values / textures in the color / texture area are obtained, and the obtained color values / textures include the color values / textures of the image area of the pen tip. After obtaining the color values / textures of the color / texture area, the obtained multiple different color values / textures are displayed to the user for selection.
[0096] Furthermore, since the image area around the pen tip position also includes the image area of the pen tip, in one implementation of step 120, the image area of the pen tip is confirmed to filter out the color / texture area that does not include the image area of the pen tip. Specifically, in one implementation of step 120, confirming the color / texture area in the first image acquisition result includes:
[0097] identifying the pen tip from the first image acquisition result to confirm an image area of the pen tip;
[0098] The color / texture area is confirmed according to the image area of the pen tip, wherein the color / texture area is connected to the image area of the pen tip.
[0099] Furthermore, in some application scenarios, in the first image acquisition result, the image area connected to the image area of the pen tip may not only be the area that the user wants to extract color / texture. For example, if the target object has multiple different colors / textures, then the image area of the target object in the first image acquisition result may include multiple areas with different colors / textures. In the process of color / texture extraction, if the pen tip of the pen-like object points to a certain color / texture area of the target object (assuming it is named the first area), then in the first image acquisition result, the image area of the pen tip will not only be connected to the image area corresponding to the first area, but also may be connected to the image area corresponding to the adjacent area of the first area. For another example, when performing image acquisition, take a picture from the side of the target object and the pen-like object, then, in the first image acquisition result, near the position where the pen tip and the target object are connected, in addition to the image area of the target object and the image area of the pen-like object, it may also include the background image area behind the target object and the pen-like object. That is, in the first image acquisition result, the image area of the pen tip will not only be connected to the image area corresponding to the target object, but also may be connected to the background image area.
[0100] Therefore, in one implementation of step 120, after the image area of the pen tip is confirmed to screen out the color / texture area that does not include the image area of the pen tip, when performing color / texture extraction, multiple different color values / textures in the color / texture area are obtained (the obtained color value / texture may include the color value / texture of the background image area or multiple different color values / textures on the target object). After the color value / texture of the color / texture area is obtained, the obtained multiple different color values / textures are displayed to the user for the user to select.
[0101] Furthermore, in order to effectively avoid the situation where the background image area is used as part of the color extraction / texture area, in one implementation of step 120, confirming the color extraction / texture area in the first image acquisition result includes:
[0102] identifying the pen tip from the first image acquisition result to confirm an image area of the pen tip;
[0103] identifying a target object from the first image acquisition result to confirm an image region of the target object;
[0104] The color / texture area is determined according to the image area of the pen tip and the image area of the target object, wherein the color / texture area is a sub-area in the image area of the target object, and the color / texture area is connected to the image area of the pen tip.
[0105] Furthermore, in actual application scenarios, it is considered that the pen-like object points to the area on the target object where the user wants to extract color / texture. Therefore, the color / texture area must be in the direction of the pen tip. Then, the image area in the direction of the pen tip is screened out from the image area connected to the image area of the pen tip, and the screened image area is used as the color / texture area, which can effectively avoid the situation where the background image area or the area other than the area on the target object where the user wants to extract color / texture is used as part of the color / texture area.
[0106] Therefore, in one implementation of step 120, confirming the color / texture region in the first image acquisition result includes:
[0107] identifying the pen tip from the first image acquisition result to confirm an image area of the pen tip;
[0108] The color / texture area is confirmed according to the image area of the pen tip, wherein the color / texture area is connected to the image area of the pen tip, and the color / texture area is the image area in the pointing direction of the pen tip.
[0109] Alternatively, in an implementation of step 120, confirming the color / texture region in the first image acquisition result includes:
[0110] identifying the pen tip from the first image acquisition result to confirm an image area of the pen tip;
[0111] identifying a target object from the first image acquisition result to confirm an image region of the target object;
[0112] The color / texture area is confirmed according to the image area of the pen tip and the image area of the target object, wherein the color / texture area is a sub-area in the image area of the target object, and the color / texture area is connected to the image area of the pen tip and is in the pointing direction of the pen tip.
[0113] Furthermore, in actual application scenarios, when color / texture is being extracted, the pen tip of the pen-like object is not in physical contact with the color / texture position of the target object, and the pen tip only points to the color / texture position of the target object. In this case, in the first image acquisition result, the image area of the pen tip displayed in the image may not be connected to the image area of the target object. In view of the above situation, in one implementation of step 120, confirming the color / texture area in the first image acquisition result includes:
[0114] Identifying the pen tip from the first image acquisition result to confirm the image area of the pen tip and the pointing direction of the pen tip;
[0115] identifying a target object from the first image acquisition result to confirm an image region of the target object;
[0116] The color / texture area is confirmed based on the image area of the pen tip, the pointing direction of the pen tip, and the image area of the target object, wherein the color / texture area is a sub-area in the image area of the target object, and the sub-area is the image area in the image area of the target object that is closest to the pen tip in the pointing direction of the pen tip.
[0117] Furthermore, the execution of color picking / texture is controlled according to the external control instruction. Specifically, in one embodiment of the present application, before executing the first shooting focus setting, the method further includes: judging whether to enter the color picking / texture mode according to the control instruction, and when it is judged that the color picking / texture mode is entered, executing the first shooting focus setting, the first image acquisition and subsequent operations.
[0118] Figure 4 The flowchart of the color / texture extraction method according to one embodiment of the present application is shown. Figure 4 As shown, the following steps are performed during the implementation of the color / texture method:
[0119] Step 400, determining whether there is a color / texture control instruction;
[0120] When there is no color / texture control instruction, return to step 400;
[0121] When there is a color / texture control instruction, execute step 401;
[0122] Step 401, turn on the camera;
[0123] Step 402, first shooting focus setting: identifying the tip of the pen-like object to confirm the position of the tip, and setting the shooting focus of the camera to the position of the tip, wherein the tip of the pen-like object points to the color / texture position of the target object;
[0124] Step 410, first image acquisition: performing image acquisition based on a camera whose shooting focus is set to the position of the pen tip, and obtaining a first image acquisition result;
[0125] Step 420, confirming the color / texture region in the first image acquisition result, wherein the color / texture region is an image region in the first image acquisition result corresponding to the color / texture position of the target object;
[0126] Step 430, obtaining the color value / texture of the color / texture area in the first image acquisition result.
[0127] Furthermore, in an embodiment of the present application, each time after entering the color picking / texture mode, steps 402 to 430 are executed to perform a color picking / texture operation, and after step 430, the color picking / texture mode is exited, waiting to enter the color picking / texture mode again.
[0128] Furthermore, in an embodiment of the present application, each time the color picking / texture mode is entered, steps 402 to 430 are executed in a loop, and multiple color picking / texture operations are performed in real time until the color picking / texture mode is exited according to the control instruction. In this way, after entering the color picking / texture mode, the color picking / texture of different color picking / texture areas corresponding to the pen tip position can be picked in real time when the user moves the pen tip, and different color values / textures can be obtained according to the change of the pen tip position.
[0129] Furthermore, in an embodiment of the present application, the acquired color value / texture is displayed to the user after step 430 (for example, using a desktop display, a mobile phone, a tablet computer, or a display screen installed on the color picker pen). As the user moves the pen tip position, the color value / texture displayed to the user also changes, and the user can thereby confirm the color value / texture that he or she wants to obtain.
[0130] For example, in an application scenario, the user controls the color picking system to enter the color picking / texture mode through the button on the color picking pen, the color picking system executes step 401, and then loops through steps 402 to 430, and the display screen / indicator light (or other display screen) on the color picking pen displays the color value / texture obtained in step 430 in real time. As the user moves the tip of the color picking pen, the color value / texture displayed on the display screen / indicator light on the color picking pen also changes. When the user confirms that the color value / texture displayed on the display screen / indicator light on the color picking pen is the color value / texture required by the user, the user controls the color picking system to exit the color picking / texture mode through the button on the color picking pen, and stops the loop execution of steps 402 to 430. At this time, the color value / texture obtained by the last execution of step 430 (the color value / texture currently displayed on the display screen / indicator light on the color picking pen) is the color value / texture finally obtained.
[0131] For another example, in an application scenario, the user controls the color picking system to enter the color picking / texture mode through the button on the color picking pen, the color picking system executes step 401, and then loops through steps 402 to 430, and the display screen / indicator light (or other display screen) on the color picking pen displays the color value / texture obtained in step 430. As the user moves the tip of the color picking pen, the color value / texture displayed on the display screen / indicator light on the color picking pen also increases. The user controls the color picking system to exit the color picking / texture mode through the button on the color picking pen, and stops the loop execution of steps 402 to 430. At this time, the display screen / indicator light (or other display screen) on the color picking pen will display all the color values / textures obtained in step 430 during the loop execution of steps 402 to 430 (the color value / texture currently displayed on the display screen / indicator light on the color picking pen). The user can select the color value / texture required by himself according to the display screen / indicator light (or other display screen) on the color picking pen.
[0132] Furthermore, the focus of the camera is set to perform step-by-step control during image acquisition. Specifically, in one embodiment of the present application, after receiving a control instruction to start the color acquisition / texture mode, the color acquisition / texture mode is entered, the camera is turned on and the shooting focus is set. After the shooting focus is set, image acquisition is not directly performed, but further image acquisition control instructions are waited for. While waiting for the image acquisition control instruction, the pen tip position recognition and shooting focus setting are performed in real time.
[0133] Specifically, in one embodiment of the present application, before the first shooting focus is set, the method also includes: judging whether to enter the color picking / texture mode according to the control instruction, and when it is judged that the color picking / texture mode is entered, executing the first shooting focus setting; before the first image is captured, the method also includes: looping the first shooting focus setting until it is judged that the first image capture and subsequent operations are executed according to the control instruction.
[0134] Figure 5 The flowchart of the color / texture extraction method according to one embodiment of the present application is shown. Figure 5 As shown, the following steps are performed during the implementation of the color / texture method:
[0135] Step 500, determine whether there is a color / texture start instruction;
[0136] When there is no color / texture start instruction, return to step 500;
[0137] When there is a color / texture start instruction, execute step 501;
[0138] Step 501, turn on the camera;
[0139] Step 502, first shooting focus setting: identifying the tip of the pen-like object to confirm the position of the tip, and setting the shooting focus of the camera to the position of the tip, wherein the tip of the pen-like object points to the color / texture position of the target object;
[0140] Step 510, determining whether there is a color extraction / texture execution instruction;
[0141] When there is no color fetching / texture execution instruction, return to step 510;
[0142] When there is a color / texture execution instruction, execute step 511;
[0143] Step 511, first image acquisition: performing image acquisition based on a camera whose shooting focus is set to the pen tip position, and obtaining a first image acquisition result;
[0144] Step 520: Confirm the color sampling / texture area in the first image acquisition result, where the color sampling / texture area is the image area in the first image acquisition result corresponding to the color sampling / texture position of the target object.
[0145] Step 530: Obtain the color value / texture of the color sampling / texture area in the first image acquisition result.
[0146] Furthermore, in an embodiment of the present application, a button is configured on the pen-shaped object used to point to the color sampling / texture position, and manipulation instructions are input through the button. For example, a single click on the button inputs a color sampling / texture start instruction, and a double click on the button inputs a color sampling / texture execution instruction.
[0147] Furthermore, in an embodiment of the present application, manipulation instructions are obtained by recognizing the actions of the pen-shaped object. For example, after entering the color sampling / texture mode, when the pen-shaped object performs a click action, color sampling / texture is performed at the click position of the pen-shaped object.
[0148] Specifically, in the application scenario of an embodiment of the present application, a stylus and a camera are used to achieve color sampling / texture.
[0149] Specifically:
[0150] Trigger the operation of "physical color sampling / texture" by means of single click / double click / triple click on the pen body button of the stylus, and transmit the relevant operation instructions to the electronic device with a camera through communication methods such as Bluetooth / Wifi / NFC or short range.
[0151] After receiving the operation instruction of "physical color sampling / texture", the electronic device turns on the camera and executes the following loop C: The focus position of the camera is N1. The picture content within the detection range of the camera is transmitted to the calculation unit (such as NPU, etc.). The position of the stylus is dynamically recognized through the calculation unit, and then the position N2 of the tip of the stylus is recognized and determined. After determining the tip position, a focus position instruction is sent to the camera, and the position N2 of the tip is set as the current focus of the camera: N1 = N2; At this time, the position of the stylus is dynamically recognized through the calculation unit again, and then the position N3 of the tip of the stylus is recognized and determined. If |N3 - N2| > N, continue to execute loop C until |N(n) - N(n - 1)| < N, then stop executing loop C. By dynamically adjusting in real time, the picture content of the contact point between the tip and the physical object is made clearer, which helps to improve the accuracy of color sampling / texture of the picture.
[0152] The user actively triggers the color sampling instruction through the stylus button, for example, clicks on a certain position in an object within the detection range of the electronic device camera.
[0153] When the electronic device receives the color-picking instruction and captures the stylus pen tip of the current field of view, the camera transmits the current picture information to the computing unit, which performs grid analysis on the picture information, intelligently identifies the contact point A between the stylus pen tip and the physical object, and performs color value / texture extraction;
[0154] The computing unit identifies the color / texture of the contact point between the pen tip and the object, transmits the color back to the corresponding software color palette in real time, and transmits the color value back to the stylus via Bluetooth or short-distance communication. If the photo scan fails, the pen body vibrates to prompt the user that the color / texture acquisition failed.
[0155] The indicator light on the pen body will flash once after the color is extracted successfully to inform the user and display the corresponding color;
[0156] At this time, the color of the stroke when the user's stylus is writing, drawing or annotating on the software is the color value extracted from the real object.
[0157] Specifically, taking an application scenario as an example, Figure 6 The figure shows an application scenario diagram according to an embodiment of the color / texture extraction method of the present application. Figure 6 As shown, the user places the apple 600 (the target object for color / texture extraction) within the detection range of the camera 601 (within the shooting angle R of the camera 601). The user holds the stylus 603 and makes the stylus 603 touch the color / texture extraction position of the apple 600. The contact position between the tip of the stylus 603 and the apple 600 is Figure 6 The position A shown in the figure. The color picking device connected to the camera 601 analyzes the image collected by the camera 601, identifies the position A, and sets the shooting focus of the camera 601 to the position A.
[0158] Figure 7 The following is a schematic diagram of the photographing result according to an embodiment of the color / texture extraction method of the present application. After the photographing focus of the camera 601 is set to position A, the camera 601 takes a photo of the stylus 603 and the apple 600. The photographing result is shown in FIG. Figure 7 The color picking device connected to the camera 601 is Figure 7 Perform grid analysis to identify Figure 7 The stylus tip position B of the present invention is detected and color value / texture extraction is performed on position B.
[0159] It is to be understood that some or all of the steps or operations in the above embodiments are merely examples, and the present application embodiments may also perform other operations or variations of various operations. In addition, the various steps may be performed in different orders presented in the above embodiments, and it is possible that not all of the operations in the above embodiments need to be performed.
[0160] Furthermore, based on the color / texture extraction method proposed in one embodiment of the present application, one embodiment of the present application also proposes a color / texture extraction device. Figure 8 The structure diagram of the color / texture device according to one embodiment of the present application is shown. Figure 8 As shown, in one embodiment of the present application, the color / texture device 600 includes:
[0161] A shooting focus setting module 810 is used to identify the tip of the pen-like object to confirm the position of the tip, and set the shooting focus of the camera to the position of the tip, wherein the tip of the pen-like object points to the color / texture position of the target object;
[0162] An image acquisition module 820, which is used to obtain a first image acquisition result, wherein the first image acquisition result is an image acquisition result generated by performing image acquisition based on a camera whose shooting focus is set to the position of the pen tip;
[0163] A color / texture region confirmation module 830 is used to confirm the color / texture region in the first image acquisition result, wherein the color / texture region is an image region in the first image acquisition result corresponding to the color / texture position of the target object;
[0164] The color / texture extraction module 840 is used to obtain the color value / texture of the color / texture extraction area.
[0165] Furthermore, an embodiment of the present application also proposes a color / texture picking system. The system includes a camera, a color picking pen, and Figure 8 The color / texture device shown. Specifically, in one embodiment of the present application:
[0166] The shooting focus setting module of the color picking / texture picking device in the color picking / texture picking system obtains the image of the color picking pen based on the camera, identifies the tip of the pen-like object according to the image of the pen-like object to confirm the position of the tip, and sets the shooting focus of the camera to the position of the tip;
[0167] After the shooting focus of the camera is set, the image acquisition module of the color / texture device in the color / texture system controls the camera to capture an image (first image acquisition result) including the color picking pen and the target object;
[0168] A color picking / texture region confirmation module of a color picking / texture picking device in a color picking / texture picking system confirms a color picking / texture region in an image including a color picking pen and a target object;
[0169] The color / texture picking module of the color / texture picking device in the color / texture picking system obtains the color value / texture of the color / texture picking area.
[0170] Furthermore, in the 1990s, improvements to a technology could be clearly distinguished as hardware improvements (for example, improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the method flow). However, with the development of technology, many improvements to the method flow today can be regarded as direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that an improvement in a method flow cannot be implemented using a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the access party programming the device. Designers can "integrate" a digital device on a PLD by programming it themselves, without having to ask a chip manufacturer to design and produce a dedicated integrated circuit chip. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.
[0171] The controller can be implemented in any appropriate manner, for example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) that can be executed by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in a purely computer-readable program code manner, the controller can be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, this controller can be considered as a hardware component, and the devices included therein for implementing various functions can also be regarded as structures within the hardware component. Or even, the devices for implementing various functions can be regarded as both software modules for implementing the method and structures within the hardware component.
[0172] In the description of the embodiments of the present application, for the convenience of description, the device is described by being divided into various modules / units according to their functions. The division of each module / unit is merely a division of logical functions. When implementing the embodiments of the present application, the functions of each module / unit can be implemented in the same or one or more software and / or hardware.
[0173] Specifically, the device proposed in the embodiment of the present application can be fully or partially integrated into a physical entity during actual implementation, or it can be physically separated. And these modules can all be implemented in the form of software calling through processing elements; they can also be all implemented in the form of hardware; some modules can also be implemented in the form of software calling through processing elements, and some modules can be implemented in the form of hardware. For example, the detection module can be a separately established processing element, or it can be integrated in a chip of an electronic device. The implementation of other modules is similar. In addition, all or part of these modules can be integrated together, or they can be implemented independently. In the implementation process, each step of the above method or each of the above modules can be completed by an integrated logic circuit of hardware in a processor element or instructions in the form of software.
[0174] For example, the above modules may be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASIC), or one or more digital signal processors (DSP), or one or more field programmable gate arrays (FPGA), etc. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
[0175] Those skilled in the art will appreciate that the various units and algorithm steps described in the embodiments of the present application can be implemented by a combination of electronic hardware, computer software, and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0176] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices, modules and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0177] Each embodiment in this application is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0178] An embodiment of the present application further proposes an electronic device, which includes a memory for storing computer program instructions and a processor for executing the program instructions, wherein when the computer program instructions are executed by the processor, the electronic device is triggered to execute the method steps described in the embodiment of the present application.
[0179] Specifically, in one embodiment of the present application, the above-mentioned one or more computer programs are stored in the above-mentioned memory, and the above-mentioned one or more computer programs include instructions. When the above-mentioned instructions are executed by the above-mentioned device, the above-mentioned device executes the method steps described in the embodiment of the present application.
[0180] Specifically, in one embodiment of the present application, the processor of the electronic device may be a SOC device on a chip, which may include a central processing unit (CPU), and may further include other types of processors. Specifically, in one embodiment of the present application, the processor of the electronic device may be a PWM control chip.
[0181] Specifically, in an embodiment of the present application, the processor involved may include, for example, a CPU, a DSP, a microcontroller or a digital signal processor, and may also include a GPU, an embedded neural network processor (Neural-network Process Units, NPU) and an image signal processor (Image Signal Processing, ISP). The processor may also include necessary hardware accelerators or logic processing hardware circuits, such as ASICs, or one or more integrated circuits for controlling the execution of the program of the technical solution of the present application. In addition, the processor may have the function of operating one or more software programs, and the software programs may be stored in a storage medium.
[0182] Specifically, in one embodiment of the present application, the memory of the electronic device may be a read-only memory (ROM), other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), a magnetic disk storage medium or other magnetic storage devices, or may be any computer-readable medium that can be used to carry or store desired program codes in the form of instructions or data structures and can be accessed by a computer.
[0183] Specifically, in an embodiment of the present application, the processor and the memory can be combined into a processing device, more commonly, they are independent components, and the processor is used to execute the program code stored in the memory to implement the method described in the embodiment of the present application. In specific implementation, the memory can also be integrated into the processor, or independent of the processor.
[0184] Furthermore, the devices, apparatuses, means, modules or units illustrated in the embodiments of the present application may be specifically implemented by a computer chip or entity, or by a product having a certain function.
[0185] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, devices, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media containing computer-usable program code.
[0186] In the several embodiments provided in the present application, if any function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application.
[0187] Specifically, in one embodiment of the present application, a computer-readable storage medium is further provided, in which a computer program is stored. When the computer program is run on a computer, the computer executes the method provided in the embodiment of the present application.
[0188] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is run on a computer, the computer executes the method provided by the embodiment of the present application.
[0189] The embodiments described in this application are described with reference to the flowcharts and / or block diagrams of the methods, devices (apparatus), and computer program products according to the embodiments of the application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0190] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0191] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0192] The present application may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0193] It should also be noted that in the embodiments of the present application, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent the existence of A alone, the existence of A and B at the same time, and the existence of B alone. Among them, A and B can be singular or plural. The character " / " generally indicates that the previous and subsequent associated objects are in an "or" relationship. "At least one of the following" and similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b and c can be represented by: a, b, c, a and b, a and c, b and c, or a and b and c, where a, b, c can be single or multiple.
[0194] In the embodiments of the present application, the terms "include", "comprises" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the presence of other identical elements in the process, method, commodity or device including the element.
[0195] The above is only a specific implementation of the present application. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. The protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A color / texture extraction method, It is characterized in that include: First shooting focus setting: identifying the tip of the pen-like object from the shooting picture of the camera to confirm the position of the pen tip, and setting the shooting focus of the camera to the position of the pen tip, wherein the tip of the pen-like object points to the color / texture position of the target object, and the camera is an external camera outside the pen-like object; First image acquisition: performing image acquisition based on the camera whose shooting focus is set to the position of the pen tip, and obtaining a first image acquisition result; Confirming a color / texture region in the first image acquisition result, wherein the color / texture region is an image region in the first image acquisition result corresponding to a color / texture position of the target object; Get the color value / texture of the color / texture area.
2. The method according to claim 1, It is characterized in that The first shooting focus setting includes: Second image acquisition: performing image acquisition based on the camera, obtaining a second image acquisition result, and identifying the pen tip from the second image acquisition result to confirm the position of the pen tip; Second shooting focus setting: when the shooting focus when acquiring the second image acquisition result and the pen tip position confirmed based on the second image acquisition result are greater than a preset distance, the shooting focus of the camera is set to the pen tip position confirmed based on the second image acquisition result; The second image acquisition and the second shooting focus setting are executed in a loop until the distance between the shooting focus when acquiring the second image acquisition result and the pen tip position confirmed based on the second image acquisition result is less than or equal to a preset distance.
3. The method according to claim 1, It is characterized in that The confirming the color / texture region in the first image acquisition result includes: identifying the pen tip from the first image acquisition result to confirm an image area of the pen tip; The color / texture area is confirmed according to the image area of the pen tip, wherein the color / texture area is connected to the image area of the pen tip.
4. The method according to claim 1, It is characterized in that The confirming the color / texture region in the first image acquisition result includes: identifying the pen tip from the first image acquisition result to confirm an image area of the pen tip; identifying the target object from the first image acquisition result to confirm an image region of the target object; The color / texture area is confirmed according to the image area of the pen tip and the image area of the target object, wherein the color / texture area is a sub-area in the image area of the target object, and the sub-area is connected to the image area of the pen tip.
5. The method according to claim 3 or 4, It is characterized in that The color / texture area is the image area in the direction in which the pen tip points.
6. The method according to claim 1, It is characterized in that The confirming the color / texture region in the first image acquisition result includes: Identifying the pen tip from the first image acquisition result to confirm an image area of the pen tip and a pointing direction of the pen tip; identifying the target object from the first image acquisition result to confirm an image region of the target object; The color / texture area is confirmed based on the image area of the pen tip, the pointing direction of the pen tip, and the image area of the target object, wherein the color / texture area is a sub-area in the image area of the target object, and the sub-area is the image area in the image area of the target object that is closest to the pen tip in the pointing direction of the pen tip.
7. The method according to any one of claims 1 to 6, Features: Before the first shooting focus is set, the method further includes: judging whether to enter a color picking / texture mode according to a control instruction, and when it is judged that the color picking / texture mode is entered, executing the first shooting focus setting, the first image acquisition and subsequent operations.
8. The method according to any one of claims 1 to 6, Features: Before the first shooting focus is set, the method further includes: judging whether to enter a color picking / texture mode according to a control instruction, and executing the first shooting focus setting when it is judged that the color picking / texture mode is entered; Before the first image acquisition, the method further includes: loopingly executing the first shooting focus setting until it is determined to execute the first image acquisition and subsequent operations according to a control instruction.
9. The method according to any one of claims 1 to 8, Features: In the process of acquiring the color value / texture of the color / texture region, acquiring a plurality of different color values / textures of the color / texture region; After acquiring the color value / texture of the color / texture area, the method further includes: displaying the multiple different color values / textures to the user for the user to select.
10. A color / texture extraction device, It is characterized in that include: A shooting focus setting module, which is used to: identify the tip of the pen-like object from the shooting picture of the camera, and output an error prompt message when the tip of the pen cannot be identified; When the pen tip is identified, the position of the pen tip is confirmed, and the shooting focus of the camera is set to the position of the pen tip, wherein the pen tip of the pen-like object points to the color / texture position of the target object; An image acquisition module, which is used to obtain a first image acquisition result, wherein the first image acquisition result is an image acquisition result generated by performing image acquisition based on the camera whose shooting focus is set to the position of the pen tip, wherein during the process in which the shooting focus setting module sets the shooting focus of the camera and the image acquisition module obtains the first image acquisition result, the position and shooting direction of the camera are fixed; A color / texture region confirmation module, which is used to confirm the color / texture region in the first image acquisition result, wherein the color / texture region is an image region in the first image acquisition result corresponding to the color / texture position of the target object; The color / texture extraction module is used to obtain the color value / texture of the color / texture extraction area.
11. A color / texture system, It is characterized in that It comprises a camera, a color picking pen and the color picking / texture device as claimed in claim 10.
12. An electronic device, It is characterized in that The electronic device comprises a memory for storing computer program instructions and a processor for executing the program instructions, wherein when the computer program instructions are executed by the processor, the electronic device is triggered to execute the method steps as claimed in any one of claims 1 to 9.
13. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, which, when executed on a computer, enables the computer to execute the method according to any one of claims 1 to 9.
