WO2023005123A1 - 光心确定方法、装置、电子设备及介质 - Google Patents

光心确定方法、装置、电子设备及介质 Download PDF

Info

Publication number
WO2023005123A1
WO2023005123A1 PCT/CN2021/140671 CN2021140671W WO2023005123A1 WO 2023005123 A1 WO2023005123 A1 WO 2023005123A1 CN 2021140671 W CN2021140671 W CN 2021140671W WO 2023005123 A1 WO2023005123 A1 WO 2023005123A1
Authority
WO
WIPO (PCT)
Prior art keywords
optical center
value
point
determining
gray
Prior art date
Application number
PCT/CN2021/140671
Other languages
English (en)
French (fr)
Inventor
王国振
Original Assignee
浙江宇视科技有限公司
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 浙江宇视科技有限公司 filed Critical 浙江宇视科技有限公司
Priority to EP21951695.2A priority Critical patent/EP4261781A1/en
Priority to US18/551,324 priority patent/US20240169591A1/en
Publication of WO2023005123A1 publication Critical patent/WO2023005123A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/80Analysis of captured images to determine intrinsic or extrinsic camera parameters, i.e. camera calibration
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N17/00Diagnosis, testing or measuring for television systems or their details
    • H04N17/002Diagnosis, testing or measuring for television systems or their details for television cameras

Definitions

  • the present application relates to the technical field of computer vision, for example, to a method, device, electronic equipment and medium for determining an optical center.
  • the optical center of the camera lens When the camera is imaging, the intersection of the optical axis of the camera lens and the photosensitive plane of the sensor (Sensor) is the optical center of the camera lens.
  • the optical center of the lens is located at the center of the image frame. If there is a large shift in the position of the optical center of the camera lens, it will directly affect the imaging quality of the camera. Therefore, accurately calculating the position of the optical center of the camera is a prerequisite for adjusting the optical center to the center of the image.
  • the present application provides a method, device, electronic equipment and medium for determining the optical center, which can quickly determine the position of the optical center of the camera module with a small amount of calculation.
  • a method for determining an optical center including:
  • the position information of the optical center is determined according to the auxiliary point whose gray value is consistent with the gray value of the reference point and the at least two reference points.
  • optical center determination device comprising:
  • the reference line obtaining module is configured to connect the edge points with the largest distance in the target image to obtain at least one reference line;
  • a reference point determination module configured to determine at least two reference points whose gray value on at least one reference line is in a preset ratio to the gray peak, wherein the gray peak is the gray value of a pixel point on the at least one reference line the maximum value in
  • the optical center position information determining module is configured to determine the position information of the optical center according to the auxiliary point whose gray value is consistent with the gray value of the reference point and the at least two reference points.
  • An electronic device including a memory, a processor, and a computer program stored on the memory and operable by the processor.
  • the processor executes the computer program, the determination of the optical center as described in the embodiment of the present application is realized. method.
  • a computer-readable storage medium is also provided, storing a computer program, and implementing the method for determining the optical center as described in the embodiment of the present application when the computer program is executed by a processor.
  • Fig. 1 is a flowchart of an optical center determination method provided by an embodiment of the present application
  • Fig. 2 is a schematic diagram of reference line determination provided by an embodiment of the present application.
  • Fig. 3 is a schematic diagram of reference point determination provided by an embodiment of the present application.
  • FIG. 4 is a flowchart of a method for determining an optical center provided in another embodiment of the present application.
  • Fig. 5 is a schematic diagram of auxiliary point determination provided by another embodiment of the present application.
  • Fig. 6 is a schematic diagram of midpoint determination provided by another embodiment of the present application.
  • Fig. 7 is a schematic diagram of auxiliary line determination provided by another embodiment of the present application.
  • Fig. 8 is a schematic diagram of determining a reference line provided by another embodiment of the present application.
  • Fig. 9 is a schematic diagram of reference point determination provided by another embodiment of the present application.
  • Fig. 10 is a schematic diagram of auxiliary point determination provided by another embodiment of the present application.
  • Fig. 11 is a schematic diagram of midpoint determination provided by another embodiment of the present application.
  • Fig. 12 is a schematic diagram of auxiliary line determination provided by another embodiment of the present application.
  • Fig. 13 is a structural block diagram of an optical center determination device provided by an embodiment of the present application.
  • Fig. 14 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • FIG. 1 is a flowchart of a method for determining an optical center provided by an embodiment of the present application, and this embodiment is applicable to a scene of determining the position of an optical center of a camera module.
  • the method can be executed by the device for determining the optical center provided in the embodiment of the present application, the device can be implemented by software and/or hardware, and can be integrated into electronic equipment.
  • the optical center determination method provided in the embodiment of the present application may include the following steps.
  • the target image can be a grayscale image obtained by taking an image of a uniform white light panel through the lens module and then converting it.
  • the image shape can be rectangle, circle or ellipse etc.
  • the edge points with the largest distance in the target image are connected.
  • the edge points with the largest distance in the target image are two diagonal points, and at least one pair of diagonal
  • the diagonal line obtained by connecting the points is the reference line;
  • the target image is a circle
  • the edge point with the largest distance in the target image is the two endpoints of the diameter passing through the center of the circle, and the line where at least one diameter in the circle is located is the reference line .
  • Fig. 2 is a schematic diagram of determining a reference line provided by an embodiment of the present application, in which a reference line is taken as an example.
  • the image shown in Figure 2 is the target image, and the target image is a rectangle.
  • the target image has a reference line, which is a diagonal of the rectangle.
  • the grayscale peak value is the maximum value among the grayscale values of the pixels on the at least one reference line.
  • the grayscale peak value on the reference line is the largest value among grayscale values corresponding to multiple pixel points on the reference line.
  • the gray value ranges from 0 to 255, corresponding to the color in the gray image from black to white, and the position of the optical center should be the whitest, so the gray corresponding to the pixel on the reference line is closer to the optical center.
  • the larger the intensity value the smaller the gray value of the pixel point on the reference line that is farther away from the optical center position.
  • the preset ratio may be set according to experience, or may be calculated according to the distribution of gray values on the actual reference line.
  • the at least two reference points are on a gray contour line.
  • FIG. 3 is a schematic diagram of reference point determination provided by an embodiment of the present application.
  • the curve in FIG. 3 is the distribution of gray values corresponding to the pixels on the reference line in FIG. 2, and the abscissa represents the Nth pixel on the reference line, and the ordinate represents the gray value corresponding to the Nth pixel on the reference line.
  • a 1 and B 1 are the reference points where the gray value on the reference line in Figure 2 is in preset proportion to the gray peak of the reference line, and the gray values of A 1 and B 1 are on the same contour line in the curve.
  • the process of determining the preset ratio includes the following steps.
  • a ratio of the second difference to the gray peak value is used as a preset ratio.
  • the target endpoint on the reference line refers to the point with the largest gray value corresponding to the pixel points at the first and last two endpoints of the reference line.
  • the preset ratio can be expressed by the following formula:
  • Preset ratio (S max (x,y)-(S max (x,y)-MAX(S(1,1),S(x,y)))/N)/S max (x,y)
  • S(1,1) is the gray value of the pixel at one end of the reference line
  • S(x,y) is the gray value of the pixel at the other end of the reference line
  • S max (x,y ) is the gray peak value on the reference line
  • 1/N is the preset coefficient
  • the value obtained by S max (x,y)-MAX(S(1,1),S(x,y)) is the first difference; (S max (x,y)-MAX(S( 1,1),S(x,y)))/N is the product value; S max (x,y)-(S max (x,y)-MAX(S(1,1),S(x ,y)))/N is the second difference.
  • the target gray value is obtained according to the gray peak value and the preset ratio, and at least two reference points identical to the target gray value are determined from the reference line.
  • N is a number greater than 1, such as 2, 3, 5/4, etc.
  • the value of N can determine the position of the reference point in the target image. If the value of N is too large, the reference point is close to On the edge of the image, if the value of N is too small, the distance between the reference points is relatively close, and neither the distance between the reference points nor the reference point close to the edge of the image is the best position to determine the optical center. Therefore, according to the gray distribution on the reference line, The value of N is adaptively determined so that the reference point is located at a proper position of the target image, for example, as shown in FIG. 2 , the value of N of the reference point is selected as 2.
  • determining at least two reference points whose gray value on at least one reference line is in a preset ratio to the gray peak value includes:
  • At least two points on the reference line whose grayscale value is consistent with the target grayscale value are used as the at least two reference points.
  • the product of the peak value of the gray scale and the preset ratio can be directly used as the target gray value, or the product of the peak value of the gray scale and the preset ratio, and the product of the preset adjustment coefficient can be used as the target gray value
  • the adjustment coefficient can be determined according to the actual situation.
  • the present application determines at least two reference points according to the peak value of the gray scale and the preset ratio, so as to adaptively determine the points that are located at the appropriate position of the image and have the same gray value and belong to the same gray scale contour line, that is, determine the light The point on the concentric circle at the edge of the spot where the center is located, and then quickly and accurately determine the position of the optical center with as few pixels as possible.
  • the midpoint between the auxiliary point and the reference point can be determined on the connection line between the auxiliary point and the reference point, and the disjoint midpoints of the connecting lines can be connected, and the position of the obtained intersection point is the position of the optical center. If there are more than two intersection points, the position information of the optical center can be determined through a solution such as finding an intermediate point between the intersection points.
  • the optical center position of the camera module is determined by the following methods: connecting the edge points with the largest distance in the target image to obtain at least one reference line; Two reference points; according to the auxiliary point whose gray value is consistent with the reference point gray value, and the reference point, the position information of the optical center is determined.
  • the optical center calculation scheme provided by this embodiment does not need to calculate all the pixels, but only needs to calculate less data to determine the optical center position, thereby effectively reducing the data processing burden.
  • this scheme can determine the position of the optical center more quickly, and since the reference point determined in this scheme is a point on the same gray contour line, the spot with the optical center is a concentric circle, according to the concentric A reference point on the circle enables more precise determination of the optical center position.
  • Fig. 4 is a flowchart of a method for determining an optical center provided by another embodiment of the present application, and this embodiment is described on the basis of the above-mentioned embodiments.
  • determining the position information of the optical center includes: in the same horizontal direction as the reference point, and in the same horizontal direction as the reference point In the same vertical direction, determine a point consistent with the gray value of the reference point as an auxiliary point; determine the midpoint of the line between the at least two reference points and the auxiliary point; according to the midpoint, determine The location information of the optical center.
  • the method for determining the optical center may include the following steps.
  • FIG. 5 is a schematic diagram of determining an auxiliary point provided by another embodiment of the present application, and a reference line is used as an example in this figure.
  • A11 is the auxiliary point of the reference point A1 in the same horizontal direction
  • A12 is the auxiliary point of the reference point A1 in the same vertical direction
  • the gray levels of A11 , A12 and A1 The values are consistent
  • B 11 is the auxiliary point of the reference point B 1 in the same horizontal direction
  • B 12 is the auxiliary point of the reference point B 1 in the same vertical direction
  • the gray values of B 11 and B 12 are consistent with B 1 .
  • the position of the midpoint of the line between the reference point and the auxiliary point of the reference point can be determined by establishing a coordinate system.
  • a coordinate system For example, take the reference point A 1 and the auxiliary points A 11 and A 12 of the reference point A 1 in FIG. 5 as an example.
  • the coordinates of A 1 are (x A1 , y A1 ), and the coordinates of A 11 and A 12 are (x A11 , y A11 ), (x A12 , y A12 ), respectively.
  • Fig. 6 is a schematic diagram of midpoint determination provided by another embodiment of the present application.
  • A' 11 in Fig. 6 is the midpoint of the line connecting reference point A 1 and auxiliary point A 11 of reference point A 1 in Fig.
  • A' 12 is the midpoint of the line connecting the reference point A1 and the auxiliary point A12 of the reference point A1 in Figure 5
  • B'11 is the midpoint of the line connecting the reference point B1 and the auxiliary point B11 of the reference point B1 in Figure 5
  • B'12 is the midpoint of the line connecting the reference point B1 and the auxiliary point B12 of the reference point B1 in FIG . 5 .
  • determining the position information of the optical center according to the midpoint includes:
  • the position information of the optical center is determined according to the intersection point of the at least two auxiliary lines.
  • the disjoint connection lines are disjoint connection lines among all the connection lines between the reference point and the auxiliary point of the reference point.
  • FIG. 7 is a schematic diagram of determining an auxiliary line provided by another embodiment of the present application, and a reference line is used as an example in this figure.
  • A' 11 , A' 12 , B' 11 , and B' 12 in the figure are the midpoints of the line between the reference point and the auxiliary point.
  • the position information of the optical center is determined, including:
  • the position information of the optical center is determined according to the perpendicular line of the line connecting the reference point and the auxiliary point.
  • the light spot is the shape of the figure fitted by connecting the reference point and the auxiliary point. If the shape of the light spot is circular, the position of the intersection point of the perpendicular line connecting the reference point and the auxiliary point is the position information of the optical center.
  • the position of the optical center of the camera module is determined by the following method: in the same horizontal direction as the reference point, and in the same vertical direction as the reference point, determine a point that is consistent with the gray value of the reference point , as an auxiliary point; determine the midpoint of the line between the reference point and the auxiliary point; determine the position information of the optical center according to the midpoint.
  • the optical center calculation solution provided in this embodiment does not need to calculate all the pixels, but only needs to calculate the corresponding optical center position by calculating less data, thereby effectively reducing the data processing burden. For more and more scenarios, this solution can determine the position of the optical center more quickly.
  • Yet another embodiment of the present application provides a method for determining an optical center.
  • This method takes two reference lines as an example to illustrate the optical center determination method of the present application, which is applicable to the situation where the light spot where the optical center is located is close to the edge of the target image, or the light spot where the optical center is located is located on one side of a reference line.
  • FIG. 8 is a schematic diagram of determining a reference line provided by another embodiment of the present application
  • FIG. 9 is a schematic diagram of determining a reference point provided by another embodiment of the present application. Both FIG. 8 and FIG. 9 use two reference lines as examples.
  • the image shown in FIG. 8 is the target image, and the shape of the target image is a rectangle.
  • a 1 and B 1 are reference points on one of the reference lines, and C 1 and D 1 are reference points on the other reference line.
  • the grayscale values at A 1 and B 1 are in preset proportions to the grayscale peaks on the reference line
  • the grayscale values at C 1 and D 1 are in preset proportions to the grayscale peaks on the reference line.
  • FIG. 10 is a schematic diagram of determining an auxiliary point provided by another embodiment of the present application, in which two reference lines are taken as an example.
  • a 11 is the auxiliary point of the reference point A 1 in the same horizontal direction
  • a 12 is the auxiliary point of the reference point A 1 in the same vertical direction
  • the gray levels of A 11 , A 12 and A 1 B11 is the auxiliary point of the reference point B1 in the same horizontal direction
  • B12 is the auxiliary point of the reference point B1 in the same vertical direction
  • the gray values of B11 , B12 and B1 are consistent
  • C 11 is the auxiliary point of the reference point C 1 in the same horizontal direction
  • C 12 is the auxiliary point of the reference point C 1 in the same vertical direction
  • the gray values of C 11 and C 12 are consistent with C 1
  • D 12 is an auxiliary point in the same vertical direction as the reference point D 1
  • the gray values of D 11 and D 12 are
  • point A 1 coincides with point C 12
  • point D 1 coincides with point B 12
  • point C 1 coincides with point A 12
  • point B 1 coincides with point D 12 .
  • Fig. 11 is a schematic diagram of determining the midpoint provided by another embodiment of the present application
  • Fig. 12 is a schematic diagram of determining the auxiliary line provided by another embodiment of the present application.
  • Fig. 11 and Fig. 12 take two reference lines as examples.
  • A' 11 , A' 12 , B' 11 , B' 12 , C' 11 , C' 12 , D' 11 , D' 12 in the figure are the lines connecting the reference point and the auxiliary point midpoint. It can be seen from the figure that the connecting lines of the two points C' 11 and D' 11 do not intersect, the connecting lines of the two points of B' 11 and A' 11 do not intersect, and so on.
  • Connect the disjoint midpoints of the respective connecting lines to obtain at least two auxiliary lines as shown in Figure 12, the position of point O in Figure 12 is the position of the intersection of at least two auxiliary lines, that is, the position of the optical center.
  • the at least two auxiliary lines are at least four auxiliary lines
  • determine the position information of the optical center including:
  • the position information of the optical center is determined according to an average value of the at least two intersections.
  • the average value of at least two intersection points can be the average value of the position coordinates of at least two intersection points, for example, if there are intersection points A(x 1 , y 1 ), B(x 2 , y 2 ), then the coordinates of A and B
  • the average coordinate of is ((x 1 +x 2 )/2, (y 1 +y 2 )/2), which is the position information of the optical center.
  • the solution in the embodiment of the present application can accurately obtain pixels with a larger gray scale distribution range through at least two reference lines when the spot is located in a relatively biased position in the target image and not located in the central area, so as to be more accurate.
  • the reference point located on the gray contour line can be accurately determined, thereby improving the accuracy of determining the optical center.
  • Fig. 13 is a structural block diagram of an optical center determination device provided by an embodiment of the present application.
  • the device can execute the optical center determination method provided by any embodiment of the present application, and has corresponding functional modules and effects for executing the method. As shown in Figure 13, the device may include the following modules.
  • the reference line obtaining module 310 is configured to connect the edge points with the largest distance in the target image to obtain at least one reference line;
  • the reference point determination module 320 is configured to determine at least two reference points whose gray value and gray peak value on at least one reference line have a preset ratio, wherein the gray peak value is the gray level of a pixel point on the at least one reference line the maximum value;
  • the optical center position information determination module 330 is configured to determine the position information of the optical center according to the auxiliary point whose gray value is consistent with the gray value of the reference point and the at least two reference points.
  • the reference point determination module 320 includes:
  • the target gray value determining unit is configured to determine the target gray value according to the product of the gray peak value and the preset ratio.
  • the reference point determination unit is configured to use at least two points on the reference line whose gray value is consistent with the target gray value as at least two reference points.
  • the device further includes: a preset ratio determination module, configured to determine a preset ratio, and the preset ratio determination module includes:
  • the first difference value determining unit is configured to determine the first difference between the gray value peak value and the gray value of the target endpoint on the reference line, wherein the target endpoint is the endpoint with a larger gray value among the two endpoints of the reference line;
  • the second difference value determination unit is configured to determine the product value of the first difference value and the preset coefficient, and determine the second difference value between the gray scale peak value and the product value, wherein the value of the preset coefficient is The range is (0, 1);
  • the ratio determining unit is configured to use the ratio of the second difference to the gray peak value as a preset ratio.
  • the optical center position information determination module 330 includes:
  • the auxiliary point determining unit is configured to determine a point consistent with the gray value of the reference point in the same horizontal direction as the reference point and in the same vertical direction as the reference point as the auxiliary point.
  • a midpoint determination unit is configured to determine a midpoint of a line between the at least two reference points and the auxiliary point.
  • the optical center position information determining unit is configured to determine the optical center position information according to the midpoint.
  • the optical center position information determination unit is set to:
  • the position information of the optical center is determined according to the intersection point of the at least two auxiliary lines.
  • the at least two auxiliary lines are at least four auxiliary lines
  • the optical center position information determination unit is set to:
  • the position information of the optical center is determined according to an average value of the at least two intersections.
  • the optical center position information determining module 330 is set to:
  • the position information of the optical center is determined according to the perpendicular line of the line connecting the reference point and the auxiliary point.
  • the above-mentioned products can execute the method for determining the optical center provided in the embodiment of the present application, and have corresponding functional modules and effects for executing the method.
  • FIG. 14 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • FIG. 14 shows a block diagram of an exemplary electronic device 412 suitable for implementing embodiments of the present application.
  • the electronic device 412 shown in FIG. 14 is only an example, and should not limit the functions and scope of use of this embodiment of the present application.
  • the electronic device 412 may include: one or more processors 416 ; a memory 428 configured to store one or more programs, when the one or more programs are executed by the one or more processors 416 Execute, so that the one or more processors 416 implement the method for determining the optical center provided in the embodiment of the present application, including:
  • the position information of the optical center is determined according to the auxiliary point whose gray value is consistent with the gray value of the reference point and the at least two reference points.
  • the components of the electronic device 412 may include: one or more processors 416, a memory 428, and a bus 418 connecting different device components (including the memory 428 and the processor 416).
  • Bus 418 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus structures.
  • bus structures include, for example, the Industry Subversive Alliance (ISA) bus, the Micro Channel Architecture (MCA) bus, the processing ISA bus, the Video Electronics Standards Association (VESA) ) Local bus and Peripheral Component Interconnect (PCI) bus.
  • ISA Industry Subversive Alliance
  • MCA Micro Channel Architecture
  • VESA Video Electronics Standards Association
  • PCI Peripheral Component Interconnect
  • Electronic device 412 includes a variety of computer device-readable storage media. These storage media may be any available storage media that can be accessed by the electronic device 412, including volatile and non-volatile storage media, removable and non-removable storage media.
  • the storage medium may be a non-transitory storage medium.
  • Memory 428 may include computer device-readable storage media in the form of volatile memory, such as Random Access Memory (RAM) 430 and/or cache 432 .
  • Electronic device 412 may include other removable/non-removable, volatile/nonvolatile computer device storage media.
  • storage system 434 may be used to read and write to non-removable, non-volatile magnetic storage media (not shown in FIG. 14, commonly referred to as "hard drives").
  • a disk drive for reading and writing to a removable non-volatile disk such as a "floppy disk”
  • a disk drive for a removable non-volatile disk such as a Compact Disk ROM (Compact Disk).
  • Memory 428 may include at least one program product having a set (eg, at least one) of program modules configured to perform the functions of various embodiments of the present application.
  • a program/utility tool 440 having a set (at least one) of program modules 442, which may be stored, for example, in memory 428, such program modules 442 including an operating device, one or more application programs, other program modules, and program data, examples of which are Each or some combination of these may include implementations of network environments.
  • the program module 442 generally executes the functions and/or methods in the embodiments described in this application.
  • the electronic device 412 may also communicate with one or more external devices 414 and/or the display 424, etc., and may also communicate with one or more devices that allow the user to interact with the electronic device 412, and/or communicate with the electronic device 412 Any device (eg, network card, modem, etc.) capable of communicating with one or more other computing devices communicates. Such communication may be performed through an Input/Output (I/O) interface 422 .
  • the electronic device 412 can also communicate with one or more networks (such as a local area network (Local Area Network, LAN), a wide area network (Wide Area Network, WAN) and/or a public network, such as the Internet) through the network adapter 420. As shown in FIG.
  • network adapter 420 communicates with other modules of electronic device 412 via bus 418 .
  • other hardware and/or software modules may be used in conjunction with electronic device 412, including: microcode, device drivers, redundant processing units, external disk drive arrays, disk arrays (Redundant Arrays of Independent Drives, RAID ) devices, tape drives, and data backup storage devices.
  • the processor 416 executes at least one of the other programs stored in the memory 428 to perform various functional applications and data processing, for example, to implement a method for determining the optical center provided in the embodiment of the present application.
  • Embodiment 5 of the present application provides a storage medium containing computer-executable instructions, the computer-executable instructions are used to execute the optical center determination method when executed by a computer processor, including:
  • the position information of the optical center is determined according to the auxiliary point whose gray value is consistent with the gray value of the reference point and the at least two reference points.
  • the computer storage medium in the embodiments of the present application may use any combination of one or more computer-readable storage media.
  • the computer readable storage medium may be a computer readable signal storage medium or a computer readable storage medium.
  • the computer-readable storage medium may be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor device, apparatus, or device, or any combination thereof.
  • the storage medium may be a non-transitory storage medium.
  • Computer-readable storage media include: electrical connections with one or more wires, portable computer disks, hard disks, RAM, Read-Only Memory (ROM), Erasable Programmable Read-Only Memory (Erasable Programmable Read-Only Memory) Only Memory, EPROM), flash memory, optical fiber, portable CD-ROM, optical storage device, magnetic storage device, or any suitable combination of the above.
  • a computer-readable storage medium may be any tangible storage medium containing or storing a program, and the program may be used by or in combination with an instruction execution device, device, or device.
  • a computer readable signal storage medium may include a data signal carrying computer readable program code in baseband or as part of a carrier wave traveling as a data signal. Such propagated data signals may take many forms, including electromagnetic signals, optical signals, or any suitable combination of the foregoing.
  • the computer-readable signal storage medium may also be any computer-readable storage medium other than a computer-readable storage medium that can be sent, propagated, or transmitted for use by or in conjunction with an instruction execution device, apparatus, or device the program used.
  • the program code contained on the computer-readable storage medium may be transmitted by any suitable storage medium, including wireless, electric wire, optical cable, radio frequency (Radio Frequency, RF), etc., or any suitable combination of the above.
  • Computer program code for performing the operations of the present application may be written in one or more programming languages or combinations thereof, including object-oriented programming languages—such as Java, Smalltalk, C++, and conventional Procedural Programming Language - such as "C" or a similar programming language.
  • the program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or device.
  • the remote computer can be connected to the user computer through any kind of network, including a LAN or WAN, or it can be connected to an external computer (eg via the Internet using an Internet Service Provider).

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • General Health & Medical Sciences (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Length Measuring Devices By Optical Means (AREA)
  • Image Analysis (AREA)

Abstract

本申请提供了一种光心确定方法、装置、电子设备及介质。该光心确定方法包括:将目标图像中距离最大的边缘点连接,得到至少一条参考线;确定至少一条参考线上灰度值与灰度峰值呈预设比例的至少两个参考点;根据灰度值与参考点的灰度值一致的辅助点,以及所述至少两个参考点,确定光心的位置信息。

Description

光心确定方法、装置、电子设备及介质
本申请要求在2021年07月30日提交中国专利局、申请号为202110875409.8的中国专利申请的优先权,该申请的全部内容通过引用结合在本申请中。
技术领域
本申请涉及计算机视觉技术领域,例如涉及一种光心确定方法、装置、电子设备及介质。
背景技术
摄像机成像时,摄像机镜头的光轴与传感器(Sensor)的感光平面的交点,该点即为摄像机镜头光心。在常规摄像机使用过程中,镜头光心位于图像画面中心。如果摄像机镜头光心的位置存在较大偏移,则会直接影响摄像机的成像质量。因此,准确地求解摄像机光心位置是调整光心位于图像中心的前提。
相关技术先利用摄像头拍摄均匀白光灯板得到光强分布图,再将光强分布图转化成灰度图,并将灰度图上的灰度值进行二值化处理(大于一定百分比的数据赋1,小于该百分比的数据赋0),再通过质心计算获得光心坐标。但是该方案需对整幅画面的像素点灰度值进行计算,数据处理量较大,随着实际场景中画面像素点的增加,该方案会加大数据处理负担。
发明内容
本申请提供一种光心确定方法、装置、电子设备及介质,可以实现以较小的计算量快速地确定摄像模组光心的位置。
提供了一种光心确定方法,包括:
将目标图像中距离最大的边缘点连接,得到至少一条参考线;
确定至少一条参考线上灰度值与灰度峰值呈预设比例的至少两个参考点,其中,灰度峰值为所述至少一条参考线上像素点的灰度值中的最大值;
根据灰度值与参考点的灰度值一致的辅助点,以及所述至少两个参考点,确定光心的位置信息。
还提供了一种光心确定装置,包括:
参考线获得模块,设置为将目标图像中距离最大的边缘点连接,得到至少一条参考线;
参考点确定模块,设置为确定至少一条参考线上灰度值与灰度峰值呈预设比例的至少两个参考点,其中,灰度峰值为所述至少一条参考线上像素点的灰度值中的最大值;
光心位置信息确定模块,设置为根据灰度值与参考点的灰度值一致的辅助点,以及所述至少两个参考点,确定光心的位置信息。
还提供了一种电子设备,包括存储器,处理器及存储在存储器上并可在处理器运行的计算机程序,所述处理器执行所述计算机程序时实现如本申请实施例所述的光心确定方法。
还提供了一种计算机可读存储介质,存储有计算机程序,该计算机程序被处理器执行时实现如本申请实施例所述的光心确定方法。
附图说明
图1是本申请一种实施例提供的光心确定方法的流程图;
图2是本申请一种实施例提供的参考线确定示意图;
图3是本申请一种实施例提供的参考点确定示意图;
图4是本申请另一种实施例提供的光心确定方法的流程图;
图5是本申请另一种实施例提供的辅助点确定示意图;
图6是本申请另一种实施例提供的中点确定示意图;
图7是本申请另一种实施例提供的辅助线确定示意图;
图8是本申请又一种实施例提供的参考线确定示意图;
图9是本申请又一种实施例提供的参考点确定示意图;
图10是本申请又一种实施例提供的辅助点确定示意图;
图11是本申请又一种实施例提供的中点确定示意图;
图12是本申请又一种实施例提供的辅助线确定示意图;
图13是本申请一种实施例提供的光心确定装置的结构框图;
图14是本申请一种实施例提供的电子设备的结构示意图。
具体实施方式
下面结合附图和实施例对本申请在实施例中进行说明。此处所描述的实施例仅仅用于解释本申请,而非对本申请的限定。为了便于描述,附图中仅示出了与本申请相关的部分而非全部结构。
图1是本申请一种实施例提供的光心确定方法的流程图,本实施例可适用于确定摄像模组的光心位置的场景中。该方法可以由本申请实施例所提供的光心确定装置执行,该装置可以由软件和/或硬件的方式来实现,并可集成于电子设备中。
如图1所示,本申请实施例中提供的光心确定方法可包括以下步骤。
S110、将目标图像中距离最大的边缘点连接,得到至少一条参考线。
目标图像可以为通过镜头模组拍摄均匀白光灯板得到的图像再经过转换得到的灰度图像。图像形状可以为矩形、圆形或椭圆形等。
在本申请实施例中,将目标图像中距离最大的边缘点连接,示例性的,若目标图像是矩形,则目标图像中距离最大的边缘点为对角的两点,将至少一对对角点进行连接得到的对角线为参考线;若目标图像为圆形,则目标图像中距离最大的边缘点为经过圆心的直径的两个端点,圆中的至少一条直径所在的线为参考线。
图2是本申请一种实施例提供的参考线确定示意图,图中以一条参考线作为示例。图2中所示图像为目标图像,目标图像为一个矩形。该目标图像有一条参考线,即该矩形的一条对角线。
S120、确定至少一条参考线上灰度值与灰度峰值呈预设比例的至少两个参考点。其中,灰度峰值为所述至少一条参考线上像素点的灰度值中的最大值。
在本申请实施例中,参考线上的灰度峰值为参考线上的多个像素点对应的灰度值中最大的值。通常灰度值的范围为0~255,对应灰度图像中的颜色为从黑到白,而光心所在位置应为最白,所以参考线上离光心位置越近的像素点对应的灰度值越大,参考线上离光心位置越远的像素点的灰度值越小。
本申请实施例中,预设比例可以是根据经验设置的,也可以是根据实际的参考线上灰度值的分布计算出来的。
由于至少两个参考点的灰度值相同,均与灰度峰值呈预设比例,因此至少两个参考点在一个灰度等高线上。
示例性的,图3是本申请一种实施例提供的参考点确定示意图,如图3所示,图3中的曲线为图2中参考线上的像素点对应的灰度值分布,横坐标代表 该参考线上第N个像素点,纵坐标代表该参考线上第N个像素点对应的灰度值。A 1和B 1为图2中参考线上灰度值与该参考线的灰度峰值成预设比例的参考点,A 1和B 1的灰度值在曲线中处于同一等高线上。
预设比例设置的越小,说明参考线上至少两个参考点的灰度值与灰度峰值的差距越大,至少两个参考点与灰度峰值所在点的距离越远;反之,预设比例设置的越大,说明参考线上至少两个参考点的灰度值与灰度峰值的差距越小,至少两个参考点与灰度峰值所在点的距离越近。
本申请实施例中,所述预设比例的确定过程包括以下步骤。
确定灰度峰值与参考线上目标端点的灰度值的第一差值,其中,目标端点为参考线的两个端点中灰度值较大的端点;
确定所述第一差值与预设系数的乘积值,并确定灰度峰值与所述乘积值的第二差值,其中,所述预设系数的取值范围为(0,1);
将所述第二差值与所述灰度峰值的比值,作为预设比例。
其中,参考线上的目标端点是指参考线首尾两个端点处的像素点对应的灰度值最大的点。
示例性的,所述预设别比例可以通过以下公式进行表达:
预设比例=(S max(x,y)-(S max(x,y)-MAX(S(1,1),S(x,y)))/N)/S max(x,y)
其中,S(1,1)为参考线其中一端端点处的像素点的灰度值,S(x,y)为参考线另一端端点处的像素点的灰度值,S max(x,y)为该参考线上的灰度峰值,1/N为预设系数。
若S(1,1)>S(x,y),则S(1,1)对应的端点为目标端点;若S(1,1)<S(x,y),则S(x,y)对应的端点为目标端点;若S(1,1)=S(x,y),则S(1,1)或S(x,y)对应的端点均可做为目标端点。
上述公式中,S max(x,y)-MAX(S(1,1),S(x,y))得到的值为第一差值;(S max(x,y)-MAX(S(1,1),S(x,y)))/N所得值为乘积值;S max(x,y)-(S max(x,y)-MAX(S(1,1),S(x,y)))/N所得值为第二差值。在本申请实施例中,根据灰度峰值与预设比例得到目标灰度值,从参考线中确定至少两个与目标灰度值相同的参考点。
在本申请实施例中,N为大于1的数,例如2、3、5/4等,N的取值可以决 定参考点位于目标图像中的位置,若N取值过大,则参考点靠近图像边缘,若N取值过小,则参考点相距较近,参考点相距较近和参考点靠近图像边缘都不是确定光心的最佳位置,因此,可以根据参考线上的灰度分布,适应性地确定N的值,以使参考点位于目标图像的合适位置,例如,如图2所示的参考点,参考点的N值选取为2。
本申请实施例中,确定至少一条参考线上灰度值与灰度峰值呈预设比例的至少两个参考点,包括:
根据灰度峰值与所述预设比例的乘积,确定目标灰度值;
将参考线上灰度值与目标灰度值一致的至少两个点,作为所述至少两个参考点。
本申请实施例中,可以直接将灰度峰值与预设比例的乘积作为目标灰度值,也可以将灰度峰值与预设比例的乘积、与预设的调节系数的乘积,作为目标灰度值,调节系数可以根据实际情况确定。
本申请根据灰度峰值和预设比例,确定至少两个参考点,从而适应性地确定位于图像的合适位置、并且灰度值相同属于同一个灰度等高线上的点,也就是确定光心所在的光斑边缘同心圆上的点,进而通过尽可能少的像素点,快速准确地确定光心位置。
S130、根据灰度值与参考点的灰度值一致的辅助点,以及所述至少两个参考点,确定光心的位置信息。
示例性的,可以在辅助点和参考点的连线上确定辅助点和参考点之间的中点,并将所在连线不相交的中点进行连接,得到的交点位置即为光心位置。若交点为两个以上,则可通过求交点之间的中间点等方案确定光心位置信息。
本实施例通过以下方法确定了摄像模组的光心位置:将目标图像中距离最大的边缘点连接,得到至少一条参考线;确定参考线上灰度值与灰度峰值呈预设比例的至少两个参考点;根据灰度值与参考点灰度值一致的辅助点,以及所述参考点,确定光心的位置信息。本实施例提供的光心计算方案,不需要对全部的像素点进行计算,只需要通过计算较少的数据则可以确定光心位置,从而有效的降低了数据处理负担,对于当前画面像素点越来越多的场景,此方案能够更快速确定光心位置,并且,由于本方案中确定的参考点为同一灰度等高线上的点,因此与光心所在的光斑为同心圆,根据同心圆上的参考点能够更加精确地确定光心位置。
图4是本申请另一种实施例提供的光心确定方法的流程图,本实施例以上 述实施例为基础进行说明。其中,根据灰度值与参考点的灰度值一致的辅助点,以及所述参考点,确定光心的位置信息,包括:在与所述参考点同一水平方向上,以及与所述参考点同一竖直方向上,确定与参考点的灰度值一致的点,作为辅助点;确定所述至少两个参考点与所述辅助点之间连线的中点;根据所述中点,确定光心的位置信息。
如图4所示,本申请实施例中提供的光心确定方法可包括以下步骤。
S210、将目标图像中距离最大的边缘点连接,得到至少一条参考线。
S220、确定参考线上灰度值与灰度峰值呈预设比例的至少两个参考点。
S230、在与所述参考点同一水平方向上,以及与所述参考点同一竖直方向上,确定与参考点的灰度值一致的点,作为辅助点。
示例性的,图5是本申请另一种实施例提供的辅助点确定示意图,该图以一条参考线作为示例。如图5所示,A 11为参考点A 1在同一水平方向上的辅助点,A 12为参考点A 1在同一竖直方向上的辅助点,A 11、A 12与A 1的灰度值一致;B 11为参考点B 1在同一水平方向上的辅助点,B 12为参考点B 1在同一竖直方向上的辅助点,B 11、B 12与B 1的灰度值一致。
S240、确定所述至少两个参考点与所述辅助点之间连线的中点。
在本申请实施例中,可通过建立坐标系确定参考点与参考点的辅助点之间连线中点的位置。示例性的,以图5中参考点A 1和参考点A 1的辅助点A 11、A 12为例。如图5所示,A 1的坐标为(x A1,y A1),A 11与A 12的坐标分别为(x A11,y A11)、(x A12,y A12)。则A 1与A 11之间连线的中点的坐标为(x A1+(x A11-x A1)/2,y A1),A 1与A 12之间连线的中点的坐标为(x A1,y A12+(y A1-y A12)/2)。图6是本申请另一种实施例提供的中点确定示意图,图6中A’ 11为图5中参考点A 1与参考点A 1的辅助点A 11连线的中点,A’ 12为图5中参考点A 1与参考点A 1的辅助点A 12连线的中点、B’ 11为图5中参考点B 1与参考点B 1的辅助点B 11连线的中点、B’ 12为图5中参考点B 1与参考点B 1的辅助点B 12连线的中点。
S250、根据所述中点,确定光心的位置信息。
本申请实施例中,根据所述中点,确定光心的位置信息,包括:
将不相交的连线确定的中点相连接,得到至少两条辅助线;
根据至少两条辅助线的交点,确定光心的位置信息。
其中,不相交的连线为所有参考点与参考点的辅助点之间的连线中不相交的连线。示例性的,图7是本申请另一种实施例提供的辅助线确定示意图,该图以一条参考线作为示例。如图7所示,图中A’ 11、A’ 12、B’ 11、B’ 12为参考点与 辅助点之间连线的中点。从图中可以看出,A’ 12与B’ 12两点各自所在的连线不相交,B’ 11与A’ 11两点各自所在的连线不相交,所以将B’ 11与A’ 11进行连接,A’ 12与B’ 12进行连接,得到两条辅助线,则该两条辅助线的交点的位置为光心的位置。
本申请实施例中,根据灰度值与参考点灰度值一致的辅助点,以及所述参考点,确定光心的位置信息,包括:
若所述光心所在的光斑为圆形,则根据所述参考点与所述辅助点之间连线的中垂线,确定光心的位置信息。
其中,光斑为将参考点和辅助点连接起来所拟合的图形形状。若光斑形状为圆形,则参考点与辅助点之间连线的中垂线的交点所在位置为光心的位置信息。
本实施例通过以下方法确定了摄像模组光心的位置:在与所述参考点同一水平方向上,以及与所述参考点同一竖直方向上,确定与参考点的灰度值一致的点,作为辅助点;确定所述参考点与所述辅助点之间连线的中点;根据所述中点,确定光心的位置信息。本实施例提供的光心计算方案,不需要对全部的像素点进行计算,只需通过计算较少的数据获得对应的光心位置,从而有效的降低了数据处理负担,对于当前画面像素点越来越多的场景,本方案能够更快速确定光心位置。
本申请又一种实施例提供了一种光心确定方法。本方法以两条参考线为例说明了本申请的光心确定方法,适用于光心所在的光斑靠近目标图像的边缘,或者光心所在的光斑位于一条参考线的一侧的情况。图8是本申请又一种实施例提供的参考线确定示意图,图9是本申请又一种实施例提供的参考点确定示意图,图8和图9均以两条参考线作为示例。
图8所示图像为目标图像,目标图像形状为矩形。目标图像中参考线为两条,即矩形的两条对角线,S1为其中一条参考线上像素点对应的灰度值集合,S2为另一条参考线上像素点对应的灰度值集合。图9中A 1、B 1为其中一条参考线上的参考点,C 1、D 1为另一条参考线上的参考点。其中,A 1、B 1处的灰度值与所在参考线上的灰度峰值成预设比例,C 1、D 1处的灰度值与所在参考线上的灰度峰值成预设比例。
图10是本申请又一种实施例提供的辅助点确定示意图,该图以两条参考线作为示例。如图10所示,A 11为参考点A 1在同一水平方向上的辅助点,A 12为参考点A 1在同一竖直方向上的辅助点,A 11、A 12与A 1的灰度值一致;B 11为参 考点B 1在同一水平方向上的辅助点,B 12为参考点B 1在同一竖直方向上的辅助点,B 11、B 12与B 1的灰度值一致;C 11为参考点C 1在同一水平方向上的辅助点,C 12为参考点C 1在同一竖直方向上的辅助点,C 11、C 12与C 1的灰度值一致;D 11为参考点D 1在同一水平方向上的辅助点,D 12为参考点D 1在同一竖直方向上的辅助点,D 11、D 12与D 1的灰度值一致。
图10中,点A 1与点C 12重合,点D 1与点B 12重合,点C 1与点A 12重合,点B 1与点D 12重合。
图11是本申请又一种实施例提供的中点确定示意图,图12是本申请又一种实施例提供的辅助线确定示意图,图11、图12以两条参考线作为示例。如图11所示,图中A’ 11、A’ 12、B’ 11、B’ 12、C’ 11、C’ 12、D’ 11、D’ 12为参考点与辅助点之间连线的中点。从图中可以看出,C’ 11与D’ 11两点各自所在的连线不相交,B’ 11与A’ 11两点各自所在的连线不相交,以此类推。将各自所在连线不相交的中点进行连接得到至少两条辅助线,如图12所示,图12中O点的位置为至少两条辅助线的交点的位置,即光心的位置。
本申请实施例中,所述至少两条辅助线为至少四条辅助线;
根据至少两条辅助线的交点,确定光心的位置信息,包括:
若至少四条辅助线的交点为至少两个交点,则根据至少两个交点的平均值,确定光心的位置信息。
其中,至少两个交点的平均值可以是至少两个交点的位置坐标的平均值,例如,若有交点A(x 1,y 1),B(x 2,y 2),则A、B坐标的平均值坐标为((x 1+x 2)/2,(y 1+y 2)/2),该坐标即为光心的位置信息。
本申请实施例中的方案,能够在光斑位于目标图像中的位置较偏、未位于中心区域的情况下,通过至少两条参考线,精确获取灰度分布范围较大的像素点,以更加精确地确定位于灰度等高线上的参考点,进而提高光心确定的准确性。
图13是本申请一种实施例提供的光心确定装置的结构框图,该装置可执行本申请任意实施例所提供的光心确定方法,具备执行方法相应的功能模块和效果。如图13所示,该装置可以包括以下模块。
参考线获得模块310,设置为将目标图像中距离最大的边缘点连接,得到至少一条参考线;
参考点确定模块320,设置为确定至少一条参考线上灰度值与灰度峰值呈预 设比例的至少两个参考点,其中,灰度峰值为所述至少一条参考线上像素点的灰度值中的最大值;
光心位置信息确定模块330,设置为根据灰度值与参考点的灰度值一致的辅助点,以及所述至少两个参考点,确定光心的位置信息。
在本申请实施例中,参考点确定模块320,包括:
目标灰度值确定单元,设置为根据灰度峰值与所述预设比例的乘积,确定目标灰度值。
参考点确定单元,设置为将参考线上灰度值与目标灰度值一致的至少两个点,作为至少两个参考点。
在本申请实施例中,所述装置还包括:预设比例确定模块,设置为确定预设比例,所述预设比例确定模块包括:
第一差值确定单元,设置为确定灰度峰值与参考线上目标端点的灰度值的第一差值,其中,目标端点为参考线的两个端点中灰度值较大的端点;
第二差值确定单元,设置为确定所述第一差值与预设系数的乘积值,并确定灰度峰值与所述乘积值的第二差值,其中,所述预设系数的取值范围为(0,1);
比值确定单元,设置为将所述第二差值与所述灰度峰值的比值,作为预设比例。
在本申请实施例中,光心位置信息确定模块330,包括:
辅助点确定单元,设置为在与所述参考点同一水平方向上,以及与所述参考点同一竖直方向上,确定与参考点的灰度值一致的点,作为辅助点。
中点确定单元,设置为确定所述至少两个参考点与所述辅助点之间连线的中点。
光心位置信息确定单元,设置为根据所述中点,确定光心的位置信息。
在本申请实施例中,光心位置信息确定单元,是设置为:
将不相交的连线确定的中点相连接,得到至少两条辅助线;
根据至少两条辅助线的交点,确定光心的位置信息。
在本申请实施例中,所述至少两条辅助线为至少四条辅助线;
在本申请实施例中,光心位置信息确定单元,是设置为:
若至少四条辅助线的交点为至少两个交点,则根据至少两个交点的平均值, 确定光心的位置信息。
在本申请实施例中,光心位置信息确定模块330,是设置为:
若所述光心所在的光斑为圆形,则根据所述参考点与所述辅助点之间连线的中垂线,确定光心的位置信息。
上述产品可执行本申请实施例所提供的光心确定方法,具备执行方法相应的功能模块和效果。
图14是本申请一种实施例提供的电子设备的结构示意图。图14示出了适于用来实现本申请实施例的示例性电子设备412的框图。图14显示的电子设备412仅仅是一个示例,不应对本申请实施例的功能和使用范围带来任何限制。
如图14所示,电子设备412可以包括:一个或多个处理器416;存储器428,设置为存储一个或多个程序,当所述一个或多个程序被所述一个或多个处理器416执行,使得所述一个或多个处理器416实现本申请实施例所提供的光心确定方法,包括:
将目标图像中距离最大的边缘点连接,得到至少一条参考线;
确定至少一条参考线上灰度值与灰度峰值呈预设比例的至少两个参考点,其中,灰度峰值为所述至少一条参考线上像素点的灰度值中的最大值;
根据灰度值与参考点的灰度值一致的辅助点,以及所述至少两个参考点,确定光心的位置信息。
电子设备412的组件可以包括:一个或者多个处理器416,存储器428,连接不同设备组件(包括存储器428和处理器416)的总线418。
总线418表示几类总线结构中的一种或多种,包括存储器总线或者存储器控制器,外围总线,图形加速端口,处理器或者使用多种总线结构中的任意总线结构的局域总线。举例来说,这些体系结构包括工业标准体系结构(Industry Subversive Alliance,ISA)总线,微通道体系结构(Micro Channel Architecture,MCA)总线,处理型ISA总线、视频电子标准协会(Video Electronics Standards Association,VESA)局域总线以及外围组件互连(Peripheral Component Interconnect,PCI)总线。
电子设备412包括多种计算机设备可读存储介质。这些存储介质可以是任何能够被电子设备412访问的可用存储介质,包括易失性和非易失性存储介质,可移动的和不可移动的存储介质。存储介质可以是非暂态(non-transitory)存储介质。
存储器428可以包括易失性存储器形式的计算机设备可读存储介质,例如随机存取存储器(Random Access Memory,RAM)430和/或高速缓存432。电子设备412可以包括其它可移动/不可移动的、易失性/非易失性计算机设备存储介质。仅作为举例,存储系统434可以用于读写不可移动的、非易失性磁存储介质(图14未显示,通常称为“硬盘驱动器”)。尽管图14中未示出,可以提供用于对可移动非易失性磁盘(例如“软盘”)读写的磁盘驱动器,以及对可移动非易失性光盘(例如紧凑磁盘只读存储器(Compact Disc Read Only Memory,CD-ROM),数字多功能盘只读存储器(Digital Video Disk Read Only Memory,DVD-ROM)或者其它光存储介质)读写的光盘驱动器。在这些情况下,每个驱动器可以通过一个或者多个数据存储介质接口与总线418相连。存储器428可以包括至少一个程序产品,该程序产品具有一组(例如至少一个)程序模块,这些程序模块被配置以执行本申请多个实施例的功能。
具有一组(至少一个)程序模块442的程序/实用工具440,可以存储在例如存储器428中,这样的程序模块442包括操作设备、一个或者多个应用程序、其它程序模块以及程序数据,这些示例中的每一个或某种组合中可能包括网络环境的实现。程序模块442通常执行本申请所描述的实施例中的功能和/或方法。
电子设备412也可以与一个或多个外部设备414和/或显示器424等通信,还可与一个或者多个使得用户能与该电子设备412交互的设备通信,和/或与使得该电子设备412能与一个或多个其它计算设备进行通信的任何设备(例如网卡,调制解调器等等)通信。这种通信可以通过输入/输出(Input/Output,I/O)接口422进行。并且,电子设备412还可以通过网络适配器420与一个或者多个网络(例如局域网(Local Area Network,LAN),广域网(Wide Area Network,WAN)和/或公共网络,例如因特网)通信。如图14所示,网络适配器420通过总线418与电子设备412的其它模块通信。尽管图14中未示出,可以结合电子设备412使用其它硬件和/或软件模块,包括:微代码、设备驱动器、冗余处理单元、外部磁盘驱动阵列、磁盘阵列(Redundant Arrays of Independent Drives,RAID)设备、磁带驱动器以及数据备份存储设备等。
处理器416通过运行存储在存储器428中的多个程序中其他程序的至少一个,从而执行多种功能应用以及数据处理,例如实现本申请实施例所提供的一种光心确定方法。
本申请实施例五提供了一种包含计算机可执行指令的存储介质,所述计算机可执行指令在由计算机处理器执行时用于执行光心确定方法,包括:
将目标图像中距离最大的边缘点连接,得到至少一条参考线;
确定至少一条参考线上灰度值与灰度峰值呈预设比例的至少两个参考点,其中,灰度峰值为所述至少一条参考线上像素点的灰度值中的最大值;
根据灰度值与参考点的灰度值一致的辅助点,以及所述至少两个参考点,确定光心的位置信息。
本申请实施例的计算机存储介质,可以采用一个或多个计算机可读的存储介质的任意组合。计算机可读存储介质可以是计算机可读信号存储介质或者计算机可读存储介质。计算机可读存储介质例如可以是电、磁、光、电磁、红外线、或半导体的设备、装置或器件,或者任意以上的组合。存储介质可以是非暂态(non-transitory)存储介质。计算机可读存储介质包括:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、RAM、只读存储器(Read-Only Memory,ROM)、可擦式可编程只读存储器(Erasable Programmable Read-Only Memory,EPROM)、闪存、光纤、便携式CD-ROM、光存储器件、磁存储器件、或者上述的任意合适的组合。在本申请实施例中,计算机可读存储介质可以是任何包含或存储程序的有形存储介质,该程序可以被指令执行设备、装置或者器件使用或者与其结合使用。
计算机可读的信号存储介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括电磁信号、光信号或上述的任意合适的组合。计算机可读的信号存储介质还可以是计算机可读存储介质以外的任何计算机可读存储介质,该计算机可读存储介质可以发送、传播或者传输用于由指令执行设备、装置或者器件使用或者与其结合使用的程序。
计算机可读存储介质上包含的程序代码可以用任何适当的存储介质传输,包括无线、电线、光缆、射频(Radio Frequency,RF)等等,或者上述的任意合适的组合。
可以以一种或多种程序设计语言或其组合来编写用于执行本申请操作的计算机程序代码,所述程序设计语言包括面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或设备上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括LAN或WAN—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。

Claims (10)

  1. 一种光心确定方法,包括:
    将目标图像中距离最大的边缘点连接,得到至少一条参考线;
    确定所述至少一条参考线上灰度值与灰度峰值呈预设比例的至少两个参考点,其中,所述灰度峰值为所述至少一条参考线上像素点的灰度值中的最大值;
    根据灰度值与参考点的灰度值一致的辅助点,以及所述至少两个参考点,确定光心的位置信息。
  2. 根据权利要求1所述的方法,其中,所述确定所述至少一条参考线上灰度值与灰度峰值呈预设比例的至少两个参考点,包括:
    根据所述灰度峰值与所述预设比例的乘积,确定目标灰度值;
    将所述至少一条参考线上灰度值与所述目标灰度值一致的至少两个点,作为所述至少两个参考点。
  3. 根据权利要求1所述的方法,其中,所述预设比例的确定过程包括:
    确定所述灰度峰值与参考线上目标端点的灰度值的第一差值,其中,所述目标端点为参考线的两个端点中灰度值较大的端点;
    确定所述第一差值与预设系数的乘积值,并确定所述灰度峰值与所述乘积值的第二差值,其中,所述预设系数的取值范围为(0,1);
    将所述第二差值与所述灰度峰值的比值,作为所述预设比例。
  4. 根据权利要求1所述的方法,其中,所述根据灰度值与参考点的灰度值一致的辅助点,以及所述至少两个参考点,确定光心的位置信息,包括:
    在与所述参考点同一水平方向上,以及与所述参考点同一竖直方向上,确定与所述参考点的灰度值一致的点,作为辅助点;
    确定所述至少两个参考点与所述辅助点之间连线的中点;
    根据所述中点,确定所述光心的位置信息。
  5. 根据权利要求4所述的方法,其中,所述根据所述中点,确定所述光心的位置信息,包括:
    将不相交的连线确定的中点相连接,得到至少两条辅助线;
    根据所述至少两条辅助线的交点,确定所述光心的位置信息。
  6. 根据权利要求5所述的方法,其中,所述至少两条辅助线为至少四条辅助线;
    所述根据所述至少两条辅助线的交点,确定所述光心的位置信息,包括:
    在所述至少四条辅助线的交点为至少两个交点的情况下,根据所述至少两个交点的平均值,确定所述光心的位置信息。
  7. 根据权利要求1所述的方法,其中,所述根据灰度值与参考点的灰度值一致的辅助点,以及所述至少两个参考点,确定光心的位置信息,包括:
    在所述光心所在的光斑为圆形的情况下,根据所述至少两个参考点与所述辅助点之间连线的中垂线,确定所述光心的位置信息。
  8. 一种光心确定装置,包括:
    参考线获得模块,设置为将目标图像中距离最大的边缘点连接,得到至少一条参考线;
    参考点确定模块,设置为确定所述至少一条参考线上灰度值与灰度峰值呈预设比例的至少两个参考点,其中,所述灰度峰值为所述至少一条参考线上像素点的灰度值中的最大值;
    光心位置信息确定模块,设置为根据灰度值与参考点的灰度值一致的辅助点,以及所述至少两个参考点,确定光心的位置信息。
  9. 一种电子设备,包括存储器,处理器及存储在所述存储器上并可在所述处理器运行的计算机程序,其中,所述处理器执行所述计算机程序时实现如权利要求1-7中任一项所述的光心确定方法。
  10. 一种计算机可读存储介质,存储有计算机程序,其中,所述计算机程序被处理器执行时实现如权利要求1-7中任一项所述的光心确定方法。
PCT/CN2021/140671 2021-07-30 2021-12-23 光心确定方法、装置、电子设备及介质 WO2023005123A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP21951695.2A EP4261781A1 (en) 2021-07-30 2021-12-23 Optical center determination method and apparatus, electronic device, and medium
US18/551,324 US20240169591A1 (en) 2021-07-30 2021-12-23 Optical center determination method and apparatus, electronic device, and medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110875409.8A CN115690191A (zh) 2021-07-30 2021-07-30 光心确定方法、装置、电子设备及介质
CN202110875409.8 2021-07-30

Publications (1)

Publication Number Publication Date
WO2023005123A1 true WO2023005123A1 (zh) 2023-02-02

Family

ID=85060068

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/140671 WO2023005123A1 (zh) 2021-07-30 2021-12-23 光心确定方法、装置、电子设备及介质

Country Status (4)

Country Link
US (1) US20240169591A1 (zh)
EP (1) EP4261781A1 (zh)
CN (1) CN115690191A (zh)
WO (1) WO2023005123A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117252897A (zh) * 2023-11-17 2023-12-19 天津市眼科医院视光中心有限公司 塑形镜划痕前景图像提取方法、装置、设备及存储介质

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106600653A (zh) * 2016-12-30 2017-04-26 亿嘉和科技股份有限公司 一种变倍相机光心标定方法
CN106683135A (zh) * 2015-11-09 2017-05-17 宁波舜宇光电信息有限公司 寻找镜头光心的方法
US20180146175A1 (en) * 2013-09-11 2018-05-24 Color Match, LLC Color measurement and calibration
CN111508027A (zh) * 2019-01-31 2020-08-07 杭州海康威视数字技术股份有限公司 摄像机外参标定的方法和装置
CN112085752A (zh) * 2020-08-20 2020-12-15 浙江华睿科技有限公司 一种图像的处理方法、装置、设备及介质
CN112991202A (zh) * 2021-03-01 2021-06-18 歌尔科技有限公司 光心位置的校准方法、终端设备及计算机可读存储介质

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180146175A1 (en) * 2013-09-11 2018-05-24 Color Match, LLC Color measurement and calibration
CN106683135A (zh) * 2015-11-09 2017-05-17 宁波舜宇光电信息有限公司 寻找镜头光心的方法
CN106600653A (zh) * 2016-12-30 2017-04-26 亿嘉和科技股份有限公司 一种变倍相机光心标定方法
CN111508027A (zh) * 2019-01-31 2020-08-07 杭州海康威视数字技术股份有限公司 摄像机外参标定的方法和装置
CN112085752A (zh) * 2020-08-20 2020-12-15 浙江华睿科技有限公司 一种图像的处理方法、装置、设备及介质
CN112991202A (zh) * 2021-03-01 2021-06-18 歌尔科技有限公司 光心位置的校准方法、终端设备及计算机可读存储介质

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117252897A (zh) * 2023-11-17 2023-12-19 天津市眼科医院视光中心有限公司 塑形镜划痕前景图像提取方法、装置、设备及存储介质
CN117252897B (zh) * 2023-11-17 2024-02-02 天津市眼科医院视光中心有限公司 塑形镜划痕前景图像提取方法、装置、设备及存储介质

Also Published As

Publication number Publication date
CN115690191A (zh) 2023-02-03
US20240169591A1 (en) 2024-05-23
EP4261781A1 (en) 2023-10-18

Similar Documents

Publication Publication Date Title
WO2020259271A1 (zh) 图像畸变校正方法和装置
WO2021175180A1 (zh) 视线确定方法、装置、电子设备和计算机可读存储介质
CN110189336B (zh) 图像生成方法、系统、服务器及存储介质
CN112348763B (zh) 图像增强方法、装置、电子设备及介质
WO2020135234A1 (zh) 一种图像处理方法及装置
WO2019105254A1 (zh) 背景虚化处理方法、装置及设备
CN111368587B (zh) 场景检测方法、装置、终端设备及计算机可读存储介质
US20230214989A1 (en) Defect detection method, electronic device and readable storage medium
CN112116542B (zh) 图像对比度增强方法、装置、电子设备和存储介质
WO2023005123A1 (zh) 光心确定方法、装置、电子设备及介质
CN112991465A (zh) 相机标定方法、装置、电子设备和计算机可读介质
WO2024139491A1 (zh) 一种全景图像的确定方法、装置、设备及存储介质
WO2019128539A1 (zh) 图片清晰度的获取方法、装置、存储介质及电子设备
CN113965664B (zh) 一种图像虚化方法、存储介质以及终端设备
CN112312001A (zh) 一种图像检测的方法、装置、设备和计算机存储介质
CN115587948A (zh) 一种图像暗场校正方法及设备
CN111078090A (zh) 一种显示方法、装置、设备和存储介质
WO2019165791A1 (zh) 图像转换方法和装置、终端、存储介质
WO2019137396A1 (zh) 一种图像处理方法及装置
JP2009301181A (ja) 画像処理装置、画像処理プログラム、画像処理方法、および電子機器
US20060050084A1 (en) Apparatus and method for histogram stretching
JP2009302731A (ja) 画像処理装置、画像処理プログラム、画像処理方法、および電子機器
CN113822940B (zh) 平场矫正标定方法、装置及系统、计算机设备及介质
WO2023125003A1 (zh) 调制传递函数的确定方法、电子设备及存储介质
WO2022205934A1 (zh) 视差图优化方法、装置、电子设备及计算机可读存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21951695

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2021951695

Country of ref document: EP

Effective date: 20230710

WWE Wipo information: entry into national phase

Ref document number: 18551324

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE