CN110736432A - Size marking method and device, electronic equipment and storage medium - Google Patents

Size marking method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN110736432A
CN110736432A CN201911011875.0A CN201911011875A CN110736432A CN 110736432 A CN110736432 A CN 110736432A CN 201911011875 A CN201911011875 A CN 201911011875A CN 110736432 A CN110736432 A CN 110736432A
Authority
CN
China
Prior art keywords
image
lens module
distance
optical magnification
determining
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201911011875.0A
Other languages
Chinese (zh)
Inventor
周彦汝
周奇群
韦怡
张海裕
陈嘉伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201911011875.0A priority Critical patent/CN110736432A/en
Publication of CN110736432A publication Critical patent/CN110736432A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01BMEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
    • G01B11/00Measuring arrangements characterised by the use of optical techniques
    • G01B11/02Measuring arrangements characterised by the use of optical techniques for measuring length, width or thickness
    • G01B11/022Measuring arrangements characterised by the use of optical techniques for measuring length, width or thickness by means of tv-camera scanning
    • GPHYSICS
    • G02OPTICS
    • G02BOPTICAL ELEMENTS, SYSTEMS OR APPARATUS
    • G02B7/00Mountings, adjusting means, or light-tight connections, for optical elements
    • G02B7/28Systems for automatic generation of focusing signals
    • GPHYSICS
    • G03PHOTOGRAPHY; CINEMATOGRAPHY; ANALOGOUS TECHNIQUES USING WAVES OTHER THAN OPTICAL WAVES; ELECTROGRAPHY; HOLOGRAPHY
    • G03BAPPARATUS OR ARRANGEMENTS FOR TAKING PHOTOGRAPHS OR FOR PROJECTING OR VIEWING THEM; APPARATUS OR ARRANGEMENTS EMPLOYING ANALOGOUS TECHNIQUES USING WAVES OTHER THAN OPTICAL WAVES; ACCESSORIES THEREFOR
    • G03B13/00Viewfinders; Focusing aids for cameras; Means for focusing for cameras; Autofocus systems for cameras
    • G03B13/32Means for focusing
    • G03B13/34Power focusing
    • G03B13/36Autofocus systems
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/50Constructional details
    • H04N23/55Optical parts specially adapted for electronic image sensors; Mounting thereof
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/67Focus control based on electronic image sensor signals

Abstract

The invention discloses size labeling methods, devices, electronic equipment and a storage medium, wherein the method comprises the steps of determining the distance from a corresponding object plane to the surface of the th lens of a lens module when the lens module is focused, determining the object distance and the image distance when the lens module is focused on the object plane according to the distance, and determining the corresponding optical magnification according to the object distance and the image distance so as to display a ruler with set length on an image output by a screen of the electronic equipment according to the optical magnification, the size of an image sensor of the electronic equipment and the size of the screen when the electronic equipment is focused by the lens module and images are obtained.

Description

Size marking method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of image technologies, and in particular, to size labeling methods and apparatuses, an electronic device, and a storage medium.
Background
At present, electronic equipment such as a mobile phone and the like has a micro-distance shooting function and can realize the amplification shooting of a micro object in a short distance, and because the micro-distance shooting has a large amplification factor on a shot object and usually only shoots small parts of the whole object, the actual size of the shot object cannot be marked in a micro-distance image simply according to the content of the image.
Disclosure of Invention
In view of the above, embodiments of the present invention provide size labeling methods, apparatuses, electronic devices, and storage media, so as to at least solve the problem that the related art cannot label the actual size of a subject in a macro image based on the image content.
The technical scheme of the embodiment of the invention is realized as follows:
the embodiment of the invention provides size labeling methods, which comprise the following steps:
when the lens module is focused, determining the distance from the corresponding object plane to the surface of the th lens of the lens module;
determining the object distance and the image distance of the lens module when focusing on the object plane according to the distance;
and determining a corresponding optical magnification according to the object distance and the image distance so as to display a ruler with a set length on the image output by the screen of the electronic equipment according to the optical magnification, the size of an image sensor of the electronic equipment and the size of the screen when the electronic equipment utilizes the lens module to focus and shoot to obtain the image.
In the foregoing solution, the lens module is a zoom lens module, and the method further includes:
determining th motor strokes with at least two different lengths in the focusing state of the lens module;
and generating a lookup table, wherein each th motor stroke and the corresponding optical magnification are stored in the lookup table, so that when a terminal focuses and shoots an image by using the lens module, the th motor stroke which is the same as the second motor stroke corresponding to the image is searched by using the lookup table, and the corresponding optical magnification is determined.
In the foregoing solution, the determining th motor strokes with at least two different lengths in the focusing state of the lens module includes:
determining M positions uniformly distributed in the total stroke of a motor of the lens module;
determining M th motor strokes corresponding to the M positions respectively, wherein,
and M is an integer greater than 2.
In the foregoing solution, the generating the lookup table includes:
fitting a curve by using the M th motor strokes and corresponding optical magnification, wherein the curve is used for representing the corresponding relation between the th motor stroke and the optical magnification;
taking N points on the curve to obtain corresponding relations between strokes and optical magnification of N groups of th motors;
generating the lookup table by using the obtained corresponding relation between the strokes and the optical magnifications of the N groups of th motors, wherein the corresponding relation between the strokes and the optical magnifications of the N groups of th motors is stored in the lookup table,
and N is an integer greater than M.
The embodiment of the invention provides size marking methods, which are applied to electronic equipment, wherein the electronic equipment is provided with a lens module, and the method comprises the following steps:
focusing and shooting by using the lens module to obtain an image;
determining the optical magnification corresponding to the image, wherein the optical magnification is determined according to the object distance and the image distance when the lens module focuses on the object plane, and the object distance and the image distance are determined according to the distance from the object plane to the surface of the th lens of the lens module;
displaying a scale of a set length on the image output via a screen of the electronic device according to the optical magnification and an image sensor size and a screen size of the electronic device.
In the foregoing solution, the lens module is a zoom lens module, and the determining the optical magnification corresponding to the image includes:
searching th motor stroke which is the same as the second motor stroke corresponding to the image in a lookup table, wherein the lookup table stores the corresponding relation between at least two groups of th motor strokes and optical magnification;
and determining the optical magnification corresponding to the image according to the searched th motor stroke.
In the above aspect, the displaying a scale of a set length on the image output via the screen of the electronic device according to the optical magnification and the image sensor size and the screen size of the electronic device includes:
determining an annotation object in the image;
determining the length to be marked in the marked object as the set length;
displaying a scale of a set length on the image output via a screen of the electronic device according to the optical magnification and an image sensor size and a screen size of the electronic device.
The embodiment of the invention also provides size labeling devices, which comprise:
an determining unit, for determining the distance from the corresponding object plane to the th lens surface of the lens module when the lens module is in focus;
the second determining unit is used for determining the object distance and the image distance when the lens module focuses on the object plane according to the distance;
and the third determining unit is used for determining corresponding optical magnification according to the object distance and the image distance so as to display a scale with set length on the image output by the screen of the electronic equipment according to the optical magnification, the size of an image sensor of the electronic equipment and the size of the screen when the electronic equipment utilizes the lens module to focus and shoot to obtain the image.
The embodiment of the present invention further provides size labeling devices, which are applied to electronic equipment, wherein the electronic equipment is provided with a lens module, and the device includes:
the shooting unit is used for focusing and shooting by utilizing the lens module to obtain an image;
the fourth determining unit is used for determining the optical magnification corresponding to the image, wherein the optical magnification is determined according to the object distance and the image distance when the lens module focuses on the object plane, and the object distance and the image distance are determined according to the distance from the object plane to the surface of the th lens of the lens module;
a display unit for displaying a scale of a set length on the image output via a screen of the electronic device according to the optical magnification and an image sensor size and a screen size of the electronic device.
Embodiments of the present invention also provide electronic devices, comprising a processor and a memory for storing a computer program capable of running on the processor,
wherein the processor is configured to perform the steps of any of the methods described above when the computer program is run.
Embodiments of the present invention also provide storage media having stored thereon a computer program that, when executed by a processor, performs the steps of any of the methods described above.
In the embodiment of the invention, the corresponding optical magnification factor is determined based on the corresponding object distance and image distance of the lens module in the focusing state, and when the electronic equipment utilizes the lens module to focus and shoot images, a scale with a set length is displayed on the images output by the screen according to the corresponding optical magnification factor, the image sensor size and the screen size of the electronic equipment, so that the actual size of the shot object can be visually marked, and the problem that the actual size of the shot object cannot be marked in the images simply according to the image content at present is solved.
Drawings
Fig. 1 is a schematic flow chart of an implementation of a method for size labeling according to an embodiment of the present invention;
FIG. 2 is a flow chart illustrating an implementation of a method for dimensioning according to another embodiment of the present invention;
FIG. 3 is a flow chart illustrating an implementation of a method for dimensioning according to yet another embodiment of the present invention;
FIG. 4 is a flow chart illustrating an implementation of a method for dimensioning to generate a lookup table according to yet another embodiment of the present invention;
FIG. 5 is a flowchart illustrating an implementation of a method for dimensioning according to yet another embodiment of the present invention;
FIG. 6 is a flowchart illustrating an implementation of a method for dimensioning according to yet another embodiment of the present invention;
FIG. 7 is a flowchart illustrating an implementation of a method for dimensioning according to yet another embodiment of the present invention;
FIG. 8 is a schematic structural diagram of a size marking apparatus according to an embodiment of the present invention;
FIG. 9 is a schematic structural diagram of a dimensioning apparatus according to another embodiment of the present invention;
fig. 10 is a schematic diagram of a hardware component structure of an electronic device according to an embodiment of the present invention.
Detailed Description
The invention is described in further detail with reference to the figures and the embodiments.
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the invention. It will be apparent, however, to one skilled in the art that the present invention may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, and methods are omitted so as not to obscure the description of the present invention with unnecessary detail.
The technical means described in the embodiments of the present invention may be arbitrarily combined without conflict.
In addition, in the present examples, "", "second", etc. are used for distinguishing similar objects, and are not necessarily used for describing a particular order or sequence.
Fig. 1 shows an implementation flow of a method for dimensioning according to an embodiment of the present invention, where an execution subject of the method may be an electronic device configured with a lens module, such as a mobile phone, a tablet, and the like. The method comprises the following steps:
s101, when the lens module is focused, determining the distance from the corresponding object plane to the th lens surface of the lens module.
When the lens module focuses object planes, the lens module is calibrated, and the distance d from the corresponding object plane to the surface of the th lens of the lens module can be obtained.
S102: and determining the object distance and the image distance of the lens module when focusing the object plane according to the distance.
The object distance is the distance from the object plane where the shot object of the lens module is located to the optical center of the lens module, the image distance is the distance from the image plane imaged by the lens module to the optical center of the lens module, and when the lens module focuses the object plane, the object distance and the image distance corresponding to the lens module are determined values.
The object distance determining method comprises the following steps of calculating the position of an object main surface corresponding to the lens module, namely the distance P between the surface of the th lens piece of the lens module and the object main surface according to the optical structure of the lens module, taking the object plane positioned on the left side of the th lens piece of the lens module as an example, if the object plane is positioned on the right side of the th lens piece of the lens module, P is a positive value, if the object plane is positioned on the left side of the th lens piece of the lens module, P is a negative value, and adding D and P to obtain the object distance D corresponding to the lens module.
Based on the focal length of the lens module and the determined object distance, the object image relation is as follows: the reciprocal of the object distance + the reciprocal of the image distance is the reciprocal of the focal length, and the image distance imD corresponding to the object distance D can be obtained.
S103: and determining a corresponding optical magnification according to the object distance and the image distance so as to display a scale with a set length on the image output by the screen of the electronic equipment according to the optical magnification, the size of an image sensor of the electronic equipment and the size of the screen when the electronic equipment obtains the image by focusing and shooting by using the lens module.
Here, the optical magnification is optical lens performance parameters, which is a ratio of an imaging size of an object passing through the lens module on a focal plane to an actual size of the object, and the value of the optical magnification is a ratio of an image distance of the lens module in a focusing state to an object distance, so that the optical magnification of the lens module can be determined according to the determined object distance and image distance.
After the optical magnification resolution is determined, when the electronic device uses the same type of lens module to focus and shoot an image and corresponds to the same distance from the object plane to the th lens surface of the lens module, a ruler with a set length can be displayed on the image shot by the lens module according to the corresponding optical magnification, the size of the image sensor of the electronic device and the size of the screen.
For example, when the lens module is focused on object plane, the corresponding object distance is D, the image distance is imD, the corresponding optical magnification β is the ratio of the image distance imD to the object distance D, so that the image imaged on the image sensor is output to the screen of the electronic device in steps of , and if the image size of the object is 1mm, the image size of the image sensor is displayed on the screen of the electronic device, that is, if the number of pixels imaged on the image sensor is N, β/δ, the ratio of the image size to the image sensor size is γ, the final magnification value of the image sensor is γ mm, and the final magnification value of the image length is γ mm.
Therefore, after the optical magnification is determined, the number of pixels of the set length corresponding to the screen of the electronic device can be obtained from the determined optical magnification and the image sensor size and the screen size of the electronic device, so that the scale of the set length is displayed on the image output via the screen. For example, when the length is set to 10mm, a scale for marking the length of 10mm is output on the screen, and the number of pixels corresponding to 10mm on the scale is 10N γ.
In the embodiment of the invention, the corresponding optical magnification factor is determined based on the corresponding object distance and image distance of the lens module in the focusing state, and when the electronic equipment utilizes the lens module to focus and shoot images, a scale with a set length is displayed on the images output by the screen according to the corresponding optical magnification factor, the image sensor size and the screen size of the electronic equipment, so that the actual size of the shot object can be visually marked, and the problem that the actual size of the shot object cannot be marked in the images simply according to the image content at present is solved.
, when the lens module is an ultramicro lens module, because the ultramicro lens module has a magnification of several tens of times to the subject, and usually only the microscopic picture of the subject can be displayed in the captured image, the method for marking the size provided by the embodiment of the present invention can directly and quickly mark the actual size of the subject in the ultramicro image, thereby solving the problem that the user cannot know the actual size of the subject after the current ultramicro lens performs magnification shooting on the close-range microscopic subject.
In the above embodiment, for the fixed focus lens module, since the fixed focus lens module can only focus object planes, that is, only optical magnifications are corresponded, and for the zoom lens module, corresponding to different motor strokes, the zoom lens module can focus different object planes, that is, corresponding to different distances from the object planes to the th lens surface of the lens module, therefore, for the zoom lens module, the corresponding relationship between different motor strokes and optical magnifications can be predetermined to facilitate rapid image size marking, based on this, the invention provides another embodiment, which is an improvement of the zoom lens module, referring to fig. 2, when the lens module is a zoom lens module, the method further comprises:
and S104, determining th motor strokes with at least two different lengths in the focusing state of the lens module.
Because the used lens module is a zoom lens module, the zoom lens module needs a Voice Coil Motor (VCM) to drive the lens focusing assembly to complete focusing when focusing, different Motor strokes correspond to different object planes when the zoom lens module focuses, and at least two groups of th Motor strokes with different lengths of the lens module are firstly determined.
In embodiments, as shown in fig. 3, the determining th motor strokes of at least two different lengths in the lens module in-focus state includes:
s1041: and determining M positions uniformly distributed in the total stroke of the motor of the lens module.
The total motor stroke of the lens module is 400um, and times of shooting can be carried out every 40um, so that 11 points can be uniformly selected in the total motor stroke of the lens module in total motor stroke.
S1042, M th motor strokes corresponding to M positions are determined, wherein M is an integer larger than 2.
After M positions are selected for the total motor stroke of the lens module, M th motor strokes are obtained, which are respectively V1,……,VMOn the basis, for each th motor stroke, the method is executed to obtain the distance d from the corresponding object plane to the th lens surface of the lens module1,d2,……,dM
And S105, generating a lookup table, wherein each th motor stroke and the corresponding optical magnification are stored in the lookup table, so that when a terminal focuses and shoots an image by using the lens module, the th motor stroke which is the same as the second motor stroke corresponding to the image is searched by using the lookup table, and the corresponding optical magnification is determined.
The lookup table stores two items of data, namely th motor stroke of the lens module and optical magnification corresponding to the th motor stroke, the optical magnification corresponding to the different motor strokes of the lens module can be acquired from the lookup table, the lookup table is stored in -time programmable storage device in the electronic equipment, when the terminal uses the lens module to shoot an image under the second motor stroke, the second motor stroke of the lens module when shooting the image is determined, the th motor stroke which is the same as the second motor stroke is inquired from the lookup table, the optical magnification corresponding to the th motor stroke, namely the optical magnification corresponding to the second motor stroke, can be determined from the lookup table, exemplarily, the optical magnification corresponding to the th motor stroke m is stored in the lookup table, and the optical magnification corresponding to the th motor stroke m is β, so when the second motor stroke corresponding to the image shot by the lens module is also m, the optical magnification corresponding to the β also is also equal.
In embodiments, as shown in fig. 4, the generating a look-up table includes:
and S401, fitting a curve according to the M th motor strokes and the corresponding optical magnification, wherein the curve is used for representing the corresponding relation between the th motor stroke and the optical magnification.
S402, taking N points on the curve to obtain the corresponding relation between the strokes and the optical magnification of N groups of th motors.
And S403, generating the lookup table, wherein the lookup table stores the corresponding relation between the th motor stroke of the N groups and the optical amplification factor, wherein N is an integer larger than M.
As described in the above embodiments, M points corresponding to the motor strokes V are uniformly selected from the total motor stroke of the lens module1,……,VMCalibrating the lens after determining the strokes of the M motors corresponding to the lens module, and determining the distance d from the object plane corresponding to the strokes of the M motors of the lens module to the surface of the th lens of the lens module through calibrating the lens1,……,dMAdjust the th motor stroke of the lens module to V1The motor stroke V at is calculated according to the structure of the optical system1Position P of the main surface of the object space1Wherein if the object side main surface is located at the right side of the th lens of the lens module, P is1If the object side main surface is located at the left side of the th lens of the lens module, P is positive1Is negative, according to the th motor stroke of the lens module is V1The distance d1 from the object plane to the th lens surface of the lens module and the distance P from the main surface of the object to the th lens surface of the lens module1The corresponding object distance D when the motor is positioned at the th motor stroke position can be calculated1=d1+P1. By analogy, the motor stroke of the lens module is sequentially adjusted to uniformly selected M points, and finally, when the motor stroke of the lens module is VMDetermining the object distance of a clear object plane corresponding to the motor stroke of the lens module as DMAccording to the objective image relation of the reciprocal of the objective distance + the reciprocal of the image distance being the reciprocal of the focal length, the corresponding image distance im of the lens module under different th motor strokes can be obtainedDMAccording to the object distance and the image distance corresponding to the lens module under different th motor strokes, the corresponding distance can be obtainedCorresponding optical magnification β, the motor strokes of each set are combined with the corresponding optical magnification to (V)1,β1),(V2,β2),……,(VM, βM) After the points are drawn, curve fitting is carried out on the M points by using a least square method, a curve obtained by fitting can represent the corresponding relation between the th motor stroke and the optical magnification, and V is f (β). N points are further taken on the curve obtained by fitting, wherein N is an integer larger than M, so that the corresponding relation between the th motor stroke and the optical magnification is obtained, a corresponding relation lookup table of the th motor stroke and the optical magnification is generated according to the corresponding relation, and the lookup table is stored in a -time programmable storage device in the electronic equipment.
In the above embodiment, only M object distances and image distances need to be determined in advance, and the corresponding relationship between the stroke of the motor more than M groups and the optical magnification can be obtained through the fitted curve, so that the operation of size labeling is simplified, the corresponding relationship between the th motor stroke with sufficient number and the number of pixels can be efficiently obtained, and the accuracy of the scale is improved.
Accordingly, fig. 5 shows an implementation flow of the method for dimensioning provided by the embodiment of the present invention, wherein an execution subject of the method may be an electronic device configured with a lens module, such as a mobile phone, a tablet, and the like. The method comprises the following steps:
s501: and shooting by using the lens module to obtain a focused clear image.
In the embodiment of the invention, the lens module is used for focusing and shooting to obtain the image.
S502, determining the optical magnification corresponding to the image, wherein the optical magnification is determined according to the object distance and the image distance when the lens module focuses on the object plane, and the object distance and the image distance are determined according to the distance from the object plane to the surface of the th lens of the lens module.
S503: displaying a scale of a set length on the image output via the screen of the electronic device according to the optical magnification and the image sensor size and screen size of the electronic device.
The method comprises the steps of utilizing a lens module to focus and shoot to obtain an image, determining the corresponding optical magnification ratio when the lens module shoots the image, and displaying a ruler with a set length on the image output by a screen of the electronic equipment according to the optical magnification ratio, the size of an image sensor of the electronic equipment and the size of the screen.
For example, when the lens module is focused on object plane, the corresponding object distance is D, the image distance is imD, the corresponding optical magnification β is the ratio of the image distance imD to the object distance D, so that the image imaged on the image sensor is output to the screen of the electronic device in steps of , and if the image size of the object is 1mm, the image size of the image sensor is displayed on the screen of the electronic device, that is, if the number of pixels imaged on the image sensor is N, β/δ, the ratio of the image size to the image sensor size is γ, the final magnification value of the image sensor is γ mm, and the final magnification value of the image length is γ mm.
Therefore, after the optical magnification is determined, the number of pixels of the set length corresponding to the screen of the electronic device can be obtained from the determined optical magnification and the image sensor size and the screen size of the electronic device, so that the scale of the set length is displayed on the image output via the screen. For example, when the length is set to 10mm, a scale for marking the length of 10mm is output on the screen, and the number of pixels corresponding to 10mm on the scale is 10N γ.
In the embodiment of the invention, the corresponding optical magnification factor is determined based on the corresponding object distance and image distance of the lens module in the focusing state, and when the electronic equipment utilizes the lens module to focus and shoot images, a scale with a set length is displayed on the images output by the screen according to the corresponding optical magnification factor, the image sensor size and the screen size of the electronic equipment, so that the actual size of the shot object can be visually marked, and the problem that the actual size of the shot object cannot be marked in the images simply according to the image content at present is solved.
, when the lens module is an ultramicro lens module, because the ultramicro lens module has a magnification of several tens of times to the subject, and usually only the microscopic picture of the subject can be displayed in the captured image, the method for marking the size provided by the embodiment of the present invention can directly and quickly mark the actual size of the subject in the ultramicro image, thereby solving the problem that the user cannot know the actual size of the subject after the current ultramicro lens performs magnification shooting on the close-range microscopic subject.
In the foregoing embodiments, for the fixed focus lens module, since the fixed focus lens module can focus only object planes, that is, only optical magnifications are corresponded, and for the zoom lens module, corresponding to different motor strokes within the stroke range of the motor, the zoom lens module can focus different object planes, therefore, for the zoom lens module, the corresponding relationship between different motor strokes and optical magnifications can be predetermined so as to perform size labeling on the image quickly, based on this, the invention provides another embodiment, as shown in fig. 6, the determining the optical magnifications corresponding to the image includes:
s5021, a th motor stroke which is the same as a second motor stroke corresponding to the image is searched in a lookup table, and at least two groups of corresponding relations between th motor strokes and optical magnification are stored in the lookup table.
And S5022, determining the optical magnification corresponding to the image according to the searched th motor stroke.
The lookup table stores two items of data, namely th motor stroke of the lens module and optical magnification corresponding to the th motor stroke, the optical magnification corresponding to the different motor strokes of the lens module can be acquired from the lookup table, the lookup table is stored in -time programmable storage device in the electronic equipment, when the terminal uses the lens module to shoot an image under the second motor stroke, the second motor stroke of the lens module when shooting the image is determined, the th motor stroke which is the same as the second motor stroke is inquired from the lookup table, the optical magnification corresponding to the th motor stroke, namely the optical magnification corresponding to the second motor stroke, can be determined from the lookup table, exemplarily, the optical magnification corresponding to the th motor stroke m is stored in the lookup table, and the optical magnification corresponding to the th motor stroke m is β, so when the second motor stroke corresponding to the image shot by the lens module is also m, the optical magnification corresponding to the β also is also equal.
In an embodiment, as shown in fig. 7, the displaying a scale of a set length on the image output via a screen of the electronic device according to the optical magnification and an image sensor size and a screen size of the electronic device includes:
s5031: and determining an annotation object in the image.
In practical application, in an ultra-micro distance shooting scene, the labeled object can be sections of hair, wings of bees, and the like, for example.
S5032: and determining the length needing to be marked in the marked object as the set length.
After the object needing to be marked in the second image is determined, the length part needing to be marked in the marked object is determined, and the length needing to be marked is determined as the set length.
In practical applications, the length of the tagged object and the length to be tagged can be determined by a user command, for example, for hairs shot under the macro lens, the user determines that the hairs are the tagged object by clicking the area where the hairs are located in the image, and then automatically identifies the hairs as the length to be tagged, and for example, for bees shot under the macro lens, the user determines that the legs are the tagged object by clicking legs of the image, and then the user slides distances along the leg lines on the legs by a sliding operation, and then determines that the distance corresponding to the sliding operation is the length to be tagged.
S5033: displaying a scale of a set length on the image output via the screen of the electronic device according to the optical magnification and the image sensor size and screen size of the electronic device.
The set length is no longer fixed length, and by the method, the size of the part needing size marking can be marked according to the actual content in the image, so that the size of the image content can be flexibly marked according to the requirement of a user, and the user can conveniently and intuitively obtain the actual size of the shot object.
In order to implement the method according to the embodiment of the present invention, there are also provided size marking devices, as shown in fig. 8, where the size marking device includes:
an determining unit 801, configured to determine, when the lens module is in focus, a distance from a corresponding object plane to a th lens surface of the lens module;
a second determining unit 802, configured to determine an object distance and an image distance when the lens module focuses on the object plane according to the distance;
a third determining unit 803, configured to determine a corresponding optical magnification according to the object distance and the image distance, so that when an image is obtained by focusing and shooting the electronic device by using the lens module, a ruler with a set length is displayed on the image output through the screen of the electronic device according to the optical magnification, the size of the image sensor of the electronic device, and the size of the screen.
In , the lens module is a zoom lens module, the apparatus includes:
a fifth determining unit, configured to determine th motor strokes with at least two different lengths in a focusing state of the lens module;
and the generating unit is used for generating a lookup table, wherein each th motor stroke and the corresponding optical magnification are stored in the lookup table, so that when a terminal focuses and shoots an image by using the lens module, the th motor stroke which is the same as the second motor stroke corresponding to the image is searched by using the lookup table, and the corresponding optical magnification is determined.
In , the fifth determining unit determines th motor strokes of at least two different lengths in the lens module in-focus state, including:
determining M positions uniformly distributed in the total stroke of a motor of the lens module;
determining M th motor strokes corresponding to the M positions respectively, wherein,
and M is an integer greater than 2.
In the embodiment, the generating unit generates a lookup table including:
fitting a curve by using the M th motor strokes and corresponding optical magnification, wherein the curve is used for representing the corresponding relation between the th motor stroke and the optical magnification;
taking N points on the curve to obtain corresponding relations between strokes and optical magnification of N groups of th motors;
generating the lookup table by using the obtained corresponding relation between the strokes and the optical magnifications of the N groups of th motors, wherein the corresponding relation between the strokes and the optical magnifications of the N groups of th motors is stored in the lookup table,
and N is an integer greater than M.
In practice, the th determining unit 801, the second determining unit 802, the third determining unit 803, the fifth determining unit and the generating unit may be implemented by a processor in the dimensioning device.
In order to implement the size labeling method according to the embodiment of the present invention, an size labeling apparatus is further provided in the embodiment of the present invention, and is applied to an electronic device, where the electronic device is provided with a lens module, as shown in fig. 9, the size labeling apparatus includes:
a shooting unit 901, configured to focus and shoot by using the lens module to obtain an image;
a fourth determining unit 902, configured to determine an optical magnification corresponding to the image, where the optical magnification is determined according to an object distance and an image distance when the lens module focuses on an object plane, and the object distance and the image distance are determined according to a distance from the object plane to an th lens surface of the lens module;
a display unit 903 for displaying a scale of a set length on the image output via the screen of the electronic apparatus according to the optical magnification and the image sensor size and screen size of the electronic apparatus.
Wherein, in embodiment, the lens module is a zoom lens module, and the fourth determining unit 902 is configured to:
searching th motor stroke which is the same as the second motor stroke corresponding to the image in a lookup table, wherein the lookup table stores the corresponding relation between at least two groups of th motor strokes and optical magnification;
and determining the optical magnification corresponding to the image according to the searched th motor stroke.
In the embodiment, the display unit 903 is configured to:
determining an annotation object in the image;
determining the length to be marked in the marked object as the set length;
displaying a scale of a set length on the image output via a screen of the electronic device according to the optical magnification and an image sensor size and a screen size of the electronic device.
In actual use, the photographing unit 901, the fourth determining unit 902, and the display unit 903 may be implemented by a processor in a dimensioning apparatus. Of course, the processor needs to execute the program stored in the memory to realize the functions of the above-mentioned program modules.
It should be noted that, when the size marking apparatus provided in the embodiment of fig. 8 or 9 performs size marking, only the division of the program modules is used for illustration, and in practical applications, the processing distribution may be completed by different program modules as needed, that is, the internal structure of the apparatus is divided into different program modules to complete all or part of the processing described above.
Based on the hardware implementation of the program module, and in order to implement the method according to the embodiment of the present invention, electronic devices are further provided in the embodiment of the present invention, fig. 10 is a schematic diagram of a hardware composition structure of an electronic device according to an embodiment of the present invention, and as shown in fig. 10, the electronic device includes:
a communication interface 1 capable of information interaction with other devices such as network devices and the like;
the processor 2 is connected with the communication interface 1 to realize information interaction with other equipment, and when the processor is used for running a computer program, the processor executes the size marking method provided by or more technical solutions, and the computer program is stored on the memory 3.
In practice, of course, the various components in the electronic device are coupled through bus system 4. it will be appreciated that bus system 4 is used to effect connected communications between these components, that bus system 4 includes a power bus, a control bus, and a status signal bus in addition to a data bus, but for clarity of illustration, the various buses are labeled as bus system 4 in FIG. 10.
The memory 3 in the embodiment of the present invention is used to store various types of data to support the operation of the electronic device. Examples of such data include: any computer program for operating on an electronic device.
It will be appreciated that the memory 3 may be either volatile memory or nonvolatile memory, and may also include both volatile and nonvolatile memory. Among them, the nonvolatile Memory may be a Read Only Memory (ROM), a Programmable Read Only Memory (PROM), an Erasable Programmable Read-Only Memory (EPROM), an Electrically Erasable Programmable Read-Only Memory (EEPROM), a magnetic random access Memory (FRAM), a Flash Memory (Flash Memory), a magnetic surface Memory, an optical disk, or a Compact Disc Read-Only Memory (CD-ROM); the magnetic surface storage may be disk storage or tape storage. The volatile Memory may be a Random Access Memory (RAM) which acts as an external cache Memory. By way of illustration and not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Synchronous Static Random Access Memory (SSRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM), Enhanced Synchronous Dynamic Random Access Memory (Enhanced Synchronous Random Access Memory), Synchronous linked Dynamic Random Access Memory (DRAM), and Direct Random Access Memory (DRMBER). The memory 2 described in the embodiments of the present invention is intended to comprise, without being limited to, these and any other suitable types of memory.
The method disclosed in the above embodiments of the present invention may be applied to the processor 2, or implemented by the processor 2, the processor 2 may be kinds of integrated circuit chips having signal processing capability, and in the implementation process, the steps of the method may be implemented by integrated logic circuits of hardware in the processor 2 or instructions in the form of software, the processor 2 may be a general-purpose processor, a DSP, or other programmable logic device, a discrete or transistor logic device, a discrete hardware component, etc. the processor 2 may implement or execute the methods, steps, and logic blocks disclosed in the embodiments of the present invention.
When the processor 2 executes the program, corresponding processes in the methods according to the embodiments of the present invention are realized, which is not described herein for brevity.
In an exemplary embodiment, the embodiment of the present invention further provides storage media, specifically a computer-readable storage medium, for example, a Memory 3 storing a computer program executable by a processor 2 to perform the steps of the aforementioned method, wherein the computer-readable storage medium may be a Memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface Memory, optical disk, or CD-ROM.
The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units into only logical functions may be implemented in other ways, e.g., multiple units or components may be combined, or may be integrated into another systems, or features may be omitted, or not implemented, and further, the shown or discussed components may be coupled, or directly coupled, or communicatively coupled, to each other via interfaces, indirectly coupled, or communicatively coupled, or mechanically or otherwise, to the devices or units.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, that is, may be located in places, may also be distributed on multiple network units, and some or all of the units may be selected according to actual needs to achieve the purpose of the embodiment.
In addition, all the functional units in the embodiments of the present invention may be integrated into processing units, or each unit may be respectively and independently units, or two or more units may be integrated into units, and the integrated units may be implemented in the form of hardware, or in the form of hardware and software functional units.
It will be understood by those skilled in the art that all or part of the steps of implementing the above-described method embodiments may be implemented by hardware associated with program instructions, and that the program may be stored in a computer readable storage medium, and when executed, the program performs the steps comprising the above-described method embodiments, and the storage medium may include various media capable of storing program code, such as removable storage devices, ROM, RAM, magnetic or optical disks.
Based on such understanding, the technical solution of the embodiments of the present invention or the portions contributing to the prior art may be embodied in the form of software products stored in storage media, which include several instructions for making electronic devices (which may be personal computers, servers, or network devices) execute all or part of the methods described in the embodiments of the present invention.
The above description is only for the specific embodiment of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the appended claims.

Claims (11)

1, A method for marking size, comprising:
when the lens module is focused, determining the distance from the corresponding object plane to the surface of the th lens of the lens module;
determining the object distance and the image distance of the lens module when focusing on the object plane according to the distance;
and determining a corresponding optical magnification according to the object distance and the image distance so as to display a ruler with a set length on the image output by the screen of the electronic equipment according to the optical magnification, the size of an image sensor of the electronic equipment and the size of the screen when the electronic equipment utilizes the lens module to focus and shoot to obtain the image.
2. The method of claim 1, wherein the lens module is a zoom lens module, the method further comprising:
determining th motor strokes with at least two different lengths in the focusing state of the lens module;
and generating a lookup table, wherein each th motor stroke and the corresponding optical magnification are stored in the lookup table, so that when a terminal focuses and shoots an image by using the lens module, the th motor stroke which is the same as the second motor stroke corresponding to the image is searched by using the lookup table, and the corresponding optical magnification is determined.
3. The method of claim 2, wherein the determining th motor strokes with at least two different lengths in the lens module in-focus state comprises:
determining M positions uniformly distributed in the total stroke of a motor of the lens module;
determining M th motor strokes corresponding to the M positions respectively, wherein,
and M is an integer greater than 2.
4. The method of claim 3, wherein generating the lookup table comprises:
fitting a curve by using the M th motor strokes and corresponding optical magnification, wherein the curve is used for representing the corresponding relation between the th motor stroke and the optical magnification;
taking N points on the curve to obtain the corresponding relation between the strokes of N groups of th motors and the optical magnification;
generating the lookup table by using the obtained corresponding relation between the strokes and the optical magnifications of the N groups of th motors, wherein the corresponding relation between the strokes and the optical magnifications of the N groups of th motors is stored in the lookup table,
and N is an integer greater than M.
The size labeling method of is characterized in that the method is applied to electronic equipment, a lens module is arranged on the electronic equipment, and the method comprises the following steps:
focusing and shooting by using the lens module to obtain an image;
determining the optical magnification corresponding to the image, wherein the optical magnification is determined according to the object distance and the image distance when the lens module focuses on the object plane, and the object distance and the image distance are determined according to the distance from the object plane to the surface of the th lens of the lens module;
displaying a scale of a set length on the image output via a screen of the electronic device according to the optical magnification and an image sensor size and a screen size of the electronic device.
6. The method of claim 5, wherein the lens module is a zoom lens module, and the determining the optical magnification corresponding to the image comprises:
searching th motor stroke which is the same as the second motor stroke corresponding to the image in a lookup table, wherein the lookup table stores the corresponding relation between at least two groups of th motor strokes and optical magnification;
and determining the optical magnification corresponding to the image according to the searched th motor stroke.
7. The method according to claim 5, wherein the displaying a scale of a set length on the image output via a screen of the electronic device according to the optical magnification and an image sensor size and a screen size of the electronic device comprises:
determining an annotation object in the image;
determining the length to be marked in the marked object as the set length;
displaying a scale of a set length on the image output via a screen of the electronic device according to the optical magnification and an image sensor size and a screen size of the electronic device.
A marking device of size, comprising:
an determining unit, for determining the distance from the corresponding object plane to the th lens surface of the lens module when the lens module is focused;
the second determining unit is used for determining the object distance and the image distance when the lens module focuses on the object plane according to the distance;
and the third determining unit is used for determining a corresponding optical magnification according to the object distance and the image distance so as to display a ruler with a set length on the image output by the screen of the electronic equipment according to the optical magnification, the size of an image sensor of the electronic equipment and the size of the screen when the electronic equipment utilizes the lens module to focus and shoot to obtain the image.
9, kinds of size mark device, its characterized in that is applied to electronic equipment, be provided with the lens module on the electronic equipment, the device includes:
the shooting unit is used for focusing and shooting by utilizing the lens module to obtain an image;
the fourth determining unit is used for determining the optical magnification corresponding to the image, wherein the optical magnification is determined according to the object distance and the image distance when the lens module focuses on the object plane, and the object distance and the image distance are determined according to the distance from the object plane to the th lens surface of the lens module;
a display unit for displaying a scale of a set length on the image output via a screen of the electronic device according to the optical magnification and an image sensor size and a screen size of the electronic device.
An electronic device of the kind 10, , comprising a processor and a memory for storing a computer program capable of running on the processor,
wherein the processor is configured to perform the steps of the method of any one of claims 1 to 4 through or to implement the steps of the method of any one of claims 5 to 7 through when the computer program is run.
Storage medium, , having a computer program stored thereon, wherein the computer program, when being executed by a processor, is adapted to carry out the steps of the method of any of claims 1 to 4 to or to carry out the steps of the method of any of claims 5 to 7 to .
CN201911011875.0A 2019-10-23 2019-10-23 Size marking method and device, electronic equipment and storage medium Pending CN110736432A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911011875.0A CN110736432A (en) 2019-10-23 2019-10-23 Size marking method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911011875.0A CN110736432A (en) 2019-10-23 2019-10-23 Size marking method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN110736432A true CN110736432A (en) 2020-01-31

Family

ID=69270963

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911011875.0A Pending CN110736432A (en) 2019-10-23 2019-10-23 Size marking method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110736432A (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101672620A (en) * 2008-09-08 2010-03-17 鸿富锦精密工业(深圳)有限公司 Electronic device and method for measuring size of object
CN103591894A (en) * 2013-11-05 2014-02-19 广东欧珀移动通信有限公司 Method and device for measuring length of object through camera
CN105136042A (en) * 2015-08-20 2015-12-09 广东欧珀移动通信有限公司 Height measuring method and apparatus, and mobile terminal
CN105571495A (en) * 2015-12-30 2016-05-11 青岛海信移动通信技术股份有限公司 Measuring method and device
CN107753028A (en) * 2017-09-19 2018-03-06 努比亚技术有限公司 Take pictures and survey method, mobile terminal and the computer-readable recording medium of height
CN108050943A (en) * 2014-12-23 2018-05-18 广东欧珀移动通信有限公司 A kind of length measurement method and terminal
CN108931191A (en) * 2018-06-01 2018-12-04 普联技术有限公司 Distance measuring method, dimension measurement method and terminal
CN110006343A (en) * 2019-04-15 2019-07-12 Oppo广东移动通信有限公司 Measurement method, device and the terminal of object geometric parameter

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101672620A (en) * 2008-09-08 2010-03-17 鸿富锦精密工业(深圳)有限公司 Electronic device and method for measuring size of object
CN103591894A (en) * 2013-11-05 2014-02-19 广东欧珀移动通信有限公司 Method and device for measuring length of object through camera
CN108050943A (en) * 2014-12-23 2018-05-18 广东欧珀移动通信有限公司 A kind of length measurement method and terminal
CN105136042A (en) * 2015-08-20 2015-12-09 广东欧珀移动通信有限公司 Height measuring method and apparatus, and mobile terminal
CN105571495A (en) * 2015-12-30 2016-05-11 青岛海信移动通信技术股份有限公司 Measuring method and device
CN107753028A (en) * 2017-09-19 2018-03-06 努比亚技术有限公司 Take pictures and survey method, mobile terminal and the computer-readable recording medium of height
CN108931191A (en) * 2018-06-01 2018-12-04 普联技术有限公司 Distance measuring method, dimension measurement method and terminal
CN110006343A (en) * 2019-04-15 2019-07-12 Oppo广东移动通信有限公司 Measurement method, device and the terminal of object geometric parameter

Similar Documents

Publication Publication Date Title
CN108076286B (en) Image blurring method and device, mobile terminal and storage medium
Mir et al. An extensive empirical evaluation of focus measures for digital photography
JP6411505B2 (en) Method and apparatus for generating an omnifocal image
TW202011254A (en) Auxiliary method for capturing damage assessment image of vehicle, device, and apparatus
US20130083990A1 (en) Using Videogrammetry to Fabricate Parts
CN105227838A (en) A kind of image processing method and mobile terminal
CN110611767B (en) Image processing method and device and electronic equipment
CN110602409B (en) Photographing method and device, electronic equipment and storage medium
CN109740487B (en) Point cloud labeling method and device, computer equipment and storage medium
CN108513057B (en) Image processing method and device
CN103826064A (en) Image processing method, device and handheld electronic equipment
CN111279393A (en) Camera calibration method, device, equipment and storage medium
CN114390201A (en) Focusing method and device thereof
CN112653835B (en) Method and device for judging focusing state and storage medium
CN110736432A (en) Size marking method and device, electronic equipment and storage medium
CN113067985A (en) Shooting method, shooting device, electronic equipment and storage medium
CN111160238A (en) Microscopic image quality analysis method, training method, system, device and medium
US9667846B2 (en) Plenoptic camera apparatus, a method and a computer program
CN110736431A (en) Size marking method and device, electronic equipment and storage medium
Cao et al. Method based on bioinspired sample improves autofocusing performances
JP6623419B2 (en) Display control device, imaging device, smartphone, display control method, and program
CN113973200A (en) Zoom magnification calibration method and device, electronic equipment and storage medium
Lv et al. Fast template matching based on grey prediction for real-time object tracking
Li et al. Extraction of thin occlusions from digital images
Solh Real-time focal stack compositing for handheld mobile cameras

Legal Events

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