Lens magnification measuring method and related equipment
By acquiring and matching the captured images and calculating the pixel displacement distance, the problem of inaccurate measurement of lens magnification is solved, and the measurement accuracy is improved.
Patent Information
- Application Number
- CN202411540276.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-31
- Publication Date
- 2025-02-25
AI Technical Summary
Manual measurement of lens magnification is prone to identification errors, resulting in inaccurate measurement results and reducing the accuracy of lens magnification measurement.
By acquiring the first image and the second image taken by the object to be photographed, the target feature point is determined by using feature point matching, and the pixel displacement distance is calculated, and the lens magnification is determined based on this.
By accurately controlling the movement direction and distance of the mobile device, the measurement error is avoided, and the accuracy of lens magnification measurement is improved.
Smart Images

Figure CN119520763A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of measurement technology, and in particular to a lens magnification measurement method and related equipment. Background Art
[0002] Lens magnification refers to the ratio of the image size of an object on the focal plane of the camera and lens to the actual size of the object.
[0003] In the related art, the magnification of a lens is generally measured manually, whereby line pair cards of different resolutions are purchased, the line pair cards are photographed with a camera and a lens, and the magnification of the lens is deduced by manually identifying the line pairs. However, manual measurement may result in recognition errors, which leads to inaccurate measurement results and reduces the accuracy of the lens magnification measurement. Summary of the invention
[0004] The main purpose of the present application is to provide a lens magnification measurement method and related equipment, aiming to solve the technical problem that recognition errors may occur in manual measurement, resulting in inaccurate measurement results and reducing the accuracy of lens magnification measurement.
[0005] To achieve the above object, the present application proposes a lens magnification measurement method, which includes:
[0006] Acquire a first image obtained by photographing the object to be photographed;
[0007] By controlling the mobile device to move a preset distance along a preset moving direction and photographing, a second image of the object to be photographed is obtained, wherein the first image partially overlaps with the second image;
[0008] Performing feature point matching on the first image and the second image to determine a preset number of pairs of corresponding target feature points;
[0009] The coordinate displacement between the target feature points is calculated to obtain a pixel displacement distance, and the lens magnification is determined based on the pixel displacement distance and the preset distance.
[0010] In one embodiment, the step of matching feature points of the first image and the second image to determine a preset number of pairs of corresponding target feature points includes:
[0011] Detecting key points of the first image to obtain a first key point set;
[0012] Detecting key points of the second image to obtain a second key point set;
[0013] Performing feature matching on the first key point set and the second key point set to obtain a matching point set;
[0014] The matching point set is selected to obtain target feature points, wherein the target feature points include first feature points of the first image and second feature points of the second image.
[0015] In one embodiment, the step of performing feature matching on the first key point set and the second key point set to obtain a matching point set includes:
[0016] Extracting feature vectors of the first key point set to obtain a first feature vector;
[0017] Extracting the feature vector of the second key point set to obtain a second feature vector;
[0018] The distance between the first feature vector and the second feature vector is judged by a preset threshold value. If the distance is less than the preset threshold value, the match is successful and a matching point set is obtained.
[0019] In one embodiment, the step of calculating the coordinate displacement between the target feature points to obtain a pixel displacement distance, and determining the lens magnification based on the pixel displacement distance and the preset distance includes:
[0020] Creating a coordinate map for the first image to obtain first coordinates of the first feature point;
[0021] Creating a coordinate map for the second image to obtain second coordinates of the second feature point;
[0022] Calculating the displacement distance between the first coordinate and the second coordinate to obtain a pixel displacement distance;
[0023] A preset pixel size is obtained, and a lens magnification is determined based on the pixel displacement distance, the preset pixel size, and the preset distance.
[0024] In one embodiment, the step of obtaining a preset pixel size and determining the lens magnification based on the pixel displacement distance, the preset pixel size and the preset distance includes:
[0025] If the preset moving direction is parallel to the coordinate axis of the coordinate graph, obtaining a target value of the pixel displacement distance;
[0026] The target value is multiplied by the preset pixel size, and the target result obtained by the multiplication is divided by the preset distance to obtain the lens magnification.
[0027] In one embodiment, the step of obtaining a preset pixel size and determining the lens magnification based on the pixel displacement distance, the preset pixel size and the preset distance includes:
[0028] If the preset moving direction is not parallel to the coordinate axis of the coordinate graph, subtracting the second coordinate from the first coordinate to obtain a difference coordinate;
[0029] Obtaining a first coordinate value and a second coordinate value of the difference coordinate, and calculating a square sum of the first coordinate value and the second coordinate value to obtain a coordinate square sum;
[0030] Performing square root calculation on the square sum of the coordinates to obtain a displacement value;
[0031] The displacement value is multiplied by the preset pixel size, and the target result obtained by the multiplication is divided by the preset distance to obtain the lens magnification.
[0032] In addition, to achieve the above-mentioned purpose, the present application also proposes a lens magnification measurement device, the lens magnification measurement device comprising:
[0033] An acquisition module, used to acquire a first image obtained by photographing the object to be photographed;
[0034] A moving module, used to control the mobile device to move a preset distance along a preset moving direction and take pictures, so as to obtain a second image of the object to be photographed, wherein the first image partially overlaps with the second image;
[0035] A matching module, used to match feature points of the first image and the second image to determine a preset number of pairs of corresponding target feature points;
[0036] The determination module is used to calculate the coordinate displacement between the target feature points to obtain a pixel displacement distance, and determine the lens magnification based on the pixel displacement distance and the preset distance.
[0037] In addition, to achieve the above-mentioned purpose, the present application also proposes a lens magnification measurement device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the lens magnification measurement method as described above.
[0038] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the lens magnification measurement method as described above are implemented.
[0039] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, wherein the computer program product includes a computer program, and when the computer program is executed by a processor, the steps of the lens magnification measurement method as described above are implemented.
[0040] One or more technical solutions proposed in this application have at least the following technical effects:
[0041] Compared with the related art, which may cause recognition errors in manual measurement, resulting in inaccurate measurement results and reducing the accuracy of lens magnification measurement, the present application obtains a first image of the object to be photographed; controls the mobile device to move a preset distance along a preset moving direction and shoots, thereby obtaining a second image of the object to be photographed, wherein the first image partially overlaps with the second image; performs feature point matching on the first image and the second image to determine a preset number of pairs of corresponding target feature points; calculates the coordinate displacement between the target feature points to obtain a pixel displacement distance, and determines the lens magnification based on the pixel displacement distance and the preset distance. It can be understood that after obtaining the first image of the object to be photographed, the present application controls the mobile device to move a preset distance along a preset moving direction instead of manually measuring the moving distance. Since the mobile device is controlled to accurately control the movement of the shooting device, measurement errors are avoided. Furthermore, after the first image and the second image are matched with feature points and the preset number of pairs of corresponding target feature points are determined, the lens magnification can be determined according to the precise preset distance and target feature points, thereby improving the accuracy of lens magnification measurement. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0043] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0044] Figure 1 A schematic diagram of a process flow provided for the first embodiment of the lens magnification measurement method of the present application;
[0045] Figure 2 A diagram showing an apparatus for measuring the lens magnification ratio of this application;
[0046] Figure 3 The A and B photo planes for the lens magnification measurement method of this application;
[0047] Figure 4 A schematic diagram of a flow chart provided for Embodiment 2 of the lens magnification measurement method of the present application;
[0048] Figure 5 This is a schematic diagram of the module structure of the lens magnification measurement device according to an embodiment of the present application;
[0049] Figure 6 Schematic diagram of the device structure of the hardware operating environment involved in the lens magnification measurement method in the embodiment of the present application.
[0050] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0051] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0052] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0053] After acquiring the first image of the object to be photographed, the present application controls the mobile device to move a preset distance along a preset moving direction, rather than manually measuring the moving distance. Since the mobile device is controlled to accurately control the movement of the photographing device, measurement errors are avoided. Furthermore, feature point matching is performed on the first image and the second image, and after a preset number of pairs of corresponding target feature points are determined, the lens magnification can be determined based on the precise preset distance and target feature points, thereby improving the accuracy of lens magnification measurement.
[0054] In the related art, the lens magnification of an image is generally measured by manual measurement, which involves purchasing line pair cards of different resolutions, photographing the line pair cards with a camera and a lens, and calculating the lens magnification of the lens by manually identifying the line pairs. However, manual measurement may result in recognition errors, resulting in inaccurate measurement results, which reduces the accuracy of lens magnification measurement.
[0055] After acquiring the first image of the object to be photographed, the present application controls the mobile device to move a preset distance along a preset moving direction, rather than manually measuring the moving distance. Since the mobile device is controlled to accurately control the movement of the photographing device, measurement errors are avoided. Furthermore, feature point matching is performed on the first image and the second image, and after a preset number of pairs of corresponding target feature points are determined, the lens magnification can be determined based on the precise preset distance and target feature points, thereby improving the accuracy of lens magnification measurement.
[0056] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, etc. The following takes a lens magnification measurement device as an example to illustrate this embodiment and the following embodiments.
[0057] Based on this, the present application embodiment provides a lens magnification measurement method, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the lens magnification measurement method of the present application.
[0058] In this embodiment, the lens magnification measurement method includes steps S100 to S400:
[0059] Step S100, obtaining a first image obtained by photographing the object to be photographed;
[0060] It should be noted that the execution subject of this embodiment is a lens magnification measurement device. The lens magnification measurement device is provided with a mobile device and a backlight source. The mobile device is connected to a shooting device, and the shooting device includes a camera and a lens. The mobile device can be any device that can accurately control the moving distance. The lens and the camera are physically connected. Please refer to Figure 2 , Figure 2 The device overview diagram is provided. The lens magnification measurement device uses a shooting device connected to a mobile device and composed of a lens and a camera to shoot the object for the first time to obtain a first image.
[0061] Step S200, obtaining a second image of the object to be photographed by controlling the mobile device to move a preset distance along a preset moving direction and photographing, wherein the first image partially overlaps with the second image;
[0062] It is understandable that the mobile device of the lens magnification measuring device can move a preset distance according to a preset moving direction, and after the mobile device moves, the second image of the object to be photographed is captured at the current position to which the mobile device moves.
[0063] In the specific implementation, Figure 2 On the XOY plane shown in the figure, the mobile device drives the camera and lens to move in the X direction to take two photos A and B. There should be an overlapping area between the two photos A and B. Please refer to Figure 3 , Figure 3 For the A and B photo planes, the lens magnification measurement device can also move the camera and lens in the Y direction by a preset distance and take two photos with overlapping areas.
[0064] In particular, the mobile device of the lens magnification measuring device can also control the movement of the shooting surface to move the paper, which is the object to be photographed, by a preset distance along a preset direction.
[0065] Step S300, performing feature point matching on the first image and the second image to determine a preset number of pairs of corresponding target feature points;
[0066] It should be noted that the preset number of pairs is at least three pairs. The target feature point is a pair of feature points selected from all matched feature points. The lens magnification measurement device matches the feature points of the first image and the second image, and selects at least three pairs of feature points from all matched feature points as target feature points.
[0067] In a feasible implementation manner, step S300 includes the following steps:
[0068] Detecting key points of the first image to obtain a first key point set;
[0069] It is understandable that key points are significant feature points of an image, which usually have a unique local structure and can be stably detected and repeatedly identified in the image. The lens magnification measurement device calculates SIFT feature points, extracts key points in the first image that have a unique local structure and can be stably detected and repeatedly identified in the image, and obtains a first key point set.
[0070] Detecting key points of the second image to obtain a second key point set;
[0071] It should be noted that the lens magnification measurement device calculates SIFT feature points to obtain a second key point set in the second image.
[0072] Performing feature matching on the first key point set and the second key point set to obtain a matching point set;
[0073] It is understandable that the matching point set is a set of points in the first key point set and the second key point set whose distance is less than a threshold. The lens magnification measurement device matches the points in the two key point sets whose distance is less than the threshold to obtain a matching point set.
[0074] The matching point set is selected to obtain target feature points, wherein the target feature points include first feature points of the first image and second feature points of the second image.
[0075] It should be noted that the lens magnification measurement device selects at least three pairs of matching points from the matching point set as target feature points, wherein the target feature points include first feature points of the first image and second feature points of the second image.
[0076] In the specific implementation, please refer to Figure 4 , Figure 4 It is a position diagram of matching points on photos A and B. The lens magnification measurement device finds matching points on photos A and B. Generally, there are more than one matching points. A pair of matching points a and b can be selected (a is on photo A, and b is on photo B).
[0077] In a feasible implementation manner, performing feature matching on the first key point set and the second key point set to obtain a matching point set includes the following steps:
[0078] Extracting feature vectors of the first key point set to obtain a first feature vector;
[0079] It is understandable that the first eigenvector is a eigenvector obtained by calculating the gradient direction and amplitude of pixels in the neighborhood of the key point. The lens magnification measurement device extracts the eigenvector of each key point to obtain the first eigenvector.
[0080] Extracting the feature vector of the second key point set to obtain a second feature vector;
[0081] It should be noted that the lens magnification measurement device obtains a second eigenvector related to the second key point set.
[0082] The distance between the first feature vector and the second feature vector is judged by a preset threshold value. If the distance is less than the preset threshold value, the match is successful and a matching point set is obtained.
[0083] It is understandable that the matching point set represents that the matching points in the matching point set are the same physical object. The lens magnification measurement device finds the nearest matching point and the second nearest matching point for each key point. If the distance ratio between the two is greater than a threshold, the match is considered unreliable.
[0084] Step S400, calculating the coordinate displacement between the target feature points to obtain a pixel displacement distance, and determining the lens magnification based on the pixel displacement distance and the preset distance.
[0085] It should be noted that the pixel displacement distance is a pixel-level displacement distance. Lens magnification refers to the degree of change in image resolution, that is, the increase ratio of the number of pixels in a certain dimension of the image. The lens magnification measurement device calculates the pixel-level pixel displacement distance between the target feature points to obtain the pixel-level pixel displacement distance, and obtains the lens magnification based on the obtained pixel-level pixel displacement distance and the preset distance, wherein the lens magnification is used to characterize the degree of change in image resolution.
[0086] In this embodiment, the lens magnification measuring device can accurately control the movement of the shooting device by controlling the mobile device to move a preset distance along a preset moving direction to avoid measurement errors, and accurately obtain points with the same features through feature point matching, and obtain the lens magnification by marking the feature points and the preset distance, thereby improving the accuracy of the lens magnification measurement.
[0087] The present application embodiment provides a lens magnification measurement method, referring to Figure 4 , Figure 4 This is a flow chart of a second embodiment of the lens magnification measurement method of the present application.
[0088] In a feasible implementation manner, step S400 includes the following steps A10 to A40:
[0089] Step A10, establishing a coordinate map for the first image, and obtaining the first coordinates of the first feature point;
[0090] It should be noted that the first coordinate is the coordinate of the first feature point on the coordinate graph. The lens magnification measurement device establishes a coordinate graph for the first image, determines the first feature point selected on the first image, records the position coordinate of the first feature point, and obtains the first coordinate.
[0091] Step A20, establishing a coordinate map for the second image, and obtaining second coordinates of the second feature point;
[0092] It is understandable that the second coordinate is the coordinate of the second feature point on the coordinate graph. The lens magnification measurement device establishes a coordinate graph for the second image, determines a second feature point selected on the second image, and the second feature point should correspond to the first feature point in the first image, and records the position coordinate of the second feature point to obtain the second coordinate.
[0093] Step A30, calculating the displacement distance between the first coordinate and the second coordinate to obtain a pixel displacement distance;
[0094] It should be noted that the pixel displacement distance is a pixel-level displacement vector between the coordinates before the movement and the coordinates after the movement. The lens magnification measurement device calculates the displacement vector between the selected target feature points to obtain the pixel-level pixel displacement distance.
[0095] Step A40, obtaining a preset pixel size, and determining the lens magnification based on the pixel displacement distance, the preset pixel size and the preset distance.
[0096] It is understandable that the preset pixel size is the pixel size corresponding to the shooting device. The lens magnification is the increase ratio of the number of pixels per unit length. The lens magnification measurement device multiplies the pixel displacement distance of the first coordinate and the second coordinate, the pixel size corresponding to the shooting device, and the preset distance to obtain the lens magnification representing the increase ratio of the number of pixels per unit length.
[0097] In a feasible implementation manner, the step of obtaining a preset pixel size and determining the lens magnification based on the pixel displacement distance, the preset pixel size and the preset distance comprises the following steps:
[0098] If the preset moving direction is parallel to the coordinate axis of the coordinate graph, obtaining a target value of the pixel displacement distance;
[0099] It should be noted that the target value is the value of the coordinate displacement. The lens magnification measurement device obtains the value of the coordinate displacement as the target value.
[0100] In the specific implementation, Figure 3 As shown, on the XOY plane of the shooting surface, the mobile device drives the camera and lens to move in the X direction, taking photo A before moving and photo B after moving. The two photos should have an overlapping area, such as Figure 2 As shown. Record the moving distance m millimeters of the mobile device; calculate the feature points of photos A and B respectively (the method of calculating feature points is not limited to SIFT and other methods), and perform feature matching; calculate the pixel moving distance offset_x of photos A and B in the X direction through the matching points of photos A and B.
[0101] The target value is multiplied by the preset pixel size, and the target result obtained by the multiplication is divided by the preset distance to obtain the lens magnification.
[0102] It is understandable that the lens magnification measurement device multiplies the pixel displacement distance by the pixel size corresponding to the shooting device, and divides the multiplication result by the value corresponding to the preset distance to obtain the lens magnification.
[0103] Specifically, the lens magnification is calculated by the following formula to obtain the lens magnification.
[0104] (offset_x*a) / m; (a is the pixel size, unit is millimeter).
[0105] In particular, the lens magnification measurement device allows the camera and lens to move n millimeters in the Y direction, takes two photos with overlapping areas, calculates the SIFT feature points of the two pictures and matches them, and then calculates the pixel movement distance offset_y in the Y direction of the two pictures A and B. The lens magnification of the image is: (offset_y*a) / n, where n is the displacement of the camera and lens in the y-axis.
[0106] In particular, the calculation of offset_x is not limited to the method of obtaining the transformation matrix of the two images A and B using RANSAC (consistency calculation).
[0107] In a feasible implementation manner, the step of obtaining a preset pixel size and determining the lens magnification based on the pixel displacement distance, the preset pixel size and the preset distance further comprises the following steps:
[0108] If the preset moving direction is not parallel to the coordinate axis of the coordinate graph, subtracting the second coordinate from the first coordinate to obtain a difference coordinate;
[0109] It should be noted that the difference coordinates are the displacement vectors of the first feature point and the second feature point. The lens magnification measurement device subtracts the second coordinates from the first coordinates. If the coordinates of the first feature point are (x1, y1) and the coordinates of the second feature point are (x2, y2), the difference coordinates are (x1-x2, y1-y2).
[0110] Obtaining a first coordinate value and a second coordinate value of the difference coordinate, and calculating a square sum of the first coordinate value and the second coordinate value to obtain a coordinate square sum;
[0111] It can be understood that the square sum is the coordinate square sum calculated by summing up the squares of the values of the difference coordinates. The lens magnification measurement device obtains the coordinate square sum by summing up the squares of the values in the difference coordinates.
[0112] If the difference coordinates are (x1-x2, y1-y2), then the sum of the squares of the coordinates is (x1-x2) 2 -(y1-y2) 2 .
[0113] Performing square root calculation on the square sum of the coordinates to obtain a displacement value;
[0114] It should be noted that the displacement value is the displacement vector of the matching feature point. The lens magnification measurement device calculates the square root of the sum of the squares of the coordinates to obtain the displacement value.
[0115] If the sum of the squares of the coordinates is (x1-x2) 2 -(y1-y2) 2 , then the displacement value is:
[0116]
[0117] The target value is multiplied by the preset pixel size, and the target result obtained by the multiplication is divided by the preset distance to obtain the lens magnification.
[0118] It is understandable that the lens magnification measurement device multiplies the pixel displacement distance by the pixel size corresponding to the shooting device, and divides the multiplication result by the value corresponding to the preset distance to obtain the lens magnification. The formula is as follows:
[0119]
[0120] In this embodiment, the lens magnification measuring device calculates the displacement distance of the target feature point using different formulas for the target feature point through different mobile device movement modes, and then calculates the lens magnification. By calculating the displacement distance of the target feature point through different formulas, the flexibility of the movement of the mobile device is improved, and the lens magnification can be calculated through different movement modes, thereby improving the flexibility of lens magnification measurement.
[0121] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the lens magnification measurement method of the present application. More simple transformations based on this technical concept are all within the protection scope of the present application.
[0122] This application also provides a lens magnification measurement device, please refer to Figure 5 ,,The lens magnification measuring device comprises:
[0123] An acquisition module 10 is used to acquire a first image obtained by photographing the object to be photographed;
[0124] A moving module 20, configured to obtain a second image of the object to be photographed by controlling the mobile device to move a preset distance along a preset moving direction and photographing, wherein the first image partially overlaps with the second image;
[0125] A matching module 30, configured to perform feature point matching on the first image and the second image to determine a preset number of pairs of corresponding target feature points;
[0126] The determination module 40 is used to calculate the coordinate displacement between the target feature points to obtain a pixel displacement distance, and determine the lens magnification based on the pixel displacement distance and the preset distance.
[0127] Optionally, the matching module includes:
[0128] A detection module is used to detect key points of the first image to obtain a first key point set; detect key points of the second image to obtain a second key point set; perform feature matching on the first key point set and the second key point set to obtain a matching point set; select the matching point set to obtain target feature points, wherein the target feature points include first feature points of the first image and second feature points of the second image.
[0129] Optionally, the detection module includes:
[0130] The extraction module is used to extract the feature vector of the first key point set to obtain a first feature vector; extract the feature vector of the second key point set to obtain a second feature vector; judge the distance between the first feature vector and the second feature vector by a preset threshold, if the distance is less than the preset threshold, the match is successful, and a matching point set is obtained.
[0131] Optionally, the determining module includes:
[0132] A calculation module is used to establish a coordinate map for the first image to obtain the first coordinate of the first feature point; establish a coordinate map for the second image to obtain the second coordinate of the second feature point; calculate the displacement distance between the first coordinate and the second coordinate to obtain the pixel displacement distance; obtain a preset pixel size, and determine the lens magnification based on the pixel displacement distance, the preset pixel size and the preset distance.
[0133] Optionally, the calculation module includes:
[0134] The parallel module is used to obtain the target value of the pixel displacement distance if the preset moving direction is parallel to the coordinate axis of the coordinate diagram; multiply the target value by the preset pixel size, and divide the target result obtained by the multiplication by the preset distance to obtain the lens magnification.
[0135] A proportion module is used for, if the preset moving direction is not parallel to the coordinate axis of the coordinate graph, subtracting the second coordinate from the first coordinate to obtain a difference coordinate; obtaining the first coordinate value and the second coordinate value of the difference coordinate, and calculating the square sum of the first coordinate value and the second coordinate value to obtain the coordinate square sum; performing square root calculation on the coordinate square sum to obtain a displacement value; multiplying the displacement value by the preset pixel size, and dividing the target result obtained by the multiplication by the preset distance to obtain the lens magnification.
[0136] The lens magnification measurement device provided by the present application adopts the lens magnification measurement method in the above embodiment, which can solve the technical problem of lens magnification measurement. Compared with the prior art, the beneficial effects of the lens magnification measurement device provided by the present application are the same as the beneficial effects of the lens magnification measurement method provided by the above embodiment, and other technical features in the lens magnification measurement device are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0137] The present application provides a lens magnification measurement device, which includes: at least one processor; and a memory connected to the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the lens magnification measurement method in the above-mentioned embodiment 1.
[0138] Reference below Figure 6 , which shows a schematic diagram of the structure of a lens magnification measurement device suitable for implementing the embodiment of the present application. The lens magnification measurement device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 6 The lens magnification measurement device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0139] like Figure 6As shown, the lens magnification measurement device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM) 1004. Various programs and data required for the operation of the lens magnification measurement device are also stored in the RAM 1004. The processing device 1001, the ROM 1002, and the RAM 1004 are connected to each other via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems may be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 may allow the lens magnification measurement device to communicate with other devices wirelessly or by wire to exchange data. Although the lens magnification measurement device having various systems is shown in the figure, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems may be implemented or have instead.
[0140] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0141] The lens magnification measurement device provided by the present application adopts the lens magnification measurement method in the above embodiment, which can solve the technical problem of lens magnification measurement. Compared with the prior art, the beneficial effects of the lens magnification measurement device provided by the present application are the same as the beneficial effects of the lens magnification measurement method provided by the above embodiment, and other technical features in the lens magnification measurement device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0142] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0143] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field 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. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0144] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the lens magnification measurement method in the above-mentioned embodiment.
[0145] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.
[0146] The computer-readable storage medium may be included in the lens magnification measurement device; or may exist independently without being assembled into the lens magnification measurement device.
[0147] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the lens magnification measurement device, the lens magnification measurement device: obtains a first image of an object to be photographed; obtains a second image of the object to be photographed by controlling the mobile device to move a preset distance along a preset moving direction and photograph, wherein the first image partially overlaps with the second image; performs feature point matching on the first image and the second image to determine a preset number of pairs of corresponding target feature points; calculates the coordinate displacement between the target feature points to obtain a pixel displacement distance, and determines the lens magnification based on the pixel displacement distance and the preset distance.
[0148] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0149] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0150] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0151] The readable storage medium provided in the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned lens magnification measurement method, and can solve the technical problem of lens magnification measurement. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in the present application are the same as the beneficial effects of the lens magnification measurement method provided in the above-mentioned embodiment, and will not be repeated here.
[0152] The present application also provides a computer program product, including a computer program, which implements the steps of the lens magnification measurement method as described above when the computer program is executed by a processor.
[0153] The computer program product provided by the present application can solve the technical problem of lens magnification measurement. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as the beneficial effects of the lens magnification measurement method provided by the above embodiment, which will not be repeated here.
[0154] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A lens magnification measurement method, characterized in that: The lens magnification measurement method comprises: Acquire a first image obtained by photographing the object to be photographed; By controlling the mobile device to move a preset distance along a preset moving direction and photographing, a second image of the object to be photographed is obtained, wherein the first image partially overlaps with the second image; Performing feature point matching on the first image and the second image to determine a preset number of pairs of corresponding target feature points; The coordinate displacement between the target feature points is calculated to obtain a pixel displacement distance, and the lens magnification is determined based on the pixel displacement distance and the preset distance.
2. The lens magnification measurement method according to claim 1, characterized in that: The step of matching the feature points of the first image and the second image to determine a preset number of pairs of corresponding target feature points comprises: Detecting key points of the first image to obtain a first key point set; Detecting key points of the second image to obtain a second key point set; Performing feature matching on the first key point set and the second key point set to obtain a matching point set; The matching point set is selected to obtain target feature points, wherein the target feature points include first feature points of the first image and second feature points of the second image.
3. The lens magnification measurement method according to claim 2, characterized in that: The step of performing feature matching on the first key point set and the second key point set to obtain a matching point set comprises: Extracting feature vectors of the first key point set to obtain a first feature vector; Extracting the feature vector of the second key point set to obtain a second feature vector; The distance between the first feature vector and the second feature vector is judged by a preset threshold value. If the distance is less than the preset threshold value, the match is successful and a matching point set is obtained.
4. The lens magnification measurement method according to claim 2, characterized in that: The step of calculating the coordinate displacement between the target feature points to obtain a pixel displacement distance, and determining the lens magnification based on the pixel displacement distance and the preset distance comprises: Creating a coordinate map for the first image to obtain first coordinates of the first feature point; Creating a coordinate map for the second image to obtain second coordinates of the second feature point; Calculating the displacement distance between the first coordinate and the second coordinate to obtain a pixel displacement distance; A preset pixel size is obtained, and a lens magnification is determined based on the pixel displacement distance, the preset pixel size, and the preset distance.
5. The lens magnification measurement method according to claim 4, characterized in that: The step of obtaining a preset pixel size and determining the lens magnification based on the pixel displacement distance, the preset pixel size and the preset distance comprises: If the preset moving direction is parallel to the coordinate axis of the coordinate graph, obtaining a target value of the pixel displacement distance; The target value is multiplied by the preset pixel size, and the target result obtained by the multiplication is divided by the preset distance to obtain the lens magnification.
6. The lens magnification measurement method according to claim 4, characterized in that: The step of obtaining a preset pixel size and determining the lens magnification based on the pixel displacement distance, the preset pixel size and the preset distance also includes: If the preset moving direction is not parallel to the coordinate axis of the coordinate graph, subtracting the second coordinate from the first coordinate to obtain a difference coordinate; Obtaining a first coordinate value and a second coordinate value of the difference coordinate, and calculating a square sum of the first coordinate value and the second coordinate value to obtain a coordinate square sum; Performing square root calculation on the square sum of the coordinates to obtain a displacement value; The displacement value is multiplied by the preset pixel size, and the target result obtained by the multiplication is divided by the preset distance to obtain the lens magnification.
7. A lens magnification measurement device, characterized in that: The device comprises: An acquisition module, used to acquire a first image obtained by photographing the object to be photographed; A moving module, used to control the mobile device to move a preset distance along a preset moving direction and take pictures, so as to obtain a second image of the object to be photographed, wherein the first image partially overlaps with the second image; A matching module, used to match feature points of the first image and the second image to determine a preset number of pairs of corresponding target feature points; The determination module is used to calculate the coordinate displacement between the target feature points to obtain a pixel displacement distance, and determine the lens magnification based on the pixel displacement distance and the preset distance.
8. A lens magnification measurement device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the lens magnification measurement method according to any one of claims 1 to 6.
9. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the lens magnification measurement method according to any one of claims 1 to 6 are implemented.
10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the lens magnification measurement method according to any one of claims 1 to 6 are implemented.