A pixel size determination method and apparatus, electronic device, and storage medium

By acquiring images of template features using an imaging device and determining the number of pixels by moving the image, the problem of cumbersome and inaccurate pixel size measurement in existing technologies is solved, and a simple and flexible pixel size determination is achieved.

CN116255911BActive Publication Date: 2025-12-26SUZHOU MEGAROBO TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211645968.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-20
Publication Date
2025-12-26
Estimated Expiration
2042-12-20

AI Technical Summary

Technical Problem

The process of determining pixel size in existing technologies is cumbersome and inflexible, resulting in inaccurate measurements.

Method used

The template features are captured by an imaging device, which moves along a predetermined direction and captures multiple images. The number of pixels is determined by the positional changes of the template features in different images, and the pixel size is calculated.

Benefits of technology

It simplifies the process of determining pixel size, improves the flexibility and accuracy of measurement, and avoids errors caused by using template positioning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116255911B_ABST
    Figure CN116255911B_ABST
Patent Text Reader

Abstract

The application discloses a pixel size determination method and device, electronic equipment and readable storage medium, which can be applied to the technical field of measurement. A first image including a template feature is obtained by a shooting device; a first position of the template feature in a shooting field of view of the shooting device is determined; a second image is obtained after the shooting device moves a first distance along a predetermined direction, and a pixel number between a second position of the template feature in the second image and the first position is determined as a first number; a third image is obtained after the shooting device moves a second distance in the opposite direction of the predetermined direction, and a pixel number between a third position of the template feature in the third image and the first position is determined as a second number; and a pixel size is determined according to the second distance, the first pixel number and the second pixel number. It can be seen that, by means of the specified feature point, the application avoids the problem that the determined pixel size is not accurate enough due to the use of the template positioning feature point, and makes the determination process of the pixel size more simple, flexible and accurate.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of measurement, in particular to a pixel size determination method and device, electronic equipment and storage medium. BACKGROUND

[0002] In the field of measurement, after shooting the measured image, the image of the measured object is obtained, and at this time, the actual size represented by each pixel in the shot image of the measured object needs to be determined.

[0003] In the prior art, the region of interest is first determined and positioned, and then the actual size of each pixel is determined by the actual size of the region of interest and the number of pixels contained. However, this method requires the use of existing templates or determined templates to position the region of interest. This step of positioning the region of interest is relatively cumbersome in the process of determining the pixel size, and only existing templates can be used for corresponding positioning, which lacks flexibility. Moreover, the cumbersome operation will result in many mistakes, and ultimately the determined pixel size is not accurate enough. Therefore, how to design a simple, flexible and accurate pixel size determination method has become a technical problem to be solved in the field. SUMMARY

[0004] Therefore, the embodiments of the present application provide a pixel size determination method and device, electronic equipment and storage medium, aiming to achieve the requirement of simple, flexible and accurate determination of pixel size.

[0005] In a first aspect, the embodiments of the present application provide a pixel size determination method, which comprises:

[0006] obtaining a first image including a template feature by a shooting device;

[0007] determining a first position of the template feature in a shooting device field of view of the shooting device;

[0008] obtaining a second image after the shooting device moves a first distance along a predetermined direction, determining a second position of the template feature in the second image and the first position, and taking the number of pixels therebetween as a first number;

[0009] obtaining a third image after the shooting device moves a second distance in the opposite direction of the predetermined direction, determining a third position of the template feature in the third image and the first position, and taking the number of pixels therebetween as a second number; wherein the second distance is greater than the first distance;

[0010] determining a pixel size according to the second distance, the first number of pixels and the second number of pixels.

[0011] Optionally, the determining the pixel size according to the second distance, the first pixel number and the second pixel number specifically comprises: the pixel size corresponds to a ratio of the second distance to a sum of the first pixel number and the second pixel number.

[0012] Optionally, after the photographing device moves by the first distance along the predetermined direction, the method further comprises:

[0013] determining whether the template feature is in the field of view of the photographing device;

[0014] if the template feature is in the field of view of the photographing device, acquiring the second image;

[0015] if the template feature is not in the field of view of the photographing device, moving along the reverse direction of the predetermined direction until the template feature reappears in the field of view of the photographing device, and acquiring the second image.

[0016] Optionally, after the photographing device moves by the second distance along the reverse direction of the predetermined direction, the method further comprises:

[0017] determining whether the template feature is in the field of view of the photographing device;

[0018] if the template feature is in the field of view of the photographing device, acquiring the third image;

[0019] if the template feature is not in the field of view of the photographing device, moving along the predetermined direction until the template feature reappears in the field of view of the photographing device, and acquiring the third image.

[0020] Optionally, the determining the first position of the template feature in the field of view of the photographing device of the photographing device specifically comprises:

[0021] adjusting the photographing device so that a center point of the template feature is at a center position of the field of view of the photographing device, and determining the center position as the first position of the template feature in the field of view of the photographing device.

[0022] Optionally, the second position is a position of a center point of the template feature in the second image; and the third position is a position of a center point of the template feature in the third image.

[0023] Optionally, the predetermined direction is a horizontal direction or a vertical direction.

[0024] In a second aspect, an embodiment of the present application provides a pixel size determination apparatus, which comprises:

[0025] an image acquisition module, configured to acquire a first image comprising a template feature by a photographing device;

[0026] a feature determining module configured to determine a first position of the template feature in a field of view of the photographing device;

[0027] a pixel counting module configured to acquire a second image after the photographing device moves a first distance along a predetermined direction, determine a first quantity of pixels between a second position of the template feature in the second image and the first position, acquire a third image after the photographing device moves a second distance along a reverse direction of the predetermined direction, and determine a second quantity of pixels between a third position of the template feature in the third image and the first position, wherein the second distance is greater than the first distance;

[0028] a size determining module configured to determine a pixel size according to the second distance, the first quantity of pixels and the second quantity of pixels.

[0029] In a third aspect, an electronic device for pixel size determination is provided, and the electronic device comprises:

[0030] a memory configured to store a computer program;

[0031] a processor configured to execute the computer program to implement the pixel size determination method.

[0032] In a fourth aspect, a computer readable storage medium is provided, and the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the pixel size determination method.

[0033] The pixel size determination method provided by the embodiments of the present application is provided. When the method is executed, first, a photographing device acquires a first image of a pixel to be measured; a template feature determining module determines a first position of a template feature in a field of view of the photographing device; then, the photographing device acquires a second image after moving a first distance along a predetermined direction, determines a first quantity of pixels between the template feature in the second image and the first position; the photographing device acquires a third image after moving a second distance along a reverse direction of the predetermined direction, and determines a second quantity of pixels between the template feature in the third image and the first position; wherein the second distance is greater than the first distance; a size determining module determines a pixel size according to the second distance, the first quantity of pixels and the second quantity of pixels. It can be seen that the embodiments of the present application specify a feature point, and thus the cumbersome process of positioning the feature point by matching a template is omitted; the photographing device is moved in the forward and reverse directions to prolong the displacement of the template feature and further determine the actual size of the pixel, and thus the measurement accuracy is improved; the pixel size is determined by moving the photographing device, and thus the problem that the determined pixel size is not accurate enough due to the positioning of the feature point by using a template is avoided, and the determination process of the pixel size is more simple, flexible and accurate. BRIEF DESCRIPTION OF DRAWINGS

[0034] In order to make the technical solution of the present embodiment or the prior art clearer, the drawings needed in the description of the embodiments or the prior art will be briefly introduced as follows. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative effort on the basis of these drawings.

[0035] Figure 1 An application scenario diagram of the method for determining the pixel size in the prior art;

[0036] Figure 2 A method flowchart of the pixel size determination method provided by the embodiments of the present application;

[0037] Figure 3 An application scenario diagram of the pixel size determination method provided by the embodiments of the present application;

[0038] Figure 4 Another application scenario diagram of the pixel size determination method provided by the embodiments of the present application;

[0039] Figure 5 A structural diagram of the pixel size determination device provided by the embodiments of the present application. DETAILED DESCRIPTION

[0040] In order to make the technical solution of the present embodiment or the prior art clearer, the drawings needed in the description of the embodiments or the prior art will be briefly introduced as follows. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative effort on the basis of these drawings.

[0041] In the field of measurement technology, when it is needed to determine the actual size represented by each pixel in the image of the measured object, the general idea in the prior art is to first determine the region of interest, and then determine the actual size of each pixel through the actual size of the region of interest and the number of pixels contained. However, it is difficult to determine the actual size of the region of interest in actual operation.

[0042] Therefore, in the prior art, the actual size of each pixel is usually determined by using the actual moving displacement of the region of interest and the pixel moving displacement. This method needs to position the region of interest first. Specifically, as shown in FIG. 1, the actual size of each pixel is determined by using the actual moving displacement of the region of interest and the pixel moving displacement. Figure 1The application scenario of the prior art method for determining the pixel size shows that the measured object can obtain an image 100 and an image 200 by moving left and right, and then match the image 100 and the image 200 to determine whether there is a region (a circle) of a matching template 300, and then, according to the actual moving displacement of the image and the pixel coordinate displacement of the region (the circle) of the matching template 300, the pixel size of the measured object can be calculated.

[0043] The pixel size determination method provided by the embodiment of the application has a method flowchart as shown in Figure 2 The method flowchart comprises the following steps:

[0044] S10, obtaining, by a shooting device, a first image comprising a template feature.

[0045] The shooting device is used to shoot the to-be-measured pixel to obtain a first image of the to-be-measured pixel comprising the template feature, that is, an original image of the template feature of the to-be-measured pixel, and the purpose is to determine the relative position of the to-be-measured pixel and the shooting device.

[0046] S20, determining a first position of the template feature in a shooting device field of view of the shooting device.

[0047] The shooting device is an imaging device and has an imaging limit (the shooting device field of view). The template feature, that is, the feature of the to-be-measured pixel, can be a pixel point or a collection of pixel points.

[0048] First, the template feature in the shooting device field of view is determined, and then the specific position of the template feature in the shooting device field of view is determined and taken as the first position.

[0049] S30, obtaining, by the shooting device, a second image after moving a first distance in a predetermined direction, and determining the number of pixels between a second position of the template feature in the second image and the first position as a first number.

[0050] The shooting device is moved, wherein the first distance of the shooting device is an actual distance, which is adjusted by a user according to the actual situation of the shooting device and the to-be-measured pixel, and is prepared for subsequent adjustment of a second distance.

[0051] The second image is obtained first, and then the relative position of the template feature, that is, the second position, is determined, and the relative moving distance of the template feature in the shooting device field of view is determined.

[0052] The predetermined direction can be set according to the needs of the user, and the application does not make specific limitations.

[0053] S40, acquiring a third image after the shooting device moves a second distance in the opposite direction of the predetermined direction, and determining a second quantity of pixels between a third position of the template feature in the third image and the first position.

[0054] Moving the shooting device, wherein the second distance that the shooting device moves is an actual distance, and the second distance is greater than the first distance, so that the third position of the shooting device after moving passes the first position of the template feature.

[0055] Acquiring the third image first, and then determining the relative position of the template feature, that is, the relative moving distance of the template feature in the field of view of the shooting device.

[0056] S50, determining the pixel size according to the second distance, the first quantity of pixels and the second quantity of pixels.

[0057] After obtaining these parameters, the pixel size can be obtained by these parameters.

[0058] It can be seen that, by specifying the feature points, the application saves the cumbersome process of positioning the feature points by matching the template; by moving the shooting device forward and backward to extend the displacement of the template feature and further determine the actual size of the pixel, the measurement accuracy is improved; by moving the shooting device, the pixel size can be determined, avoiding the problem that the pixel size determined by using the matching template to position the feature points is not accurate enough, so that the determination process of the pixel size is more simple, flexible and accurate.

[0059] In some specific embodiments, step S50 specifically includes:

[0060] The determination of the pixel size according to the second distance, the first quantity of pixels and the second quantity of pixels is specifically that the pixel size corresponds to the ratio of the second distance to the sum of the first quantity of pixels and the second quantity of pixels.

[0061] The second distance is an actual distance corresponding to the maximum relative distance between the shooting device and the template feature. The first quantity of pixels is the quantity of pixels from the first position of the template feature after the template feature moves the first distance, and the second quantity of pixels is the quantity of pixels from the first position of the template feature after the template feature moves the second distance.

[0062] In some specific embodiments, after step S30, the method further includes:

[0063] Judging whether the template feature is in the field of view of the shooting device;

[0064] If the template feature is in the field of view of the shooting device, acquiring the second image;

[0065] If the template feature is not in the field of view of the photographing device, move in the reverse direction along the predetermined direction until the template feature reappears in the field of view of the photographing device, and acquire a second image.

[0066] After detecting the movement of the photographing device, whether the movement is too large so that the template feature is lost from the field of view of the photographing device. If the template feature is lost from the field of view of the photographing device, the photographing device is moved back to prevent inaccurate measurement due to incorrect distance setting.

[0067] In some embodiments, after step S40, the method further comprises:

[0068] determining whether the template feature is in the field of view of the photographing device;

[0069] If the template feature is in the field of view of the photographing device, acquire a third image;

[0070] If the template feature is not in the field of view of the photographing device, move in the predetermined direction until the template feature reappears in the field of view of the photographing device, and acquire a third image.

[0071] As above, if the template feature is lost from the field of view of the photographing device, the photographing device is moved back to prevent inaccurate measurement due to incorrect distance setting.

[0072] In some embodiments, step S20 specifically comprises:

[0073] adjust the photographing device so that the center point of the template feature is at the center position of the field of view of the photographing device, and determine the center position as a first position of the template feature in the field of view of the photographing device.

[0074] By adjusting the position of the photographing device, the template feature is placed at the center of the field of view of the photographing device. This facilitates subsequent movement of the first distance and the second distance.

[0075] In some embodiments, the second position is the position of the center point of the template feature in the second image; and the third position is the position of the center point of the template feature in the third image.

[0076] When the template feature is at the center point of the field of view of the photographing device, the pixel points between the positions of the template feature in the second image and the third image and the first position are also changed to the number of pixels between the positions of the template feature in the second image and the third image and the center point of the field of view of the photographing device. This makes it more convenient to determine the number of pixels.

[0077] In some embodiments, the pixel size determination method further comprises:

[0078] The predetermined direction is a horizontal direction or a vertical direction.

[0079] Since the individual pixel points are generally square, and the specific size of the pixel is generally determined by the length and width of the pixel point, the pixel quantity can be determined more accurately and simply by moving in the horizontal or vertical direction.

[0080] In some specific embodiments, an application scenario of the pixel size determination method is shown in FIG. 1, for the convenience of understanding, wherein Figure 3 is a side view of the shooting device and the measured object: Figure 3

[0081] First, the shooting device and the measured object are in a parallel state, the left image of the measured object is the first image in the field of view of the shooting device, and the template feature is determined. Then, the second image is determined by moving X1 in the vertical direction, and the pixel quantity Y1 between the first position and the template feature after moving is determined. Then, the shooting device is moved X2 in the opposite direction, and the pixel quantity Y2 between the first position and the template feature after moving is determined.

[0082] The pixel size H is calculated by the following formula: H = X2 / (Y1+Y2).

[0083] The pixel size H is calculated by the following formula: H = X2 / (Y1+Y2).

[0084] In some specific embodiments, another application scenario of the pixel size determination method is shown in FIG. 2, for the convenience of understanding, wherein Figure 4 is a front view of the shooting device and the measured object, that is, the template feature is observed through the field of view of the shooting device: Figure 4

[0085] First, as shown in the initial position, it is the first image in the field of view of the shooting device, and the template feature is determined. The template feature is placed at the center point of the field of view of the shooting device. Then, the second image is determined by moving X1 in the vertical direction, and the pixel quantity Y1 between the first position and the template feature after moving is determined. Then, for the convenience of calculation, the shooting device is moved by 2X1 in the opposite direction, and the pixel quantity 2Y1 between the first position and the template feature after moving is determined.

[0086] The pixel size H is calculated by the following formula: H = 2X1 / 2Y1.

[0087] The pixel size H is calculated by the following formula: H = 2X1 / 2Y1.

[0088] Based on the pixel size determination method provided in the above embodiments, the present embodiment provides a device for executing the pixel size determination. The structure diagram of the pixel size determination device is shown in FIG. 3. Figure 5 ​​The pixel size determination device is shown to include:

[0089] The image acquisition module 10 is configured to acquire a first image of the pixel to be measured by a shooting device.

[0090] The shooting device is used to shoot the pixel to be measured to obtain a first image of the pixel to be measured including the template feature, i.e., an original image of the template feature of the pixel to be measured, so as to determine the relative position of the pixel to be measured and the shooting device.

[0091] The feature determination module 20 is configured to determine a first position of the template feature in the field of view of the shooting device.

[0092] The first position of the template feature in the field of view of the shooting device is determined first, and then the specific position of the template feature in the field of view of the shooting device is determined and taken as the first position.

[0093] The pixel counting module 30 is configured to acquire a second image after the shooting device moves a first distance along a predetermined direction, determine a pixel number between the template feature in the second image and the first position as a first number; acquire a third image after the shooting device moves a second distance in the opposite direction of the predetermined direction, determine a pixel number between the template feature in the third image and the first position as a second number; wherein the second distance is greater than the first distance.

[0094] The shooting device is moved first, wherein the first distance of the shooting device is an actual distance, which is adjusted by a user according to the actual situation of the shooting device and the pixel to be measured, and is used for subsequent adjustment of the second distance. The second image is acquired, and then the relative position of the template feature is determined, i.e., the relative moving distance of the template feature in the field of view of the shooting device.

[0095] The shooting device is moved second, wherein the second distance of the shooting device is an actual distance, and the second distance is greater than the first distance, so as to move the shooting device beyond the first position of the template feature. The third image is acquired, and then the relative position of the template feature is determined, i.e., the relative moving distance of the template feature in the field of view of the shooting device.

[0096] The size determination module 40 is configured to determine the pixel size according to the second distance, the first pixel number and the second pixel number.

[0097] After the parameters are obtained, the pixel size can be obtained by the size determination module 40 according to the parameters.

[0098] In addition, the application further discloses an electronic device for pixel size determination, comprising:

[0099] The memory is configured to store a computer program.

[0100] a processor configured to execute the computer program to implement the pixel size determination method as described above.

[0101] In addition, the embodiments of the present application further disclose a computer readable storage medium, which stores a computer program. The computer program is executed by a processor to implement the pixel size determination method as described above.

[0102] The various embodiments are described in a progressive manner in the specification, and each embodiment focuses on the differences from other embodiments. The same or similar parts of each embodiment can be referred to each other. For the device disclosed by the embodiments, the description is relatively simple because it corresponds to the method disclosed by the embodiments. The relevant parts can be referred to the description of the method.

[0103] The above provides a detailed description of the scheme provided by the present application. The principle and implementation manner of the present application are described by applying specific examples. The above embodiment description is only used to help understand the method and core idea of the present application. Meanwhile, for those skilled in the art, the specific implementation manner and application range can be changed according to the idea of the present application. In conclusion, the content of the specification should not be understood as a limitation of the present application.

Claims

1. A pixel size determination method, characterized by, The method comprises: acquiring a first image including a template feature by a shooting device; determining a first position of the template feature in a shooting device field of view of the shooting device; after the shooting device is moved by a first distance in a predetermined direction, judging whether the template feature is in the shooting device field of view; if yes, acquiring a second image; if no, moving in the opposite direction of the predetermined direction until the template feature appears in the shooting device field of view, and acquiring a second image; determining a first pixel number as the pixel number between a second position of the template feature in the second image and the first position, the second position being the position of the center point of the template feature in the second image; after the shooting device is moved by a second distance in the opposite direction of the predetermined direction, judging whether the template feature is in the shooting device field of view; if yes, acquiring a third image; if no, moving in the predetermined direction until the template feature appears in the shooting device field of view, and acquiring a third image; determining a second pixel number as the pixel number between a third position of the template feature in the third image and the first position, the third position being the position of the center point of the template feature in the third image; wherein the second distance is greater than the first distance; determining a pixel size according to the ratio of the second distance to the sum of the first pixel number and the second pixel number.

2. The method of claim 1, wherein, The determination of the first position of the template feature in the shooting device field of view of the shooting device specifically comprises: adjusting the shooting device so that the center point of the template feature is at the center position of the shooting device field of view, and determining the center position as the first position of the template feature in the shooting device field of view.

3. The method of claim 1, wherein, The predetermined direction is a horizontal direction or a vertical direction.

4. A pixel size determination apparatus characterized by comprising: The device comprises: an image acquisition module for acquiring a first image including a template feature by a shooting device; a feature determination module for determining a first position of the template feature in a shooting device field of view of the shooting device; The pixel counting module is configured to: after the photographing device moves a first distance along a predetermined direction, determine whether the template feature is in the field of view of the photographing device; if yes, acquire a second image; if not, move in the opposite direction of the predetermined direction until the template feature appears in the field of view of the photographing device, and acquire a second image; determine a first pixel number as the number of pixels between a first position and a second position of the template feature in the second image, the second position being the position of the center point of the template feature in the second image; after the photographing device moves a second distance in the opposite direction of the predetermined direction, determine whether the template feature is in the field of view of the photographing device; if yes, acquire a third image; if not, move along the predetermined direction until the template feature appears in the field of view of the photographing device, and acquire a third image; determine a second pixel number as the number of pixels between the first position and a third position of the template feature in the third image, the third position being the position of the center point of the template feature in the third image; wherein the second distance is greater than the first distance, and the third position is the position of the center point of the template feature in the third image; The size determining module is configured to determine a pixel size according to a ratio of the second distance to the sum of the first pixel number and the second pixel number.

5. An electronic device for pixel size determination, the device comprising: The computer program is stored in the computer readable storage medium and is executed by the processor to implement the pixel size determination method according to any one of claims 1 to 3. The computer program is stored in the computer readable storage medium and is executed by the processor to implement the pixel size determination method according to any one of claims 1 to 3. ​ 6. A computer-readable storage medium, characterized in that, ​

Citation Information

Patent Citations

  • Pixel size calibration method, apparatus, and device for electron beam defect detection

    WO2022246898A1