WO2017161496A1 - 条纹集合查找方法、装置以及系统 - Google Patents

条纹集合查找方法、装置以及系统 Download PDF

Info

Publication number
WO2017161496A1
WO2017161496A1 PCT/CN2016/076980 CN2016076980W WO2017161496A1 WO 2017161496 A1 WO2017161496 A1 WO 2017161496A1 CN 2016076980 W CN2016076980 W CN 2016076980W WO 2017161496 A1 WO2017161496 A1 WO 2017161496A1
Authority
WO
WIPO (PCT)
Prior art keywords
stripe
connected domain
stripe set
image
target connected
Prior art date
Application number
PCT/CN2016/076980
Other languages
English (en)
French (fr)
Inventor
贺杰
戴景文
万聪灵
胡永涛
Original Assignee
广东虚拟现实科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 广东虚拟现实科技有限公司 filed Critical 广东虚拟现实科技有限公司
Priority to US15/578,705 priority Critical patent/US10795456B2/en
Priority to PCT/CN2016/076980 priority patent/WO2017161496A1/zh
Priority to CN201680003225.XA priority patent/CN107223265B/zh
Publication of WO2017161496A1 publication Critical patent/WO2017161496A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/03Arrangements for converting the position or the displacement of a member into a coded form
    • G06F3/033Pointing devices displaced or positioned by the user, e.g. mice, trackballs, pens or joysticks; Accessories therefor
    • G06F3/0346Pointing devices displaced or positioned by the user, e.g. mice, trackballs, pens or joysticks; Accessories therefor with detection of the device orientation or free movement in a 3D space, e.g. 3D mice, 6-DOF [six degrees of freedom] pointers using gyroscopes, accelerometers or tilt-sensors
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/017Gesture based interaction, e.g. based on a set of recognized hand gestures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/03Arrangements for converting the position or the displacement of a member into a coded form
    • G06F3/0304Detection arrangements using opto-electronic means
    • G06F3/0325Detection arrangements using opto-electronic means using a plurality of light emitters or reflectors or a plurality of detectors forming a reference frame from which to derive the orientation of the object, e.g. by triangulation or on the basis of reference deformation in the picked up image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/20Analysis of motion
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N25/00Circuitry of solid-state image sensors [SSIS]; Control thereof
    • H04N25/50Control of the SSIS exposure
    • H04N25/53Control of the integration time
    • H04N25/531Control of the integration time by controlling rolling shutters in CMOS SSIS
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10141Special mode during image acquisition
    • G06T2207/10152Varying illumination
    • 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/30168Image quality inspection
    • 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/30204Marker
    • G06T2207/30208Marker matrix

Definitions

  • the present application relates to the field of image processing, and in particular, to a stripe set searching method, apparatus, and system.
  • the prior art provides a motion tracking system capable of performing image acquisition on a light spot of a moving object by image processing to achieve tracking of the moving object.
  • the striped pattern generated by the blinking light source is incomplete in the original image, which may cause interference to the image recognition.
  • An object of the application of the embodiments of the present invention is to provide a method for eliminating a stripe set that is incomplete.
  • the method before the acquiring the plurality of first connectivity domains in the binarized image, the method further includes: receiving a single frame original image acquired by the rolling image sensor Wherein the original image comprises a striped pattern formed by a scintillating light source; according to a binarization threshold Value, the original image is binarized to obtain a binarized image.
  • the method after receiving the original image acquired by the rolling-edge image sensor, before selecting the target connected domain from the plurality of first connected domains, the method includes: The original image is processed to obtain a striped graphic template, and the target connected domain is identified according to the striped graphic template, wherein the shape of the striped graphic template is a patch shape in which the striped pattern in the original image is fused.
  • the identifying the target connectivity domain according to the stripe graphics template is: determining a pixel of the first connectivity domain Whether the coordinates are all included in the set of coordinates of the pixel points of the stripe pattern template; if so, the first connected domain is determined to be the target connected domain.
  • the classifying the target connected domain to obtain the multiple stripe set comprises: forming a stripe according to the target connected domain a condition of the set, determining an initial stripe set, filtering the target connected domain that is not classified into any initial stripe set; selecting the jth target connected domain from the target connected domain that is not included in any initial stripe set, where j a positive integer; a center of the centroid of the jth target connected domain, a circle of the length of the jth target connected domain as a diameter; determining whether any one of the initial connected regions in the initial stripe set is The circles intersect; if intersected, the jth target connected domain is classified into the corresponding initial stripe set, thereby obtaining a stripe set.
  • the center of the striped pattern is calculated according to the target connected domain in the stripe set Specifically, the coordinate values of the center of the target connected domain in the stripe set are averaged to obtain coordinate values of the center of the stripe pattern.
  • the coordinate values of the center of the target connected domain in the stripe set are averaged according to formula (1)
  • the method further includes: pixel value of a pixel point in the rectangular area Q Filtering to obtain a filtered pixel value, wherein the rectangular region Q is centered on a center (u 0 , v 0 ) of the stripe pattern, and a rectangle having a width of a largest connected domain in the stripe set is a side length a region; recalculating a coordinate value of a center (u 0 , v 0 ) of the stripe pattern with a pixel value of the filtered pixel as a weight.
  • the pixel value of the filtered pixel point is used as a weight to recalculate the center of the striped pattern
  • the coordinate values of (u 0 , v 0 ) are specifically:
  • the determining whether the stripe set is The effective stripe set specifically includes:
  • R is the width of the largest connected domain in the set of stripes
  • kwide is the width of the binarized image
  • kheight is the height of the binarized image
  • a second aspect of the present invention provides a stripe set validity determining apparatus, the apparatus comprising means capable of implementing the method of any of the above.
  • a fifth aspect of the present invention provides an image processing apparatus including: a processor and a memory, wherein the processor is coupled to the memory, the memory is configured to store an instruction, and the processor is configured to execute the instruction when When the processor executes the instructions, the method of any of the above may be performed according to the instructions to perform processing on the image collected by the rolling image sensor to determine the validity of the stripe set.
  • a sixth aspect of the present invention provides an image processing system including a rolling type image sensor and an image processing apparatus, the image processing apparatus being coupled to the rolling type image sensor, wherein the image processing apparatus is as described above Image processing device.
  • a seventh aspect of the present invention provides a moving object tracking system including a rolling type image sensor, a controller provided with a scintillating light source, and an image processing apparatus, the image processing apparatus coupling the rolling type image sensor and the A controller, wherein the controller is mounted on a moving object, the image processing device being an image processing device as described above.
  • An eighth aspect of the invention provides a computer readable storage medium storing program code for determining validity of a stripe set, the program code comprising means for performing the method of any of the above Instructions.
  • FIG. 1 is a schematic structural diagram of a motion tracking system according to an embodiment of the present invention.
  • FIG. 3 is a schematic diagram of an original image captured by a rolling type image sensor in an actual working environment in an exercise tracking system according to an embodiment of the present invention
  • FIG. 6 is an image obtained after performing step 440 in a stripe set searching method according to an embodiment of the present invention.
  • FIG. 7 is an image obtained after performing step 450 in a stripe set searching method according to an embodiment of the present invention.
  • FIG. 8 is an image obtained after performing step 470 in a stripe set searching method according to an embodiment of the present invention.
  • FIG. 9 is a schematic structural diagram of a terminal according to an embodiment of the present invention.
  • the rolling type image sensor 110 is an image sensor having a rolling shutter function, for example, a CMOS (Complementary Metal Oxide Semiconductor) sensor provided with an electronic rolling shutter and A CCD (Charge-coupled Device) sensor or the like provided with a rolling shutter is provided.
  • the roller-type image sensor can be disposed on the image processing device or on a separate third-party device.
  • the rolling type image sensor is scanned by a line scan or a column scan for an image sensor having a rolling shutter function.
  • the blinking frequency of the scintillating light source is greater than the scanning frequency of the rolling image sensor 110, after the rolling image sensor 110 completes the scanning of the scintillating light source, a pattern composed of a plurality of light and dark spaced stripes appears correspondingly in the original image. .
  • the spot shape formed by the fluorescent lamps 310 in the environment is inevitably present in the original image.
  • the pattern and the spot-like pattern formed by the incandescent lamp 320 Therefore, after the rolling image sensor 110 acquires the original image, the original image needs to be sent to the image processing device, and the original image is image processed by the image processing device to exclude the spotted pattern and incandescence formed by the fluorescent lamp 310.
  • the effect of the patch-like pattern formed by the lamp 320 recognizes the stripe pattern formed by the scintillation light sources 331 and 332 from the original image.
  • the striped pattern in the original image is composed of a plurality of bright stripes or a plurality of dark stripes in the light-dark interval pattern formed by the exposure of the blinking light sources 331 and 332.
  • the shape of the outline of the striped pattern in the original image is related to the shapes of the blinking light sources 331 and 332, for example, if the shapes of the blinking light sources 331 and 332 are circular, the striped pattern is composed of bright stripes of different lengths, and The outline of the striped pattern is a circle.
  • the original image acquired by the receiving roller-type image sensor is specifically: since the rolling-type image sensor may be integrated in the image processing device, or may be disposed in an independent third-party device. Therefore, the original image may be obtained by the image processing device directly exposing the scintillation light source through the rolling image sensor, or may be obtained by the image processing device indirectly receiving an image of the scintillation light source that is forwarded by the third party device. .
  • the terminal after receiving the original image acquired by the rolling image sensor, the terminal binarizes the image to obtain a binarized image.
  • the original image it can be binarized according to the following formula:
  • i is the sequence number of the pixel in the original image
  • P(i) is the pixel value of the pixel i in the original image
  • x is the preset binarization threshold
  • P 1 is the preset first value
  • P 2 is the preset second value. Since the pixel value of the scintillation light source is similar to the pixel value of the incandescent lamp and the fluorescent lamp, the pixel value of the scintillation light source is far different from the pixel value of the background.
  • the binarization threshold x may be set in advance such that the pixel pattern of the stripe pattern formed by the scintillation light source and the spot pattern formed by the incandescent lamp, the fluorescent lamp, or the like is larger than the binarization threshold x, and the pixel of the background pixel point The value is less than or equal to the binarization threshold x.
  • the second value is preset to “0”; when the first value is preset to “0”, the second value is preset to “1”. As shown in FIG.
  • the manner of setting the binarization threshold may include: a global preset threshold method, an adaptive threshold method, a local threshold method, and the like.
  • the adaptive threshold method may be implemented by determining a binarization threshold of a current frame original image according to information of a plurality of previous original images. For the current frame original image, all pixels in the original image are compared with the binarization threshold of the current frame original image to obtain a binarized image.
  • the local threshold method may be implemented by sequentially scanning images from top to bottom and from left to right, and determining, for each pixel i, whether the pixel value of the pixel i is less than a preset. Threshold. If it is less than the preset threshold, it will not be processed temporarily. If it is greater than or equal to the preset threshold, the average value or the Gaussian average of the pixel values is calculated in the N ⁇ N neighborhood of the current pixel i, and the calculated average or Gaussian average is used as the binarization of the current pixel i. Threshold, where N is a positive integer greater than zero.
  • the connected domain is searched for the pixel point whose pixel value is the first value in the binarized image to obtain a plurality of first connected domains. Specifically, in the binarized image, if the pixel point A is adjacent to or adjacent to the pixel point B, the pixel point A is in communication with the pixel point B.
  • pixel point I (x, y) and pixel point I (x-1, y), pixel point I (x +1, y), pixel point I (x, y-1), pixel point I (x, y+1)4 adjacency; pixel point I(x,y) and pixel point I(x-1,y-1), pixel point I(x-1,y), pixel point I(x-1,y+ 1), pixel point I (x, y-1), pixel point I (x, y + 1), pixel point I (x + 1, y - 1), pixel point I (x + 1, y), pixel Point I(x+1, y+1)8 is adjacent.
  • pixel points A, B, and C all belong to the same connected domain.
  • searching for the connected domain by an algorithm such as the Two-Pass method or the Seed-Filling seed filling method, a plurality of first connected domains can be obtained. As shown in FIG.
  • the width difference of the first connected domain corresponding to the stripe in the stripe pattern is much smaller than the width difference of the first connected domain corresponding to the fluorescent lamp and the incandescent lamp, and the width difference of the first connected domain corresponding to the stripe in the stripe pattern It is impossible to be too small, so the following connected method can be used to determine whether the first connected domain is the target connected domain.
  • the stripe length direction of the preset stripe image is taken as the x-axis, and the y-axis is perpendicular to the x-axis. Navigating all the pixel points of the plurality of first connected domains to obtain a maximum column coordinate y 1 and a minimum column coordinate y 2 of the plurality of first connected domains corresponding to all the pixel points, and determining each of the first connected domains in the plurality of first connected domains
  • the width difference is: the maximum column coordinate y 1 of each pixel in the first connected domain minus the minimum column coordinate y 2 of the pixel; determining whether the width difference of each first connected domain in the plurality of first connected domains is ⁇ kh 1 and ⁇ kh 2 , wherein kh 1 is a preset first boundary condition parameter, and kh 2 is a preset second boundary condition parameter.
  • a shape of the plurality of second connected domains is identified, and a second connected domain that is closest to the shape of the striped pattern formed by the preset blinking light source is used as the striped graphic template.
  • the second connected domain obtained by the processing includes: a second connected domain corresponding to the plaque pattern formed by the stripe pattern, wherein a stripe pattern corresponds to a second connected domain; and the spot pattern formed by the incandescent lamp corresponds to the second connected domain a second connected domain, wherein a spot pattern formed by an incandescent lamp corresponds to a second connected domain; and a second pattern corresponding to the spot pattern formed by the fluorescent lamp, wherein the spot pattern formed by a fluorescent lamp corresponds to a first Two connected domains.
  • the second connected domain corresponding to the patch pattern formed by the stripe pattern, the second connected domain corresponding to the spot pattern formed by the incandescent lamp, and the second connected domain corresponding to the spot pattern formed by the fluorescent lamp are different in shape. Therefore, the shape of the plurality of second connected domains can be identified, and the second connected domain closest to the shape of the striped pattern formed by the preset blinking light source is selected as the striped graphic template. Thereafter, a set of coordinates of the pixel points in the stripe graphic template is found.
  • the first connected domain is the target connected domain, and vice versa, it may be determined that the first connected domain is not Target connected domain.
  • the original image includes a plurality of striped patterns formed by a plurality of scintillation light sources
  • the target connected domain constitutes a stripe set
  • the initial stripe set is determined, and the target connected domain that is not classified into any initial stripe set is filtered.
  • the condition that the target connected domain forms the stripe set may be that a target connected domain that is not classified into any one of the stripe sets is randomly selected, and the selected target connected domain is classified into the initial stripe set, thereby obtaining an initial stripe set.
  • averaging the coordinate values of the center of the target connected domain in the stripe set to obtain the coordinate value of the center of the stripe pattern may be: coordinates of the center of the target connected domain in the stripe set according to formula (1) The values are averaged to get the center of the striped pattern (u 0 , v 0 ):
  • i is the sequence number of the target connected domain in the stripe set
  • L i is the number of target connected domains in the stripe set. Is the minimum abscissa of the connected domain of the i-th target, It is the minimum ordinate of the i-th target connected domain, W i is the width of i target connected domains, and H i is the length of i target connected domains.
  • averaging the coordinate values of the center of the target connected domain in the stripe set to obtain the coordinate value of the center of the stripe pattern may also be: first, according to formula (1), the target connected domain in the stripe set The coordinates of the center are averaged to get the center of the stripe pattern (u 0 , v 0 ):
  • i is the sequence number of the target connected domain in the stripe set
  • L i is the number of target connected domains in the stripe set.
  • W i is the width of i target connected domains
  • H i is the length of i target connected domains.
  • the filtering method may be Gaussian filtering, mean filtering, or the like.
  • the filtering may be performed by filtering the pixel values of the pixel points in the rectangular region Q by the filtering template according to formula (2) to obtain the filtered pixel values.
  • n is the number of rows and columns of the filter template.
  • kvalue is the binarization threshold.
  • the coordinate value of the center (u 0 , v 0 ) of the stripe pattern is recalculated with the pixel value of the filtered pixel as the weight.
  • the coordinate values of the center (u 0 , v 0 ) of the stripe pattern are recalculated according to formula (3).
  • it may be determined by determining whether the stripe set is a valid stripe set, and specifically determining whether the center (u 0 , v 0 ) of the stripe pattern satisfies at least one of the following:
  • R is the width of the largest connected domain in the stripe set
  • kwide is the width of the binarized image
  • kheight is the height of the binarized image
  • the present invention further provides a terminal.
  • the terminal 500 may include an RF (Radio Frequency) circuit 510, a memory 520 including one or more computer readable storage media, and an input unit 530.
  • the terminal structure shown in FIG. 8 does not constitute a limitation to the terminal, and may include more or less components than those illustrated, or a combination of certain components, or different component arrangements. among them:
  • the RF circuit 510 can be used for receiving and transmitting signals during and after receiving or transmitting information, in particular, after receiving downlink information of the base station, and processing it by one or more processors 580; in addition, transmitting data related to the uplink to the base station.
  • the RF circuit 510 includes, but is not limited to, an antenna, at least one amplifier, a tuner, one or more oscillators, a Subscriber Identity Module (SIM) card, a transceiver, a coupler, an LNA (Low Noise Amplifier). , duplexer, etc.
  • SIM Subscriber Identity Module
  • RF circuitry 510 can also communicate with the network and other devices via wireless communication.
  • the memory 520 can be used to store software programs and modules, and the processor 580 executes various functional applications and data processing by running software programs and modules stored in the memory 520.
  • the memory 520 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application required for at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may be stored according to The data created by the use of the terminal 500 (such as audio data, phone book, etc.) and the like.
  • memory 520 can include high speed random access memory, and can also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, memory 520 may also include a memory controller to provide access to memory 520 by processor 580 and input unit 530.
  • Input unit 530 can be used to receive input numeric or character information, as well as to generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function controls.
  • input unit 530 can include touch-sensitive surface 531 as well as other input devices 532.
  • a touch-sensitive surface 531 also referred to as a touch display or trackpad, can collect touch operations on or near the user (eg, the user uses a finger, stylus, etc., any suitable object or accessory on the touch-sensitive surface 531 or The operation near the touch-sensitive surface 531) and driving the corresponding connecting device according to a preset program.
  • the touch-sensitive surface 531 can include two portions of a touch detection device and a touch controller.
  • the touch detection device detects the touch orientation of the user, and detects a signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts the touch information into contact coordinates, and sends the touch information.
  • the processor 580 is provided and can receive commands from the processor 580 and execute them.
  • the touch sensitive surface 531 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves.
  • the input unit 530 can also include other input devices 532. Specifically, other input devices 532 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control buttons, switch buttons, etc.), trackballs, mice, joysticks, and the like.
  • the display unit 540 can be used to display information input by the user or information provided to the user and various graphical user interfaces of the terminal 500, which can be represented by graphics, text, icons, and views. The frequency is combined with any combination thereof.
  • the display unit 540 can include a display panel 541.
  • the display panel 541 can be configured in the form of an LCD (Liquid Crystal Display), an OLED (Organic Light-Emitting Diode), or the like.
  • touch-sensitive surface 531 can cover the display panel 541, and when the touch-sensitive surface 531 detects a touch operation thereon or nearby, it is transmitted to the processor 580 to determine the type of the touch event, and then the processor 580 according to the touch event The type provides a corresponding visual output on display panel 541.
  • touch-sensitive surface 531 and display panel 541 are implemented as two separate components to implement input and input functions, in some embodiments, touch-sensitive surface 531 can be integrated with display panel 541 for input. And output function.
  • Terminal 500 can also include at least one type of sensor 550, such as a light sensor, motion sensor, and other sensors.
  • the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 541 according to the brightness of the ambient light, and the proximity sensor may close the display panel 541 when the terminal 500 moves to the ear. / or backlight.
  • the gravity acceleration sensor can detect the magnitude of acceleration in all directions (usually three axes). When it is stationary, it can detect the magnitude and direction of gravity.
  • the terminal 500 can also be configured with gyroscopes, barometers, hygrometers, thermometers, infrared sensors and other sensors, here Let me repeat.
  • Audio circuit 560, speaker 561, and microphone 562 can provide an audio interface between the user and terminal 500.
  • the audio circuit 560 can transmit the converted electrical data of the received audio data to the speaker 561, and convert it into a sound signal output by the speaker 561.
  • the microphone 562 converts the collected sound signal into an electrical signal, and the audio circuit 560 is used by the audio circuit 560. After receiving, it is converted into audio data, and then processed by the audio data output processor 580, transmitted to the terminal, for example, via the RF circuit 510, or outputted to the memory 520 for further processing.
  • the audio circuit 560 may also include an earbud jack to provide communication of the peripheral earphones with the terminal 500.
  • WiFi is a short-range wireless transmission technology
  • the terminal 500 can help users to send and receive emails, browse web pages, and access streaming media through the WiFi module 570, which provides wireless broadband Internet access for users.
  • FIG. 8 shows the WiFi module 570, it can be understood that it does not belong to the essential configuration of the terminal 500, and may be omitted as needed within the scope of not changing the essence of the invention.
  • the terminal 500 also includes a power source 590 (such as a battery) that supplies power to the various components.
  • a power source 590 such as a battery
  • the power source can be logically coupled to the processor 580 through a power management system to manage functions such as charging, discharging, and power management through the power management system.
  • Power supply 590 may also include any one or more of a DC or AC power source, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and the like.
  • the terminal 500 may further include a camera, a Bluetooth module, and the like, and details are not described herein again.
  • the display unit of the terminal is a touch screen display
  • the terminal further includes a memory, and one or more programs, wherein one or more programs are stored in the memory and configured to be processed by one or more The execution of one or more programs includes instructions for performing the following operations:
  • the method before the acquiring the plurality of first connected domains in the binarized image, the method further includes: receiving a single frame original image acquired by the rolling image sensor, wherein the original image includes a stripe formed by the blinking light source a graph; binarizing the original image to obtain a binarized image according to a binarization threshold.
  • selecting the target connected domain from the plurality of first connected domains includes: determining a width difference of each of the plurality of first connected domains, the first connected domain The width difference is compared with the preset width difference, and the first connected domain in which the condition is met is determined as the target connected domain according to the comparison result.
  • determining The first connected domain that meets the condition is the target connected domain, and specifically includes: according to the imaging plane of the rolling image sensor, the stripe length direction of the preset stripe image is the x-axis, and the y-axis is perpendicular to the x-axis; traversing Determining, by the plurality of pixel points of the plurality of first connected domains, a maximum column coordinate y1 and a minimum column coordinate y2 corresponding to all the pixel points of the plurality of first connected domains, determining each of the plurality of first connected domains
  • the width difference of a connected domain is: a maximum column coordinate y1 of each pixel in the first connected domain minus a minimum column coordinate y2 of the pixel; and a difference in width of each first connected domain in the plurality of first connected domains Whether ⁇ kh1 and ⁇ kh2, where kh1 is a preset first boundary condition
  • the method further includes the step of deleting the first connected domain of the width difference ⁇ kh 1 or >kh 2 from the plurality of first connected domains.
  • processing the original image to obtain a striped graphic template is specifically: filtering the original image according to the filtered parameter to obtain a blurred image, wherein the filtered parameter is set such that the original Each of the graphics in the image is fused into a corresponding plaque; the blurred image is binarized to obtain a binary blurred image; and the connected domain is searched for the binary image to obtain a plurality of second connected domains; Recognizing a shape of the plurality of second connected domains, and using a second connected domain that is closest to a shape of the striped pattern formed by the preset blinking light source as a striped graphic template.
  • identifying the target connected domain according to the stripe pattern template is: determining whether coordinates of the pixel points of the first connected domain are all included in a set of coordinates of pixel points of the stripe pattern template; Yes, determining that the first connected domain is a target connected domain.
  • the original image includes a plurality of striped patterns formed by a plurality of blinking light sources, and determining the stripe set according to the target connected domain is specifically: classifying the target connected domains to obtain a plurality of stripe sets.
  • classifying the target connected domain to obtain a plurality of stripe sets comprises: determining an initial stripe set according to a condition that the target connected domain forms a stripe set, and screening the target connectivity that is not classified into any initial stripe set. Domain; the target connected domain that has never been attributed to any initial stripe set, Selecting the jth target connected domain, where j is a positive integer; taking the centroid of the jth target connected domain as a center, and taking the length of the jth target connected domain as a circle as a circle; determining the initial stripe set Whether any one of the target connected domain regions intersects the circle; if intersects, the jth target connected domain is classified into the corresponding initial stripe set, thereby obtaining a stripe set.
  • the classifying the target connected domain to obtain the plurality of stripe sets further includes: determining whether the stripe set satisfies the following condition: whether the number of target connected domains in the stripe set is greater than a quantity threshold; Whether the length of the longest target connected domain in the stripe set is greater than a length threshold; if the condition is not satisfied at the same time, the stripe set is deleted.
  • averaging coordinate values of a center of the target connected domain in the stripe set to obtain a coordinate value of a center of the stripe pattern is specifically:
  • i is the sequence number of the target connected domain in the stripe set
  • L i is the number of target connected domains in the stripe set
  • Is the minimum abscissa of the connected domain of the i-th target
  • It is the minimum ordinate of the i-th target connected domain
  • W i is the width of i target connected domains
  • H i is the length of i target connected domains.
  • the pixel values of the pixel points in the rectangular area Q are filtered to obtain the filtered pixel values.
  • the pixel values of the pixel points in the rectangular area Q are filtered by the filtering template according to formula (2) to obtain Filtered pixel value among them,
  • n is the number of rows and columns of the filtering template,
  • kvalue is the binarization threshold.
  • recalculating the coordinate value of the center (u 0 , v 0 ) of the striped pattern by using the pixel value of the filtered pixel as a weight is specifically:
  • (u j , v j ) is a coordinate value of a pixel point in the rectangular area Q, The pixel value filtered for the pixel (u j , v j ).
  • the embodiment of the present invention further discloses another motion tracking system, which is different from the motion tracking system shown in FIG. 1 in that the rolling image sensor and the image processing device are both Integrated in the terminal.
  • the terminal may be a smart phone, a notebook computer, a tablet computer, a driving recorder, a video recorder, a projector, and the like.
  • the embodiment of the invention also discloses an image processing system, which is different from the motion tracking system shown in FIG. 1 in that the image processing system includes only a rolling type image sensor and an image processing device, and does not include a controller.
  • the embodiment of the present invention further provides a stripe set search device, and the device includes a unit capable of implementing the method as shown in FIG. 4.
  • the device includes a unit capable of implementing the method as shown in FIG. 4.
  • the technical solution of the present application or the part that contributes to the prior art or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium, including several instructions. All or part of the steps of the method of the various embodiments of the present application are performed by a computer device (which may be a personal computer, server, or network device, etc.) or a processor.
  • the foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like. .

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Quality & Reliability (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Image Analysis (AREA)
  • Image Processing (AREA)

Abstract

本申请公开了一种条纹集合有效性确定方法以及装置。其中,所述方法包括:获取二值化图像中的多个第一连通域;从所述多个第一连通域中选择出目标连通域;根据所述目标连通域确定条纹集合,从而确定条纹图形;根据所述条纹集合中的目标连通域计算出所述条纹图形的中心;根据所述条纹图形的中心确定所述条纹集合是否为有效条纹集合。上述方法能够排除残缺的条纹图形对图像的影响,提高识别的准确性。

Description

条纹集合查找方法、装置以及系统 技术领域
本申请涉及图像处理领域,尤其涉及一种条纹集合查找方法、装置以及系统。
背景技术
随着人机交互应用技术得发展,利用手势摆动等运动物体取代直接接触计算机装置,来进行指令的输入,已成为一种发展趋势。进而为跟踪人体手势或者其他物体运动状态成为目前需要解决的技术问题。现有技术提供了一种运动跟踪系统,能够通过图像处理的方法对运动物体的光点进行图像采集,以实现对运动物体的跟踪。
但是,在实际的应用场景中,如果闪烁光源到了卷帘式图像传感器采集的边缘时,闪烁光源所产生的条纹图形在原始图像中是残缺不全的,会对图像识别造成干扰。
发明内容
本发明实施例申请的目的在于提供一种能够排除残缺不全的条纹集合的方法。
本发明第一方面提供了一种条纹集合有效性确定方法,包括:获取二值化图像中的多个第一连通域;从所述多个第一连通域中选择出目标连通域;根据所述目标连通域确定条纹集合,从而确定条纹图形;根据所述条纹集合中的目标连通域计算出所述条纹图形的中心;根据所述条纹图形的中心确定所述条纹集合是否为有效条纹集合。
结合第一方面,第一方面的第一种可能的实施方式中,所述获取二值化图像中的多个第一连通域之前还包括:接收卷帘式图像传感器采集得到的单帧原始图像,其中,所述原始图像包括闪烁光源所形成的条纹图形;根据二值化阈 值,对所述原始图像进行二值化以得到二值化图像。
结合第一方面,第一方面的第二种可能的实施方式中,从所述多个第一连通域中选择出目标连通域包括:确定所述多个第一连通域中每个第一连通域的宽度差,将所述每个第一连通域的宽度差和预设的宽度差进行比较,根据比较结果确定其中符合条件的第一连通域为目标连通域。
结合第一方面的第二种可能的实施方式,第一方面的第三种可能的实施方式中,将所述每个第一连通域的宽度差和预设的宽度差进行比较,确定其中符合条件的第一连通域为目标连通域,具体包括:根据卷帘式图像传感器成像平面,以预设条纹图像的条纹长度方向为x轴,并令y轴垂直于所述x轴;遍历所述多个第一连通域的所有像素点以获得所述多个第一连通域对应所有像素点的最大列坐标y1和最小列坐标y2,确定所述多个第一连通域中每个第一连通域的宽度差为:每个第一连通域中的像素点最大列坐标y1减去像素点最小列坐标y2;判断所述多个第一连通域中每个第一连通域的宽度差是否≧kh1且≦kh2,其中,kh1为预设的第一边界条件参数,kh2为预设的第二边界条件参数;确定符合宽度差≧kh1且≦kh2的第一连通域为目标连通域。
结合第一方面的第三种可能的实施方式,第一方面的第四种可能的实施方式中,还包括以下步骤:从所述多个第一连通域中删除宽度差﹤kh1或者﹥kh2的第一连通域。
结合第一方面,第一方面的第五种可能的实施方式中,接收卷帘式图像传感器采集得到的原始图像之后,从所述多个第一连通域中选择出目标连通域之前包括:对所述原始图像进行处理以得到条纹图形模板,并根据所述条纹图形模板识别出目标连通域,其中,所述条纹图形模板的形状为所述原始图像中的条纹图形融合而成的斑状。
结合第一方面的第五种可能的实施方式,第一方面的第六种可能的实施方式中,对所述原始图像进行处理以得到条纹图形模板具体为:根据所述滤波的参数对所述原始图像进行滤波以得到模糊图像,其中,所述滤波的参数设置为使得所述原始图像中的各个图形融合成各自对应的斑块;对所述模糊图像进行二值化以得到二值化模糊图像;对所述二值化模糊图像查找连通域以获得多个第二连通域;识别所述多个第二连通域的形状,并根据与预设的所述闪烁光源 所形成的条纹图形形状最接近的第二连通域作为条纹图形模板。
结合第一方面的第六种可能的实施方式,第一方面的第七种可能的实施方式中,根据所述条纹图形模板识别出目标连通域具体为:判断所述第一连通域的像素点的坐标是否都包括在所述条纹图形模板的像素点的坐标构成的集合中;如果是,确定所述第一连通域为目标连通域。
结合第一方面至第七种可能的实施方式中的任意一种,第一方面的第八种可能的实施方式中,所述原始图像包括多个闪烁光源所形成的多个条纹图形,根据所述目标连通域确定条纹集合具体为:对所述目标连通域进行分类以获得多个条纹集合。
结合第一方面的第八种可能的实施方式,第一方面的第九种可能的实施方式中,对所述目标连通域进行分类以获得多个条纹集合包括:根据所述目标连通域构成条纹集合的条件,确定初始条纹集合,筛选未归入任何初始条纹集合的所述目标连通域;从未归入任何初始条纹集合的所述目标连通域中,选取第j个目标连通域,其中j为正整数;以所述第j个目标连通域的质心为圆心,以所述第j个目标连通域的长度为直径作圆;判断所述初始条纹集合中的任意一个目标连通域区域是否与所述圆相交;如果相交,则将所述第j个目标连通域归入对应的所述初始条纹集合,从而得到条纹集合。
结合第一方面的第九种可能的实施方式,第一方面的第十种可能的实施方式中,对所述目标连通域进行分类以获得多个条纹集合之后还包括:判断所述条纹集合是否同时满足以下条件:所述条纹集合中的目标连通域的数量是否大于数量阈值;所述条纹集合中最长的目标连通域的长度是否大于长度阈值;如果不是同时满足所述条件,则删除所述条纹集合。
结合第一方面至第十种可能的实施方式中的任意一种,第一方面的第十一种可能的实施方式中,根据所述条纹集合中的目标连通域计算出所述条纹图形的中心具体为:对所述条纹集合中的目标连通域的中心的坐标值求平均以得到所述条纹图形的中心的坐标值。
结合第一方面的第十一种可能的实施方式,第一方面的第十二种可能的实施方式中,对所述条纹集合中的目标连通域的中心的坐标值求平均以得到所述条纹图形的中心的坐标值具体为:根据公式(1)对所述条纹集合中的目标连 通域的中心的坐标值求平均以得到所述条纹图形的中心(u0,v0):
Figure PCTCN2016076980-appb-000001
      公式(1)
其中,i为所述条纹集合中目标连通域的序号,Li为所述条纹集合中目标连通域的数量,
Figure PCTCN2016076980-appb-000002
为第i个目标连通域的最小横坐标,
Figure PCTCN2016076980-appb-000003
为第i个目标连通域的最小纵坐标,Wi为i个目标连通域的宽度,Hi为i个目标连通域的长度。
结合第一方面的第十二种可能的实施方式,第一方面的第十三种可能的实施方式中,根据公式(1)对所述条纹集合中的目标连通域的中心的坐标值求平均以得到所述条纹图形的中心(u0,v0)之后,根据所述条纹图形的中心确定所述条纹集合是否为有效条纹集合之前,还包括:对矩形区域Q中的像素点的像素值进行滤波以得到滤波后的像素值,其中,所述矩形区域Q为所述条纹图形的中心(u0,v0)为中心,以所述条纹集合中最大连通域的宽度为边长的矩形区域;以所述滤波后的像素点的像素值作为权值重新计算所述条纹图形的中心(u0,v0)的坐标值。
结合第一方面的第十三种可能的实施方式,第一方面的第十四种可能的实施方式中,对矩形区域Q中的像素点的像素值进行滤波以得到滤波后的像素值具体为:根据公式(2)对矩形区域Q中的像素点的像素值通过滤波模板进行滤波以得到滤波后的像素值
Figure PCTCN2016076980-appb-000004
其中,
Figure PCTCN2016076980-appb-000005
   公式(2)
n为所述滤波模板的行数和列数,
Figure PCTCN2016076980-appb-000006
为像素值,kvalue为二值化阈值。
结合第一方面的第十三种可能的实施方式,第一方面的第十五种可能的实施方式中,以所述滤波后的像素点的像素值作为权值重新计算所述条纹图形的中心(u0,v0)的坐标值具体为:
根据公式(3)重新计算所述条纹图形的中心(u0,v0)的坐标值,其中,
Figure PCTCN2016076980-appb-000007
                                                公式(3)
(uj,vj)为矩形区域Q中的像素点的坐标值,
Figure PCTCN2016076980-appb-000008
为像素点(uj,vj)滤波后的像素值。
结合第一方面第十二至第十五种可能的实施方式中的任意一种,第一方面的第十五种可能的实施方式中,根据所述条纹图形的中心确定所述条纹集合是否为有效条纹集合具体包括:
判断所述条纹图形的中心(u0,v0)是否满足以下至少一个:
Figure PCTCN2016076980-appb-000009
其中,R为所述条纹集合中最大的连通域的宽度,kwide为所述二值化图像的宽度,kheight为所述二值化图像的高度;
如果满足至少一个,则确定所述条纹集合为无效条纹集合,如果不满足任意一个,则确定所述条纹集合为有效条纹集合。
本发明第二方面提供了一种条纹集合有效性确定装置,所述装置包括能够实现上述任一项所述的方法的单元。
本发明第三方面提供了一种终端,包括卷帘式图像传感器、存储器以及分别与所述卷帘式图像传感器、存储器耦合的处理器,所述存储器用于存储所述卷帘式图像传感器采集到的图像以及指令,所述处理器用于执行所述指令,当所述处理器在执行所述指令时,可根据所述指令执行如上述任一项的方法,以实现对所述卷帘式图像传感器采集到的图像进行处理以确定条纹集合的有效性。
本发明第四方面提供了一种运动物体跟踪系统,包括终端、设置有闪烁光源的控制器,其中,所述终端设置有卷帘式图像传感器,所述设置有闪烁光源 的控制器被安装在运动物体上,所述终端为如上述的终端。
本发明第五方面提供了一种图像处理装置,包括:处理器以及存储器,其中,所述处理器连接所述存储器,所述存储器用于存储指令,所述处理器用于执行所述指令,当所述处理器在执行所述指令时,可根据所述指令执行如上述任一项的方法,以实现对所述卷帘式图像传感器采集到的图像进行处理以确定条纹集合的有效性。
本发明第六方面提供了一种图像处理系统,包括卷帘式图像传感器以及图像处理装置,所述图像处理装置耦合所述卷帘式图像传感器,其中,所述图像处理装置为如上述所述的图像处理装置。
本发明第七方面提供了一种运动物体跟踪系统,包括卷帘式图像传感器、设置有闪烁光源的控制器以及图像处理装置,所述图像处理装置分别耦合所述卷帘式图像传感器以及所述控制器,其中,所述控制器被安装在运动物体上,所述图像处理装置为如上述所述的图像处理装置。
本发明第八方面提供了一种计算机可读存储介质,所述计算机可读存储介质存储了确定条纹集合有效性的程序代码,所述程序代码包括用于执行如上述任一项所述的方法的指令。
本发明通过从二值化图像中选择出目标连通域,并从目标连通域中选择出条纹集合,在根据条纹集合的目标连通域计算出目标连通域对应的条纹图形的中心,最后再根据条纹图形的中心确定条纹集合是否为有效条纹集合,能够有效地排除残缺的条纹集合。
附图说明
图1是本发明实施例提供的一种运动跟踪系统的结构示意图;
图2是本发明实施例提供的一种运动跟踪系统中卷帘式图像传感器采集到的闪烁光源的条纹图形的示意图;
图3是本发明实施例提供的一种运动跟踪系统中卷帘式图像传感器在实际工作环境中采集到原始图像;
图4是本发明实施例提供的一种条纹集合有效性确定方法的流程图;
图5是本发明实施例提供的一种条纹集合有效性确定方法中执行步骤420后得到的图像;
图6是本发明实施例提供的一种条纹集合查找方法中执行步骤440后得到的图像;
图7是本发明实施例提供的一种条纹集合查找方法中执行步骤450后得到的图像;
图8是本发明实施例提供的一种条纹集合查找方法中执行步骤470后得到的图像;
图9是本发明实施例提供的一种终端的结构示意图。
具体实施方式
如图1以及图2所示,本发明实施例公开了一种运动跟踪系统,包括卷帘式图像传感器110、设置有闪烁光源121的控制器120以及图像处理装置130。
卷帘式图像传感器110为带有卷帘快门(Rolling shutter)功能的图像传感器,例如,设置有电子卷帘快门(Electronic rolling shutter)的CMOS(Complementary Metal Oxide Semiconductor,互补金属氧化物半导体)传感器以及设置有卷帘快门(Rolling shutter)的CCD(Charge-coupled Device,电荷耦合元件)传感器等等。卷帘式图像传感器可以设置在图像处理装置上,也可以设置在独立的第三方设备上。卷帘式图像传感器为带有卷帘快门(Rolling shutter)功能的图像传感器以行扫描或者列扫描的方式进行扫描。
控制器120可以是带有闪烁光源的游戏手柄、指示棒、体感鼠标等等。控制器的数量可以是一个,也可以是多个。每个控制器上的闪烁光源的数量可以是一个,也可以是多个。闪烁光源为具备有较稳定闪烁频率或者变化闪烁频率的光源,例如,LED灯等等,通过控制输入到LED等的电源的占空比,可以控制LED灯按照固定的频率或者非固定的频率进行闪烁。其中,闪烁光源的闪烁频率大于卷帘式图像传感器的扫描频率。
图像处理装置130可以是嵌入式处理器、数字图像处理器、智能手机、计算机、平板电脑、笔记本等具有良好计算能力的实体。图像处理装置上可以设置有卷帘式图像传感器,也可以不设置卷帘式图像传感器。
这里的卷帘式图像传感器110为带有卷帘式快门功能的图像传感器,用于对控制器120上的闪烁光源进行曝光成像以得到原始图像。闪烁光源为具备有较稳定闪烁频率或者变化闪烁频率的光源,能够影响卷帘式图像传感器110在原始图像的水平方向上形成明暗间隔的图形。具体地,当闪烁光源为“亮”时,卷帘式图像传感器110对闪烁光源进行扫描,则原始图像中会对应出现一个亮条纹;当闪烁光源为“灭”时,卷帘式图像传感器110对闪烁光源进行扫描,则原始图像中会对应出现一个暗条纹。由于闪烁光源的闪烁频率大于卷帘式图像传感器110的扫描频率,所以,卷帘式图像传感器110在完成对闪烁光源的扫描后,原始图像中会对应出现一个多个明暗间隔条纹所组成的图形。
以图3为例,由于实际成像环境的影响,曝光成像后,除了对闪烁光源331以及332拍摄所形成的图形外,原始图像中还会不可避免地存在环境中的日光灯310所形成的光斑状的图形和白炽灯320所形成的光斑状的图形。所以,在卷帘式图像传感器110采集到原始图像后,需要将原始图像发送给图像处理装置,并由图像处理装置对原始图像进行图像处理,以排除日光灯310所形成的光斑状的图形和白炽灯320所形成的光斑状的图形的影响,从原始图像中识别出闪烁光源331和332所形成的条纹图形。
其中,在一般情况下,原始图像中的条纹图形是由闪烁光源331和332所曝光形成的明暗间隔的图形中的多个亮条纹或者多个暗条纹组成的。为了便于陈述,下面均以亮条纹为例。原始图像中的条纹图形的轮廓的形状与闪烁光源331和332的形状相关,例如,如果闪烁光源331和332的形状是圆形的,则条纹图形是由长短不一的亮条纹所构成,而且条纹图形的轮廓是圆形,如果闪烁光源331和332的形状是长方形状的,则条纹图形是由长度相同的亮条纹所构成的,而且,条纹图形的轮廓是长方形。条纹图形中的亮条纹的宽度与闪烁光源331和332的闪烁周期相关,闪烁光源331和332的闪烁周期越长,亮条纹的宽度越宽。在极限状况下,如果闪烁光源331和332的闪烁周期为无穷大,则闪烁光源331和332在原始图像上将会形成一个没有条纹的全亮光斑。原始图像中的条纹 图形的数量和卷帘式图像传感器采集范围内的闪烁光源331和332的个数一一对应,例如,卷帘式图像传感器110采集范围内的闪烁光源的个数为2个,则原始图像中条纹图形的数量也为2个。
下面进一步具体说明对所述图像处理装置对原始图像进行处理以排除闪烁光源所形成的残缺的条纹图形的过程。如图4所示,
410:接收卷帘式图像传感器采集得到的原始图像,其中,原始图像包括闪烁光源所形成的条纹图形。进一步的,本步骤中,接收卷帘式图像传感器采集得到的单帧原始图像,该单帧原始图像可以为卷帘式图像传感器的拍摄得到的包含一个或多个闪烁光源所形成的具有不同宽度特征条纹的一幅图像。
420:对原始图像进行二值化以得到二值化图像,其中,二值化阈值设置为条纹图形对应的像素点的值为第一值。
430:对二值化图像中像素值为第一值的像素点查找连通域以获得多个第一连通域。
440:从多个第一连通域中选择出目标连通域,其中,目标连通域为所述条纹所形成的连通域。
450:根据目标连通域确定条纹集合,其中,条纹集合为条纹图形对应的目标通域所构成的集合。
460:根据条纹集合中的目标连通域计算出条纹图形的中心。
470:根据条纹图形的中心确定条纹集合是否为有效条纹集合。
在一具体的实施例中,接收卷帘式图像传感器采集得到的原始图像具体为:由于卷帘式图像传感器可以是集成在图像处理装置中的,也可以是设置在独立的第三方设备中的,所以,原始图像可以是图像处理装置直接通过卷帘式图像传感器对闪烁光源进行曝光成像得到的,也可以为图像处理装置间接接收到第三方设备转发的对闪烁光源进行曝光成像的图像得到的。
在一具体的实施例中,终端接收到卷帘式图像传感器采集得到的原始图像后,对图像进行二值化以得到二值化图像。具体地,对于原始图像,可以根据下面的公式进行二值化:
Figure PCTCN2016076980-appb-000010
其中,i为原始图像中的像素点的序号,P(i)为原始图像中的像素点i的像素值,x为预设的二值化阈值,P1为预设的第一值,P2为预设的第二值。由于闪烁光源的像素值和白炽灯、日光灯的像素值相近,而闪烁光源的像素值远不同于背景的像素值。所以,可以预先设置二值化阈值x使得闪烁光源所形成的条纹图形和白炽灯、日光灯等所形成的光斑状图形对应的像素点的像素值大于二值化阈值x,背景的像素点的像素值小于或等于二值化阈值x。通常而言,当第一值预设为“1”时,第二值预设为“0”;当第一值预设为“0”时,第二值预设为“1”。如图5所示的,经过二值化后得到的二值化图像中,闪烁光源所形成的条纹图形和白炽灯、日光灯等所形成的光斑状图形对应的像素点的像素值被设置为“1”,背景对应的像素点的像素值被设置为“0”。
在一具体的实施方式中,设置二值化阈值的方式可以包括:全局预设阈值法、自适应阈值法以及局部阈值法等等。
在本发明实施方式中,所述全局预设阈值法可以通过如下方式实现:预设一个全局阈值,对所有帧的原始图像均采用同一个全局阈值作为二值化阈值。对于具体的一帧原始图像,原始图像中的所有像素点均和该二值化阈值进行比较,从而得到二值化图像。其中,全局阈值可以根据经验人工设置。
在本发明实施方式中,所述自适应阈值法可以通过如下方式实现:根据以往的几帧原始图像的信息确定当前帧原始图像的二值化阈值。对于当前帧原始图像,原始图像中的所有像素点均和当前帧原始图像的二值化阈值进行比较,从而得到二值化图像。
在本发明实施方式中,所述局部阈值法可以通过如下方式实现:以从上往下以及从左往右的顺序依次扫描图像,对每个像素i,判断像素i的像素值是否小于预设阈值。如果小于预设阈值,则暂时不作处理。如果大于或者等于预设阈值,在当前像素点i的N×N邻域内计算像素值的平均值或者高斯平均值,并将计算得到的平均值或者高斯平均值作为当前像素点i的二值化阈值,其中,N为大于0的正整数。将像素点i的像素值和像素点i的二值化阈值进行比较,如果大于像素点i的二值化阈值,则设置为第一值,最后,将小于预设阈值的像素点设置为第二值,从而得到二值化图像。
在一具体的实施例中,在得到二值化图像后,对二值化图像中像素值为第一值的像素点查找连通域以获得多个第一连通域。具体地,在二值化图像中,如果像素点A与像素点B为4邻接或者8邻接,则像素点A与像素点B连通。其中,像素点I(x,y)与像素点I(x-1,y)、像素点I(x+1,y)、像素点I(x,y-1)、像素点I(x,y+1)4邻接;像素点I(x,y)与像素点I(x-1,y-1)、像素点I(x-1,y)、像素点I(x-1,y+1)、像素点I(x,y-1)、像素点I(x,y+1)、像素点I(x+1,y-1)、像素点I(x+1,y)、像素点I(x+1,y+1)8邻接。如果像素点A与像素点B连通,像素点B与像素点C连通,则像素点A、B和C均属于同一个连通域。通过Two-Pass法或者Seed-Filling种子填充法等算法查找连通域后,可以得到多个第一连通域。以图5为例,这些第一连通域中,包括:闪烁光源331和332所形成的条纹图形所对应的第一连通域,其中,条纹图形中的每个条纹对应得到一个第一连通域;白炽灯320所形成的光斑状图形对应的第一连通域,其中,一个白炽灯320所形成的光斑状图形对应得到一个第一连通域;日光灯310所形成的光斑状图形对应的第一连通,其中,一个日光灯310所形成的光斑状图形对应得到一个第一连通域。
在一具体的实施例中,在得到多个第一连通域后,从多个第一连通域中选择出闪烁光源形成的条纹图形对应的第一连通域以作为目标连通域。具体地,可以通过以下的两种方式获得目标连通域:
在第一种方式中,确定多个第一连通域中每个第一连通域的宽度差,将每个第一连通域的宽度差和预设的宽度差进行比较,根据比较结果确定其中符合条件的第一连通域为目标连通域。具体地,由于条纹图形中的条纹对应的第一连通域的宽度差远小于日光灯和白炽灯对应的第一连通域的宽度差,而且,条纹图形中的条纹对应的第一连通域的宽度差不可能太小,所以,可以通过下面的方法判断第一连通域是否为目标连通域。首先,根据卷帘式图像传感器成像平面,以预设条纹图像的条纹长度方向为x轴,并令y轴垂直于所述x轴。遍历多个第一连通域的所有像素点以获得多个第一连通域对应所有像素点的最大列坐标y1和最小列坐标y2,确定多个第一连通域中每个第一连通域的宽度差为:每个第一连通域中的像素点最大列坐标y1减去像素点最小列坐标y2;判断多个第一连通域中每个第一连通域的宽度差是否≧kh1且≦kh2,其中,kh1 为预设的第一边界条件参数,kh2为预设的第二边界条件参数。确定符合宽度差≧kh1且≦kh2的第一连通域为目标连通域,不符合宽度差≧kh1且≦kh2的第一连通域不是目标连通域。将不是目标连通域的第一连通域删去。以图6为例,将不是目标连通域的第一连通域删去后,如图示的结果。
在一具体的实施方式中,第一边界条件参数kh1以及第二边界条件参数kh2可以根据如下方式确定:如果闪烁光源的闪烁周期为T,闪烁光源的调制信号的占空比为Φ,卷帘式图像传感器行或列曝光时间为t,则第一边界条件参数kh1=(Φ*T)/(2t),第二边界条件参数kh2=K*(Φ*T)/(2t),其中K为调优参数。
在第二种方式中,对原始图像进行处理以得到条纹图形模板,并根据条纹图形模板识别出目标连通域,其中,条纹图形模板的形状为原始图像中的条纹图形融合而成的斑状。具体地,根据滤波的参数对原始图像进行滤波以得到模糊图像,其中,滤波的参数设置为使得原始图像中的各个图形融合成各自对应的斑块。然后,对模糊图像进行二值化以得到二值化模糊图像。之后,对二值化模糊图像查找连通域以获得多个第二连通域。识别多个第二连通域的形状,并根据与预设的闪烁光源所形成的条纹图形形状最接近的第二连通域作为条纹图形模板。如此处理后所得到的第二连通域包括:条纹图形所构成的斑状图形对应的第二连通域,其中,一个条纹图形对应得到一个第二连通域;白炽灯所形成的光斑状图形对应的第二连通域,其中,一个白炽灯所形成的光斑状图形对应得到一个第二连通域;日光灯所形成的光斑状图形对应的第二连通,其中,一个日光灯所形成的光斑状图形对应得到一个第二连通域。而且,由于条纹图形所构成的斑状图形对应的第二连通域、白炽灯所形成的光斑状图形对应的第二连通域和日光灯所形成的光斑状图形对应的第二连通域的形状各不相同,所以,可以识别多个第二连通域的形状,并选择与预设的闪烁光源所形成的条纹图形形状最接近的第二连通域作为条纹图形模板。此后,找出条纹图形模板中的像素点的坐标的集合。如果判断第一连通域的所有像素点的坐标都落入条纹图形模板的像素点的坐标构成的集合内,则可以确定第一连通域为目标连通域,反之,则可以确定第一连通域不是目标连通域。对每一个第一连通域都进行上述的判断,就可以将条纹图形对应的所有目标连通域都查找出来。
在一具体的实施例中,如果原始图像包括多个闪烁光源所形成的多个条纹图形,则还需要对查找到的目标连通域进行分类以获得多个条纹集合。具体地,根据目标连通域构成条纹集合的条件,确定初始条纹集合,筛选未归入任何初始条纹集合的目标连通域。其中,目标连通域构成条纹集合的条件可以是随机选择一个未归入任何一个条纹集合的目标连通域,将选择出来的目标连通域归入初始条纹集合,从而得到初始条纹集合。然后,从未归入任何条纹集合的目标连通域中,选取第j个目标连通域,其中j为正整数。以第j个目标连通域的质心为圆心,以第j个目标连通域的长度为直径作圆;判断初始条纹集合中的任意一个目标连通域区域是否与圆相交。如果相交,则将第j个目标连通域归入对应的初始条纹集合。对所有未归入任何一个条纹集合的目标连通域按上述的方法进行判断后,则初始条纹集合被对应更新为条纹集合。完成查找后,查找的结果如图7所示。
在一具体的实施例中,由于目标连通域个数太少的条纹集合和最长的目标连通域长度太短的条纹集合都是不及格的条纹集合,所以,为了提高查找条纹集合的准确性,还可以在完成查找后进行如下判断,以将不符合的条纹集合去掉。具体地,判断条纹集合是否同时满足以下条件:条纹集合中的目标连通域的数量是否大于数量阈值;条纹集合中最长的目标连通域的长度是否大于长度阈值。如果不是同时满足所述条件,则删除条纹集合,如果同时满足所述条件,则保留条纹集合。
在一具体的实施例中,根据条纹集合中的目标连通域计算出条纹图形的中心可以包括:对条纹集合中的目标连通域的中心的坐标值求平均以得到条纹图形的中心的坐标值,或者,对条纹集合中的目标连通域的所有像素点的坐标值求平均以得到条纹图形的中心的坐标值等等。
在具体的实现中,对条纹集合中的目标连通域的中心的坐标值求平均以得到条纹图形的中心的坐标值可以是:根据公式(1)对条纹集合中的目标连通域的中心的坐标值求平均以得到条纹图形的中心(u0,v0):
Figure PCTCN2016076980-appb-000011
          公式(1)
其中,i为条纹集合中目标连通域的序号,Li为条纹集合中目标连通域的数量,
Figure PCTCN2016076980-appb-000012
为第i个目标连通域的最小横坐标,
Figure PCTCN2016076980-appb-000013
为第i个目标连通域的最小纵坐标,Wi为i个目标连通域的宽度,Hi为i个目标连通域的长度。
在具体的实现中,对条纹集合中的目标连通域的中心的坐标值求平均以得到条纹图形的中心的坐标值还可以是:首先,根据公式(1)对条纹集合中的目标连通域的中心的坐标值求平均以得到条纹图形的中心(u0,v0):
Figure PCTCN2016076980-appb-000014
        公式(1)
其中,i为条纹集合中目标连通域的序号,Li为条纹集合中目标连通域的数量,
Figure PCTCN2016076980-appb-000015
为第i个目标连通域的最小横坐标,
Figure PCTCN2016076980-appb-000016
为第i个目标连通域的最小纵坐标,Wi为i个目标连通域的宽度,Hi为i个目标连通域的长度。然后,以条纹图形的中心(u0,v0)为中心,以条纹集合中最大连通域的宽度为边长得到一个矩形区域Q。之后,对矩形区域Q中的像素点的像素值进行滤波以得到滤波后的像素值。滤波的方式可以是高斯滤波、均值滤波等等。在一具体的实施方式中,可以通过如下的方法进行滤波,根据公式(2)对矩形区域Q中的像素点的像素值通过滤波模板进行滤波以得到滤波后的像素值
Figure PCTCN2016076980-appb-000017
Figure PCTCN2016076980-appb-000018
    公式(2)
其中,n为滤波模板的行数和列数,
Figure PCTCN2016076980-appb-000019
为像素值,kvalue为二值化阈值。最后,以滤波后的像素点的像素值作为权值重新计算条纹图形的中心(u0,v0)的坐标值。在一具体的实施方式中,根据公式(3)重新计算条纹图形的中心(u0,v0)的坐标值,
Figure PCTCN2016076980-appb-000020
                                                     公式(3)
其中,(uj,vj)为矩形区域Q中的像素点的坐标值,
Figure PCTCN2016076980-appb-000021
为像素点(uj,vj)滤波后的像素值。
在一具体的实施例中,可以通过如下的方法判断确定条纹集合是否为有效条纹集合,具体地:判断所述条纹图形的中心(u0,v0)是否满足以下至少一个:
Figure PCTCN2016076980-appb-000022
其中,R为条纹集合中最大的连通域的宽度,kwide为二值化图像的宽度,kheight为二值化图像的高度;如果满足至少一个,则确定条纹集合为无效条纹集合,如果不满足任意一个,则确定条纹集合为有效条纹集合。经过判断确定条纹集合是否为有效条纹集合之后,得到的图像如图8所示。
参阅图9,本发明还提供了一种终端,具体来讲:终端500可以包括RF(Radio Frequency,射频)电路510、包括有一个或一个以上计算机可读存储介质的存储器520、输入单元530、显示单元540、传感器550、音频电路5160、WiFi(wireless fidelity,无线保真)模块570、包括有一个或者一个以上处理核心的处理器580、以及电源590等部件。本领域技术人员可以理解,图8中示出的终端结构并不构成对终端的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。其中:
RF电路510可用于收发信息或通话过程中,信号的接收和发送,特别地,将基站的下行信息接收后,交由一个或者一个以上处理器580处理;另外,将涉及上行的数据发送给基站。通常,RF电路510包括但不限于天线、至少一个放大器、调谐器、一个或多个振荡器、用户身份模块(SIM)卡、收发信机、耦合器、LNA(Low Noise Amplifier,低噪声放大器)、双工器等。此外,RF电路510还可以通过无线通信与网络和其他设备通信。所述无线通信可以使用任一通信标准或协议,包括但不限于GSM(Global System of Mobile  communication,全球移动通讯系统)、GPRS(General Packet Radio Service,通用分组无线服务)、CDMA(Code Division Multiple Access,码分多址)、WCDMA(Wideband Code Division Multiple Access,宽带码分多址)、LTE(Long Term Evolution,长期演进)、电子邮件、SMS(Short Messaging Service,短消息服务)等。
存储器520可用于存储软件程序以及模块,处理器580通过运行存储在存储器520的软件程序以及模块,从而执行各种功能应用以及数据处理。存储器520可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据终端500的使用所创建的数据(比如音频数据、电话本等)等。此外,存储器520可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。相应地,存储器520还可以包括存储器控制器,以提供处理器580和输入单元530对存储器520的访问。
输入单元530可用于接收输入的数字或字符信息,以及产生与用户设置以及功能控制有关的键盘、鼠标、操作杆、光学或者轨迹球信号输入。具体地,输入单元530可包括触敏表面531以及其他输入设备532。触敏表面531,也称为触摸显示屏或者触控板,可收集用户在其上或附近的触摸操作(比如用户使用手指、触笔等任何适合的物体或附件在触敏表面531上或在触敏表面531附近的操作),并根据预先设定的程式驱动相应的连接装置。可选的,触敏表面531可包括触摸检测装置和触摸控制器两个部分。其中,触摸检测装置检测用户的触摸方位,并检测触摸操作带来的信号,将信号传送给触摸控制器;触摸控制器从触摸检测装置上接收触摸信息,并将它转换成触点坐标,再送给处理器580,并能接收处理器580发来的命令并加以执行。此外,可以采用电阻式、电容式、红外线以及表面声波等多种类型实现触敏表面531。除了触敏表面531,输入单元530还可以包括其他输入设备532。具体地,其他输入设备532可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆等中的一种或多种。
显示单元540可用于显示由用户输入的信息或提供给用户的信息以及终端500的各种图形用户接口,这些图形用户接口可以由图形、文本、图标、视 频和其任意组合来构成。显示单元540可包括显示面板541,可选的,可以采用LCD(Liquid Crystal Display,液晶显示器)、OLED(Organic Light-Emitting Diode,有机发光二极管)等形式来配置显示面板541。进一步的,触敏表面531可覆盖显示面板541,当触敏表面531检测到在其上或附近的触摸操作后,传送给处理器580以确定触摸事件的类型,随后处理器580根据触摸事件的类型在显示面板541上提供相应的视觉输出。虽然在图8中,触敏表面531与显示面板541是作为两个独立的部件来实现输入和输入功能,但是在某些实施例中,可以将触敏表面531与显示面板541集成而实现输入和输出功能。
终端500还可包括至少一种传感器550,比如光传感器、运动传感器以及其他传感器。具体地,光传感器可包括环境光传感器及接近传感器,其中,环境光传感器可根据环境光线的明暗来调节显示面板541的亮度,接近传感器可在终端500移动到耳边时,关闭显示面板541和/或背光。作为运动传感器的一种,重力加速度传感器可检测各个方向上(一般为三轴)加速度的大小,静止时可检测出重力的大小及方向,可用于识别手机姿态的应用(比如横竖屏切换、相关游戏、磁力计姿态校准)、振动识别相关功能(比如计步器、敲击)等;至于终端500还可配置的陀螺仪、气压计、湿度计、温度计、红外线传感器等其他传感器,在此不再赘述。
音频电路560、扬声器561,传声器562可提供用户与终端500之间的音频接口。音频电路560可将接收到的音频数据转换后的电信号,传输到扬声器561,由扬声器561转换为声音信号输出;另一方面,传声器562将收集的声音信号转换为电信号,由音频电路560接收后转换为音频数据,再将音频数据输出处理器580处理后,经RF电路510以发送给比如另一终端,或者将音频数据输出至存储器520以便进一步处理。音频电路560还可能包括耳塞插孔,以提供外设耳机与终端500的通信。
WiFi属于短距离无线传输技术,终端500通过WiFi模块570可以帮助用户收发电子邮件、浏览网页和访问流式媒体等,它为用户提供了无线的宽带互联网访问。虽然图8示出了WiFi模块570,但是可以理解的是,其并不属于终端500的必须构成,完全可以根据需要在不改变发明的本质的范围内而省略。
处理器580是终端500的控制中心,利用各种接口和线路连接整个手机的 各个部分,通过运行或执行存储在存储器520内的软件程序和/或模块,以及调用存储在存储器520内的数据,执行终端500的各种功能和处理数据,从而对手机进行整体监控。可选的,处理器580可包括一个或多个处理核心;优选的,处理器580可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器580中。
终端500还包括给各个部件供电的电源590(比如电池),优选的,电源可以通过电源管理系统与处理器580逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。电源590还可以包括一个或一个以上的直流或交流电源、再充电系统、电源故障检测电路、电源转换器或者逆变器、电源状态指示器等任意组件。
尽管未示出,终端500还可以包括摄像头、蓝牙模块等,在此不再赘述。具体在本实施例中,终端的显示单元是触摸屏显示器,终端还包括有存储器,以及一个或者一个以上的程序,其中一个或者一个以上程序存储于存储器中,且经配置以由一个或者一个以上处理器执行述一个或者一个以上程序包含用于进行以下操作的指令:
获取二值化图像中的多个第一连通域;
从所述多个第一连通域中选择出目标连通域;
根据所述目标连通域确定条纹集合,从而确定条纹图形;
根据所述条纹集合中的目标连通域计算出所述条纹图形的中心;
根据所述条纹图形的中心确定所述条纹集合是否为有效条纹集合。
可选地,所述获取二值化图像中的多个第一连通域之前还包括:接收卷帘式图像传感器采集得到的单帧原始图像,其中,所述原始图像包括闪烁光源所形成的条纹图形;根据二值化阈值,对所述原始图像进行二值化以得到二值化图像。
可选地,从所述多个第一连通域中选择出目标连通域包括:确定所述多个第一连通域中每个第一连通域的宽度差,将所述每个第一连通域的宽度差和预设的宽度差进行比较,根据比较结果确定其中符合条件的第一连通域为目标连通域。
可选地,将所述每个第一连通域的宽度差和预设的宽度差进行比较,确定 其中符合条件的第一连通域为目标连通域,具体包括:根据卷帘式图像传感器成像平面,以预设条纹图像的条纹长度方向为x轴,并令y轴垂直于所述x轴;遍历所述多个第一连通域的所有像素点以获得所述多个第一连通域对应所有像素点的最大列坐标y1和最小列坐标y2,确定所述多个第一连通域中每个第一连通域的宽度差为:每个第一连通域中的像素点最大列坐标y1减去像素点最小列坐标y2;判断所述多个第一连通域中每个第一连通域的宽度差是否≧kh1且≦kh2,其中,kh1为预设的第一边界条件参数,kh2为预设的第二边界条件参数;确定符合宽度差≧kh1且≦kh2的第一连通域为目标连通域。
可选地,还包括以下步骤:从所述多个第一连通域中删除宽度差﹤kh1或者﹥kh2的第一连通域。
可选地,接收卷帘式图像传感器采集得到的原始图像之后,从所述多个第一连通域中选择出目标连通域之前包括:对所述原始图像进行处理以得到条纹图形模板,并根据所述条纹图形模板识别出目标连通域,其中,所述条纹图形模板的形状为所述原始图像中的条纹图形融合而成的斑状。
可选地,对所述原始图像进行处理以得到条纹图形模板具体为:根据所述滤波的参数对所述原始图像进行滤波以得到模糊图像,其中,所述滤波的参数设置为使得所述原始图像中的各个图形融合成各自对应的斑块;对所述模糊图像进行二值化以得到二值化模糊图像;对所述二值化模糊图像查找连通域以获得多个第二连通域;识别所述多个第二连通域的形状,并根据与预设的所述闪烁光源所形成的条纹图形形状最接近的第二连通域作为条纹图形模板。
可选地,根据所述条纹图形模板识别出目标连通域具体为:判断所述第一连通域的像素点的坐标是否都包括在所述条纹图形模板的像素点的坐标构成的集合中;如果是,确定所述第一连通域为目标连通域。
可选地,所述原始图像包括多个闪烁光源所形成的多个条纹图形,根据所述目标连通域确定条纹集合具体为:对所述目标连通域进行分类以获得多个条纹集合。
可选地,对所述目标连通域进行分类以获得多个条纹集合包括:根据所述目标连通域构成条纹集合的条件,确定初始条纹集合,筛选未归入任何初始条纹集合的所述目标连通域;从未归入任何初始条纹集合的所述目标连通域中, 选取第j个目标连通域,其中j为正整数;以所述第j个目标连通域的质心为圆心,以所述第j个目标连通域的长度为直径作圆;判断所述初始条纹集合中的任意一个目标连通域区域是否与所述圆相交;如果相交,则将所述第j个目标连通域归入对应的所述初始条纹集合,从而得到条纹集合。
可选地,对所述目标连通域进行分类以获得多个条纹集合之后还包括:判断所述条纹集合是否同时满足以下条件:所述条纹集合中的目标连通域的数量是否大于数量阈值;所述条纹集合中最长的目标连通域的长度是否大于长度阈值;如果不是同时满足所述条件,则删除所述条纹集合。
可选地,根据所述条纹集合中的目标连通域计算出条纹图形的中心具体为:对所述条纹集合中的目标连通域的中心的坐标值求平均以得到所述条纹图形的中心的坐标值。
可选地,对所述条纹集合中的目标连通域的中心的坐标值求平均以得到所述条纹图形的中心的坐标值具体为:
根据公式(1)对所述条纹集合中的目标连通域的中心的坐标值求平均以得到所述条纹图形的中心(u0,v0):
Figure PCTCN2016076980-appb-000023
          公式(1)
其中,i为所述条纹集合中目标连通域的序号,Li为所述条纹集合中目标连通域的数量,
Figure PCTCN2016076980-appb-000024
为第i个目标连通域的最小横坐标,
Figure PCTCN2016076980-appb-000025
为第i个目标连通域的最小纵坐标,Wi为i个目标连通域的宽度,Hi为i个目标连通域的长度。
可选地,根据公式(1)对所述条纹集合中的目标连通域的中心的坐标值求平均以得到所述条纹图形的中心(u0,v0)之后,根据所述条纹图形的中心确定所述条纹集合是否为有效条纹集合之前,还包括:对矩形区域Q中的像素点的像素值进行滤波以得到滤波后的像素值,其中,所述矩形区域Q为所述条纹图形的中心(u0,v0)为中心,以所述条纹集合中最大连通域的宽度为边长的矩形区域;以所述滤波后的像素点的像素值作为权值重新计算所述条纹图形的中心(u0,v0)的坐标值。
可选地,对矩形区域Q中的像素点的像素值进行滤波以得到滤波后的像 素值具体为:根据公式(2)对矩形区域Q中的像素点的像素值通过滤波模板进行滤波以得到滤波后的像素值
Figure PCTCN2016076980-appb-000026
其中,
Figure PCTCN2016076980-appb-000027
      公式(2)
n为所述滤波模板的行数和列数,
Figure PCTCN2016076980-appb-000028
为像素值,kvalue为二值化阈值。
可选地,以所述滤波后的像素点的像素值作为权值重新计算所述条纹图形的中心(u0,v0)的坐标值具体为:
根据公式(3)重新计算所述条纹图形的中心(u0,v0)的坐标值,其中,
Figure PCTCN2016076980-appb-000029
                                                      公式(3)
(uj,vj)为矩形区域Q中的像素点的坐标值,
Figure PCTCN2016076980-appb-000030
为像素点(uj,vj)滤波后的像素值。
可选地,根据所述条纹图形的中心确定所述条纹集合是否为有效条纹集合具体包括:
判断所述条纹图形的中心(u0,v0)是否满足以下至少一个:
Figure PCTCN2016076980-appb-000031
其中,R为所述条纹集合中最大的连通域的宽度,kwide为所述二值化图像的宽度,kheight为所述二值化图像的高度;如果满足至少一个,则确定所述条纹集合为无效条纹集合,如果不满足任意一个,则确定所述条纹集合为有效 条纹集合。
为进一步优化运动跟踪系统,本发明实施例还公开了另一种运动跟踪系统,与图1所示的运动跟踪系统的不同之处在于,所述卷帘式图像传感器和所述图像处理装置均集成在终端中。其中,终端可以是智能手机、笔记本电脑、平板电脑、行车记录仪、录像机、投影仪等等。
本发明实施例还公开了一种图像处理系统,与图1所示的运动跟踪系统的不同之处在于,所述图像处理系统只包括卷帘式图像传感器以及图像处理装置,不包括控制器。
本发明实施例还提供了一种条纹集合查找装置,所述装置包括能够实现如图4所示的方法的单元,具体请参阅图4以及相关描述,此处不再展开描述。
本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器(processor)执行本申请各个实施方式所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。

Claims (24)

  1. 一种条纹集合有效性确定方法,其特征在于,包括:
    获取二值化图像中的多个第一连通域;
    从所述多个第一连通域中选择出目标连通域;
    根据所述目标连通域确定条纹集合,从而确定条纹图形;
    根据所述条纹集合中的目标连通域计算出所述条纹图形的中心;
    根据所述条纹图形的中心确定所述条纹集合是否为有效条纹集合。
  2. 根据权利要求1所述的方法,其特征在于,所述获取二值化图像中的多个第一连通域之前还包括:
    接收卷帘式图像传感器采集得到的单帧原始图像,其中,所述原始图像包括闪烁光源所形成的条纹图形;
    根据二值化阈值,对所述原始图像进行二值化以得到二值化图像。
  3. 根据权利要求1所述的方法,其特征在于,从所述多个第一连通域中选择出目标连通域包括:
    确定所述多个第一连通域中每个第一连通域的宽度差,将所述每个第一连通域的宽度差和预设的宽度差进行比较,根据比较结果确定其中符合条件的第一连通域为目标连通域。
  4. 根据权利要求3所述的方法,其特征在于,
    将所述每个第一连通域的宽度差和预设的宽度差进行比较,确定其中符合条件的第一连通域为目标连通域,具体包括:
    根据卷帘式图像传感器成像平面,以预设条纹图像的条纹长度方向为x轴,并令y轴垂直于所述x轴;
    遍历所述多个第一连通域的所有像素点以获得所述多个第一连通域对应所有像素点的最大列坐标y1和最小列坐标y2,确定所述多个第一连通域中每个第一连通域的宽度差为:每个第一连通域中的像素点最大列坐标y1减去像素点最小列坐标y2;
    判断所述多个第一连通域中每个第一连通域的宽度差是否≧kh1且≦kh2,其中,kh1为预设的第一边界条件参数,kh2为预设的第二边界条件参数;
    确定符合宽度差≧kh1且≦kh2的第一连通域为目标连通域。
  5. 根据权利要求4所述的方法,其特征在于,还包括以下步骤:从所述多个第一连通域中删除宽度差﹤kh1或者﹥kh2的第一连通域。
  6. 根据权利要求1所述的方法,其特征在于,
    接收卷帘式图像传感器采集得到的原始图像之后,从所述多个第一连通域中选择出目标连通域之前包括:
    对所述原始图像进行处理以得到条纹图形模板,并根据所述条纹图形模板识别出目标连通域,其中,所述条纹图形模板的形状为所述原始图像中的条纹图形融合而成的斑状。
  7. 根据权利要求6所述的方法,其特征在于,
    对所述原始图像进行处理以得到条纹图形模板具体为:
    根据所述滤波的参数对所述原始图像进行滤波以得到模糊图像,其中,所述滤波的参数设置为使得所述原始图像中的各个图形融合成各自对应的斑块;
    对所述模糊图像进行二值化以得到二值化模糊图像;
    对所述二值化模糊图像查找连通域以获得多个第二连通域;
    识别所述多个第二连通域的形状,并根据与预设的所述闪烁光源所形成的条纹图形形状最接近的第二连通域作为条纹图形模板。
  8. 根据权利要求7所述的方法,其特征在于,根据所述条纹图形模板识别出目标连通域具体为:
    判断所述第一连通域的像素点的坐标是否都包括在所述条纹图形模板的像素点的坐标构成的集合中;
    如果是,确定所述第一连通域为目标连通域。
  9. 根据权利要求1至8任一权利要求所述的方法,其特征在于,所述原始图像包括多个闪烁光源所形成的多个条纹图形,根据所述目标连通域确定条纹集合具体为:
    对所述目标连通域进行分类以获得多个条纹集合。
  10. 根据权利要求9所述的方法,其特征在于,
    对所述目标连通域进行分类以获得多个条纹集合包括:
    根据所述目标连通域构成条纹集合的条件,确定初始条纹集合,筛选未归 入任何初始条纹集合的所述目标连通域;
    从未归入任何初始条纹集合的所述目标连通域中,选取第j个目标连通域,其中j为正整数;
    以所述第j个目标连通域的质心为圆心,以所述第j个目标连通域的长度为直径作圆;
    判断所述初始条纹集合中的任意一个目标连通域区域是否与所述圆相交;
    如果相交,则将所述第j个目标连通域归入对应的所述初始条纹集合,从而得到条纹集合。
  11. 根据权利要求10所述的方法,其特征在于,对所述目标连通域进行分类以获得多个条纹集合之后还包括:
    判断所述条纹集合是否同时满足以下条件:所述条纹集合中的目标连通域的数量是否大于数量阈值;所述条纹集合中最长的目标连通域的长度是否大于长度阈值;
    如果不是同时满足所述条件,则删除所述条纹集合。
  12. 根据权利要求1所述的方法,其特征在于,根据所述条纹集合中的目标连通域计算出条纹图形的中心具体为:
    对所述条纹集合中的目标连通域的中心的坐标值求平均以得到所述条纹图形的中心的坐标值。
  13. 根据权利要求12所述的方法,其特征在于,对所述条纹集合中的目标连通域的中心的坐标值求平均以得到所述条纹图形的中心的坐标值具体为:
    根据公式(1)对所述条纹集合中的目标连通域的中心的坐标值求平均以得到所述条纹图形的中心(u0,v0):
    Figure PCTCN2016076980-appb-100001
    其中,i为所述条纹集合中目标连通域的序号,Li为所述条纹集合中目标连通域的数量,
    Figure PCTCN2016076980-appb-100002
    为第i个目标连通域的最小横坐标,
    Figure PCTCN2016076980-appb-100003
    为第i个目标连通域的最小纵坐标,Wi为i个目标连通域的宽度,Hi为i个目标连通域的长度。
  14. 根据权利要求13所述的方法,其特征在于,根据公式(1)对所述条 纹集合中的目标连通域的中心的坐标值求平均以得到所述条纹图形的中心(u0,v0)之后,根据所述条纹图形的中心确定所述条纹集合是否为有效条纹集合之前,还包括:
    对矩形区域Q中的像素点的像素值进行滤波以得到滤波后的像素值,其中,所述矩形区域Q为所述条纹图形的中心(u0,v0)为中心,以所述条纹集合中最大连通域的宽度为边长的矩形区域;
    以所述滤波后的像素点的像素值作为权值重新计算所述条纹图形的中心(u0,v0)的坐标值。
  15. 根据权利要求14所述的方法,其特征在于,对矩形区域Q中的像素点的像素值进行滤波以得到滤波后的像素值具体为:
    根据公式(2)对矩形区域Q中的像素点的像素值通过滤波模板进行滤波以得到滤波后的像素值
    Figure PCTCN2016076980-appb-100004
    其中,
    Figure PCTCN2016076980-appb-100005
    n为所述滤波模板的行数和列数,
    Figure PCTCN2016076980-appb-100006
    为像素值,kvalue为二值化阈值。
  16. 根据权利要求14所述的方法,其特征在于,以所述滤波后的像素点的像素值作为权值重新计算所述条纹图形的中心(u0,v0)的坐标值具体为:
    根据公式(3)重新计算所述条纹图形的中心(u0,v0)的坐标值,其中,
    Figure PCTCN2016076980-appb-100007
    公式(3)
    (uj,vj)为矩形区域Q中的像素点的坐标值,
    Figure PCTCN2016076980-appb-100008
    为像素点(uj,vj)滤波后的像素值。
  17. 根据权利要求13至16任一权利要求所述的方法,其特征在于,根据所述条纹图形的中心确定所述条纹集合是否为有效条纹集合具体包括:
    判断所述条纹图形的中心(u0,v0)是否满足以下至少一个:
    Figure PCTCN2016076980-appb-100009
    其中,R为所述条纹集合中最大的连通域的宽度,kwide为所述二值化图像的宽度,kheight为所述二值化图像的高度;
    如果满足至少一个,则确定所述条纹集合为无效条纹集合,如果不满足任意一个,则确定所述条纹集合为有效条纹集合。
  18. 一种条纹集合有效性确定装置,其特征在于,所述装置包括能够实现如权利要求1至17任一权利要求所述的方法的单元。
  19. 一种终端,其特征在于,包括卷帘式图像传感器、存储器以及分别与所述卷帘式图像传感器、存储器耦合的处理器,所述存储器用于存储所述卷帘式图像传感器采集到的图像以及指令,所述处理器用于执行所述指令,当所述处理器在执行所述指令时,可根据所述指令执行如权利要求1-17中任一权利要求的方法,以实现对所述卷帘式图像传感器采集到的图像进行处理以确定条纹集合的有效性。
  20. 一种运动物体跟踪系统,其特征在于,包括终端、设置有闪烁光源的控制器,其中,所述终端设置有卷帘式图像传感器,所述设置有闪烁光源的控制器被安装在运动物体上,所述终端为如权利要求19所述的终端。
  21. 一种图像处理装置,其特征在于,包括:处理器以及存储器,其中,所述处理器连接所述存储器,所述存储器用于存储指令,所述处理器用于执行所述指令,当所述处理器在执行所述指令时,可根据所述指令执行如权利要求1-17中任一权利要求的方法,以实现对所述卷帘式图像传感器采集到的图像进行处理以确定条纹集合的有效性。
  22. 一种图像处理系统,其特征在于,包括卷帘式图像传感器以及图像处理装置,所述图像处理装置耦合所述卷帘式图像传感器,其中,所述图像处理 装置为如权利要求21所述的图像处理装置。
  23. 一种运动物体跟踪系统,其特征在于,包括卷帘式图像传感器、设置有闪烁光源的控制器以及图像处理装置,所述图像处理装置分别耦合所述卷帘式图像传感器以及所述控制器,其中,所述控制器被安装在运动物体上,所述图像处理装置为如权利要求21所述的图像处理装置。
  24. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储了确定条纹集合有效性的程序代码,所述程序代码包括用于执行如权利要求1-17任意一权利要求所述的方法的指令。
PCT/CN2016/076980 2016-03-22 2016-03-22 条纹集合查找方法、装置以及系统 WO2017161496A1 (zh)

Priority Applications (3)

Application Number Priority Date Filing Date Title
US15/578,705 US10795456B2 (en) 2016-03-22 2016-03-22 Method, device and terminal for determining effectiveness of stripe set
PCT/CN2016/076980 WO2017161496A1 (zh) 2016-03-22 2016-03-22 条纹集合查找方法、装置以及系统
CN201680003225.XA CN107223265B (zh) 2016-03-22 2016-03-22 条纹集合查找方法、装置以及系统

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2016/076980 WO2017161496A1 (zh) 2016-03-22 2016-03-22 条纹集合查找方法、装置以及系统

Publications (1)

Publication Number Publication Date
WO2017161496A1 true WO2017161496A1 (zh) 2017-09-28

Family

ID=59899875

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/076980 WO2017161496A1 (zh) 2016-03-22 2016-03-22 条纹集合查找方法、装置以及系统

Country Status (3)

Country Link
US (1) US10795456B2 (zh)
CN (1) CN107223265B (zh)
WO (1) WO2017161496A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112085752A (zh) * 2020-08-20 2020-12-15 浙江华睿科技有限公司 一种图像的处理方法、装置、设备及介质

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017161495A1 (zh) * 2016-03-22 2017-09-28 广东虚拟现实科技有限公司 条纹集合查找方法、装置以及系统
CN110325872B (zh) * 2016-07-14 2023-04-28 广东虚拟现实科技有限公司 闪烁光源的识别方法以及装置
CN109785380B (zh) * 2018-12-29 2020-09-18 北京金山安全软件有限公司 一种内切圆确定方法及装置
CN115409825B (zh) * 2022-09-06 2023-09-12 重庆众仁科技有限公司 一种基于图像识别的温湿压迹线识别方法

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002286411A (ja) * 2001-03-28 2002-10-03 Fuji Photo Optical Co Ltd 縞解析方法および装置
CN102426480A (zh) * 2011-11-03 2012-04-25 康佳集团股份有限公司 一种人机交互系统及其实时手势跟踪处理方法
CN102779279A (zh) * 2012-06-14 2012-11-14 南京航空航天大学 搅拌摩擦焊弧形纹间距的图像识别方法
CN104282011A (zh) * 2013-07-04 2015-01-14 浙江大华技术股份有限公司 一种检测视频图像中干扰条纹的方法及装置

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3927776B2 (ja) * 2001-06-25 2007-06-13 キヤノン株式会社 画像処理装置及びその処理方法
JP4335849B2 (ja) * 2005-06-13 2009-09-30 富士通マイクロエレクトロニクス株式会社 フリッカ検出可能な撮像装置
CN101692691B (zh) * 2009-09-27 2012-07-04 上海大学 视频图像中条带的检测方法
US9723676B2 (en) * 2011-07-26 2017-08-01 Abl Ip Holding Llc Method and system for modifying a beacon light source for use in a light based positioning system
US8334898B1 (en) * 2011-07-26 2012-12-18 ByteLight, Inc. Method and system for configuring an imaging device for the reception of digital pulse recognition information
CN103886552B (zh) * 2014-02-24 2017-01-11 深圳市安健科技股份有限公司 一种去除x射线影像滤线栅条纹的方法及系统
CN105046260B (zh) * 2015-07-31 2019-01-04 小米科技有限责任公司 图像预处理方法及装置

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002286411A (ja) * 2001-03-28 2002-10-03 Fuji Photo Optical Co Ltd 縞解析方法および装置
CN102426480A (zh) * 2011-11-03 2012-04-25 康佳集团股份有限公司 一种人机交互系统及其实时手势跟踪处理方法
CN102779279A (zh) * 2012-06-14 2012-11-14 南京航空航天大学 搅拌摩擦焊弧形纹间距的图像识别方法
CN104282011A (zh) * 2013-07-04 2015-01-14 浙江大华技术股份有限公司 一种检测视频图像中干扰条纹的方法及装置

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112085752A (zh) * 2020-08-20 2020-12-15 浙江华睿科技有限公司 一种图像的处理方法、装置、设备及介质
CN112085752B (zh) * 2020-08-20 2024-01-30 浙江华睿科技股份有限公司 一种图像的处理方法、装置、设备及介质

Also Published As

Publication number Publication date
CN107223265A (zh) 2017-09-29
CN107223265B (zh) 2020-11-27
US20180173327A1 (en) 2018-06-21
US10795456B2 (en) 2020-10-06

Similar Documents

Publication Publication Date Title
WO2017161495A1 (zh) 条纹集合查找方法、装置以及系统
CN107436685B (zh) 显示装置、自发光的显示面板及手势识别方法
CN106778585B (zh) 一种人脸关键点跟踪方法和装置
WO2017161496A1 (zh) 条纹集合查找方法、装置以及系统
JP6374970B2 (ja) 画像処理方法および装置ならびにコンピュータデバイス
CN111476780B (zh) 一种图像检测方法、装置、电子设备以及存储介质
CN107038681B (zh) 图像虚化方法、装置、计算机可读存储介质和计算机设备
CN103871051A (zh) 图像处理方法、装置和电子设备
US20150310637A1 (en) Interface adjustment method, apparatus, and terminal
CN106874906B (zh) 一种图片的二值化方法、装置及终端
CN109391762A (zh) 一种跟踪拍摄的方法和装置
US10922846B2 (en) Method, device and system for identifying light spot
WO2016173350A1 (zh) 图片处理方法及装置
CN106296617A (zh) 人脸图像的处理方法及装置
CN106371086B (zh) 一种测距的方法和装置
CN108269220B (zh) 定位数字水印的方法及装置
CN104463105A (zh) 路牌识别方法及装置
CN107124556A (zh) 对焦方法、装置、计算机可读存储介质和移动终端
CN111080665B (zh) 图像边框识别方法、装置、设备和计算机存储介质
CN106127720B (zh) 一种拍摄放大图像的方法和装置
CN105513098B (zh) 一种图像处理的方法和装置
CN113421211A (zh) 光斑虚化的方法、终端设备及存储介质
CN105657280A (zh) 一种快速对焦方法、装置及移动终端
CN114140655A (zh) 图像分类方法、装置、存储介质及电子设备
WO2018232613A1 (zh) 光源识别方法及装置

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 15578705

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE

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

Ref document number: 16894851

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 1.2.19)

122 Ep: pct application non-entry in european phase

Ref document number: 16894851

Country of ref document: EP

Kind code of ref document: A1