WO2021042638A1 - Method and apparatus for extracting test target image of projector xpr-tilt glass, and electronic device - Google Patents

Method and apparatus for extracting test target image of projector xpr-tilt glass, and electronic device Download PDF

Info

Publication number
WO2021042638A1
WO2021042638A1 PCT/CN2019/129219 CN2019129219W WO2021042638A1 WO 2021042638 A1 WO2021042638 A1 WO 2021042638A1 CN 2019129219 W CN2019129219 W CN 2019129219W WO 2021042638 A1 WO2021042638 A1 WO 2021042638A1
Authority
WO
WIPO (PCT)
Prior art keywords
gravity
centers
target image
image
center
Prior art date
Application number
PCT/CN2019/129219
Other languages
French (fr)
Chinese (zh)
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 歌尔股份有限公司
Publication of WO2021042638A1 publication Critical patent/WO2021042638A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/12Edge-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/187Segmentation; Edge detection involving region growing; involving region merging; involving connected component labelling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30108Industrial image inspection

Definitions

  • the present invention relates to the technical field of image processing, and more specifically, to a method for extracting a test target image of a projector galvanometer, a device for extracting a test target image of a projector galvanometer, an electronic device, and a computer readable Storage medium.
  • the vibration of its galvanometer needs to be tested when it leaves the factory.
  • the vibration of the galvanometer of the DLP projector is judged by the human eye, which is highly subjective, low in accuracy, and easy to cause fatigue and low efficiency.
  • an industrial camera can be used to capture the image when the galvanometer is vibrating, extract a target image containing a group of unit vibration images from the image, and then extract a unit vibration image from the target image to determine The vibration of the galvanometer.
  • One difficulty of this automatic test is to extract the test target image of the projector galvanometer from the image taken by the industrial camera.
  • An object of the present invention is to provide a new technical solution for extracting the target image in the vibration test of the projector.
  • a method for extracting a test target image of a projector galvanometer which includes:
  • the target image is obtained according to the starting position of the target image and the outline size of the target image.
  • the step of selecting multiple centers of gravity that conform to a preset positional relationship from the centers of gravity of the connected regions includes:
  • the step of determining the starting position of the target image according to the position information of the multiple centers of gravity includes:
  • the center of the four centers of gravity is used as the starting position of the target image.
  • the step of obtaining the outline size of the target image according to the size information of the standard galvanometer unit image and the size information of the multiple centers of gravity includes:
  • the outline size in the standard galvanometer unit and the scale factor the outline size of the target image is obtained.
  • the step of initially selecting four centers of gravity from the centers of gravity of the connected regions includes:
  • a center of gravity is initially selected from the centers of gravity of the connected regions, and then three other centers of gravity are selected within a preset distance range from the selected center of gravity to obtain the four centers of gravity.
  • the reference size is the distance from a certain vertex of the standard galvanometer unit to the center of gravity of the nearest subunit, and the corresponding size is from a certain center of gravity of the plurality of centers of gravity to the plurality of centers of gravity.
  • the step of acquiring the connected region and the center of gravity of the connected region in the sampled image after preprocessing includes:
  • the center of gravity of the connected area is obtained.
  • the step of preprocessing the sampled image taken by the industrial camera includes:
  • the cropped sampled image is processed into a binarized image based on a preset monochrome channel, and the binarized image is denoised to obtain a preprocessed sampled image.
  • a device for extracting a test target image of a projector galvanometer including:
  • the image acquisition module is used to preprocess the sampled image taken by the industrial camera, and acquire the connected area and the center of gravity of the connected area in the preprocessed sampled image;
  • a starting position acquiring module configured to select multiple centers of gravity that conform to a preset position relationship from the centers of gravity of the connected regions, and determine the starting position of the target image according to the position information of the multiple centers of gravity;
  • An outline size obtaining module configured to obtain the outline size of the target image according to the size information of the standard galvanometer unit image and the size information of the multiple centers of gravity;
  • the target image acquisition module is configured to obtain the target image according to the starting position of the target image and the outline size of the target image.
  • an electronic device including: a memory and a processor, the memory is used to store instructions, and the instructions are used to control the processor to operate to perform the first step according to the present invention. The method described in the aspect.
  • a computer-readable storage medium on which a computer program is stored, and the computer program, when executed by a processor, implements the method according to the first aspect of the present invention.
  • the method for extracting the target image in the galvanometer measurement of the projector provided by the embodiment of the present invention realizes the automatic extraction of the image of the test unit and improves the accuracy of the extraction work.
  • FIG. 1 is a block diagram of the hardware configuration of an electronic device that can be used to implement a method for extracting a target image in a galvanometer test of a projector according to any embodiment of the present invention.
  • Fig. 2 is a processing flowchart of a method for extracting a target image in a galvanometer test of a projector according to an embodiment of the present invention.
  • Fig. 3 shows a schematic diagram of an image projected by a projector.
  • Figure 4 is a schematic diagram of sampled graphics cropping in this example.
  • Fig. 5 is a schematic diagram of the binarized image in this example.
  • Figure 6 is a schematic diagram of determining the starting position of the target image in this example.
  • Fig. 7 is a schematic diagram of a standard galvanometer unit diagram in this example.
  • Fig. 8 is a schematic diagram of the reference edge in this example.
  • Fig. 9 is a schematic diagram of the target map obtained in this example.
  • Fig. 10 is a schematic diagram of a device for extracting a target image in a galvanometer test of a projector according to an embodiment of the present invention.
  • Fig. 11 is a schematic diagram of an electronic device according to an embodiment of the present invention.
  • FIG. 1 is a block diagram of the hardware configuration of an electronic device that can be used to implement a method for extracting a test target image of a projector galvanometer according to any embodiment of the present invention.
  • the electronic device 1000 may be an electronic device such as a mobile phone, a portable computer, a tablet computer, and a palmtop computer.
  • the electronic device 1000 may include a processor 1100, a memory 1200, an interface device 1300, a communication device 1400, a display device 1500, an input device 1600, a speaker 1700, a microphone 1800, and so on.
  • the processor 1100 may be a central processing unit (CPU), a microprocessor MCU, or the like.
  • the memory 1200 includes, for example, ROM (Read Only Memory), RAM (Random Access Memory), nonvolatile memory such as a hard disk, and the like.
  • the interface device 1300 includes, for example, a USB interface, a headphone interface, and the like.
  • the communication device 1400 can perform wired or wireless communication, for example.
  • the display device 1500 is, for example, a liquid crystal display, a touch display, or the like.
  • the input device 1600 may include, for example, a touch screen, a keyboard, and the like. The user can input/output voice information through the speaker 1700 and the microphone 1800.
  • the present invention may only involve some of the devices.
  • the electronic device 1000 only involves the memory 1200 and the processor 1100.
  • the memory 1200 of the electronic device 1000 is used to store instructions, and the instructions are used to control the processor 1100 to execute the method for extracting the test target image of the projector galvanometer provided by the embodiment of the present invention.
  • Fig. 2 is a processing flowchart of a method for extracting a test target image of a projector galvanometer according to an embodiment of the present invention.
  • the method for extracting the test target image of the projector galvanometer is implemented by electronic equipment.
  • the method for extracting the test target image of the projector galvanometer may include the following steps S2100-S2400.
  • Step S2100 Preprocess the sampled image taken by the industrial camera, and obtain the connected area and the center of gravity of the connected area in the preprocessed sampled image.
  • Fig. 3 shows a schematic diagram of an image projected by a projector.
  • the projector projects an image on the projection screen ABCD, the projected image area is A1B1C1D1, and the projector lens is parallel to the plane where the projection screen is located.
  • the industrial camera is installed in the fixture and used to shoot the projected image projected by the projector onto the projection screen.
  • the optical axis of the optical components of the industrial camera is perpendicular to the plane where the projection screen is located.
  • the electronic equipment is used to control the industrial camera to take pictures and obtain the projected images collected by the industrial camera for processing.
  • the electronic device is also used to control the galvanometer of the projector to turn on the fixed vibration mode.
  • An industrial camera is used to shoot the image projected by the projector to obtain a sampled image.
  • preprocessing the sampled images taken by the industrial camera includes the following steps S2110-S2120:
  • step S2110 the sampled image is cropped.
  • the short side of the original sampled image is the length of the side
  • the center of the original sampled image is cropped, and the cropping result is a square.
  • Step S2120 Process the cropped sampled image into a binarized image based on the preset monochrome channel, and denoise the binarized image to obtain a preprocessed sampled image.
  • the gray value of the pixel whose brightness value of the preset monochrome channel exceeds the preset brightness threshold can be set to 255, and the preset brightness value can be set to 255.
  • the gray value of the pixel whose brightness value of the monochrome channel does not exceed the preset brightness threshold is set to 0 to obtain a binary image.
  • the connected area and the center of gravity of the connected area in the preprocessed sampled image are obtained.
  • the connected regions in the sampled image correspond to the sub-units in the unit vibration image.
  • the connected area is formed by pixels with a gray value of 255.
  • acquiring the connected regions in the sampled image includes:
  • the connected area is obtained.
  • a group of pixels with gray values of 255 and adjacent to each other is selected from the sampled image, and the set of these pixels constitutes a connected area.
  • obtaining the center of gravity of the connected region includes:
  • the center of gravity of the connected area is obtained.
  • first obtain the center position coordinates of each pixel in the connected area and then calculate the average value of the center position coordinates of all pixels in the connected area, and the average value is the center of gravity coordinates of the connected area.
  • Step S2200 Select multiple centers of gravity that conform to a preset position relationship from the centers of gravity of the connected regions, and determine the starting position of the target image according to the position information of the multiple centers of gravity.
  • the number of selected centers of gravity is four.
  • the step of selecting multiple centers of gravity conforming to the preset position relationship from the centers of gravity of the connected regions includes the following steps S2210-S2220:
  • Step S2210 Preliminarily select four centers of gravity from the centers of gravity of the connected regions, and obtain the centers of gravity of a quadrilateral with the four centers of gravity as vertices as the centers of the four centers of gravity.
  • a quadrilateral can be obtained by taking the four initially selected centers of gravity as vertices. Calculate the center of gravity of the quadrilateral, which is the center of the four centers of gravity.
  • center coordinates of the four centers of gravity are equal to the average of the coordinates of the four centers of gravity.
  • step S2220 in the case where the distance difference between the four centers of gravity to the center is less than a preset threshold, the four centers of gravity are used as multiple centers of gravity that conform to the preset positional relationship.
  • the step of determining the starting position of the target image according to the position information of the multiple centers of gravity includes: taking the centers of the four centers of gravity as the starting position of the target image.
  • the center of the four centers of gravity corresponds to a vertex of the target graph, and can be used as the starting position for determining the target graph.
  • the number of centers of gravity selected in the above example is four.
  • the number of centers of gravity is other numbers, such as three, five, etc., those skilled in the art can also obtain the starting position of the target image according to the matching relationship between the arrangement of these centers of gravity and the target image.
  • step S2300 the outline size of the target image is obtained according to the size information of the standard galvanometer unit image and the size information of multiple centers of gravity.
  • the standard galvanometer unit graph reflects the ideal vibration situation, which includes a group of unit vibration images, and the size information in the graph is known. Among them, a group of unit vibration images includes multiple subunits.
  • the step of obtaining the outline size of the target image according to the size information of the standard galvanometer unit image and the size information of multiple centers of gravity includes the following steps S2310-2320:
  • Step S2310 according to the reference size in the standard galvanometer unit diagram and the corresponding sizes determined by multiple centers of gravity, a scale factor for size conversion is obtained.
  • the reference size is the distance from a vertex of the standard galvanometer unit to the center of gravity of the nearest subunit
  • the corresponding size is the distance from a certain center of gravity to the center of multiple centers of gravity. It is the center of gravity of a polygon with multiple centers of gravity as vertices. According to the ratio of the reference size to the corresponding size, the scale factor used for size conversion can be determined
  • step S2320 the contour size of the target image is obtained according to the contour size and the scale factor in the standard galvanometer unit.
  • step S2400 the target image is obtained according to the starting position of the target image and the outline size of the target image.
  • the preprocessed sampled image take the above-mentioned starting position as a starting point and perform cropping according to the above-mentioned outline size, and the obtained image is the target image.
  • the sub-unit images can be extracted based on the target image, the tilt angle difference of each sub-unit image before and after the vibration of the galvanometer is calculated, and the working state of the galvanometer is determined according to the tilt angle difference.
  • the method for extracting the target image in the galvanometer measurement of the projector provided by the embodiment of the present invention realizes the automatic extraction of the target image and improves the accuracy of the extraction work.
  • the following provides a specific example of the implementation of the method for extracting the target image in the galvanometer measurement.
  • the left side of Figure 4 is a sampled image obtained by shooting a projected image with an industrial camera.
  • the sampled image is cropped to obtain a square with the short side of the sampled image as the side length and the center of the sampled image as the center, as shown on the right side of FIG. 4.
  • pixels with a gray value of 255 and adjacent relationships are selected to form connected areas, and multiple white connected areas shown in FIG. 5 are obtained.
  • For each white connected area calculate the average value of the coordinates of all pixels in the connected area to obtain the barycentric coordinates of the connected area.
  • the center of gravity of the connected region thus obtained is shown as point A, point B, point C... in Figure 5.
  • the center of gravity A is selected.
  • the other three centers of gravity are selected from the preset distance range of point A, for example, the centers of gravity B, C, and D are selected, and the four centers of gravity are initially selected.
  • the center of gravity that is far away from A can be excluded, such as the center of gravity E, F, and G, thereby reducing the amount of calculation.
  • Verify that the initially selected centers of gravity A, B, C, and D meet the preset positional relationship. Calculate the average value of the coordinates of the center of gravity A, B, C, and D. The average value is the center coordinates of the center of gravity A, B, C, and D. From this, the center of the center of gravity A, B, C, and D is obtained as point O in Figure 6 Shown. Obtain the lengths of OA, OB, OC, and OD. Assuming that the largest value of the above-mentioned length is OA, and the smallest is OD, calculate the difference between OA and OD, and record it as diff OA-OD.
  • diff ⁇ 5 it is considered that the center of gravity A, B, C, and D meet the preset positional relationship, and subsequent calculations can be performed. If diff ⁇ 5 (pixels), the center of gravity A, B, C, and D do not meet the preset positional relationship. In this case, discard the points A, B, C, and D selected in this round, and follow the distance to the far point. Continue to select a center of gravity in the order of near to far, for example, select center of gravity E, and continue to select and verify in the above-mentioned manner.
  • the center of gravity O of A, B, C, and D is taken as the starting position of the target map.
  • Figure 7 shows a diagram of the standard galvanometer unit used in this example. It can be seen that the standard galvanometer unit includes four sub-units represented by black areas, and the size information in the figure is known, for example, the side length of the standard galvanometer unit is 32 pixels.
  • Figure 8 shows the reference edge O'A' in the standard galvanometer unit diagram in this example.
  • O' is a vertex in the standard galvanometer unit graph
  • A' is the center of gravity of the subunit closest to the vertex.
  • the length of O'A' is Correspondingly, the corresponding edge in the binarized image is OA.
  • the binarized image is cropped according to the starting position O of the target image and the outline size w of the target image to obtain the target image, which is the area within the dashed box in FIG. 9.
  • Fig. 10 is a block diagram of a device for extracting a target image in a galvanometer measurement of a projector according to an embodiment of the present invention.
  • the device 100 for extracting the target image of the projector galvanometer test includes an image acquisition module 101, a starting position acquisition module 102, an outline size acquisition module 103 and a target image acquisition module 104.
  • the image acquisition module 101 is used to preprocess the sampled image taken by the industrial camera, and acquire the connected area and the center of gravity of the connected area in the preprocessed sampled image.
  • the starting position acquiring module 102 is configured to select multiple centers of gravity that conform to a preset position relationship from the centers of gravity of the connected regions, and determine the starting position of the target image according to the position information of the multiple centers of gravity;
  • the outline size obtaining module 103 is configured to obtain the outline size of the target image according to the size information of the standard galvanometer unit image and the size information of multiple centers of gravity;
  • the target image acquisition module 104 is configured to obtain the target image according to the starting position of the target image and the outline size of the target image.
  • the starting position acquisition module 102 executes the step of selecting multiple centers of gravity that conform to the preset position relationship from the centers of gravity of the connected regions, it is also used to: initially select four centers of gravity from the centers of gravity of the connected regions, Obtain the center of gravity of the quadrilateral with the four centers of gravity as the vertices, as the centers of the four centers of gravity; when the distance difference between the four centers of gravity to the center is less than the preset threshold, the four centers of gravity are regarded as multiples that conform to the preset position relationship Center of gravity.
  • the starting position acquiring module 102 is also used to use the centers of the four centers of gravity as the starting position of the target image when performing the step of determining the starting position of the target image by the position information of the multiple centers of gravity.
  • the contour size obtaining module 103 is also used to: according to the standard galvanometer unit diagram size information and multiple center of gravity size information to obtain the contour size of the target image
  • the reference size and the corresponding sizes determined by the multiple centers of gravity are used to obtain the scale factor for size conversion; the outline size of the target image is obtained according to the outline size and the scale factor in the standard galvanometer unit.
  • the starting position acquisition module 102 when the starting position acquisition module 102 performs the four steps of preliminarily selecting the center of gravity from the center of gravity of the connected area, it is also used to: first select a center of gravity from the center of gravity of the connected area, and then start from the preset of the center of gravity. Choose the other three centers of gravity within the distance range to get four centers of gravity.
  • the reference size is the distance from a vertex of the standard galvanometer unit graph to the center of gravity of the nearest subunit, and the corresponding size is the distance from a center of gravity to the center of the multiple centers of gravity.
  • the center of each center of gravity is the center of gravity of a polygon with multiple centers of gravity as vertices.
  • the image acquisition module 101 when the image acquisition module 101 executes the step of acquiring the connected region and the center of gravity of the connected region in the preprocessed sampled image, it is also used to: according to the pixel value of each pixel in the preprocessed sampled image The connected area is obtained by the adjacent relationship between the pixel and the pixel; and the center of gravity of the connected area is obtained according to the pixel distribution of the connected area.
  • the image acquisition module 101 when the image acquisition module 101 performs the step of preprocessing the sampled image taken by the industrial camera, it is also used to: crop the sampled image; process the cropped sampled image based on the preset monochrome channel It is a binarized image, and the binarized image is denoised to obtain a preprocessed sampled image.
  • the electronic device may include the device 100 for extracting the target image in the galvanometer measurement of the projector according to any embodiment of the present invention, which is used to implement the method for extracting the target image in the galvanometer measurement of the projector according to any embodiment of the present invention.
  • the electronic device 110 shown in FIG. 11 may include a processor 112 and a memory 111.
  • the memory 111 is used for storing executable instructions
  • the processor 120 is used for operating the electronic device 110 according to the control of the instructions to execute the method for extracting the target image in the galvanometer measurement of the projector according to any embodiment of the present invention.
  • a computer-readable storage medium is also provided, on which a computer program is stored.
  • the computer program is executed by the processor, the method for extracting the target image in the galvanometer measurement of the projector as in any embodiment of the present invention is realized. .
  • the present invention may be a system, a method and/or a computer program product.
  • the computer program product may include a computer-readable storage medium loaded with computer-readable program instructions for enabling a processor to implement various aspects of the present invention.
  • the computer-readable storage medium may be a tangible device that can hold and store instructions used by the instruction execution device.
  • the computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing.
  • Non-exhaustive list of computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM) Or flash memory), static random access memory (SRAM), portable compact disk read-only memory (CD-ROM), digital versatile disk (DVD), memory stick, floppy disk, mechanical encoding device, such as a printer with instructions stored thereon
  • RAM random access memory
  • ROM read-only memory
  • EPROM erasable programmable read-only memory
  • flash memory flash memory
  • SRAM static random access memory
  • CD-ROM compact disk read-only memory
  • DVD digital versatile disk
  • memory stick floppy disk
  • mechanical encoding device such as a printer with instructions stored thereon
  • the computer-readable storage medium used here is not interpreted as the instantaneous signal itself, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (for example, light pulses through fiber optic cables), or through wires Transmission of electrical signals.
  • the computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to various computing/processing devices, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and/or a wireless network.
  • the network may include copper transmission cables, optical fiber transmission, wireless transmission, routers, firewalls, switches, gateway computers, and/or edge servers.
  • the network adapter card or network interface in each computing/processing device receives computer-readable program instructions from the network, and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing/processing device .
  • the computer program instructions used to perform the operations of the present invention may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, status setting data, or in one or more programming languages.
  • Programming languages include object-oriented programming languages-such as Smalltalk, C++, etc., and conventional procedural programming languages-such as "C" language or similar programming languages.
  • Computer-readable program instructions can be executed entirely on the user's computer, partly on the user's computer, executed as a stand-alone software package, partly on the user's computer and partly executed on a remote computer, or entirely on the remote computer or server carried out.
  • the remote computer can be connected to the user's computer through any kind of network-including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (for example, using an Internet service provider to connect to the user's computer) connection).
  • LAN local area network
  • WAN wide area network
  • an electronic circuit such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), can be customized by using the status information of the computer-readable program instructions.
  • the computer-readable program instructions are executed to implement various aspects of the present invention.
  • These computer-readable program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine that makes these instructions when executed by the processor of the computer or other programmable data processing device , A device that implements the functions/actions specified in one or more blocks in the flowcharts and/or block diagrams is produced. It is also possible to store these computer-readable program instructions in a computer-readable storage medium. These instructions make computers, programmable data processing apparatuses, and/or other devices work in a specific manner. Thus, the computer-readable medium storing the instructions includes An article of manufacture, which includes instructions for implementing various aspects of the functions/actions specified in one or more blocks in the flowcharts and/or block diagrams.
  • each block in the flowchart or block diagram can represent a module, program segment, or part of an instruction, and the module, program segment, or part of an instruction contains one or more executables for implementing the specified logical functions. instruction.
  • the functions marked in the block may also occur in a different order than the order marked in the drawings. For example, two consecutive blocks can actually be executed in parallel, or they can sometimes be executed in the reverse order, depending on the functions involved.
  • each block in the block diagram and/or flowchart, and the combination of the blocks in the block diagram and/or flowchart can be implemented by a dedicated hardware-based system that performs the specified functions or actions Or it can be realized by a combination of dedicated hardware and computer instructions. It is well known to those skilled in the art that implementation through hardware, implementation through software, and implementation through a combination of software and hardware are all equivalent.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Length Measuring Devices By Optical Means (AREA)
  • Controls And Circuits For Display Device (AREA)
  • Image Analysis (AREA)

Abstract

A method and apparatus for extracting a test target image of projector XPR-tilt glass, and an electronic device, the method comprising: preprocessing a sample image captured by an industrial camera, and acquiring a communication area in the preprocessed sample image as well as centers of gravity of the communication area (S2100); selecting from among the centers of gravity of the communication area multiple centers of gravity which comply with a preset positional relationship, and determining a starting position of a target image according to position information of the multiple centers of gravity (S2200); obtaining the contour size of the target image according to size information of a standard XPR-tilt glass unit image and size information of the multiple centers of gravity (S2300); and obtaining the target image according to the starting position of the target image and the contour size of the target image (S2400).

Description

投影仪振镜测试目标图的提取方法、装置及电子设备Method, device and electronic equipment for extracting test target image of projector galvanometer 技术领域Technical field
本发明涉及图像处理技术领域,更具体地,涉及一种投投影仪振镜测试目标图的提取方法、一种投影仪振镜测试目标图的提取装置、一种电子设备以及一种计算机可读存储介质。The present invention relates to the technical field of image processing, and more specifically, to a method for extracting a test target image of a projector galvanometer, a device for extracting a test target image of a projector galvanometer, an electronic device, and a computer readable Storage medium.
背景技术Background technique
投影仪作为无屏电视已经进入普通家庭的生活中,随着网速的不断提升和发展,人们对电视画面的清晰度不断提出新的要求,720p,1080p,4K,这些都成为选择电视的新标准。随着电视画面清晰度的上升,投影仪硬件成本成倍增加,这样振镜(XPR-tilt glass)技术应运而生,可以使用XPR-tilt glass+1080p投影仪的硬件配置,输出4K的画质。As a screenless TV, projectors have entered the lives of ordinary families. With the continuous improvement and development of Internet speeds, people continue to put forward new requirements for the clarity of the TV screen, 720p, 1080p, 4K, these have become the new choice for TV. standard. With the increase in TV picture definition, the cost of projector hardware has doubled, so the galvanometer (XPR-tilt glass) technology came into being. You can use the hardware configuration of the XPR-tilt glass+1080p projector to output 4K image quality .
对于此类DLP(Digital Light Processing,数字光处理技术)投影仪,在出厂时,需对其振镜的振动情况进行测试。目前,DLP投影仪振镜振动情况是利用人眼来判断的,主观性强,准确性低,且易导致人疲劳,效率低下。For this type of DLP (Digital Light Processing, digital light processing technology) projector, the vibration of its galvanometer needs to be tested when it leaves the factory. At present, the vibration of the galvanometer of the DLP projector is judged by the human eye, which is highly subjective, low in accuracy, and easy to cause fatigue and low efficiency.
为实现DLP投影仪振动情况的自动测试,可使用工业相机拍摄振镜振动时的图像,从该图像中提取包含一组单元振动图像的目标图,再从该目标图中提取一个单元振动图像判断振镜的振动情况。该自动测试的一个难点在于从工业相机拍摄的图像中提取投影仪振镜测试目标图。In order to realize the automatic test of the vibration of the DLP projector, an industrial camera can be used to capture the image when the galvanometer is vibrating, extract a target image containing a group of unit vibration images from the image, and then extract a unit vibration image from the target image to determine The vibration of the galvanometer. One difficulty of this automatic test is to extract the test target image of the projector galvanometer from the image taken by the industrial camera.
发明内容Summary of the invention
本发明的一个目的是提供一种用于提取投影仪振动测试中目标图的新技术方案。An object of the present invention is to provide a new technical solution for extracting the target image in the vibration test of the projector.
根据本发明的第一方面,提供了一种投影仪振镜测试目标图的提取方法,包括:According to the first aspect of the present invention, there is provided a method for extracting a test target image of a projector galvanometer, which includes:
将工业相机拍摄的采样图像进行预处理,获取预处理后的所述采样图像中的连通区域及所述连通区域的重心;Preprocessing the sampled image taken by the industrial camera to obtain the connected area and the center of gravity of the connected area in the sampled image after the preprocessing;
从所述连通区域的重心中选取符合预设位置关系的多个重心,根据所述多个重心的位置信息确定所述目标图的起始位置;Selecting multiple centers of gravity that conform to a preset position relationship from the centers of gravity of the connected regions, and determining the starting position of the target image according to the position information of the multiple centers of gravity;
根据标准振镜单元图的尺寸信息以及所述多个重心的尺寸信息,获得所述目标图的轮廓尺寸;Obtaining the outline size of the target image according to the size information of the standard galvanometer unit image and the size information of the multiple centers of gravity;
根据所述目标图的起始位置和所述目标图的轮廓尺寸,获得所述目标图。The target image is obtained according to the starting position of the target image and the outline size of the target image.
可选地,所述从所述连通区域的重心中选取符合预设位置关系的多个重心的步骤,包括:Optionally, the step of selecting multiple centers of gravity that conform to a preset positional relationship from the centers of gravity of the connected regions includes:
从所述连通区域的重心中初步选取四个重心,获取以所述四个重心为顶点的四边形的重心,作为所述四个重心的中心;Preliminarily selecting four centers of gravity from the centers of gravity of the connected regions, and obtaining the centers of gravity of a quadrilateral with the four centers of gravity as vertices as the centers of the four centers of gravity;
在所述四个重心到所述中心的距离差异的小于预设阈值的情况下,将所述四个重心作为所述符合预设位置关系的多个所述重心;In a case where the distance difference between the four centers of gravity and the center is less than a preset threshold, use the four centers of gravity as the plurality of centers of gravity that conform to the preset positional relationship;
所述根据所述多个重心的位置信息确定所述目标图的起始位置的步骤,包括:The step of determining the starting position of the target image according to the position information of the multiple centers of gravity includes:
将所述四个重心的中心作为所述目标图的起始位置。The center of the four centers of gravity is used as the starting position of the target image.
可选地,所述根据标准振镜单元图的尺寸信息以及所述多个重心的尺寸信息,获得所述目标图的轮廓尺寸的步骤,包括:Optionally, the step of obtaining the outline size of the target image according to the size information of the standard galvanometer unit image and the size information of the multiple centers of gravity includes:
根据所述标准振镜单元图中的参考尺寸以及所述多个重心确定的对应尺寸,获取用于进行尺寸转换的比例系数;Obtaining a scale factor for size conversion according to the reference size in the standard galvanometer unit diagram and the corresponding sizes determined by the multiple centers of gravity;
根据所述标准振镜单元中的轮廓尺寸和所述比例系数,获得所述目标图的轮廓尺寸。According to the outline size in the standard galvanometer unit and the scale factor, the outline size of the target image is obtained.
可选地,所述从所述连通区域的重心中初步选取四个重心的步骤,包括:Optionally, the step of initially selecting four centers of gravity from the centers of gravity of the connected regions includes:
先从所述连通区域的重心中初步选取一个重心,再从从选取的所述重心的预设距离范围内选取其他三个重心,得到所述四个重心。First, a center of gravity is initially selected from the centers of gravity of the connected regions, and then three other centers of gravity are selected within a preset distance range from the selected center of gravity to obtain the four centers of gravity.
可选地,所述参考尺寸为所述标准振镜单元图中某一顶点到最近的子单元的重心的距离,所述对应尺寸为所述多个重心中的某一重心到所述多 个重心的中心的距离,其中所述多个重心的中心是以所述多个重心为顶点的多边形的重心。Optionally, the reference size is the distance from a certain vertex of the standard galvanometer unit to the center of gravity of the nearest subunit, and the corresponding size is from a certain center of gravity of the plurality of centers of gravity to the plurality of centers of gravity. The distance from the center of the center of gravity, where the centers of the plurality of centers of gravity are the center of gravity of a polygon with the plurality of centers of gravity as vertices.
可选地,所述获取预处理后的所述采样图像中的连通区域及所述连通区域的重心的步骤,包括:Optionally, the step of acquiring the connected region and the center of gravity of the connected region in the sampled image after preprocessing includes:
根据所述预处理后的所述采样图像中每一像素的像素值和像素之间的相邻关系,获得所述连通区域;Obtaining the connected region according to the pixel value of each pixel in the sampled image after the preprocessing and the neighboring relationship between pixels;
根据所述连通区域的像素分布,获得所述连通区域的重心。According to the pixel distribution of the connected area, the center of gravity of the connected area is obtained.
可选地,所述将工业相机拍摄的采样图像进行预处理的步骤,包括:Optionally, the step of preprocessing the sampled image taken by the industrial camera includes:
将所述采样图像进行裁剪;Crop the sampled image;
基于预设的单色通道将裁剪后的所述采样图像处理为二值化图像,并对所述二值化图像去噪,获得预处理后的采样图像。The cropped sampled image is processed into a binarized image based on a preset monochrome channel, and the binarized image is denoised to obtain a preprocessed sampled image.
根据本发明的第二方面,还提供了一种投影仪振镜测试目标图的提取装置,包括:According to the second aspect of the present invention, there is also provided a device for extracting a test target image of a projector galvanometer, including:
图像获取模块,用于将工业相机拍摄的采样图像进行预处理,获取预处理后的所述采样图像中的连通区域及所述连通区域的重心;The image acquisition module is used to preprocess the sampled image taken by the industrial camera, and acquire the connected area and the center of gravity of the connected area in the preprocessed sampled image;
起始位置获取模块,用于从所述连通区域的重心中选取符合预设位置关系的多个重心,根据所述多个重心的位置信息确定所述目标图的起始位置;A starting position acquiring module, configured to select multiple centers of gravity that conform to a preset position relationship from the centers of gravity of the connected regions, and determine the starting position of the target image according to the position information of the multiple centers of gravity;
轮廓尺寸获取模块,用于根据标准振镜单元图的尺寸信息以及所述多个重心的尺寸信息,获得所述目标图的轮廓尺寸;An outline size obtaining module, configured to obtain the outline size of the target image according to the size information of the standard galvanometer unit image and the size information of the multiple centers of gravity;
目标图获取模块,用于根据所述目标图的起始位置和所述目标图的轮廓尺寸,获得所述目标图。The target image acquisition module is configured to obtain the target image according to the starting position of the target image and the outline size of the target image.
根据本发明的第三方面,还提供了一种电子设备,包括:存储器和处理器,所述存储器用于存储指令,所述指令用于控制所述处理器进行操作以执行根据本发明第一方面所述的方法。According to a third aspect of the present invention, there is also provided an electronic device, including: a memory and a processor, the memory is used to store instructions, and the instructions are used to control the processor to operate to perform the first step according to the present invention. The method described in the aspect.
根据本发明的第四方面,还提供了一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序在被处理器执行时实现根据本发明第一方面所述的方法。According to the fourth aspect of the present invention, there is also provided a computer-readable storage medium on which a computer program is stored, and the computer program, when executed by a processor, implements the method according to the first aspect of the present invention.
本发明实施例提供的投影仪振镜测中目标图的提取方法,实现了测试单元图像的自动提取,并且提高了提取工作的准确性。The method for extracting the target image in the galvanometer measurement of the projector provided by the embodiment of the present invention realizes the automatic extraction of the image of the test unit and improves the accuracy of the extraction work.
通过以下参照附图对本发明的示例性实施例的详细描述,本发明的其它特征及其优点将会变得清楚。Through the following detailed description of exemplary embodiments of the present invention with reference to the accompanying drawings, other features and advantages of the present invention will become clear.
附图说明Description of the drawings
被结合在说明书中并构成说明书的一部分的附图示出了本发明的实施例,并且连同其说明一起用于解释本发明的原理。The drawings incorporated in the specification and constituting a part of the specification illustrate the embodiments of the present invention, and together with the description are used to explain the principle of the present invention.
图1是可用于实现本发明任意实施例的投影仪振镜测试中目标图提取方法的电子设备的硬件配置的框图。FIG. 1 is a block diagram of the hardware configuration of an electronic device that can be used to implement a method for extracting a target image in a galvanometer test of a projector according to any embodiment of the present invention.
图2是根据本发明一个实施例的投影仪振镜测试中目标图提取方法的处理流程图。Fig. 2 is a processing flowchart of a method for extracting a target image in a galvanometer test of a projector according to an embodiment of the present invention.
图3示出了投影仪投影图像的示意图。Fig. 3 shows a schematic diagram of an image projected by a projector.
图4是本例子中进行采样图形裁剪的示意图。Figure 4 is a schematic diagram of sampled graphics cropping in this example.
图5是本例子中的二值化图像的示意图。Fig. 5 is a schematic diagram of the binarized image in this example.
图6是本例子中确定目标图起始位置的示意图。Figure 6 is a schematic diagram of determining the starting position of the target image in this example.
图7是本例子中的标准振镜单元图的示意图。Fig. 7 is a schematic diagram of a standard galvanometer unit diagram in this example.
图8是本例子中的参考边的示意图。Fig. 8 is a schematic diagram of the reference edge in this example.
图9是本例子中获取的目标图的示意图。Fig. 9 is a schematic diagram of the target map obtained in this example.
图10是根据本发明实施例的投影仪振镜测试中目标图提取装置的示意图。Fig. 10 is a schematic diagram of a device for extracting a target image in a galvanometer test of a projector according to an embodiment of the present invention.
图11是根据本发明实施例的电子设备的示意图。Fig. 11 is a schematic diagram of an electronic device according to an embodiment of the present invention.
具体实施方式detailed description
现在将参照附图来详细描述本发明的各种示例性实施例。应注意到:除非另外具体说明,否则在这些实施例中阐述的部件和步骤的相对布置、数字表达式和数值不限制本发明的范围。Various exemplary embodiments of the present invention will now be described in detail with reference to the accompanying drawings. It should be noted that unless specifically stated otherwise, the relative arrangement of components and steps, numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present invention.
以下对至少一个示例性实施例的描述实际上仅仅是说明性的,决不作为对本发明及其应用或使用的任何限制。The following description of at least one exemplary embodiment is actually only illustrative, and in no way serves as any limitation to the present invention and its application or use.
对于相关领域普通技术人员已知的技术、方法和设备可能不作详细讨论,但在适当情况下,技术、方法和设备应当被视为说明书的一部分。The techniques, methods, and equipment known to those of ordinary skill in the relevant fields may not be discussed in detail, but where appropriate, the techniques, methods, and equipment should be regarded as part of the specification.
在这里示出和讨论的所有例子中,任何具体值应被解释为仅仅是示例性的,而不是作为限制。因此,示例性实施例的其它例子可以具有不同的值。In all examples shown and discussed herein, any specific value should be interpreted as merely exemplary, rather than as a limitation. Therefore, other examples of the exemplary embodiment may have different values.
应注意到:相似的标号和字母在下面的附图中表示类似项,因此,一旦某一项在一个附图中被定义,则在随后的附图中不需要对其进行进一步讨论。It should be noted that similar reference numerals and letters indicate similar items in the following drawings, and therefore, once an item is defined in one drawing, it does not need to be further discussed in subsequent drawings.
<硬件配置><Hardware Configuration>
图1是可用于实现本发明任意实施例的投影仪振镜测试目标图的提取方法的电子设备的硬件配置的框图。FIG. 1 is a block diagram of the hardware configuration of an electronic device that can be used to implement a method for extracting a test target image of a projector galvanometer according to any embodiment of the present invention.
电子设备1000可以是手机、便携式电脑、平板电脑、掌上电脑等等电子设备。The electronic device 1000 may be an electronic device such as a mobile phone, a portable computer, a tablet computer, and a palmtop computer.
电子设备1000可以包括处理器1100、存储器1200、接口装置1300、通信装置1400、显示装置1500、输入装置1600、扬声器1700、麦克风1800,等等。其中,处理器1100可以是中央处理器CPU、微处理器MCU等。存储器1200例如包括ROM(只读存储器)、RAM(随机存取存储器)、诸如硬盘的非易失性存储器等。接口装置1300例如包括USB接口、耳机接口等。通信装置1400例如能够进行有线或无线通信。显示装置1500例如是液晶显示屏、触摸显示屏等。输入装置1600例如可以包括触摸屏、键盘等。用户可以通过扬声器1700和麦克风1800输入/输出语音信息。The electronic device 1000 may include a processor 1100, a memory 1200, an interface device 1300, a communication device 1400, a display device 1500, an input device 1600, a speaker 1700, a microphone 1800, and so on. Wherein, the processor 1100 may be a central processing unit (CPU), a microprocessor MCU, or the like. The memory 1200 includes, for example, ROM (Read Only Memory), RAM (Random Access Memory), nonvolatile memory such as a hard disk, and the like. The interface device 1300 includes, for example, a USB interface, a headphone interface, and the like. The communication device 1400 can perform wired or wireless communication, for example. The display device 1500 is, for example, a liquid crystal display, a touch display, or the like. The input device 1600 may include, for example, a touch screen, a keyboard, and the like. The user can input/output voice information through the speaker 1700 and the microphone 1800.
尽管在图1中对电子设备1000均示出了多个装置,但是,本发明可以仅涉及其中的部分装置,例如,电子设备1000只涉及存储器1200和处理器1100。Although multiple devices are shown for the electronic device 1000 in FIG. 1, the present invention may only involve some of the devices. For example, the electronic device 1000 only involves the memory 1200 and the processor 1100.
应用于本发明的实施例中,电子设备1000的存储器1200用于存储指令,指令用于控制处理器1100执行本发明实施例提供的投影仪振镜测试目标图的提取方法。In the embodiment of the present invention, the memory 1200 of the electronic device 1000 is used to store instructions, and the instructions are used to control the processor 1100 to execute the method for extracting the test target image of the projector galvanometer provided by the embodiment of the present invention.
在上述描述中,技术人员可以根据本发明所公开方案设计指令。指令 如何控制处理器进行操作,这是本领域公知,故在此不再详细描述。In the above description, technical personnel can design instructions according to the disclosed scheme of the present invention. How the instruction controls the processor to operate is well known in the art, so it will not be described in detail here.
<方法实施例><Method Example>
图2是根据本发明一个实施例的投影仪振镜测试目标图的提取方法的处理流程图。该投影仪振镜测试目标图的提取方法是由电子设备实施的。Fig. 2 is a processing flowchart of a method for extracting a test target image of a projector galvanometer according to an embodiment of the present invention. The method for extracting the test target image of the projector galvanometer is implemented by electronic equipment.
根据图2所示,该投影仪振镜测试目标图的提取方法可以包括以下步骤S2100-S2400。According to FIG. 2, the method for extracting the test target image of the projector galvanometer may include the following steps S2100-S2400.
步骤S2100,将工业相机拍摄的采样图像进行预处理,获取预处理后的采样图像中的连通区域及连通区域的重心。Step S2100: Preprocess the sampled image taken by the industrial camera, and obtain the connected area and the center of gravity of the connected area in the preprocessed sampled image.
图3示出了投影仪投影图像的示意图。Fig. 3 shows a schematic diagram of an image projected by a projector.
根据图3所示,投影仪将图像投影到投影幕布ABCD上,投影图像区域为A1B1C1D1,投影仪镜头与投影幕布所在平面平行。According to Figure 3, the projector projects an image on the projection screen ABCD, the projected image area is A1B1C1D1, and the projector lens is parallel to the plane where the projection screen is located.
工业相机安装在工装治具中,用于拍摄投影仪投影到投影幕布上的投影图像。工业相机的光学部件的光轴与投影幕布所在平面相互垂直。The industrial camera is installed in the fixture and used to shoot the projected image projected by the projector onto the projection screen. The optical axis of the optical components of the industrial camera is perpendicular to the plane where the projection screen is located.
电子设备用于控制工业相机拍照,并获取工业相机采集的投影图像以进行处理。电子设备还用于控制投影仪的振镜开启固定振动模式。The electronic equipment is used to control the industrial camera to take pictures and obtain the projected images collected by the industrial camera for processing. The electronic device is also used to control the galvanometer of the projector to turn on the fixed vibration mode.
利用工业相机对投影仪投影的图像进行拍摄,得到采样图像。An industrial camera is used to shoot the image projected by the projector to obtain a sampled image.
在本发明的一个实施例中,将工业相机拍摄的采样图像进行预处理,包括以下步骤S2110-S2120:In an embodiment of the present invention, preprocessing the sampled images taken by the industrial camera includes the following steps S2110-S2120:
步骤S2110,将采样图像进行裁剪。In step S2110, the sampled image is cropped.
例如,原采样图像的短边为边长对原采样图像进行中心裁剪,裁剪结果为一正方形。通过裁剪,可以在不影响最终结果的前提下减小后续图像处理的运算量,提升处理速度。For example, if the short side of the original sampled image is the length of the side, the center of the original sampled image is cropped, and the cropping result is a square. Through cropping, the amount of subsequent image processing operations can be reduced without affecting the final result, and the processing speed can be improved.
步骤S2120,基于预设的单色通道将裁剪后的采样图像处理为二值化图像,并对二值化图像去噪,获得预处理后的采样图像。Step S2120: Process the cropped sampled image into a binarized image based on the preset monochrome channel, and denoise the binarized image to obtain a preprocessed sampled image.
在进行二值化处理时,可以基于预设的单色通道的亮度值,将预设的单色通道的亮度值超过预设亮度阈值的像素点的灰度值设为255,将预设的单色通道的亮度值未超过预设亮度阈值的像素点的灰度值设为0,得到二值化图像。During the binarization process, based on the brightness value of the preset monochrome channel, the gray value of the pixel whose brightness value of the preset monochrome channel exceeds the preset brightness threshold can be set to 255, and the preset brightness value can be set to 255. The gray value of the pixel whose brightness value of the monochrome channel does not exceed the preset brightness threshold is set to 0 to obtain a binary image.
在去噪时,可以从预设单色通道的亮度值超过预设亮度阈值的像素点中,去除红色通道的亮度值超过预设红色亮度阈值、绿色通道的亮度值超过预设绿色亮度阈值且蓝色通道的亮度值超过预设蓝色亮度阈值的像素点。这样可以消除白色像素点的干扰。还可以在后续获取连通区域时,统计各连通域中灰度值为255的像素点的数量,筛选得到灰度值为255的像素点的数量超过预设数量的连通域,以避免噪点的影响。When denoising, you can remove pixels whose brightness value of the preset monochrome channel exceeds the preset brightness threshold. The brightness value of the red channel exceeds the preset red brightness threshold, and the brightness value of the green channel exceeds the preset green brightness threshold. The pixel whose brightness value of the blue channel exceeds the preset blue brightness threshold. This can eliminate the interference of white pixels. It is also possible to count the number of pixels with a gray value of 255 in each connected area when obtaining connected areas later, and filter out the number of pixels with a gray value of 255 that exceeds the preset number of connected areas to avoid the influence of noise .
将工业相机拍摄的采样图像进行预处理后,获取预处理后的采样图像中的连通区域及连通区域的重心。After preprocessing the sampled image taken by the industrial camera, the connected area and the center of gravity of the connected area in the preprocessed sampled image are obtained.
本实施例中,采样图像中的连通区域对应于单元振动图像中的子单元。在二值化图像中,由灰度值为255的像素点形成连通区域。In this embodiment, the connected regions in the sampled image correspond to the sub-units in the unit vibration image. In the binarized image, the connected area is formed by pixels with a gray value of 255.
本实施例中,获取采样图像中的连通区域包括:In this embodiment, acquiring the connected regions in the sampled image includes:
根据预处理后的采样图像中每一像素的像素值和像素之间的相邻关系,获得连通区域。According to the pixel value of each pixel in the sampled image after preprocessing and the neighboring relationship between the pixels, the connected area is obtained.
例如,从采样图像中选取灰度值均为255并且彼此相邻的一组像素点,这些像素点的集合即构成了一个连通区域。For example, a group of pixels with gray values of 255 and adjacent to each other is selected from the sampled image, and the set of these pixels constitutes a connected area.
本实施例中,获取连通区域的重心包括:In this embodiment, obtaining the center of gravity of the connected region includes:
根据连通区域的像素分布,获得连通区域的重心。According to the pixel distribution of the connected area, the center of gravity of the connected area is obtained.
例如,先获取连通区域中每一像素的中心位置坐标,再计算连通区域中所有像素的中心位置坐标的平均值,该平均值即为连通区域的重心坐标。For example, first obtain the center position coordinates of each pixel in the connected area, and then calculate the average value of the center position coordinates of all pixels in the connected area, and the average value is the center of gravity coordinates of the connected area.
步骤S2200,从连通区域的重心中选取符合预设位置关系的多个重心,根据多个重心的位置信息确定目标图的起始位置。Step S2200: Select multiple centers of gravity that conform to a preset position relationship from the centers of gravity of the connected regions, and determine the starting position of the target image according to the position information of the multiple centers of gravity.
在一个例子中,选取的重心数目为四个。从连通区域的重心中选取符合预设位置关系的多个重心的步骤,包括以下步骤S2210-S2220:In one example, the number of selected centers of gravity is four. The step of selecting multiple centers of gravity conforming to the preset position relationship from the centers of gravity of the connected regions includes the following steps S2210-S2220:
步骤S2210,从连通区域的重心中初步选取四个重心,获取以四个重心为顶点的四边形的重心,作为四个重心的中心。Step S2210: Preliminarily select four centers of gravity from the centers of gravity of the connected regions, and obtain the centers of gravity of a quadrilateral with the four centers of gravity as vertices as the centers of the four centers of gravity.
初步选取四个重心时,可以先从连通区域的重心中初步选取一个重心,再从该重心的预设距离范围内选取其他三个重心,得到四个重心。When initially selecting four centers of gravity, you can first select a center of gravity from the center of gravity of the connected area, and then select the other three centers of gravity within the preset distance range of the center of gravity to obtain four centers of gravity.
以初步选取的四个重心为顶点可得到一个四边形。计算该四边形的重心,即为四个重心的中心。A quadrilateral can be obtained by taking the four initially selected centers of gravity as vertices. Calculate the center of gravity of the quadrilateral, which is the center of the four centers of gravity.
容易理解,选取的四个重心需不共线。It is easy to understand that the selected four centers of gravity need not be collinear.
容易理解,四个重心的中心坐标,等于四个重心的坐标的平均值。It is easy to understand that the center coordinates of the four centers of gravity are equal to the average of the coordinates of the four centers of gravity.
步骤S2220,在四个重心到中心的距离差异的小于预设阈值的情况下,将四个重心作为符合预设位置关系的多个重心。In step S2220, in the case where the distance difference between the four centers of gravity to the center is less than a preset threshold, the four centers of gravity are used as multiple centers of gravity that conform to the preset positional relationship.
获取四个重心各自到中心的距离,这些距离中的最大值和最小值的差值小于预设阈值,即为四个重心到中心的距离差异的小于预设阈值。Obtain the distances from each of the four centers of gravity to the center, and the difference between the maximum value and the minimum value of these distances is less than the preset threshold, that is, the difference between the four centers of gravity to the center is less than the preset threshold.
相应地,根据多个重心的位置信息确定目标图的起始位置的步骤,包括:将四个重心的中心作为目标图的起始位置。Correspondingly, the step of determining the starting position of the target image according to the position information of the multiple centers of gravity includes: taking the centers of the four centers of gravity as the starting position of the target image.
四个重心的中心对应于目标图的一个顶点,可以作为确定目标图的起始位置。The center of the four centers of gravity corresponds to a vertex of the target graph, and can be used as the starting position for determining the target graph.
需要说明的是,上面的例子中选取的重心数目为四个。在重心数目为其他数目,例如为三个、五个等数目的情况下,本领域技术人员也可以根据这些重心的排布与目标图的匹配关系,获取目标图的起始位置。It should be noted that the number of centers of gravity selected in the above example is four. When the number of centers of gravity is other numbers, such as three, five, etc., those skilled in the art can also obtain the starting position of the target image according to the matching relationship between the arrangement of these centers of gravity and the target image.
步骤S2300,根据标准振镜单元图的尺寸信息以及多个重心的尺寸信息,获得目标图的轮廓尺寸。In step S2300, the outline size of the target image is obtained according to the size information of the standard galvanometer unit image and the size information of multiple centers of gravity.
标准振镜单元图反映了理想振动情况,其中包括了一组单元振动图像,并且该图中的尺寸信息都是已知量。其中,一组单元振动图像包括多个子单元。The standard galvanometer unit graph reflects the ideal vibration situation, which includes a group of unit vibration images, and the size information in the graph is known. Among them, a group of unit vibration images includes multiple subunits.
在一个例子中,根据标准振镜单元图的尺寸信息以及多个重心的尺寸信息,获得目标图的轮廓尺寸的步骤,包括以下步骤S2310-2320:In an example, the step of obtaining the outline size of the target image according to the size information of the standard galvanometer unit image and the size information of multiple centers of gravity includes the following steps S2310-2320:
步骤S2310,根据标准振镜单元图中的参考尺寸,以及多个重心确定的对应尺寸,获取用于进行尺寸转换的比例系数。Step S2310, according to the reference size in the standard galvanometer unit diagram and the corresponding sizes determined by multiple centers of gravity, a scale factor for size conversion is obtained.
例如,参考尺寸为标准振镜单元图中某一顶点到最近的子单元的重心的距离,对应尺寸为多个重心中的某一重心到多个重心的中心的距离,其中多个重心的中心是以多个重心为顶点的多边形的重心。根据参考尺寸和对应尺寸的比值,可以确定用于进行尺寸转换的比例系数For example, the reference size is the distance from a vertex of the standard galvanometer unit to the center of gravity of the nearest subunit, and the corresponding size is the distance from a certain center of gravity to the center of multiple centers of gravity. It is the center of gravity of a polygon with multiple centers of gravity as vertices. According to the ratio of the reference size to the corresponding size, the scale factor used for size conversion can be determined
步骤S2320,根据标准振镜单元中的轮廓尺寸和比例系数,获得目标图的轮廓尺寸。In step S2320, the contour size of the target image is obtained according to the contour size and the scale factor in the standard galvanometer unit.
例如,将参考尺寸和对应尺寸的比值与标准振镜单元中的轮廓尺寸相 乘,得到的乘积即为标准振镜单元图标图的轮廓尺寸。For example, multiply the ratio of the reference size and the corresponding size with the outline size of the standard galvanometer unit, and the product obtained is the outline size of the icon diagram of the standard galvanometer unit.
步骤S2400,根据目标图的起始位置和目标图的轮廓尺寸,获得目标图。In step S2400, the target image is obtained according to the starting position of the target image and the outline size of the target image.
例如,从预处理后的采样图像中,以上述起始位置为起点,按照上述轮廓尺寸进行裁剪,得到的图像即为目标图。For example, from the preprocessed sampled image, take the above-mentioned starting position as a starting point and perform cropping according to the above-mentioned outline size, and the obtained image is the target image.
提取到目标图后,基于该目标图可提取子单元图像,分别计算每个子单元图像在振镜振动前后的倾斜角度差,根据倾斜角度差确定振镜的工作状态。After the target image is extracted, the sub-unit images can be extracted based on the target image, the tilt angle difference of each sub-unit image before and after the vibration of the galvanometer is calculated, and the working state of the galvanometer is determined according to the tilt angle difference.
本发明实施例提供的投影仪振镜测中目标图的提取方法,实现了目标图的自动提取,并且提高了提取工作的准确性。The method for extracting the target image in the galvanometer measurement of the projector provided by the embodiment of the present invention realizes the automatic extraction of the target image and improves the accuracy of the extraction work.
<例子><Example>
以下提供一个影仪振镜测中目标图的提取方法实施的具体例子。The following provides a specific example of the implementation of the method for extracting the target image in the galvanometer measurement.
如图4所示,图4左侧是利用工业相机拍摄投影图像得到的采样图像。对该采样图像进行裁剪,得到以该采样图像的短边为边长、以该采样图像的中心为中心的正方形,如图4右侧所示。As shown in Figure 4, the left side of Figure 4 is a sampled image obtained by shooting a projected image with an industrial camera. The sampled image is cropped to obtain a square with the short side of the sampled image as the side length and the center of the sampled image as the center, as shown on the right side of FIG. 4.
基于绿色通道的亮度值,将绿色通道的亮度值超过预设亮度阈值的像素点的灰度值设为255,将绿色通道的亮度值未超过预设亮度阈值的像素点的灰度值设为0,并且从绿色通道的亮度值超过预设亮度阈值的像素点中,去除红色通道的亮度值超过预设红色亮度阈值且蓝色通道的亮度值超过预设蓝色亮度阈值的像素点消除白色像素点的干扰。得到如图5所示的二值化图像(图5选取了二值化图像的部分区域进行放大显示)。Based on the brightness value of the green channel, set the gray value of the pixel whose brightness value of the green channel exceeds the preset brightness threshold to 255, and set the gray value of the pixel whose brightness value does not exceed the preset brightness threshold. 0, and remove the pixels whose brightness value of the red channel exceeds the preset red brightness threshold and the brightness value of the blue channel exceeds the preset blue brightness threshold from the pixels whose brightness value of the green channel exceeds the preset brightness threshold to eliminate white Pixel interference. Obtain the binarized image as shown in FIG. 5 (in FIG. 5, a part of the binarized image is selected for magnified display).
在图5所示的二值化图像的基础上,选取灰度值为255并且具有相邻关系的像素点组成连通区域,得到图5所示的多个白色连通区域。对每一白色连通区域,计算该连通区域内所有像素点的坐标的平均值,得到该连通区域的重心坐标。由此获得的连通区域重心如图5中的A点、B点、C点……所示。On the basis of the binarized image shown in FIG. 5, pixels with a gray value of 255 and adjacent relationships are selected to form connected areas, and multiple white connected areas shown in FIG. 5 are obtained. For each white connected area, calculate the average value of the coordinates of all pixels in the connected area to obtain the barycentric coordinates of the connected area. The center of gravity of the connected region thus obtained is shown as point A, point B, point C... in Figure 5.
基于获取到的连通区域的重心,选取符合预设位置条件的四个重心。以图5中二值化图像的左上角为远点建立坐标系,按照到原点距离由近到 远的顺序初步选取一个重心,例如选取重心A。再基于A点的位置,从A点的预设距离范围内选取其他三个重心,例如选取重心B、C、D,由此便初步选取了四个重心。通过该预设距离范围,可以排除与A距离较远的重心,例如重心E、F、G,从而降低运算量。Based on the obtained center of gravity of the connected region, four centers of gravity that meet the preset location conditions are selected. Take the upper left corner of the binarized image in Fig. 5 as the far point to establish a coordinate system, and initially select a center of gravity in the order of the distance from the origin to the farthest point, for example, the center of gravity A is selected. Based on the position of point A, the other three centers of gravity are selected from the preset distance range of point A, for example, the centers of gravity B, C, and D are selected, and the four centers of gravity are initially selected. Through the preset distance range, the center of gravity that is far away from A can be excluded, such as the center of gravity E, F, and G, thereby reducing the amount of calculation.
验证初步选取的重心A、B、C、D是否满足预设的位置关系。计算重心A、B、C、D坐标的平均值,该平均值即为重心A、B、C、D的中心坐标,由此得到重心A、B、C、D的中心如图6中O点所示。获取OA、OB、OC、OD的长度,假设上述长度数值最大的为OA,最小的为OD,计算OA和OD的差值,记为diff=OA-OD。如果diff<5(像素),则认为重心A、B、C、D满足预设的位置关系,可进行后续计算。如果diff≥5(像素),则重心A、B、C、D不满足预设的位置关系,这种情况下抛弃本轮选取的A、B、C、D点,并按照到远点距离由近到远的顺序继续选择一个重心,例如选择重心E,并按照上述方式继续选取和验证。Verify that the initially selected centers of gravity A, B, C, and D meet the preset positional relationship. Calculate the average value of the coordinates of the center of gravity A, B, C, and D. The average value is the center coordinates of the center of gravity A, B, C, and D. From this, the center of the center of gravity A, B, C, and D is obtained as point O in Figure 6 Shown. Obtain the lengths of OA, OB, OC, and OD. Assuming that the largest value of the above-mentioned length is OA, and the smallest is OD, calculate the difference between OA and OD, and record it as diff=OA-OD. If diff<5 (pixels), it is considered that the center of gravity A, B, C, and D meet the preset positional relationship, and subsequent calculations can be performed. If diff ≥ 5 (pixels), the center of gravity A, B, C, and D do not meet the preset positional relationship. In this case, discard the points A, B, C, and D selected in this round, and follow the distance to the far point. Continue to select a center of gravity in the order of near to far, for example, select center of gravity E, and continue to select and verify in the above-mentioned manner.
在重心A、B、C、D满足预设位置关系的情况下,将A、B、C、D的重心O作为目标图的起始位置。When the center of gravity A, B, C, and D meet the preset positional relationship, the center of gravity O of A, B, C, and D is taken as the starting position of the target map.
图7示出了本例中使用的标准振镜单元图。可以看出,该标准振镜单元中包括了由黑色区域表示的四个子单元,并且该图中的尺寸信息都是已知的,例如该标准振镜单元图边长为32像素。Figure 7 shows a diagram of the standard galvanometer unit used in this example. It can be seen that the standard galvanometer unit includes four sub-units represented by black areas, and the size information in the figure is known, for example, the side length of the standard galvanometer unit is 32 pixels.
图8示出了本例中标准振镜单元图中的参考边O’A’。其中,O’是标准振镜单元图中的一个顶点,A’是与该顶点距离最近的子单元的重心。容易理解,O’A’的长度为
Figure PCTCN2019129219-appb-000001
相应地,二值化图像中的对应边为OA。OA的长度可以从二值化图像中量取。由此可以计算用于尺寸转换的比例系数C=OA/O’A’。
Figure 8 shows the reference edge O'A' in the standard galvanometer unit diagram in this example. Among them, O'is a vertex in the standard galvanometer unit graph, and A'is the center of gravity of the subunit closest to the vertex. It is easy to understand, the length of O'A' is
Figure PCTCN2019129219-appb-000001
Correspondingly, the corresponding edge in the binarized image is OA. The length of OA can be measured from the binarized image. From this, the scale factor C=OA/O'A' for size conversion can be calculated.
根据比例系数C和标准振镜单元图的轮廓尺寸32,可计算出目标图的轮廓尺寸w=32*C。According to the scale factor C and the contour size 32 of the standard galvanometer unit graph, the contour size w=32*C of the target graph can be calculated.
根据目标图的起始位置O和目标图的轮廓尺寸w对二值化图像进行裁剪,即可得到目标图,该目标图为图9中虚线框内的区域。The binarized image is cropped according to the starting position O of the target image and the outline size w of the target image to obtain the target image, which is the area within the dashed box in FIG. 9.
<装置实施例><Device Example>
图10为根据本发明实施例的投影仪振镜测中目标图的提取装置的框图。Fig. 10 is a block diagram of a device for extracting a target image in a galvanometer measurement of a projector according to an embodiment of the present invention.
如图10所示,该投影仪振镜测试目标图的提取装置100,包括图像获取模块101、起始位置获取模块102、轮廓尺寸获取模块103和目标图获取模块104。As shown in FIG. 10, the device 100 for extracting the target image of the projector galvanometer test includes an image acquisition module 101, a starting position acquisition module 102, an outline size acquisition module 103 and a target image acquisition module 104.
图像获取模块101用于将工业相机拍摄的采样图像进行预处理,获取预处理后的采样图像中的连通区域及连通区域的重心。The image acquisition module 101 is used to preprocess the sampled image taken by the industrial camera, and acquire the connected area and the center of gravity of the connected area in the preprocessed sampled image.
起始位置获取模块102用于从连通区域的重心中选取符合预设位置关系的多个重心,根据多个重心的位置信息确定目标图的起始位置;The starting position acquiring module 102 is configured to select multiple centers of gravity that conform to a preset position relationship from the centers of gravity of the connected regions, and determine the starting position of the target image according to the position information of the multiple centers of gravity;
轮廓尺寸获取模块103用于根据标准振镜单元图的尺寸信息以及多个重心的尺寸信息,获得目标图的轮廓尺寸;The outline size obtaining module 103 is configured to obtain the outline size of the target image according to the size information of the standard galvanometer unit image and the size information of multiple centers of gravity;
目标图获取模块104用于根据目标图的起始位置和目标图的轮廓尺寸,获得目标图。The target image acquisition module 104 is configured to obtain the target image according to the starting position of the target image and the outline size of the target image.
在一个实施例中,起始位置获取模块102在执行从连通区域的重心中选取符合预设位置关系的多个重心的步骤时,还用于:从连通区域的重心中初步选取四个重心,获取以四个重心为顶点的四边形的重心,作为四个重心的中心;在四个重心到中心的距离差异的小于预设阈值的情况下,将四个重心作为符合预设位置关系的多个重心。起始位置获取模块102在执行多个重心的位置信息确定目标图的起始位置的步骤时,还用于将四个重心的中心作为目标图的起始位置。In one embodiment, when the starting position acquisition module 102 executes the step of selecting multiple centers of gravity that conform to the preset position relationship from the centers of gravity of the connected regions, it is also used to: initially select four centers of gravity from the centers of gravity of the connected regions, Obtain the center of gravity of the quadrilateral with the four centers of gravity as the vertices, as the centers of the four centers of gravity; when the distance difference between the four centers of gravity to the center is less than the preset threshold, the four centers of gravity are regarded as multiples that conform to the preset position relationship Center of gravity. The starting position acquiring module 102 is also used to use the centers of the four centers of gravity as the starting position of the target image when performing the step of determining the starting position of the target image by the position information of the multiple centers of gravity.
在一个实施例中,轮廓尺寸获取模块103在执行根据标准振镜单元图的尺寸信息以及多个重心的尺寸信息,获得目标图的轮廓尺寸的步骤时,还用于:根据标准振镜单元图中的参考尺寸以及多个重心确定的对应尺寸,获取用于进行尺寸转换的比例系数;根据标准振镜单元中的轮廓尺寸和比例系数,获得目标图的轮廓尺寸。In one embodiment, the contour size obtaining module 103 is also used to: according to the standard galvanometer unit diagram size information and multiple center of gravity size information to obtain the contour size of the target image The reference size and the corresponding sizes determined by the multiple centers of gravity are used to obtain the scale factor for size conversion; the outline size of the target image is obtained according to the outline size and the scale factor in the standard galvanometer unit.
在一个实施例中,起始位置获取模块102在执行从连通区域的重心中初步选取四个重心步骤时,还用于:先从连通区域的重心中初步选取一个重心,再从重心的预设距离范围内选取其他三个重心,得到四个重心。In one embodiment, when the starting position acquisition module 102 performs the four steps of preliminarily selecting the center of gravity from the center of gravity of the connected area, it is also used to: first select a center of gravity from the center of gravity of the connected area, and then start from the preset of the center of gravity. Choose the other three centers of gravity within the distance range to get four centers of gravity.
在一个实施例中,参考尺寸为标准振镜单元图中某一顶点到最近的子 单元的重心的距离,对应尺寸为多个重心中的某一重心到多个重心的中心的距离,其中多个重心的中心是以多个重心为顶点的多边形的重心。In one embodiment, the reference size is the distance from a vertex of the standard galvanometer unit graph to the center of gravity of the nearest subunit, and the corresponding size is the distance from a center of gravity to the center of the multiple centers of gravity. The center of each center of gravity is the center of gravity of a polygon with multiple centers of gravity as vertices.
在一个实施例中,图像获取模块101在执行获取预处理后的采样图像中的连通区域及连通区域的重心的步骤时,还用于:根据预处理后的采样图像中每一像素的像素值和像素之间的相邻关系,获得连通区域;根据连通区域的像素分布,获得连通区域的重心。In one embodiment, when the image acquisition module 101 executes the step of acquiring the connected region and the center of gravity of the connected region in the preprocessed sampled image, it is also used to: according to the pixel value of each pixel in the preprocessed sampled image The connected area is obtained by the adjacent relationship between the pixel and the pixel; and the center of gravity of the connected area is obtained according to the pixel distribution of the connected area.
在一个实施例中,图像获取模块101在执行将工业相机拍摄的采样图像进行预处理的步骤时,还用于:将采样图像进行裁剪;基于预设的单色通道将裁剪后的采样图像处理为二值化图像,并对二值化图像去噪,获得预处理后的采样图像。In one embodiment, when the image acquisition module 101 performs the step of preprocessing the sampled image taken by the industrial camera, it is also used to: crop the sampled image; process the cropped sampled image based on the preset monochrome channel It is a binarized image, and the binarized image is denoised to obtain a preprocessed sampled image.
<电子设备实施例><Embodiment of Electronic Equipment>
在一个实施例中,电子设备可以包括根据本发明任意实施例的投影仪振镜测中目标图的提取装置100,用于实施本发明任意实施例的投影仪振镜测中目标图的提取方法。In one embodiment, the electronic device may include the device 100 for extracting the target image in the galvanometer measurement of the projector according to any embodiment of the present invention, which is used to implement the method for extracting the target image in the galvanometer measurement of the projector according to any embodiment of the present invention. .
在另一个实施例中,根据图11所示电子设备110可以包括处理器112和存储器111。该存储器111用于存储可执行的指令,该处理器120用于根据指令的控制运行电子设备110执行根据本发明任意实施例的投影仪振镜测中目标图的提取方法。In another embodiment, the electronic device 110 shown in FIG. 11 may include a processor 112 and a memory 111. The memory 111 is used for storing executable instructions, and the processor 120 is used for operating the electronic device 110 according to the control of the instructions to execute the method for extracting the target image in the galvanometer measurement of the projector according to any embodiment of the present invention.
<计算机可读存储介质><Computer readable storage medium>
在本实施例中,还提供一种计算机可读存储介质,其上存储有计算机程序,计算机程序在被处理器执行时实现如本发明任意实施例的投影仪振镜测中目标图的提取方法。In this embodiment, a computer-readable storage medium is also provided, on which a computer program is stored. When the computer program is executed by the processor, the method for extracting the target image in the galvanometer measurement of the projector as in any embodiment of the present invention is realized. .
本发明可以是系统、方法和/或计算机程序产品。计算机程序产品可以包括计算机可读存储介质,其上载有用于使处理器实现本发明的各个方面的计算机可读程序指令。The present invention may be a system, a method and/or a computer program product. The computer program product may include a computer-readable storage medium loaded with computer-readable program instructions for enabling a processor to implement various aspects of the present invention.
计算机可读存储介质可以是可以保持和存储由指令执行设备使用的 指令的有形设备。计算机可读存储介质例如可以是――但不限于――电存储设备、磁存储设备、光存储设备、电磁存储设备、半导体存储设备或者上述的任意合适的组合。计算机可读存储介质的更具体的例子(非穷举的列表)包括:便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、静态随机存取存储器(SRAM)、便携式压缩盘只读存储器(CD-ROM)、数字多功能盘(DVD)、记忆棒、软盘、机械编码设备、例如其上存储有指令的打孔卡或凹槽内凸起结构、以及上述的任意合适的组合。这里所使用的计算机可读存储介质不被解释为瞬时信号本身,诸如无线电波或者其他自由传播的电磁波、通过波导或其他传输媒介传播的电磁波(例如,通过光纤电缆的光脉冲)、或者通过电线传输的电信号。The computer-readable storage medium may be a tangible device that can hold and store instructions used by the instruction execution device. The computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples (non-exhaustive list) of computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM) Or flash memory), static random access memory (SRAM), portable compact disk read-only memory (CD-ROM), digital versatile disk (DVD), memory stick, floppy disk, mechanical encoding device, such as a printer with instructions stored thereon The protruding structure in the hole card or the groove, and any suitable combination of the above. The computer-readable storage medium used here is not interpreted as the instantaneous signal itself, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (for example, light pulses through fiber optic cables), or through wires Transmission of electrical signals.
这里所描述的计算机可读程序指令可以从计算机可读存储介质下载到各个计算/处理设备,或者通过网络、例如因特网、局域网、广域网和/或无线网下载到外部计算机或外部存储设备。网络可以包括铜传输电缆、光纤传输、无线传输、路由器、防火墙、交换机、网关计算机和/或边缘服务器。每个计算/处理设备中的网络适配卡或者网络接口从网络接收计算机可读程序指令,并转发该计算机可读程序指令,以供存储在各个计算/处理设备中的计算机可读存储介质中。The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to various computing/processing devices, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, optical fiber transmission, wireless transmission, routers, firewalls, switches, gateway computers, and/or edge servers. The network adapter card or network interface in each computing/processing device receives computer-readable program instructions from the network, and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing/processing device .
用于执行本发明操作的计算机程序指令可以是汇编指令、指令集架构(ISA)指令、机器指令、机器相关指令、微代码、固件指令、状态设置数据、或者以一种或多种编程语言的任意组合编写的源代码或目标代码,编程语言包括面向对象的编程语言—诸如Smalltalk、C++等,以及常规的过程式编程语言—诸如“C”语言或类似的编程语言。计算机可读程序指令可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络—包括局域网(LAN)或广域网(WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。在一些实施例中,通过利用计算机可读程序指令的状 态信息来个性化定制电子电路,例如可编程逻辑电路、现场可编程门阵列(FPGA)或可编程逻辑阵列(PLA),该电子电路可以执行计算机可读程序指令,从而实现本发明的各个方面。The computer program instructions used to perform the operations of the present invention may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, status setting data, or in one or more programming languages. Source code or object code written in any combination. Programming languages include object-oriented programming languages-such as Smalltalk, C++, etc., and conventional procedural programming languages-such as "C" language or similar programming languages. Computer-readable program instructions can be executed entirely on the user's computer, partly on the user's computer, executed as a stand-alone software package, partly on the user's computer and partly executed on a remote computer, or entirely on the remote computer or server carried out. In the case of a remote computer, the remote computer can be connected to the user's computer through any kind of network-including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (for example, using an Internet service provider to connect to the user's computer) connection). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), can be customized by using the status information of the computer-readable program instructions. The computer-readable program instructions are executed to implement various aspects of the present invention.
这里参照根据本发明实施例的方法、装置(系统)和计算机程序产品的流程图和/或框图描述了本发明的各个方面。应当理解,流程图和/或框图的每个方框以及流程图和/或框图中各方框的组合,都可以由计算机可读程序指令实现。Here, various aspects of the present invention are described with reference to flowcharts and/or block diagrams of methods, devices (systems) and computer program products according to embodiments of the present invention. It should be understood that each block of the flowcharts and/or block diagrams, and combinations of blocks in the flowcharts and/or block diagrams, can be implemented by computer-readable program instructions.
这些计算机可读程序指令可以提供给通用计算机、专用计算机或其它可编程数据处理装置的处理器,从而生产出一种机器,使得这些指令在通过计算机或其它可编程数据处理装置的处理器执行时,产生了实现流程图和/或框图中的一个或多个方框中规定的功能/动作的装置。也可以把这些计算机可读程序指令存储在计算机可读存储介质中,这些指令使得计算机、可编程数据处理装置和/或其他设备以特定方式工作,从而,存储有指令的计算机可读介质则包括一个制造品,其包括实现流程图和/或框图中的一个或多个方框中规定的功能/动作的各个方面的指令。These computer-readable program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine that makes these instructions when executed by the processor of the computer or other programmable data processing device , A device that implements the functions/actions specified in one or more blocks in the flowcharts and/or block diagrams is produced. It is also possible to store these computer-readable program instructions in a computer-readable storage medium. These instructions make computers, programmable data processing apparatuses, and/or other devices work in a specific manner. Thus, the computer-readable medium storing the instructions includes An article of manufacture, which includes instructions for implementing various aspects of the functions/actions specified in one or more blocks in the flowcharts and/or block diagrams.
也可以把计算机可读程序指令加载到计算机、其它可编程数据处理装置、或其它设备上,使得在计算机、其它可编程数据处理装置或其它设备上执行一系列操作步骤,以产生计算机实现的过程,从而使得在计算机、其它可编程数据处理装置、或其它设备上执行的指令实现流程图和/或框图中的一个或多个方框中规定的功能/动作。It is also possible to load computer-readable program instructions on a computer, other programmable data processing device, or other equipment, so that a series of operation steps are executed on the computer, other programmable data processing device, or other equipment to produce a computer-implemented process , So that the instructions executed on the computer, other programmable data processing apparatus, or other equipment realize the functions/actions specified in one or more blocks in the flowcharts and/or block diagrams.
附图中的流程图和框图显示了根据本发明的多个实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段或指令的一部分,模块、程序段或指令的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个连续的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或动作的专用的基于硬件的系统来实现,或 者可以用专用硬件与计算机指令的组合来实现。对于本领域技术人员来说公知的是,通过硬件方式实现、通过软件方式实现以及通过软件和硬件结合的方式实现都是等价的。The flowcharts and block diagrams in the accompanying drawings show the possible implementation architecture, functions, and operations of the system, method, and computer program product according to multiple embodiments of the present invention. In this regard, each block in the flowchart or block diagram can represent a module, program segment, or part of an instruction, and the module, program segment, or part of an instruction contains one or more executables for implementing the specified logical functions. instruction. In some alternative implementations, the functions marked in the block may also occur in a different order than the order marked in the drawings. For example, two consecutive blocks can actually be executed in parallel, or they can sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and/or flowchart, and the combination of the blocks in the block diagram and/or flowchart, can be implemented by a dedicated hardware-based system that performs the specified functions or actions Or it can be realized by a combination of dedicated hardware and computer instructions. It is well known to those skilled in the art that implementation through hardware, implementation through software, and implementation through a combination of software and hardware are all equivalent.
以上已经描述了本发明的各实施例,上述说明是示例性的,并非穷尽性的,并且也不限于所披露的各实施例。在不偏离所说明的各实施例的范围和精神的情况下,对于本技术领域的普通技术人员来说许多修改和变更都是显而易见的。本文中所用术语的选择,旨在最好地解释各实施例的原理、实际应用或对市场中的技术改进,或者使本技术领域的其它普通技术人员能理解本文披露的各实施例。本发明的范围由所附权利要求来限定。The embodiments of the present invention have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Without departing from the scope and spirit of the described embodiments, many modifications and changes are obvious to those of ordinary skill in the art. The choice of terms used herein is intended to best explain the principles, practical applications, or technical improvements in the market of the various embodiments, or to enable other ordinary skilled in the art to understand the various embodiments disclosed herein. The scope of the invention is defined by the appended claims.

Claims (10)

  1. 一种投影仪振镜测试目标图的提取方法,包括:A method for extracting a test target image of a projector galvanometer, including:
    将工业相机拍摄的采样图像进行预处理,获取预处理后的所述采样图像中的连通区域及所述连通区域的重心;Preprocessing the sampled image taken by the industrial camera to obtain the connected area and the center of gravity of the connected area in the sampled image after the preprocessing;
    从所述连通区域的重心中选取符合预设位置关系的多个重心,根据所述多个重心的位置信息确定所述目标图的起始位置;Selecting multiple centers of gravity that conform to a preset position relationship from the centers of gravity of the connected regions, and determining the starting position of the target image according to the position information of the multiple centers of gravity;
    根据标准振镜单元图的尺寸信息以及所述多个重心的尺寸信息,获得所述目标图的轮廓尺寸;Obtaining the outline size of the target image according to the size information of the standard galvanometer unit image and the size information of the multiple centers of gravity;
    根据所述目标图的起始位置和所述目标图的轮廓尺寸,获得所述目标图。The target image is obtained according to the starting position of the target image and the outline size of the target image.
  2. 根据权利要求1所述的方法,其中,所述从所述连通区域的重心中选取符合预设位置关系的多个重心的步骤,包括:The method according to claim 1, wherein the step of selecting a plurality of centers of gravity conforming to a preset positional relationship from the centers of gravity of the connected regions comprises:
    从所述连通区域的重心中初步选取四个重心,获取以所述四个重心为顶点的四边形的重心,作为所述四个重心的中心;Preliminarily selecting four centers of gravity from the centers of gravity of the connected regions, and obtaining the centers of gravity of a quadrilateral with the four centers of gravity as vertices as the centers of the four centers of gravity;
    在所述四个重心到所述中心的距离差异的小于预设阈值的情况下,将所述四个重心作为所述符合预设位置关系的多个所述重心;In a case where the distance difference between the four centers of gravity and the center is less than a preset threshold, use the four centers of gravity as the plurality of centers of gravity that conform to the preset positional relationship;
    所述根据所述多个重心的位置信息确定所述目标图的起始位置的步骤,包括:The step of determining the starting position of the target image according to the position information of the multiple centers of gravity includes:
    将所述四个重心的中心作为所述目标图的起始位置。The center of the four centers of gravity is used as the starting position of the target image.
  3. 根据权利要求1所述的方法,其中,所述根据标准振镜单元图的尺寸信息以及所述多个重心的尺寸信息,获得所述目标图的轮廓尺寸的步骤,包括:The method according to claim 1, wherein the step of obtaining the outline size of the target image according to the size information of the standard galvanometer unit image and the size information of the multiple centers of gravity comprises:
    根据所述标准振镜单元图中的参考尺寸以及所述多个重心确定的对应尺寸,获取用于进行尺寸转换的比例系数;Obtaining a scale factor for size conversion according to the reference size in the standard galvanometer unit diagram and the corresponding sizes determined by the multiple centers of gravity;
    根据所述标准振镜单元中的轮廓尺寸和所述比例系数,获得所述目标图的轮廓尺寸。According to the outline size in the standard galvanometer unit and the scale factor, the outline size of the target image is obtained.
  4. 根据权利要求2所述的方法,其中,所述从所述连通区域的重心中初步选取四个重心的步骤,包括:The method according to claim 2, wherein the step of preliminarily selecting four centers of gravity from the centers of gravity of the connected regions comprises:
    先从所述连通区域的重心中初步选取一个重心,再从选取的所述重心的预设距离范围内选取其他三个重心,得到所述四个重心。First, a center of gravity is initially selected from the centers of gravity of the connected regions, and then three other centers of gravity are selected from the preset distance range of the selected center of gravity to obtain the four centers of gravity.
  5. 根据权利要求3所述的方法,其中,所述参考尺寸为所述标准振镜单元图中某一顶点到最近的子单元的重心的距离,所述对应尺寸为所述多个重心中的某一重心到所述多个重心的中心的距离,其中所述多个重心的中心是以所述多个重心为顶点的多边形的重心。The method according to claim 3, wherein the reference size is the distance from a vertex of the standard galvanometer unit graph to the center of gravity of the nearest subunit, and the corresponding size is a certain center of gravity among the multiple centers of gravity. The distance from one center of gravity to the centers of the plurality of centers of gravity, wherein the centers of the plurality of centers of gravity are the centers of gravity of a polygon with the plurality of centers of gravity as vertices.
  6. 根据权利要求1所述的方法,其中,所述获取预处理后的所述采样图像中的连通区域及所述连通区域的重心的步骤,包括:The method according to claim 1, wherein the step of acquiring the connected region and the center of gravity of the connected region in the sampled image after preprocessing comprises:
    根据所述预处理后的所述采样图像中每一像素的像素值和像素之间的相邻关系,获得所述连通区域;Obtaining the connected region according to the pixel value of each pixel in the sampled image after the preprocessing and the neighboring relationship between pixels;
    根据所述连通区域的像素分布,获得所述连通区域的重心。According to the pixel distribution of the connected area, the center of gravity of the connected area is obtained.
  7. 根据权利要求1所述的方法,其中,所述将工业相机拍摄的采样图像进行预处理的步骤,包括:The method according to claim 1, wherein the step of preprocessing the sampled images taken by the industrial camera comprises:
    将所述采样图像进行裁剪;Crop the sampled image;
    基于预设的单色通道将裁剪后的所述采样图像处理为二值化图像,并对所述二值化图像去噪,获得预处理后的采样图像。The cropped sampled image is processed into a binarized image based on a preset monochrome channel, and the binarized image is denoised to obtain a preprocessed sampled image.
  8. 一种投影仪振镜测试目标图的提取装置,包括:A device for extracting a test target image of a projector galvanometer, comprising:
    图像获取模块,用于将工业相机拍摄的采样图像进行预处理,获取预处理后的所述采样图像中的连通区域及所述连通区域的重心;The image acquisition module is used to preprocess the sampled image taken by the industrial camera, and acquire the connected area and the center of gravity of the connected area in the preprocessed sampled image;
    起始位置获取模块,用于从所述连通区域的重心中选取符合预设位置关系的多个重心,根据所述多个重心的位置信息确定所述目标图的起始位置;A starting position acquiring module, configured to select multiple centers of gravity that conform to a preset position relationship from the centers of gravity of the connected regions, and determine the starting position of the target image according to the position information of the multiple centers of gravity;
    轮廓尺寸获取模块,用于根据标准振镜单元图的尺寸信息以及所述多个重心的尺寸信息,获得所述目标图的轮廓尺寸;An outline size obtaining module, configured to obtain the outline size of the target image according to the size information of the standard galvanometer unit image and the size information of the multiple centers of gravity;
    目标图获取模块,用于根据所述目标图的起始位置和所述目标图的轮廓尺寸,获得所述目标图。The target image acquisition module is configured to obtain the target image according to the starting position of the target image and the outline size of the target image.
  9. 一种电子设备,包括:存储器和处理器,所述存储器用于存储指令,所述指令用于控制所述处理器进行操作以执行根据权利要求1-7中任意一项所述的方法。An electronic device comprising: a memory and a processor, the memory is used to store instructions, and the instructions are used to control the processor to operate to execute the method according to any one of claims 1-7.
  10. 一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序在被处理器执行时实现根据权利要求1-7中任意一项所述的方法。A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method according to any one of claims 1-7.
PCT/CN2019/129219 2019-09-03 2019-12-27 Method and apparatus for extracting test target image of projector xpr-tilt glass, and electronic device WO2021042638A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910828707.4A CN110717920B (en) 2019-09-03 2019-09-03 Method and device for extracting target image of projector galvanometer test and electronic equipment
CN201910828707.4 2019-09-03

Publications (1)

Publication Number Publication Date
WO2021042638A1 true WO2021042638A1 (en) 2021-03-11

Family

ID=69209620

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/129219 WO2021042638A1 (en) 2019-09-03 2019-12-27 Method and apparatus for extracting test target image of projector xpr-tilt glass, and electronic device

Country Status (2)

Country Link
CN (1) CN110717920B (en)
WO (1) WO2021042638A1 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111256595A (en) * 2020-02-18 2020-06-09 重庆亚派桥梁工程质量检测有限公司 Photoelectric target type structure displacement measuring method and device and storage medium
CN111650744B (en) * 2020-08-04 2020-10-30 成都极米科技股份有限公司 Method, device and equipment for adjusting parameters of galvanometer and readable storage medium
CN112037232A (en) * 2020-08-13 2020-12-04 歌尔光学科技有限公司 Galvanometer testing method, device and computer readable storage medium
CN113838139A (en) * 2021-08-13 2021-12-24 北京极豪科技有限公司 Parameter detection method and device of image sensor, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050069219A1 (en) * 2003-09-29 2005-03-31 Shang-Yun Wu Method of processing red eye in digital images
CN105957116A (en) * 2016-05-03 2016-09-21 大连理工大学 Dynamic coding point designing and decoding method based on frequency
CN107505808A (en) * 2017-08-28 2017-12-22 海信集团有限公司 Galvanometer method of adjustment, device and display device
CN108769639A (en) * 2018-09-07 2018-11-06 四川长虹电器股份有限公司 Galvanometer self-synchronous system based on Projection Display and method

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH02276908A (en) * 1989-04-18 1990-11-13 Hamamatsu Photonics Kk Three-dimensional position recognizing device
US20090061381A1 (en) * 2007-09-05 2009-03-05 Duane Milford Durbin Systems and methods for 3D previewing
CN101271576A (en) * 2008-05-08 2008-09-24 上海交通大学 Gridiron pattern recognition locating method under complex illumination and surface condition
JP4759635B2 (en) * 2009-06-15 2011-08-31 オリンパスイメージング株式会社 Vibration device
US9392267B2 (en) * 2010-12-15 2016-07-12 Tektronix, Inc. System and methods to measure noise and to generate picture quality prediction from source having no reference
CN104614929B (en) * 2015-02-12 2017-02-01 南京中科神光科技有限公司 Multi-image projection display device and multi-image projection method
DE102016106535B4 (en) * 2016-04-08 2019-03-07 Carl Zeiss Ag Apparatus and method for measuring a surface topography
CN107492096A (en) * 2017-08-03 2017-12-19 深圳市布易科技有限公司 A kind of method for realizing the positioning of numerical control cutting equipment material
CN109506589B (en) * 2018-12-25 2020-07-28 东南大学苏州医疗器械研究院 Three-dimensional profile measuring method based on structural light field imaging

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050069219A1 (en) * 2003-09-29 2005-03-31 Shang-Yun Wu Method of processing red eye in digital images
CN105957116A (en) * 2016-05-03 2016-09-21 大连理工大学 Dynamic coding point designing and decoding method based on frequency
CN107505808A (en) * 2017-08-28 2017-12-22 海信集团有限公司 Galvanometer method of adjustment, device and display device
CN108769639A (en) * 2018-09-07 2018-11-06 四川长虹电器股份有限公司 Galvanometer self-synchronous system based on Projection Display and method

Also Published As

Publication number Publication date
CN110717920A (en) 2020-01-21
CN110717920B (en) 2022-06-07

Similar Documents

Publication Publication Date Title
WO2021042638A1 (en) Method and apparatus for extracting test target image of projector xpr-tilt glass, and electronic device
CN109242961B (en) Face modeling method and device, electronic equipment and computer readable medium
KR101121034B1 (en) System and method for obtaining camera parameters from multiple images and computer program products thereof
US8363955B2 (en) Apparatus and method of image analysis
US10354364B2 (en) Automatic perspective control using vanishing points
JP2017520050A (en) Local adaptive histogram flattening
US10540784B2 (en) Calibrating texture cameras using features extracted from depth images
WO2011049046A1 (en) Image processing device, image processing method, image processing program, and recording medium
JP2007129709A (en) Method for calibrating imaging device, method for calibrating imaging system including arrangement of imaging devices, and imaging system
CN112272292B (en) Projection correction method, apparatus and storage medium
JP5779089B2 (en) Edge detection apparatus, edge detection program, and edge detection method
CN110827288B (en) Method and device for extracting target image in projector definition test
US11258965B2 (en) Apparatus for composing objects using depth map and method for the same
CN112672139A (en) Projection display method, device and computer readable storage medium
US20180124378A1 (en) Enhanced depth map images for mobile devices
WO2021017396A1 (en) Test unit image extraction method and apparatus for projector galvanometer, and electronic device
KR20150072090A (en) Apparatus for detecting region of interest and the method thereof
JP2017130794A (en) Information processing apparatus, evaluation chart, evaluation system, and performance evaluation method
US20230033956A1 (en) Estimating depth based on iris size
WO2024055531A1 (en) Illuminometer value identification method, electronic device, and storage medium
JP2013258583A (en) Captured image display, captured image display method, and program
WO2018103143A1 (en) Imaging method and apparatus for virtual reality device, and virtual reality device
WO2023273158A1 (en) Method and apparatus for determining operating range of camera in cooperative vehicle infrastructure and roadside device
US20160217559A1 (en) Two-dimensional image processing based on third dimension data
CN113554560A (en) Method, device, equipment, system and medium for testing illumination of projection picture

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: 19944223

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19944223

Country of ref document: EP

Kind code of ref document: A1