WO2014006832A1 - サイズ測定装置及びサイズ測定方法 - Google Patents

サイズ測定装置及びサイズ測定方法 Download PDF

Info

Publication number
WO2014006832A1
WO2014006832A1 PCT/JP2013/003819 JP2013003819W WO2014006832A1 WO 2014006832 A1 WO2014006832 A1 WO 2014006832A1 JP 2013003819 W JP2013003819 W JP 2013003819W WO 2014006832 A1 WO2014006832 A1 WO 2014006832A1
Authority
WO
WIPO (PCT)
Prior art keywords
size
package
unit
vertex
peripheral
Prior art date
Application number
PCT/JP2013/003819
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 JP2014523572A priority Critical patent/JP6132275B2/ja
Priority to GB1423377.9A priority patent/GB2519006B/en
Priority to DE112013003338.0T priority patent/DE112013003338B4/de
Publication of WO2014006832A1 publication Critical patent/WO2014006832A1/ja
Priority to US14/585,627 priority patent/US9607406B2/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras
    • G06T7/73Determining position or orientation of objects or cameras using feature-based methods
    • G06T7/75Determining position or orientation of objects or cameras using feature-based methods involving models
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01BMEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
    • G01B11/00Measuring arrangements characterised by the use of optical techniques
    • G01B11/02Measuring arrangements characterised by the use of optical techniques for measuring length, width or thickness
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01CMEASURING DISTANCES, LEVELS OR BEARINGS; SURVEYING; NAVIGATION; GYROSCOPIC INSTRUMENTS; PHOTOGRAMMETRY OR VIDEOGRAMMETRY
    • G01C3/00Measuring distances in line of sight; Optical rangefinders
    • G01C3/10Measuring distances in line of sight; Optical rangefinders using a parallactic triangle with variable angles and a base of fixed length in the observation station, e.g. in the instrument
    • G01C3/14Measuring distances in line of sight; Optical rangefinders using a parallactic triangle with variable angles and a base of fixed length in the observation station, e.g. in the instrument with binocular observation at a single point, e.g. stereoscopic type
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • G06T7/62Analysis of geometric attributes of area, perimeter, diameter or volume
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras
    • G06T7/73Determining position or orientation of objects or cameras using feature-based methods
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N13/00Stereoscopic video systems; Multi-view video systems; Details thereof
    • H04N13/20Image signal generators
    • H04N13/204Image signal generators using stereoscopic image cameras
    • H04N13/239Image signal generators using stereoscopic image cameras using two 2D image sensors having a relative position equal to or related to the interocular distance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/0007Image acquisition
    • 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/10004Still image; Photographic image
    • 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/10004Still image; Photographic image
    • G06T2207/10012Stereo images
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20092Interactive image processing based on input by user
    • G06T2207/20101Interactive definition of point of interest, landmark or seed
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20092Interactive image processing based on input by user
    • G06T2207/20104Interactive definition of region of interest [ROI]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N13/00Stereoscopic video systems; Multi-view video systems; Details thereof
    • H04N2013/0074Stereoscopic image analysis
    • H04N2013/0081Depth or disparity estimation from stereoscopic image signals

Definitions

  • the present invention relates to a size measuring apparatus and a size measuring method for measuring the size of a subject from captured image data.
  • examples of managing the delivery of goods by attaching a form with a barcode printed on the product package are known in a wide range of fields.
  • the form information attached to the package for packaging the article is read with a handy terminal equipped with a bar code reader to identify the article, and the article is distributed based on the identification information.
  • the package and the form pasted on the package are assumed on the assumption that the package for wrapping the article is a cube or a rectangular parallelepiped, and the form size is known.
  • There is a size measuring device that simultaneously photographs and measures a package size using a form as a reference length in a photographed image for example, Patent Document 1).
  • the captured image data is displayed on the display device and the user designates the feature points via the input device.
  • the hardware limitations of the display device and input device Therefore, it is difficult for the user to accurately specify the coordinates that become the feature points.
  • Patent Document 1 discloses that a user designates the apex of a package with a laser beam, but the apex of the package and the laser beam should ideally be points. It is not easy for the user to accurately irradiate the top of the box with laser light.
  • An object of the present invention is to provide a size measuring apparatus and a size measuring method capable of accurately measuring the external size of a cubic or rectangular parallelepiped package based on simple designation by a user.
  • the size measuring device of the present invention is a size measuring device that measures the size of a subject from a captured image, an imaging unit that images the subject, a display unit that displays image data captured by the imaging unit, An input unit for inputting an instruction from a user; a region setting unit for setting a peripheral region including the specified position when a position is specified from the input unit for the image data displayed on the display unit; In the peripheral region set by the region setting unit, a feature point determining unit that determines a feature point serving as a coordinate to be measured is provided.
  • a process of determining a feature point serving as coordinates of a measurement target by setting a peripheral region including the designated position is performed as a vertex.
  • This search may be performed not in the entire image but in a predetermined peripheral area, and the processing load can be reduced.
  • the block block diagram which shows the structure of the size measuring apparatus which concerns on embodiment of this invention.
  • (A) is a top view of the camera portion of the size measuring terminal, and (b) is a front view of the camera portion.
  • Flow chart showing control procedure of size measuring device Schematic diagram showing the specified position with the touch pen and the corresponding surrounding area
  • (A) is explanatory drawing which shows the relationship between the left and right cameras and subject P by stereo vision
  • (b) is explanatory drawing explaining the principle which acquires the distance Zp of a camera and the subject P (ranging).
  • a perspective view for explaining the principle of obtaining (ranging) the distance Zp between the camera and the subject P is a figure which shows the left image which shows the edge detection in each peripheral area
  • (A) is a diagram showing a branch flow of exception processing in the flow of FIG. 4,
  • (b) is a diagram showing another example of the branch flow
  • (A) is a diagram for explaining a case where an edge is not detected in a part of the peripheral region,
  • (b) is a diagram for explaining (a) ST12 in FIG. 9,
  • (c) is a diagram for explaining ST13 and ST14.
  • A) is a figure explaining ST17 of FIG.9 (b), (b) is a figure explaining the same ST18.
  • (A) is a figure explaining ST19 of FIG.9 (b), (b) is a figure explaining the same ST20.
  • a first invention made to solve the above-described problem is a size measuring device for measuring the size of a subject from a captured image, the imaging unit imaging the subject, and the image data captured by the imaging unit When a position is specified from the input unit for the image data displayed on the display unit, a peripheral region including the specified position is set. And a feature point determination unit that determines a feature point that is a coordinate to be measured in the peripheral region set by the region setting unit.
  • the process of determining the feature point that becomes the coordinates of the measurement target by setting the peripheral region including the designated position is performed as a vertex search. May be performed not on the entire image but in a predetermined peripheral area, and the processing load can be reduced.
  • a distance between the two feature points is calculated based on the captured image data.
  • a configuration having a measurement unit is adopted. According to this, the distance between two feature points can be calculated, and the size of the package can be obtained based on the distance.
  • the peripheral area set by the area setting unit is displayed on the display unit. According to this, since the peripheral area of the apex of the package designated by the user is displayed on the display unit, the user can easily confirm the designated position.
  • the peripheral area set by the area setting unit is circular.
  • the peripheral area set by the area setting unit is rectangular. According to these, since the peripheral area is set by a circle or a rectangle, for example, it is possible to easily set a side area connecting the peripheral areas.
  • the imaging unit includes a first camera and a second camera arranged side by side at a predetermined interval in order to photograph the subject simultaneously from different positions.
  • the measurement unit is configured to perform a calculation process based on parallax information in the first and second cameras and calculate a distance between the feature points. According to this, the position of the apex can be determined more accurately by adopting a stereo view while adopting a simple configuration.
  • the input section and the display section are configured by a touch panel. According to this, when a user designates a position with, for example, a touch pen, the user can easily perform an instruction operation, and each designated point (a pressing point) is detected and each designated point is set to a predetermined size. Each area to be enclosed can be set easily.
  • the imaging unit images a rectangular parallelepiped package as a subject, and the three sides of the package gather from the input unit with respect to the image displayed on the display unit.
  • the area setting unit respectively sets the peripheral area with respect to the designated position of the four points.
  • the feature point determination unit determines a feature point in each of the surrounding regions.
  • the user designates, for example, a touch pen with four points, that is, a vertex where the three sides constituting the package displayed on the screen of the display unit are gathered and an end point on the side opposite to the vertex of the three sides gathered at this vertex.
  • each designated point eye pressing point
  • each surrounding area surrounding each designated point with a predetermined size is set.
  • each vertex of the package can be easily obtained by obtaining, as the position of each vertex, a point where the three sides of the package gather within each peripheral region.
  • the ninth aspect when the four feature points are determined, the ninth aspect includes a measurement unit that calculates the length of the side of the package based on the positions of the four feature points.
  • the configuration According to this, the length between the vertices can be obtained as the length of three sides, and the outer size of the package can be obtained with high accuracy.
  • the area setting is performed.
  • the unit estimates another peripheral region including a position not specified by the user based on the positional relationship between the four peripheral regions, and the feature point determination unit obtains a feature point in the estimated peripheral region
  • the feature point determination unit does not detect the feature point.
  • the feature point In the space between the peripheral region and at least two other peripheral regions adjacent to it, at least two sides are extracted, and the feature point is detected at the intersection or closest point of the extracted two sides.
  • the feature point is regarded as a feature point corresponding to the peripheral region that did not exist.
  • An intersection or closest point can be regarded as a feature point (vertex) position. Since the sides are composed of line segments and generally have a higher detection accuracy than the points, the package size can be accurately measured even when, for example, the image is taken under conditions of poor illumination conditions.
  • a twelfth invention is a size measurement method for measuring the size of a subject from a captured image, the step of imaging the subject, the step of displaying the captured image data, and the displayed image
  • the method includes a step of setting a peripheral region including the designated position, and a step of determining a feature point that is a coordinate to be measured in the peripheral region.
  • processing is performed in steps of setting a peripheral region including the designated position and determining a feature point serving as a measurement target coordinate. For example, since the feature point which becomes the vertex of the package is determined not in the whole image but in the peripheral region including the position designated by the user, the processing load can be reduced.
  • FIG. 1 is an explanatory diagram for explaining a usage state of the size measuring apparatus 1 according to the embodiment of the present invention.
  • a hexahedron used for product packaging or the like that is, a package having a substantially rectangular parallelepiped shape or a substantially cubic shape (for example, a cardboard box) Ob is taken as an example of the subject to be measured.
  • the dimensions of the three sides (W: Width, L: Length, H: High) are measured in a non-contact manner.
  • the subject is not limited to the package.
  • the size measuring device 1 includes a size measuring terminal 12 and a control device 13.
  • the size measuring terminal 12 is incorporated into a device that manages articles in a physical distribution process such as receiving, warehousing, inventory, shipping, and shipping at a physical distribution site such as a handy terminal, and is used for them.
  • the user measures the size of the package Ob that is the object of size measurement using the size measuring device 1. More specifically, the package Ob is imaged by the size measuring terminal 12, and the length of the side of the package Ob is calculated by the control device 13 based on the imaging data.
  • the size measuring device 1 may be in the form of a terminal device in which the size measuring terminal 12 and the control device 13 are integrally formed, or configured as a system in which the size measuring terminal 12 and the control device 13 are connected via a communication line.
  • the form may be sufficient.
  • the communication line may be connected via a wide area network such as the Internet instead of the local network.
  • the size information obtained by the size measuring apparatus 1 is stored and utilized in a database such as a server installed in a management center (not shown). In that case, it can be used to determine individual transportation charges or to determine the type and number of trucks required for transportation by optimally combining a plurality of packages, thereby making it possible to effectively use resources in transportation operations.
  • the size measuring terminal 12 is not limited to a dedicated terminal such as a handy terminal, and can be realized by installing a dedicated application on a terminal such as a tablet or a smartphone.
  • the control device 13 can be realized in the form of a personal computer or a dedicated set top box. Furthermore, it is possible to provide a function for outputting a form created based on the measured size information.
  • FIG. 2 is a block configuration diagram of the size measuring apparatus 1.
  • the size measuring device 1 includes a size measuring device terminal 12 and a control device 13.
  • the size measuring terminal 12 is simply referred to as a camera 4 when the left and right cameras (second cameras) 4R and the right camera (second camera) 4R capture the entire package Ob from different angles.
  • a display unit 7 constituted by a liquid crystal display, a touch panel 7a as a designated point detecting means provided on the display unit 7, a shutter operation at the time of photographing, etc.
  • the input unit 10 is provided.
  • the camera 4 constitutes an imaging unit according to the present invention
  • the display unit 7 constitutes a display unit according to the present invention
  • the input unit 10 constitutes an input unit according to the present invention.
  • the display unit 7 and the input unit 13 may be provided on the control device 13 side.
  • the control device 13 includes a memory 5 that temporarily stores left and right image data captured by the camera 4, and an image processing unit that calculates the length of three sides of the package Ob by processing the image data stored in the memory 5.
  • a non-volatile memory 8 for recording image data used for parallax calculation in the image processing unit 6 and recording an image data
  • an overall control unit 9 for controlling the entire operation of the size measuring apparatus 1 .
  • the image processing unit 6 includes a high-speed CPU (Central Processing Unit), a DSP (Digital Signal Processor), a memory, and the like (not shown), and is positioned as a main body for measuring the package size as will be described in detail later.
  • the image processing unit 6 constitutes an area setting unit, a feature point determination unit, and a measurement unit of the present invention.
  • the overall control unit 9 has a CPU (not shown), an EEPROM (Electrically Erasable Programmable Read-Only Memory) storing a program, and a working memory (Work Memory).
  • the overall control unit 9 performs overall management of the size measuring apparatus 1 including the image processing unit 6 in units of tasks managed by a predetermined RTOS (Real-time operating system).
  • RTOS Real-time operating system
  • shooting from different angles is not limited to the case where the optical axes of the two cameras form a convergence angle with respect to the subject.
  • the case where the position of the camera forms a triangle is also included. That is, “shoot from a different angle” may be rephrased as “shoot from a different position (viewpoint)”.
  • “shoot from a different angle” may be rephrased as “shoot from a different position (viewpoint)”.
  • a configuration example in which the optical axes of two cameras are made parallel will be described.
  • FIG. 3 is a diagram showing a configuration of the camera 4 of the size measuring terminal 12 according to the embodiment of the present invention.
  • 3A is a top view of the camera 4 portion
  • FIG. 3B is a front view thereof.
  • the coordinate systems shown in FIGS. 3A and 3B correspond to FIG. 1, x is the direction of the baseline length B (for example, the raster direction), and y is the baseline length B direction on the imaging surface of the image sensor 20.
  • Z indicates the direction from the camera 4 toward the subject, that is, the depth direction of the captured image.
  • reference numeral 20 in FIG. 3A is an imaging element (two-dimensional image sensor) such as a CMOS (Complementary Metal Oxide Semiconductor) or a CCD (Charge Coupled Device), and a reference numeral 21 is an imaging surface of the imaging element 20.
  • a lens that forms an optical image on the lens that is, an imaging optical system (focal length is fc).
  • the size measuring apparatus 1 of the present embodiment has two cameras, the left camera 4L and the right camera 4R, and each camera 4 includes the same imaging optical system 21 and the same imaging optical system 21. I have.
  • the distance between these optical axes is set to 50 mm, for example.
  • the image sensor 20 either a single-plate color sensor or a monochrome sensor from which a color filter is removed can be used, but it is used for applications that require resolution, such as a barcode reader function or package size measurement. When doing so, it is better to use a monochrome sensor.
  • the optical axes CAxL and CAxR of both the cameras 4 are parallel and separated from each other by the base line length B.
  • the optical axes CAxL and CAxR of both cameras 4 are arranged at the same position in the y direction.
  • the process of measuring the external size of the package Ob is managed by a size measurement execution task executed by a program.
  • the size measurement execution task monitors the input unit 10 via the overall control unit 9.
  • video shooting starts at step ST0.
  • the image pickup device 20 of the cameras 4R and 4L is driven based on a camera control signal output from the overall control unit 9, and a predetermined frame rate such as 30 frames / second (a camera that sequentially changes according to a user operation).
  • the display image that changes in synchronization with the workpiece may be a frame rate that is updated so as not to feel stress), and image data captured by the left camera 4L and the right camera 4R corresponds to each camera 4.
  • the image data once stored in the memory 5 is transferred to the image processing unit 6 and subjected to known image processing such as mosaic processing, white balance adjustment, color correction, ⁇ correction, resizing, and the like.
  • the image data processed by the image processing unit 6 is transferred to the display unit 7 by the overall control unit 9, and the image captured by the camera 4 is displayed on the display unit 7 in real time.
  • step ST1 it is checked whether or not the shooting button provided in the input unit 10 has been pressed (whether there is a still image capture instruction). If the shooting button has not been pressed, step ST1 is repeated (No in step ST1). If it is detected that the button has been pressed, the overall control unit 9 stops updating the image displayed on the display unit 7 and step ST2 Proceed to In step ST2, preprocessing is performed on the captured image. As pre-processing, auxiliary processing for accurately performing edge detection performed later is executed. For example, contrast adjustment and noise removal are performed on the entire image. These processing will be described in detail later. As described above, the processing may be limited to a region near the vertex designated by the user or a region between the vertices (peripheral region or side region).
  • the range captured by the two cameras 4 differs between the left imaging range 200L (hereinafter referred to as the left image) and the right imaging range 200R (hereinafter referred to as the right image) (see FIG. 1).
  • the image captured in the memory 5 parallax is generated according to the distance between the size measuring terminal 12 and the package Ob as the subject.
  • the image data (left and right image data photographed by the left camera 4L and the right camera 4R, having parallax as described above) captured in the memory 5 at the time when the still image capturing instruction is issued is nonvolatile. Is transferred to the storage memory 8 and stored.
  • one of the two images taken by the left camera 4L and the right camera 4R is displayed on the display unit of the size measuring apparatus 1, and the user can display the entire package Ob.
  • the size measurement target is designated for the image taken of.
  • step ST3 as indicated by the black circles (TP0, TP1, TP3, TP5) in FIG. 5, four vertices (P0) serving as a reference for measuring the size of the package Ob with the touch pen (reference numeral 14 in FIG. 1) with respect to the touch panel 7a. It is determined whether or not P1, P3, and P5) are designated.
  • the coordinate input means for the touch panel 7a is the touch pen 14, but it may be an article that can specify coordinates, and may be a finger. Also, other pointing devices such as a trackball and a mouse may be substituted.
  • step ST4 is repeated until four vertices are designated.
  • the image displayed on the display part 7 when designating 4 vertices may be either a left-right image (200L * 200R), in this embodiment, it demonstrates as a left image (200L).
  • the four vertices are, for example, a vertex P0 formed by three surfaces (surface x1y1, surface y1z1, and surface z1x1) of the package Ob displayed on the screen, and a side x1 formed by two of these three surfaces.
  • the vertices P1, P3, and P5 are the other ends opposite to the vertex P0 of the sides y1 and z1 (a set of vertices P0, P1, P3, and P5 is referred to as a designated pattern PA0).
  • the user touches the touch panel 7a with the touch pen 14 held in his hand to each vertex on the screen, but each vertex is ideally a point, whereas the touch panel 7a Since the resolution is finite and the tip of the touch pen 14 has a predetermined size, it is difficult to specify the apexes P0, P1, P3, and P5 accurately.
  • touch by eye measurement indicated by black circles in FIG. 5 hereinafter referred to as “eye push”) is out of the vertices P0, P1, P3, and P5 on the screen like points TP0, TP1, TP3, and TP5. End up.
  • the user designates four vertices.
  • the combination of designated vertices is P0 (vertex formed by the three surfaces of the package Ob) and P0 for each side gathered on the P0. Is not limited to the other end.
  • a set of vertices P1, P2, P0, and P6 (referred to as a set pattern PA1) may be specified, and a set of vertices P3, P2, P0, and P4 (referred to as a set pattern PA3) is specified.
  • a set of vertices P5, P6, P0, and P4 (referred to as a set pattern PA5) may be designated.
  • the vertex P1 is a common vertex
  • the line segment P1-P2 the line segment P1-P0, and the line segment P1-P6 are gathered at the vertex P1.
  • the vertex P3 is a common vertex
  • the line segment P3-P2 the line segment P3-P0, and the line segment P3-P4 are gathered at the vertex P3.
  • the vertex P5 is a common vertex
  • line segments P5-P6, line segments P5-P0, and line segments P5-P4 are collected at the vertex P5. That is, the user only has to specify an arbitrary common vertex where three sides are gathered and the other end opposite to the common vertex for each side gathered at this common vertex with respect to an image obtained by photographing the package Ob. In other words, it is only necessary to select four vertices that include one side each corresponding to W, L, and H (Width, Length, and High) for the package Ob displayed on the screen.
  • the areas A0, A1, A3, and A5 corresponding to the pressing points TP0, TP1, TP3, and TP5 (measurement target positions) in step ST3 are set. These are areas (hereinafter referred to as peripheral areas) including vertices P0, P1, P3, and P5 that exist in the vicinity of the eye-pushing point designated by the touch pen 14 or the like, and each peripheral area A0, A1, A3,. As indicated by a solid line in FIG. 5, A5 may be a ring with a predetermined radius centering on the pressing points (TP0, TP1, TP3, TP5). The size of the ring is determined on the screen of the display unit 7 in consideration of, for example, an error range when the user presses the package apex. Of course, the range of the peripheral area may be displayed as a rectangle.
  • a ring or a rectangle indicating each peripheral area may be displayed on the display unit 7 each time an individual pressing point (any one of TP0, TP1, TP3, and TP5) is designated.
  • the user can immediately confirm whether or not the displayed circle or the like surrounds the apex (any of P0, P1, P3, and P5) of the package Ob, which is convenient.
  • Step ST3 and Step ST4 when the user recognizes that the displayed circle or the like does not surround the apex to be designated, the user If the area is touched again with the touch pen 14, the designation (opening) may be canceled. In this case, the display of the circular ring and the like is deleted when the designation is canceled.
  • the display of the ring or the like (designation of the pressing point) and the deletion of the ring (cancellation of designation) may be alternately toggled according to the touch on the touch panel 7a.
  • the display of the ring or the like designation of the pressing point
  • the deletion of the ring cancellation of designation
  • edge detection is performed on the left image (200L) in each of the peripheral areas A0, A1, A3, and A5 to obtain an edge image.
  • an edge detection method for example, as disclosed in Japanese Patent No. 4338405, a primary difference operator is used to detect edge horizontal and vertical components with a 3 * 3 filter.
  • the determination of the end of the edge by tracking the edge is, as disclosed in the above publication, the number of pixels until the next edge is detected from the position where the continuity of the edge is interrupted, or When the number of continuous pixels of the next edge is less than a predetermined value, the interrupted position can be determined as the end point.
  • it may be used as an additional condition that the trace range is in the peripheral region. The presence of this additional condition can surely stop the trace.
  • the display may use a ring while determining the trace end condition while using a ring). In this way, for example, as shown in FIG.
  • each edge (thick line in the figure) E that becomes three sides gathered at each vertex in each peripheral area A0, A1, A3, and A5 is detected, and an edge image is acquired. can do.
  • the range in which edge detection is performed is limited to the peripheral area, and high-speed processing is possible.
  • edge composed of three sides has been described. However, depending on the camera work and the designated vertex at the time of shooting, all three sides may not be captured (for example, in the case of the above-described set pattern PA1). In some cases, an edge consisting of (Not shown)
  • step ST6 it is determined whether or not valid edges have been detected in all the peripheral areas A0, A1, A3, and A5 by the edge detection executed in step ST5.
  • the vertex of the package Ob can be obtained reliably, but even when two edges are concentrating on one point, the intersection should be the vertex. Can do.
  • step ST7 If an effective edge is detected in each of the peripheral areas A0, A1, A3, and A5, the process proceeds to step ST7. If there is any peripheral area in which no effective edge is detected, It progresses to step ST12 (or step ST17 which is another example of a branch) mentioned later.
  • Whether or not effective edge detection has been performed can be determined by, for example, detecting the contrast difference between the portion determined to be an edge during edge tracing and the other portion, and accumulating the absolute value of the contrast difference in one pixel unit tracing. And an evaluation function.
  • step ST7 the intersection coordinates of each edge detected in each of the peripheral areas A0, A1, A3, and A5 are obtained.
  • the intersection of each edge is a vertex where three sides gather in the package Ob.
  • the vertex coordinates can be calculated based on this feature.
  • the shape pattern of three sides meaning the angle at which the sides intersect
  • the shape pattern in which the side z1 connected to the vertex P0 extends beyond the peripheral region A0 and the actual side z1 is deleted is considered to be substantially identical (similar) to the pattern around the vertex P3.
  • the shape of the side connected to each vertex can be estimated from the shape of the side gathered at the common vertex P0. Therefore, by creating a pattern near the four vertices based on the positional relationship between the four pressing points, and matching the edges with the edge image generated by the edge trace, the vertices P0 and P1 serving as feature points are obtained.
  • the coordinates of P3 and P5 (for example, two-dimensional coordinates in the left image. Specifically, the xy coordinates of the image sensor that captures each vertex) can be specified.
  • each peripheral region A0R, A1R, A3R, A5R is set. Then, the coordinates of the vertices P0R, P1R, P3R, and P5R are obtained from these peripheral areas.
  • the origin of the left image and the right image (for example, the photographing region)
  • the subject in the right image is photographed with a shift to the left side of the x-axis (a negative direction when the arrow direction of the coordinate system in FIG. 1 is a plus direction) with respect to the subject in the left image.
  • the base line length B between the left and right cameras 4L and 4R, the pixel pitch and size of the image sensor mounted on each camera, the focal length f of the optical system, etc. are known when viewed as a measurement system. If there is a realistic restriction that the distance to the subject is, for example, about 1 to 2 m at the site where the package size is measured, the amount of subject displacement (number of pixels) in the left and right images taken with a stereo camera ) Can be estimated.
  • each eye-pushing point in the right image is determined, and each peripheral area (A0R, A1R, A3R, A5R) is determined based on this, and, similarly to the process for the left image described above, Edges are detected, and finally vertex coordinates (P0R, P1R, P3R, P5R) as two-dimensional coordinates in the right image are obtained.
  • the vertices P0, P1, P3, and P5 of the left image correspond to the vertices P0R, P1R, P3R, and P5R of the right image in this order.
  • the peripheral area A0 is determined around the center point TP0 with respect to the vertex P0 of the left image, and the vertex corresponding to the right image is determined from the distance between the camera 4 and the package Ob based on the use scene.
  • peripheral area A0R that surrounds P0R is determined, and the coordinates (two-dimensional coordinates) of the vertex P0 and the vertex P0R are obtained independently for the left and right peripheral areas (vertex P1, vertex PR1, vertex P3). The same applies to the vertex P3R and the vertex P5 and the vertex P5R).
  • stereo matching process when the vertex coordinates of the left and right images are obtained, a corresponding point search process called a stereo matching process is not necessary.
  • stereo matching processing can be performed to obtain more accurate parallax.
  • FIG. 6 is an explanatory diagram for explaining the principle of acquiring (ranging) the distance Zp between the camera 4 and an arbitrary point (attention point P) of the subject by stereo viewing, with respect to the size measuring apparatus 1 according to the embodiment of the present invention.
  • FIG. 6A shows the positional relationship between the camera 4 and the subject
  • FIG. 6B shows an epipolar line EL added as an auxiliary line.
  • FIG. 7 is an explanatory diagram for explaining the size measuring device 1 according to the embodiment of the present invention by extending the two-dimensional distance measurement principle to a three-dimensional space.
  • FIGS. 6 (a) and 6 (b) The coordinate system used in FIGS. 6A and 6B is the same as that used in FIGS.
  • the imaging points of the left camera 4L and the right camera 4R include the attention point P.
  • the attention point P is determined from the optical axis CAxL of the left camera 4L and the optical axis CAxR of the right camera 4R.
  • the point of interest P is on the imaging surface of each image sensor 20, and by xL for the left camera 4L, The right camera 4R shifts xR to the left in the x direction.
  • a line EL is added as an auxiliary line passing through the center point of the imaging optical system 21 of the right camera 4R.
  • the line EL is a projection of a straight line BL connecting the imaging optical system 21 of the left camera 4L and the point of interest P onto the right camera 4R, and the straight line BL and the line EL are parallel to each other.
  • the triangle O ⁇ and the triangle O ⁇ formed on the right camera 4R side are similar.
  • a point xR (amount of deviation from the optical axis CAxR in the x direction) in the standard image is xL (same as above).
  • the attention point P is projected onto the coordinates (xL, yL) in the imaging device 20 of the left camera 4L and the coordinates (xR, yR) in the imaging device 20 of the right camera 4R, and the image output by the camera 4 is output. Based on this, specific coordinate values are obtained.
  • the coordinate values Yp and Zp of the target point P are the coordinates of the target point P observed in the reference image (for example, the image captured by the right camera 4R) ( xR, yR) is used as shown in (Equation 2).
  • the size measuring apparatus 1 has the two cameras 4, but the positions of the left camera 4L and the right camera 4R in the size measuring apparatus 1 are uniquely determined by design. That is, the distance (base line length B) between the optical axes of the left camera 4L and the right camera 4R is a fixed value in design.
  • the focal length f of the imaging optical system 21 mounted on the left and right cameras 4 is also a unique value. Therefore, if the same feature point can be detected from the images taken by the left camera 4L and the right camera 4R, that is, the outputs of the left and right imaging elements 20, the difference between the coordinate values of the left and right feature points becomes the parallax ⁇ x.
  • the distance Zp from the camera 4 (reference camera) to the point of interest P can be calculated.
  • the peripheral areas A0, A1,. A3 and A5 correspond to the peripheral areas A0R, A1R, A3R, and A5R of the right image (200R).
  • the correspondence between the left image and the peripheral area of the right image will be quantitatively described below.
  • the range (change amount) of the parallax ⁇ x can be known if the change amount of Zp that is the shooting range is determined.
  • the distance Zp 1 m.
  • the parallax ⁇ x is 0.45 mm
  • the range of the parallax ⁇ x is 75 pixels ⁇ x ⁇ 150 pixels
  • the search range for stereo matching can be determined to be a narrow range based on this range.
  • the size (diameter) of the ring indicating the peripheral area displayed when pressing the left image is 150 pixels in terms of pixels of the image sensor, and the left image is used as the peripheral area of the right image.
  • the eye point is set using the left image, it is possible to set the peripheral region in consideration of the parallax in the right image.
  • the user can measure the package size simply by setting the eye point for either the left or right image.
  • the parallax is obtained based on the vertex coordinates in the left and right images.
  • the cameras 4L and 4R are adjusted based on the calibration result at the time of shipment. Therefore, the corresponding vertex P0-vertex P0R, vertex P1-vertex P1R, vertex P3-vertex
  • the difference in the x-coordinates of P3R, vertex P5-vertex P5R (the left side of each set of vertices is derived from the left image and the right side is derived from the right image) immediately represents the parallax ⁇ x for each vertex.
  • the parallax ⁇ x is directly calculated based on the vertex coordinates obtained from the edge image in this way, since the edge detection is substantially binarized, the calculation result is a discrete pixel unit of the image sensor. Value. If the number of pixels of the image sensor is sufficiently large and the parallax itself is large (for example, when the distance between the camera and the subject is short), the effect is small, but if not, for example, it corresponds in the left image and the right image
  • the parallax ⁇ x can be calculated in units of subpixels by executing the block matching process using an image in the peripheral area (which is of course a halftone image).
  • step ST10 the three-dimensional coordinates of each vertex are calculated from the parallax of each vertex P0, P1, P3, and P5 obtained in step ST9.
  • the distance Zp can be obtained by the above equation 1.
  • the lengths of the three sides (P0 to P1, P0 to P3, and P0 to P5) that gather at the common vertex P0 are calculated. So that the size of the package Ob can be determined.
  • edges are not detected in some peripheral areas, specifically, edges are detected in the peripheral areas A1 and A3, but the peripheral areas A0 and A5 are detected. Now, a case where no edge is detected will be described.
  • peripheral areas there are four peripheral areas generated based on the tapping point, and this peripheral area is one of the three common vertices that make up the package, and the three sides that are opposed to the common vertices. If there is a premise that the other end is included, based on the positional relationship between the peripheral areas, the peripheral areas (the same A2 and A4) corresponding to the vertices (vertices P2, P4, and P6 in this case) that are not actually pressed for -The position of A6) can be estimated. This is because the package that is the object to be measured is a substantially rectangular parallelepiped.
  • the thickness (width) is adjusted to the size (diameter) of the peripheral regions A0, A1, A3, and A5.
  • Edge E detects a cuboid pseudo-box BX formed based on three Y-shaped sides (A0 to A1, A0 to A3, and A0 to A5) that gather around the common area vertex A0. It is set on the screen so that the corners are aligned with the peripheral areas A1 and A3. At this time, the detected edge E can be used as a guide to finely adjust each side of the pseudo box BX. By overlapping the pseudo box shapes BX in this way, the positions of the peripheral areas A2, A4, and A6 corresponding to the unverted vertices are determined.
  • edge detection is performed in each of the peripheral areas A2, A4, and A6 corresponding to three vertices other than the four peripheral areas A0, A1, A3, and A5 based on the designation of the touch pen 14.
  • a rectangular parallelepiped package Ob when an arbitrary vertex (vertex facing the camera 4) and three sides connected to the vertex are photographed, there are seven vertices P0 to P6 as shown in FIG. Further, since the three vertices P2, P4, and P6 other than the position designated by the user with the touch pen 14 are also photographed, the vertices P2, P4, and P6 are located in the peripheral areas A2, A4, and A6 of the pseudo box BX. obtain.
  • step ST14 when the edge E is detected in the two peripheral areas A2 and A4 as shown in FIG. 10C, for example, in step ST13, the edges detected in the peripheral areas A2 and A4 are detected. E is adopted as an effective one.
  • step ST15 it is determined whether or not all the vertices that determine the three sides (side x1, side y1, and side z1) necessary for obtaining the size of the package Ob have been detected.
  • the distance between the vertices P2 and P3 corresponds to the side x1
  • the distance between the vertices P3 and P4 corresponds to the side y1
  • the distance between the vertices P1 and P2 corresponds to the side z1, which is necessary for obtaining the size of the package Ob.
  • the process proceeds to step ST8 (Yes in step ST15).
  • step ST8 the size described in FIG. 4 is performed to measure the size of the package Ob. If it is determined in step ST15 that all necessary vertices have not been obtained (No in step ST15), the size of the package Ob cannot be measured, and the process proceeds to step ST16, where, for example, an error is displayed on the display unit 7. A message is displayed and this flow ends.
  • the image processing unit 6 has four peripheral regions (A0, A1, A3, and A5 in this embodiment).
  • other peripheral areas A2, A4, and A6 in this embodiment
  • the vertex position is obtained in the estimated peripheral area.
  • step ST17 in FIG. 9B the four peripheral areas A0, A1, A3, and A5 based on the designated position of the touch pen 14 are set as large vertices, and as shown in FIG. 11A, the peripheral areas A0 and A1.
  • Each of the spaces X1, Y1, and Z1 (hereinafter referred to as sides) connecting A1, A3, and A5 from the peripheral area A0 including the common vertex with the size of A3 and A5 (diameter in the case of a circle) as the line width. (Referred to as an area). Since the peripheral region has an area, the side region which is a space connecting the peripheral regions also has an area.
  • the probability that the side connecting the two vertices is included in the side area is extremely high. Then, edge detection is performed in each of the side regions X1, Y1, and Z1 to extract sides between vertices (that is, line segment formulas).
  • the detection of the vertices in the peripheral area A0 (A1, A3, A5) is for the point, whereas the detection of the edges in the side area X1 (Y1, Z1) is for the line.
  • the detection accuracy of vertices which depend on points, depends greatly on local conditions, but for edges that are theoretically lines, even if there are bad shooting conditions, the edges that are judged to be valid are connected.
  • the probability of edge detection is increased. For example, even in an environment where the lighting conditions are insufficient, the frequency of errors due to non-detection can be reduced.
  • a rectangular parallelepiped pseudo-box BX formed by sides having a thickness matched to the size of the peripheral area (for example, A0) as in step ST12 is changed to each side as shown in FIG. It is set on the screen in accordance with the edges Ex1, Ey1, and Ez1 detected in the areas X1, Y1, and Z1 (FIG. 12A).
  • step ST18 The processing of the alignment of the pseudo box BX and step ST19 (edge detection in the pseudo box BX) described below may be omitted.
  • step ST12 in FIG. 9A described above may be omitted.
  • the final purpose of detecting the edge in this way is to extract at least two line segments composed of the edges and obtain the vertex coordinates of the package Ob from the intersection (or closest point) of these two line segments. Therefore, at least three peripheral regions (peripheral regions adjacent to each other) having side regions in between are necessary.
  • step ST19 in step ST18, for example, as shown in FIG. 12A, edge detection is performed in each side region corresponding to each side of the pseudo box BX.
  • image processing edge processing or the like for a limited narrow range is sufficient, so that the load of edge detection processing can be reduced.
  • the line segment extracted by edge detection is extended in the side region of the pseudo box BX, and the intersection of each extension line is set as each vertex (in the following description, in the following description, the line segment or The extension line may be referred to as an edge).
  • the intersection point is regarded as a vertex position in the peripheral area where the vertex position is not detected in the flow of FIG. That is, in the flow shown in FIG. 9B, a peripheral region (surface information) surrounding the pressing point (point information) is obtained, and a side (line information, straight line in the space) is further obtained from the side region connecting the peripheral regions. And the vertex coordinates (point information) are calculated at the intersection of two straight lines.
  • edges Ex2, Ex3, Ey2, Ey3, Ez2, and Ez3 are detected as shown in FIG. 12 (a), as shown by the two-dot chain line in FIG. Ex3, Ey2, Ey3, Ez2, and Ez3 are extended in the side area of the pseudo box BX, and the intersection points of the edges Ex2, Ex3, Ey2, Ey3, Ez2, and Ez3 and the extended lines are set as the vertices P1 to P6. . Then, the process proceeds to step ST15.
  • the intersections of the edges and the extension lines are not found.
  • the coordinates (nearest point) of the intermediate position between the sides that have the shortest distance between the sides in the corresponding peripheral region may be used as the vertex coordinates.
  • step ST15 as described above, the vertices necessary for determining the three sides (side x1, side y1, and side z1) necessary for measuring the size of the package Ob are determined based on the points set as the vertices in step ST20. It is determined whether or not all are obtained.
  • step ST19 six vertices (corresponding to P1 to P6) are obtained.
  • the vertices P2, P3, P5, P6 each correspond to the side x1, the vertices P3, P4, P1, P6 each correspond to the side y1, and the vertices P1, P2, P4, P5 each correspond to the side y1. It corresponds to the side z1. Note that it is not always necessary to obtain all six vertices P1 to P6. If four vertices necessary for determining three sides (side x1, side y1, and side z1) necessary for measuring the size of the package Ob are obtained. Alternatively, the vertices P1 to P4 may be obtained in the same manner as described above.
  • step ST15 If it is determined in step ST15 that four necessary vertices have been obtained, the process proceeds to step ST8, and after step ST8, the process described with reference to FIG. 4 is performed to measure the size of the package Ob.
  • an area is set corresponding to the designated position by the touch pen 14, and edge detection is performed in a narrow area around the designated position. Since the block matching process only needs to be executed, the image processing load can be greatly reduced. Thereby, the speed of the size measurement process can be increased. In addition, by setting the size of the peripheral region in consideration of an error range due to the so-called eye-pushing that is an operation of the touch pen 14, even when an edge is not detected in the region due to the influence of illumination or the like, the peripheral region is made large.
  • the edge of each side can be detected, and the state where the edge cannot be detected can be avoided as much as possible.
  • the region is specified and the vertex is surely obtained by the edge detected in the region, and the length of the side is calculated. It is possible to measure the package size with high accuracy by eliminating uncertainty due to pushing.
  • the reliability can be calculated based on, for example, the length in which edge detection is continuously performed on the side. For example, when the edges Ex3 are detected as being interrupted as in the edge Ex3 in FIG. 12A, the edge Ex2 detected continuously is considered to have higher reliability.
  • the reliability may be calculated based on the contrast information around the edge detected as the side. For the sides in the xyz-axis direction for size measurement, the reliability of each side parallel to each other is compared, and the side with high reliability is adopted. For example, as shown in FIG.
  • the edge Ex2 when the reliability of the edge Ex2 is the highest among the edges Ex1 to Ex3 in the x-axis direction, the edge Ex2 is set as the side x1 in the x-axis direction to detect vertex coordinates. Use.
  • the size measurement object is a special object that is a rectangular parallelepiped box-shaped package Ob. That is, any one side of the package Ob has three parallel sides (for example, Ex1 to Ex3), and the package Ob is a rectangular parallelepiped. Therefore, in the size measurement, each of the three parallel sides is used for each size. The vertex coordinates may be obtained, and the side having the highest reliability can be adopted.
  • the image processing unit 6 has four peripheral areas (A0, A1, A3, and A5 in this embodiment).
  • the vertex position is not detected in any of the areas, the area between the peripheral area where the vertex position is not detected (for example, A0) and at least two other peripheral areas adjacent thereto (for example, A1, A3) Extract at least two sides (for example, side Ex1 between A0-A1 and side Ez1 between A0-A3) in a space (eg, side region X1 between A0-A1 and side region Z1 between A0-A3).
  • the intersection or closest point of the extracted two sides is regarded as the vertex position in the peripheral area (A0) where the vertex position is not detected, and the length of the package side is calculated based on this vertex position.
  • the three-dimensional distance measurement in the above embodiment has been described in detail by taking a so-called stereo method as an example, but in the viewpoint of searching for a vertex only in the peripheral region set in the vicinity of the pushing point, the present invention is Not only the stereo method but also other distance measuring methods can be combined.
  • a distance measuring method for example, a reference object having a known size is photographed together with the object to be measured, and the size of the object to be measured is estimated from the size of the reference object (reference label method), projection optics
  • the phase of the sinusoidal lattice pattern generated by the system is changed and projected onto the subject, and this is imaged multiple times with one camera to obtain the phase value from the change in luminance at the measurement point (sinusoidal pattern projection method) ), Improving the sine wave pattern projection method, projecting sinusoidal fringe pattern light with different phases to the object to be measured, and obtaining the synthesized phase value from the image including moire (interference fringe projection imaging), linear
  • the object to be measured is scanned / imaged multiple times with the laser beam, and the distance to the measurement point (light cutting method) is determined based on the triangle that is uniquely determined by the baseline length, scanning angle, and light incident angle. Irradiated Measures the time from the light emission timing of Zaparusu until detecting the reflected light, a method for determining the
  • each vertex coordinate can be calculated by performing interpolation using the mesh intersection coordinate.
  • the stereo method or the reference label method it is desirable to use the stereo method or the reference label method from the viewpoint of measurement accuracy because the apex coordinate designation and the actual distance measurement are performed at different timings. From the viewpoint of versatility, it is more desirable to use a stereo method that does not require a reference label.
  • the size measuring apparatus can measure the package size with high accuracy with a simple configuration, it can be suitably applied to a handy terminal used in logistics management such as transportation industry.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Theoretical Computer Science (AREA)
  • Electromagnetism (AREA)
  • Radar, Positioning & Navigation (AREA)
  • Remote Sensing (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Geometry (AREA)
  • Length Measuring Devices By Optical Means (AREA)

Abstract

【課題】簡易な構成で、立方体や直方体形状のパッケージの外形サイズを精度よく測定することが可能なサイズ測定装置を提供すること。 【解決手段】パッケージを撮影するカメラと、パッケージが表示される画面に設けられたタッチパネルとを備え、画面に表示されたパッケージの3辺が集まる頂点と、当該頂点に集まる3辺の頂点とは相反する側の各他端との4点をユーザがタッチペンで指定する。各指定点を所定の大きさで外囲する周辺領域(A0,A1,A3,A5)を設定し、各周辺領域内でパッケージの辺に対応するエッジを検出し、周辺領域内で3辺が集まる点を各頂点の位置として求めることにより、各頂点間の長さを3辺の長さとしてパッケージの外形サイズを精度よく求めることができる。更に、パッケージの辺に対応するエッジ検出を行う場合に、画像全体に対してでなく、所定の辺領域内に対して行えばよく、処理負荷を低減し得る。

Description

サイズ測定装置及びサイズ測定方法
 本発明は、撮像された画像データから被写体のサイズを測定するサイズ測定装置及びサイズ測定方法に関するものである。
 物流や生産工程等において、物品のパッケージにバーコード等を印刷した帳票を付し、物品の配送を管理する事例が幅広い分野で知られている。例えば、物品を輸送する際、集荷配送拠点において、物品を包装するパッケージに添付された帳票情報を、バーコードリーダを備えるハンディターミナル等で読み取って物品を識別し、識別情報に基づく当該物品の流通経路の決定や授受の確認等を行うようにした物品の配送管理システムがある。このとき、帳票情報を読み取って各物品を宛先毎に仕分けする他、輸送のための運搬車の容量や台数を決定するために、個々のパッケージのサイズを測定する必要がある。
 撮像画像を利用してパッケージのサイズを測定するものとして、物品を包装するパッケージが立方体や直方体であること、また帳票サイズが既知であることを前提として、パッケージ及びこれに貼り付けられた帳票を同時に撮影して、撮影画像において帳票を基準長としてパッケージサイズを測定するサイズ測定装置がある(例えば特許文献1)。
特開2004-219255号公報
 しかしながら、撮像された画像データに基づいて被写体のサイズを測定する際、被写体のサイズ測定の基準となる特徴点(パッケージの場合は頂点)をどのように特定するのかが問題となる。画像処理のみでエッジ検出等により特徴点の抽出を行う場合では画像データ全体に処理を実行するため処理の負荷が大きいばかりでなく、ユーザが測定したい対象を効率良く抽出できるとは限らない。
 ユーザが特徴点の指定を行う場合、撮像した画像データを表示デバイスに表示させ、ユーザが入力デバイスを介して特徴点を指示する方法も考えられるが、表示デバイスや入力デバイスのハードウェア的な制限により特徴点となる座標をユーザが正確に指示することは困難である。
 また、特許文献1では、パッケージの頂点をユーザによりレーザ光で指定することが開示されているが、パッケージの頂点もレーザ光も理想的には点であるべきものであり、例えば現場で、段ボール箱の頂点にユーザがレーザ光を正確に照射するのは簡単なことではない。
 本発明は、ユーザによる簡易な指定に基づき、立方体や直方体形状のパッケージの外形サイズを精度よく測定することが可能なサイズ測定装置及びサイズ測定方法を提供することを目的とする。
 本発明のサイズ測定装置は、撮像された画像から被写体のサイズを測定するサイズ測定装置であって、被写体を撮像する撮像部と、前記撮像部で撮像された画像データを表示する表示部と、ユーザからの指示を入力する入力部と、前記表示部の表示された画像データに対して前記入力部から位置が指定されると、当該指定位置を含む周辺領域を設定する領域設定部と、前記領域設定部で設定された前記周辺領域において、測定対象の座標となる特徴点を決定する特徴点決定部と、を有するように構成したものである。
 本発明によれば、表示された画像に対してユーザが位置を指定すると、その指定された位置を含む周辺領域を設定することにより、測定対象の座標となる特徴点を決定する処理を、頂点の探索を画像全体に対してではなく、所定の周辺領域内に対して行えばよく、処理負荷を低減し得る。
本発明の実施形態に係るサイズ測定装置の使用状態を説明する説明図 本発明の実施形態に係るサイズ測定装置の構成を示すブロック構成図 (a)はサイズ測定端末のカメラ部分の上面図、(b)はカメラ部分の正面図 サイズ測定装置の制御要領を示すフロー図 タッチペンによる指定位置及び対応する周辺領域を示す模式図 (a)はステレオ視による左右のカメラと被写体Pとの関係を示す説明図、(b)はカメラと被写体Pとの距離Zpを取得(測距)する原理を説明する説明図 カメラと被写体Pとの距離Zpを取得(測距)する原理を説明する斜視図 (a)は図5の各周辺領域におけるエッジ検出を示す左画像を示す図であり、(b)は右画像を示す図 (a)は図4のフローにおける例外処理の分岐フローを示す図、(b)は同分岐フローの他の例を示す図 (a)は一部の周辺領域でエッジが検出されなかった場合を説明する図、(b)は図9(a)ST12を説明する図、(c)は同ST13・14を説明する図 (a)は図9(b)のST17を説明する図、(b)は同ST18を説明する図 (a)は図9(b)のST19を説明する図、(b)は同ST20を説明する図
 前記課題を解決するためになされた第1の発明は、撮像された画像から被写体のサイズを測定するサイズ測定装置であって、被写体を撮像する撮像部と、前記撮像部で撮像された画像データを表示する表示部と、ユーザからの指示を入力する入力部と、前記表示部の表示された画像データに対して前記入力部から位置が指定されると、当該指定位置を含む周辺領域を設定する領域設定部と、前記領域設定部で設定された周辺領域において、測定対象の座標となる特徴点を決定する特徴点決定部と、を有する構成とする。
 これによると、表示された画像に対してユーザが位置を指定すると、その指定された位置を含む周辺領域を設定することにより、測定対象の座標となる特徴点を決定する処理を、頂点の探索を画像全体に対してではなく、所定の周辺領域内に対して行えばよく、処理負荷を低減し得る。
 また、第2の発明は、前記第1の発明において、少なくとも二つの前記周辺領域において特徴点が決定された場合、当該二つの特徴点間の距離を前記撮像された画像データに基づいて算出する測定部を有する構成とする。これによると、二つの特徴点間の距離を算出し、それに基づいてパッケージのサイズを求めることができる。
 また、第3の発明は、前記第1の発明において、前記領域設定部で設定された前記周辺領域は前記表示部に表示される構成とする。これによると、ユーザが指示したパッケージの頂点の周辺領域が表示部により表示されるため、ユーザは指定した位置を容易に確認することができる。
 また、第4の発明は、前記第1の発明において、前記領域設定部で設定される前記周辺領域は円形である構成とする。また、第5の発明は、前記第1の発明において、前記領域設定部で設定される前記周辺領域は矩形である構成とする。これらによると、円形や矩形により周辺領域が設定されるので、例えば各周辺領域間を結ぶ辺領域の設定を容易に行うことができる。
 また、第6の発明は、前記第1の発明において、前記撮像部は、被写体を異なる位置から同時に撮影するために所定の間隔で並べて配置された第1のカメラと第2のカメラを有し、前記測定部は前記第1及び第2のカメラにおける視差情報に基づいて演算処理を行い前記特徴点間の距離を算出する構成とする。これによると、ステレオ視により、簡易な構成を採用しつつ頂点の位置をより一層正確に求めることができる。
 また、第7の発明は、前記第1の発明において、前記入力部と前記表示部はタッチパネルにより構成される。これによると、ユーザが例えばタッチペンで位置を指定することにより、ユーザによる指示操作を容易に行うことができるとともに、各指定点(目押し点)を検出しかつ各指定点を所定の大きさで外囲する各領域をそれぞれ容易に設定することができる。
 また、第8の発明は、前記第1の発明において、前記撮像部は被写体として直方体のパッケージを撮像し、前記表示部の表示された画像に対して前記入力部から前記パッケージの3辺が集まる頂点と当該頂点に集まる3辺の該頂点とは相反する側の各端点との4点が測定対象位置として指定した場合、前記領域設定部は前記4点の指定位置に対してそれぞれ前記周辺領域を設定し、前記特徴点決定部は各前記周辺領域において特徴点を決定する構成とする。
 これによると、表示部の画面に表示されたパッケージを構成する3辺が集まる頂点と、この頂点に集まる3辺の頂点とは相反する側の各端点との4点をユーザが例えばタッチペンで指定することにより、各指定点(目押し点)を検出しかつ各指定点を所定の大きさで外囲する各周辺領域をそれぞれ設定する。そして、各周辺領域内でパッケージの3辺が集まる点を各頂点の位置として求めることにより、パッケージの各頂点を容易に求めることができる。
 また、第9の発明は、前記第8の発明において、前記4つの特徴点が決定された場合、前記4つの特徴点の位置に基づいて前記パッケージの辺の長さを算出する測定部を有する構成とする。これによると、各頂点間の長さを3辺の長さとして求めることができ、パッケージの外形サイズを精度よく求めることができる。
 また、第10の発明は、前記第8の発明において、前記4点の指定位置に対して設定された4つの前記周辺領域のいずれかで特徴点が検出されなかった場合には、前記領域設定部は、前記4つの周辺領域の位置関係に基づき、ユーザが指定しなかった位置を包含する他の周辺領域を推定し、前記特徴点決定部は前記推定された周辺領域において特徴点を求める構成とする。
 これによると、ユーザ指定による4つの周辺領域内のいずれかで特徴点が検出されなかった場合には、ユーザが指定しなかった位置を包含する他の周辺領域を推定して、その周辺領域において特徴点(頂点)を検出する。被測定物であるパッケージが略直方体であるという知識を利用することで、ユーザが指定しなかった位置(頂点)の周辺領域を推定でき、例えば、照明条件が悪い状況下で撮影したような場合であっても正確にパッケージサイズを測定することが可能となる。
 また、第11の発明は、前記第8の発明において、前記4つの周辺領域のいずれかで特徴点が検出されなかった場合には、前記特徴点決定部は、前記特徴点が検出されなかった周辺領域と、これに隣接する少なくとも二つの他の周辺領域との間の空間において、少なくとも二つの辺を抽出し、抽出された前記二つの辺の交点又は最近接点を、前記特徴点が検出されなかった周辺領域に対応する特徴点とみなす構成とする。
 これによると、ユーザ指定による4つの周辺領域内のいずれかで特徴点が検出されなかった場合には、ユーザ指定による4つの周辺領域を結ぶ空間において辺を抽出することにより、抽出された辺の交点又は最近接点を特徴点(頂点)位置とみなすことができる。辺は線分で構成され、一般に点よりも検出確度が高いため、例えば照明条件が悪い状況下で撮影したような場合であっても正確にパッケージサイズを測定することが可能となる。
 また、第12の発明は、撮像された画像から被写体のサイズを測定するサイズ測定方法であって、被写体を撮像するステップと、前記撮像された画像データを表示するステップと、前記表示された画像データに対してユーザより位置が指定されると、当該指定位置を含む周辺領域を設定するステップと、前記周辺領域において、測定対象の座標となる特徴点を決定するステップと、を有する構成とする。
 これによると、表示された画像に対してユーザが位置を指定したら、その指定された位置を含む周辺領域を設定し、測定対象の座標となる特徴点を決定するというステップで処理することから、例えばパッケージの頂点となる特徴点の決定を、頂点の探索を画像全体に対してではなく、ユーザにより指定された位置を含む周辺領域内に対して行うため、処理負荷を低減し得る。
 以下、本発明の実施形態について図面を参照しながら説明する。
 図1は、本発明の実施形態に係るサイズ測定装置1の使用状態を説明する説明図である。本実施の形態では、測定対象となる被写体として、製品の梱包等に用いる六面体、即ち略直方体や略立方体形状を有するパッケージ(例えば、段ボール箱など)Obを例とし、その外形寸法、つまりパッケージObを構成する3辺(W:Width,L:Length,H:Hight)の寸法を非接触で測定する。しかしながら被写体はパッケージに限定されるものではない。
 本実施のサイズ測定装置1は、サイズ測定端末12と制御装置13とにより構成されている。サイズ測定端末12は、例えばハンディターミナルといった例えば物流現場における入荷、入庫、在庫、出庫、出荷といった物流過程において物品の管理を行う機器に組み込まれて、それらの利用に供される。図1に示すように、ユーザはサイズ測定装置1を用いてサイズ測定の対象となるパッケージObのサイズを測定する。より具体的には、サイズ測定端末12によってパッケージObを撮像し、当該撮像データに基づいて制御装置13によりパッケージObの辺の長さが算出される。サイズ測定装置1は、サイズ測定端末12と制御装置13とを一体的に構成した端末装置の形態であってもよいし、サイズ測定端末12と制御装置13と通信回線で接続したシステムとして構成された形態であってもよい。その通信回線はローカルネットワークではなくインターネット等の広域ネットワークで接続されたものであってもよい。更に、サイズ測定装置1によって得られたサイズ情報は図示しない管理センター等に設置されたサーバ等のデータベースに蓄積し活用することが考えられる。その場合、個々の輸送料金の決定や、複数のパッケージを最適に組み合わせて輸送に必要なトラックの種類や台数の決定に利用され、運送業務における資源の有効活用を図ることができる。また、サイズ測定端末12は、ハンディターミナルのような専用端末に限定されるものではなく、タブレットやスマートフォン等の端末に専用のアプリケーションをインストールして実現することも可能である。また、制御装置13は、パーソナルコンピュータや専用のセットトップボックスといった形態で実現可能である。更に、測定したサイズ情報に基づいて作成した帳票を出力する機能を備えることも可能である。
 図2は、サイズ測定装置1のブロック構成図である。図2に示すように、本実施の形態に係るサイズ測定装置1は、サイズ測定装置端末12と制御装置13により構成される。サイズ測定端末12は、パッケージOb全体を異なる角度から撮影する左カメラ(第1のカメラ)4L及び右カメラ(第2のカメラ)4R(なお、左右を区別しないときは、単にカメラ4と呼称する)、例えば液晶ディスプレイで構成される表示部7、表示部7に重ねて設けられた指定点検出手段としてのタッチパネル7a、撮影時のシャッタ動作等、スイッチや押下ボタンで構成されユーザの指示を入力する入力部10を備える。カメラ4は本願発明の撮像部、表示部7は本願発明の表示部、入力部10は本願発明の入力部をそれぞれ構成する。また、表示部7、入力部13は制御装置13側に設けられる構成であってもよい。制御装置13は、カメラ4で撮影された左右の画像データを一時的に格納するメモリ5、メモリ5に格納された画像データを処理してパッケージObの3辺の長さを算出する画像処理部6、画像処理部6で視差演算に用いられ測定結果のベースとなった画像データを記録しておく不揮発性メモリ8、サイズ測定装置1の動作全体を制御する全体制御部9で構成されている。ここで画像処理部6は図示しない高速CPU(Central Processing Unit)、DSP(Digital Signal Processor)、メモリ等で構成されており、後に詳細に説明するようにパッケージサイズを測定する主体として位置づけられる。画像処理部6は本願発明の領域設定部、特徴点決定部、測定部を構成する。
 全体制御部9は、図示しないCPU、プログラムを格納したEEPROM(Electrically Erasable Programmable Read-Only Memory)、作業メモリ(Work Memory)を有している。全体制御部9は、所定のRTOS(Real-time operating system)によって管理されたタスクを単位として、画像処理部6を含むサイズ測定装置1の全体の管理を行っている。
 なお、上述の「異なる角度から撮影する」とは、被写体に対して二つのカメラの光軸が輻輳角を形成する場合に限らず、二つのカメラの光軸を平行にすると共に被写体と二つのカメラの位置が三角形を形成している場合も含まれる。即ち、「異なる角度から撮影する」は「異なる位置(視点)から撮影する」と言い換えてもよい。以降、二つのカメラの光軸を平行にした構成例について説明する。
 図3は、本発明の実施形態に係るサイズ測定端末12のカメラ4の構成を示す図である。図3(a)は、カメラ4部分の上面図を、図3(b)は同正面図を示している。なお、図3(a)・(b)に示す座標系は図1に対応し、xは基線長Bの方向(例えば、ラスタ方向)を、yは撮像素子20の撮像面において基線長B方向と直交する方向を、zはカメラ4から被写体に向かう方向、即ち撮影した画像の奥行き方向を示す。
 カメラ4において、図3(a)の符号20は例えばCMOS(Complementary Metal Oxide Semiconductor)やCCD(Charge Coupled Device)等の撮像素子(二次元イメージセンサー)であり、符号21は撮像素子20の撮像面に光像を結像するレンズ、即ち結像光学系である(焦点距離はfc)。上述したように、本実施形態のサイズ測定装置1は、左カメラ4Lと右カメラ4Rの二つのカメラを有しており、各カメラ4は同一の撮像素子20と同一の結像光学系21を備えている。そして、左カメラ4Lの光軸をCAxL、右カメラ4Rの光軸をCAxRとするとき、これらの光軸間の距離(基線長B)は、例えば50mmに設定されている。なお、撮像素子20としては、単板式のカラーセンサーやカラーフィルタを除去したモノクロセンサーのいずれをも用いることができるが、バーコードリーダ機能や、パッケージサイズ測定等、解像度を必要とするアプリケーションに利用する場合はモノクロセンサーを用いるとよい。
 図3(a)に示すように、カメラ4を上面から(y方向に)見て、両カメラ4の光軸CAxL及びCAxRは平行であり、互いに基線長Bだけ離間している。また、図3(b)に示すように、カメラ4を正面(z方向)から見た場合、y方向において、両カメラ4の光軸CAxL及びCAxRは同じ位置に配置されている。
 次に、図4のフローに基づいて、本発明の実施形態に係るサイズ測定装置1で動作するサイズ測定実行タスクの処理の概要を説明する。パッケージObの外形サイズ測定のプロセスは、プログラムにより実行されるサイズ測定実行タスクが管理している。サイズ測定実行タスクは、全体制御部9を介して入力部10をモニターする。
 先ずステップST0で動画撮影を開始する。具体的には、全体制御部9が出力するカメラ制御信号に基づいてカメラ4R,4Lの撮像素子20が駆動され、例えば30フレーム/秒といった所定のフレームレート(ユーザ操作に応じて逐次変化するカメラワークに同期して変化する表示画像が、ストレスを感じない程度に更新されるフレームレートであればよい)で、左カメラ4L、右カメラ4Rで撮影された画像データをそれぞれのカメラ4に対応したメモリ5に取り込む。メモリ5に一旦格納された画像データは画像処理部6に転送され、画像処理部6でモザイク処理、ホワイトバランス調整、色補正、γ補正、リサイズ等の公知の画像処理を施される。画像処理部6で処理された画像データは、全体制御部9によって表示部7に転送され、カメラ4によって撮像された画像は表示部7にリアルタイムで表示される。
 次にステップST1では、入力部10に設けられている撮影ボタンが押されたか否か(静止画像取り込み指示の有無)をチェックする。撮影ボタンが押されていない場合にはステップST1を繰り返し(ステップST1でNo)、押されたことが検出されたら、全体制御部9は表示部7に表示する画像の更新を停止してステップST2に進む。ステップST2では、撮影された画像に対する前処理を行う。前処理としては、後に行うエッジ検出を精度よく行うための補助的な処理が実行され、例えば、画像全体に対してコントラスト調整やノイズ除去等が行われるが、これらの処理は、後に詳細に説明するようにユーザが指定した頂点近傍の領域や頂点間の領域(周辺領域や辺領域)に限定して行ってもよい。
 なお、二つのカメラ4で撮像される範囲は左撮像範囲200L(以降、左画像と呼称する)と右撮像範囲200R(以降、右画像と呼称する)とで異なっており(図1参照)、メモリ5に取り込まれた画像にはサイズ測定端末12と被写体としてのパッケージObとの間の距離に応じて視差が発生している。
 更に前処理では、静止画像取り込み指示があった時点でメモリ5に取り込まれていた画像データ(左カメラ4Lと右カメラ4Rで撮影された左右の画像データ。上述のように視差を有する)を不揮発性メモリ8に転送して記憶する。
 さて、この時点でサイズ測定装置1の表示部には、左カメラ4Lと右カメラ4Rで撮影された2枚の画像のうちいずれか一方の静止画像が表示されており、ユーザはパッケージObの全体が撮影された画像に対して、サイズ測定対象を指定する。
 ステップST3では、図5の黒丸(TP0・TP1・TP3・TP5)に示されるように、タッチパネル7aに対してタッチペン(図1の符号14)によりパッケージObのサイズ測定の基準となる4頂点(P0・P1・P3・P5)が指定されたか否かを判別する。なお、本実施形態ではタッチパネル7aに対する座標入力手段をタッチペン14としているが、座標を指定可能な物品であればよく、指であってもよい。また、トラックボールやマウスのような他のポインティングデバイスを代用してもよい。
 4頂点の全てが指定された場合にはステップST4に進み、4頂点が指定されるまではステップST3を繰り返す。なお、4頂点を指定する際に表示部7に表示する画像は、左右の画像(200L・200R)のいずれでもよいが、本実施形態では左画像(200L)として説明する。
 この4頂点とは、例えば画面上に表示されているパッケージObの3面(面x1y1・面y1z1・面z1x1)により形成される頂点P0と、これら3面のうち2面により形成される辺x1・辺y1・辺z1の頂点P0とは相反する他端となる各頂点P1・P3・P5である(頂点P0,P1,P3,P5の組を指定パターンPA0と呼称する)。上述のように、ユーザ(操作者)は画面上の各頂点に対して手に持ったタッチペン14によりタッチパネル7aをタッチするが、各頂点は理想的には点であるのに対し、タッチパネル7aの解像度は有限で、かつタッチペン14の先端も所定の大きさを有するため、頂点P0・P1・P3・P5を正確に指定することは難しい。通常は、図5の黒丸で示される目測によるタッチ(以降「目押し」と呼称する)では、点TP0・TP1・TP3・TP5のように画面上の各頂点P0・P1・P3・P5から外れてしまう。
 なお、パッケージサイズの測定に際して、ユーザは4つの頂点を指定するが、指定する頂点の組み合わせは、上述したP0(パッケージObの3面により形成される頂点)と、これに集合する各辺についてP0と相反する他端に限られない。
 例えば、図5において頂点P1・P2・P0・P6の組(組パターンPA1と呼称する)を指定してもよく、頂点P3・P2・P0・P4の組(組パターンPA3と呼称する)を指定してもよく、頂点P5・P6・P0・P4の組(組パターンPA5と呼称する)を指定してもよい。組パターンPA1では頂点P1が共通頂点であり、頂点P1に線分P1-P2,線分P1-P0,線分P1-P6が集合する。組パターンPA3では頂点P3が共通頂点であり、頂点P3に線分P3-P2,線分P3-P0,線分P3-P4が集合する。組パターンPA5では頂点P5が共通頂点であり、頂点P5に線分P5-P6,線分P5-P0,線分P5-P4が集合する。つまり、ユーザはパッケージObを撮影した画像に対して、3つの辺が集合する任意の共通頂点と、この共通頂点に集合する各辺について共通頂点と相反する他端を指定すればよい。表現を変えれば、画面上に表示されているパッケージObに対してW,L,H(Width,Length,Hight)に対応した辺を一つずつ含むような4頂点を選択すればよい。
 なお以降は、簡単のために、上述した指定パターンPA0に基づいて頂点が指定された場合について説明する。
 なお、ここでは、4頂点が全て指定されるまでは、次のステップに移らない例について説明したが、ST3,ST4,ST5の処理を1点に対して順次処理し、この処理を4回繰り返す手続きをとっても構わない。
 次のステップST4では、ステップST3における各目押し点TP0・TP1・TP3・TP5(測定対象位置)に対応する領域A0・A1・A3・A5の設定を行う。これらはタッチペン14等により指定される目押し点の近傍に存在する頂点P0・P1・P3・P5を包含する領域(以降、周辺領域と呼称する)であり、各周辺領域A0・A1・A3・A5は、図5に実線で示されるように、目押し点(TP0・TP1・TP3・TP5)を中心とする所定の半径の円環であってよい。円環の大きさは、表示部7の画面上で、例えばユーザによるパッケージ頂点に対する目押しを行った場合の誤差範囲を考慮して決めておく。もちろん周辺領域の範囲を、矩形で表示しても構わない。
 ここで、各周辺領域を示す円環や矩形を、個々の目押し点(TP0・TP1・TP3・TP5のいずれか)が指定される毎に、表示部7に表示するようにしてもよい。このようにするとユーザは表示された円環等がパッケージObの頂点(P0・P1・P3・P5のいずれか)を外囲しているか否かを直ちに確認でき、便宜である。また、フロー図には図示していないが、ステップST3,ステップST4に関連して、表示された円環等が指定すべき頂点を外囲していないとユーザが認めた場合、ユーザが当該周辺領域をタッチペン14で再度タッチすると指定(目押し)が解除されるように構成してもよい。この場合は、指定解除と共に円環等の表示は消去される。更に、円環等の表示(目押し点の指定)と円環の消去(指定の解除)を、タッチパネル7aへのタッチに応じて交互にトグルするようにしてもよい。これにより各頂点を指定したものの、実際は周辺領域が頂点を外囲しないような事態を簡易に回避することができ、ユーザの使い勝手が向上する。
 このようにして、周辺領域で外囲される4頂点の指定が完了するとステップST3,ST4の処理が終了する。
 次のステップST5では、左画像(200L)に対して各周辺領域A0・A1・A3・A5内でエッジの検出を行ってエッジ画像を得る。エッジの検出方法としては、例えば特許第4338405号公報に開示されているように、1次差分オペレータを用い、3*3のフィルタで、エッジの水平方向成分と垂直方向成分とを検出し、これらの処理結果を合算してエッジ画像を生成し、フィルタ処理後のエッジ画像を2値化して、2値化を行った後にエッジを追跡(トレース)することで行うことができる。また、このエッジの追跡によるエッジの終端の判定は、上記公報に開示されているように、エッジの連続性が途切れた位置から次のエッジが検出されるまでの画素数が所定値以上、又は次のエッジの連続画素数が所定値未満の場合に、途切れた位置を終端として決定することができる。また、エッジの終端の判定に関しては、このような一般的条件に加えて、トレース範囲が周辺領域内であることを付加条件として用いてもよい。この付加条件の存在によってトレースを確実に停止することができる。ここで、周辺領域を矩形とすることで、この条件適否を高速に判断することができる(表示は円環を利用しつつ、トレース終了条件の判断には矩形を用いるようにしてもよい)。このようにして、例えば図8に示されるように、各周辺領域A0・A1・A3・A5内に各頂点に集まる3辺となる各エッジ(図の太線)Eを検出し、エッジ画像を取得することができる。エッジ検出を実行する範囲は周辺領域内に限定されており、高速処理が可能となる。
 ここでは3辺からなるエッジについて説明したが、撮影時のカメラワークや指定頂点によっては、3辺の全てが写っていないこともあり(例えば、上述した組パターンPA1のような場合)、2辺からなるエッジを利用する場合もある。(図示せず)
 次のステップST6では、ステップST5において実行されたエッジ検出により、全ての各周辺領域A0・A1・A3・A5内にそれぞれ有効なエッジが検出されたか否かを判別する。領域内に1点に集中する3本のエッジが検出されることによりパッケージObの頂点を確実に求めることができるが、2本のエッジが1点に集中する場合でもその交点を頂点とすることができる。全ての周辺領域A0・A1・A3・A5内にそれぞれ頂点を求めるのに有効なエッジが検出された場合にはステップST7に進み、有効なエッジが検出されない周辺領域が一つでもある場合には後記するステップST12(又は分岐の他の例であるステップST17)に進む。
 なお、有効なエッジ検出が行われたか否かは、例えば、エッジトレースに際してエッジと判断された部分と他の部分のコントラスト差を検出し、1画素単位のトレースにおいてコントラスト差の絶対値を累積して評価関数とすればよい。一般的にコントラスト差が大きいほど、エッジは検出され易いから、評価関数の値が所定の閾値より大きければ、有効なエッジ検出がされたものと推定することができる。
 ステップST7では、各周辺領域A0・A1・A3・A5内に検出された各エッジの交点座標を求める。上記したように、各エッジの交点は、パッケージObにおいて3辺が集まる頂点となる。
 また、目押し点(図5に示す、TP0・TP1・TP3・TP5)同士を結ぶ形状は、パッケージObの配置状態に対応して変化するから、この特徴に基づき頂点座標を計算することができる。以降、図8(a)を用いて説明する。例えば撮影された画像において、共通頂点P0に集合する3辺の形状パターン(辺同士が交わる角度等を意味する)は、周辺領域A0周辺のパターンと略一致(相似)すると考えられる。また、頂点P0に接続する辺z1を、周辺領域A0を越えて延伸し、かつ実際の辺z1を消去した形状パターンは、頂点P3周辺のパターンと略一致(相似)すると考えられる。頂点P1,P5周辺のパターンについても同様である。つまり、共通頂点P0に集合する辺の形状から、各頂点に接続する辺の形状が推測できることになる。よって、4つの目押し点の位置関係に基づき、4つの頂点近傍のパターンを作成しておき、エッジトレースによって生成したエッジ画像と辺のマッチングをとることで、特徴点となる各頂点P0・P1・P3・P5の座標(例えば、左画像における2次元座標。具体的には、各頂点を撮影する撮像素子のxy座標)を特定することができる。
 次のステップST8では、図8(a)に示されるように左画像(200L)における各周辺領域A0・A1・A3・A5に対応して、図8(b)に示されるように右画像(200R)上での各周辺領域A0R・A1R・A3R・A5Rを設定する。そして、これらの周辺領域から頂点P0R・P1R・P3R・P5Rの座標を求める。
 以降、この過程について詳細に説明する。
 一般にステレオカメラでは、例えば製造過程において、左右のカメラ4L,4R間で図1に示すy軸,z軸のシフト方向及び、x軸,y軸,z軸の回転方向についてのキャリブレーション及びこの結果に基づく調整が行われており、被写体を撮像したときの視差はx軸方向のみに生じると考えてよい。これに従えば、左右のカメラ4L,4Rで撮影されたパッケージObは、相互に図1のx軸方向(左右方向)にシフトして撮影され、左画像と右画像の原点(例えば撮影領域の左上の点)を揃えると、左画像における被写体に対して右画像の被写体は、x軸左側(図1の座標系の矢印方向をプラス方向とするとマイナスの方向)にずれて撮影される。
 また、後に詳細に説明するように、左右カメラ4L,4R間の基線長B、各カメラに搭載された撮像素子の画素ピッチやサイズ、光学系の焦点距離f等は測定系としてみたときに既知の固定値であり、パッケージサイズが測定される現場において被写体までの距離が例えば1~2m程度という現実的な制約があれば、ステレオカメラで撮影された左右の画像における被写体のずれ量(画素数)を推定することができる。
 これによって、左画像に対してユーザが目押しした点(TP0・TP1・TP3・TP5)が、右画像においてどの範囲に対応するかが推定される。このようにして右画像における各目押し点が決定し、これに基づいて各周辺領域(A0R・A1R・A3R・A5R)が定められ、上述してきた左画像に対するプロセスと同様に、各周辺領域でエッジが検出され、最終的に右画像における2次元座標としての頂点座標(P0R・P1R・P3R・P5R)が求められる。
 さて、これまでの説明によって、左画像の各頂点P0・P1・P3・P5は、この順序で右画像の各頂点P0R・P1R・P3R・P5Rと対応していることは明白である。何故なら、本実施形態によれば、例えば左画像の頂点P0に対する目押し点TP0を中心として周辺領域A0が定められ、使用シーンに基づくカメラ4とパッケージObの離間距離から右画像において対応する頂点P0Rを外囲する周辺領域A0Rが定められ、左右それぞれの周辺領域に対して独立して頂点P0及び頂点P0Rの座標(2次元座標)が求められるからである(頂点P1と頂点PR1、頂点P3と頂点P3R、頂点P5と頂点P5Rについても同様)。
 上記のように、左右画像それぞれの頂点座標が求まった場合は、ステレオマッチング処理と呼ばれる対応点探索処理は不要となる。視差精度が求められる場合は、ステレオマッチング処理を行い、より高精度な視差を求めることも可能となる。
 図6は、本発明の実施形態に係るサイズ測定装置1に関して、ステレオ視によってカメラ4と被写体の任意の点(注目点P)との距離Zpを取得(測距)する原理を説明する説明図であり、図6(a)はカメラ4と被写体との位置関係を示し、図6(b)は補助線としてエピポーラ線ELを追加したものである。また、図7は、本発明の実施形態に係るサイズ測定装置1に関して、二次元的に示した測距原理を三次元空間に拡張して説明する説明図である。
 以下、図6(a)、図6(b)を用いて三次元測距の原理と、注目点Pの空間座標(Xp,Yp,Zp)を求める過程を説明する。なお、図6(a)、図6(b)で用いる座標系は図1、図3等で用いたものと同じである。
 図6(a)において左カメラ4L、右カメラ4Rの撮像範囲には注目点Pが含まれているが、注目点Pは左カメラ4Lの光軸CAxL、右カメラ4Rの光軸CAxRから図のx方向右側にずれており、各光軸と対応する各撮像素子20の各交点20cを基準とすると、注目点Pは各撮像素子20の撮像面上で、左カメラ4LではxLだけ、図のx方向左側に右カメラ4RではxRだけ、シフトして撮影される。
 図6(b)に示すように、右カメラ4Rの結像光学系21の中心点を通る補助線として線ELを追加する。ここで線ELとは、左カメラ4Lの結像光学系21と注目点Pを結ぶ直線BLを右カメラ4Rに射影したものであり、直線BLと線ELは互いに平行である。このように作図すると、右カメラ4R側に形成される三角形Oαβと三角形Oυζは相似となる。右カメラ4Rで撮像した画像を基準画像、左カメラ4Lで撮像した画像を参照画像とすると、基準画像中の点xR(x方向において光軸CAxRからのずれ量)は参照画像ではxL(同,光軸CAxLからのずれ量)に移動しているから、x軸方向の移動量|xL-xR|を基準画像における視差δxと定義し、δx=|xL-xR|と表す。ここで、レンズの焦点距離をf、両カメラ4の光軸間の距離(基線長)をBとするとき、距離(奥行き)Zpは、
Zp=f×(B/δx)  ・・・(式1)
で計算される。
 図6(a)、図6(b)では左カメラ4Lと右カメラ4Rを上面(y軸方向)から見て、三次元測距の原理をx軸方向(基線長Bの方向)に発生する視差に基づいて説明を行ったが、図7に示すように、実際の撮像素子20は三次元空間内に位置し、注目点Pは撮像素子21の撮像面(x'y'平面)に配置された画素に投影される。このx'y'平面は撮像素子20の撮像面であるから、図6(b)等から理解されるように、上述のxyz座標系と本質的に同じである。そして、注目点Pは、左カメラ4Lの撮像素子20においては座標(xL,yL)に、右カメラ4Rの撮像素子20においては座標(xR,yR)に投影され、カメラ4が出力する画像に基づいて具体的な座標値が取得される。
 そして、(式1)に基づいて距離Zpが求められれば、注目点Pの座標値Yp,Zpは、基準画像(例えば右カメラ4Rによって撮像された画像)で観測された注目点Pの座標(xR,yR)を用いて(式2)のようにして求められる。
(Xp,Yp,Zp)
=((Zp/f)xR,(Zp/f)yR,(B×f)/δx)
=(B/δx)(xR,yR,f)  …(式2)
 上述したようにサイズ測定装置1は二つのカメラ4を有しているが、サイズ測定装置1における左カメラ4Lと右カメラ4Rの位置は設計上一意に決定されている。即ち、左カメラ4Lと右カメラ4Rとの光軸間の距離(基線長B)は設計上の固定値である。そして、左右のカメラ4に搭載される結像光学系21が有する焦点距離fも固有の値である。従って左カメラ4Lと右カメラ4Rとがそれぞれ撮影した画像、即ち左右の撮像素子20の出力から同一の特徴点を検出できれば、左右の特徴点の座標値の差が視差δxとなる。このようにして、基線長B、焦点距離f、視差δxが得られることにより、カメラ4(基準とするカメラ)から注目点Pまでの距離Zpを計算することができる。
 さて、上述したように、本実施形態ではサイズ測定装置1が実際に使用される際のカメラ4と被写体(パッケージOb)の距離を想定して、左画像(200L)における周辺領域A0・A1・A3・A5を、右画像(200R)の周辺領域A0R・A1R・A3R・A5Rに対応させているが、以下に、左画像と右画像の周辺領域の対応関係について定量的に説明する。
 本実施形態で使用するカメラ4L,4Rにおいて基線長B及び焦点距離fは固定値であるため、撮影範囲となるZpの変化量が決まれば、視差δxの範囲(変化量)が分かる。これにより、左画像を基準とした場合の上記各周辺領域A0・A1・A3・A5に対応する右画像上での各周辺領域A0R・A1R・A3R・A5R内に各頂点P0・P1・P3・P5が位置することが推定され、各頂点を探索する範囲(周辺領域)を絞ることができ、例えばその後のエッジ検出処理の負荷を低減し得る。
 本実施形態においては、具体的には、例えば基線長Bが75mm、焦点距離fが6mmとし、また撮像素子20の画素ピッチが0.003mmのカメラ4の場合に、距離Zp=1mとすると、上記式3から、視差δxは0.45mmとなり、距離Zp=2mとすると、視差δxは0.225mmとなる。画素ピッチは0.003mmなので、視差δxの範囲は、75画素<δx<150画素となり、この範囲に基づいてステレオマッチングの探索範囲を狭い範囲に決定することができる。より具体的には、左画像で目押しをした際に表示される周辺領域を示す円環のサイズ(直径)を、撮像素子の画素換算で150画素とし、右画像の周辺領域として、左画像の目押し点からx軸左方向(図1の座標系の矢印方向をプラス方向とするとマイナスの方向)に(75+150)/2=112画素だけシフトして周辺領域の中心座標を大まかに設定する。このようにすることで、左画像を用いて目押し点を設定した場合でも、右画像で視差を考慮した周辺領域を設定することができる。これによってユーザは、左右いずれかの画像に対して目押し点を設定するだけで、パッケージサイズを測定することができる。
 次のステップST9では、左右の画像における各頂点座標に基づいて、視差を求める。上述のようにx軸シフト方向を除き、カメラ4L,4Rは出荷時のキャリブレーション結果に基づく調整がなされているから、これら対応する頂点P0-頂点P0R、頂点P1-頂点P1R、頂点P3-頂点P3R、頂点P5-頂点P5R(これら各頂点の組の左側は左画像に由来し、右側は右画像に由来する)のx座標の差分は、直ちに各頂点に対する視差δxを表す。
 ただし、このようにエッジ画像から求めた頂点座標に基づいて、直接的に視差δxを計算すると、エッジ検出が実質的な2値化であることから計算結果は撮像素子の1画素単位の離散的な値となる。撮像素子の画素数が十分に多く更に視差そのものが大きければ(例えば、カメラと被写体間の距離が短いような場合)影響は小さいが、そうでない場合は、例えば、左画像と右画像において対応する周辺領域内の画像(もちろん中間調の画像である)を用いてブロックマッチング処理を実行することで、サブピクセル単位で視差δxを算出できる。
 ステップST10では、ステップST9で求めた各頂点P0・P1・P3・P5のそれぞれの視差から、各頂点の3次元座標を算出する。なお、距離Zpは、上記式1により求めることができる。このようにして、各頂点P0・P1・P3・P5の3次元座標を求めることにより、共通頂点P0に集まる3辺の各長さ(P0~P1、P0~P3、P0~P5)を算出することができ、それによりパッケージObのサイズを求めることができる。
 次に、上記した図4のステップST6で4つの周辺領域A0・A1・A3・A5のいずれかで有効なエッジが検出されなかった場合、即ち例外処理の分岐フローを、図9(a)を参照して以下に説明する。なお、エッジの有効性については、既に説明したように、エッジ部とその周辺領域のコントラスト差等を尺度として判定することができる。
 以降、例として図10(a)に示されるように一部の周辺領域でエッジが検出されなかった場合、具体的には周辺領域A1・A3ではエッジが検出されたが、周辺領域A0・A5ではエッジが検出されなかった場合について説明する。
 上述したように、目押し点に基づいて生成された周辺領域は4つ存在するが、この周辺領域が、パッケージを構成する3辺の共通頂点の一つと、この共通頂点と相対する当該3辺の他端を含むとの前提があれば、各周辺領域の位置関係に基づき、実際には目押しされていない頂点(ここでは頂点P2・P4・P6)に対応した周辺領域(同A2・A4・A6)の位置を推定することができる。これは、被測定物であるパッケージが略直方体だからである。
 具体的には、図9(a)のステップST12では、図10(b)に示されるように、周辺領域A0・A1・A3・A5の大きさ(直径)に合わせた太さ(幅)で形成される辺により、周辺領域A0を共通頂点として集まるY字状の3辺(A0~A1・A0~A3・A0~A5)に基づいて形成した直方体の疑似箱形BXを、エッジEが検出された周辺領域A1・A3に角を合わせるように画面上にセットする。このとき、検出されたエッジEをガイドにして疑似箱形BXの各辺を合わせる微調整を行うことができる。このように疑似箱形BXを重ねることで、目押しされていない頂点に対応した周辺領域A2・A4・A6の位置が定まる。
 次のステップST13では、タッチペン14の指定に基づく4周辺領域A0・A1・A3・A5以外の3頂点に対応する各周辺領域A2・A4・A6内でエッジ検出を行う。直方体形のパッケージObに対して、任意の頂点(カメラ4に対向する頂点)及びその頂点に接続する3辺を撮影した場合には、図5に示されるように7つの頂点P0~P6が存在し、ユーザがタッチペン14により位置指定した以外の3頂点P2・P4・P6も撮影されるため、疑似箱形BXの各周辺領域A2・A4・A6内に各頂点P2・P4・P6が位置し得る。従って、各頂点P2・P4・P6を求めるための各辺(エッジ)の検出に対して、限られた狭い範囲となる各周辺領域A2・A4・A6内の画像処理(エッジ処理等)で済むため、画面全体に対してエッジ処理を行う必要がなく、画像処理の負荷を低減することができる。
 次のステップST14では、ステップST13で例えば図10(c)に示されるように二つの周辺領域A2・A4内でエッジEが検出された場合に、それら周辺領域A2・A4内で検出されたエッジEを有効なものとして採用する。
 次のステップST15では、パッケージObのサイズを求めるのに必要な3辺(辺x1・辺y1・辺z1)を決定する各頂点が全て検出されたか否かを判別する。図示例の場合、頂点P2・P3間が辺x1に相当し、頂点P3・P4間が辺y1に相当し、頂点P1・P2間が辺z1に相当し、パッケージObのサイズを求めるのに必要な辺x1・y1・z1を抽出可能な全ての頂点P1~P4が求められたことになる。この場合にはステップST8に進む(ステップST15でYes)。
 ステップST8以降では図4を用いて説明した処理を行ってパッケージObのサイズを測定する。ステップST15で必要な全ての頂点が求められなかったと判断された場合(ステップST15でNo)には、パッケージObのサイズを測定することができないため、ステップST16に進み、そこで例えば表示部7にエラーメッセージを表示させて、本フローを終了する。
 以上、述べてきたように、図9(a)のフローに示す例外処理では、画像処理部6(図2参照)は、4つの周辺領域(本実施形態ではA0・A1・A3・A5)のいずれかで頂点位置が検出されなかった場合には、4つの周辺領域の位置関係から、ユーザが指定しなかった頂点位置を包含する他の周辺領域(本実施形態ではA2・A4・A6)を推定し、この推定した周辺領域において頂点位置を求める。
 次に、上記した図4のステップST6で4つの周辺領域A0・A1・A3・A5のいずれかで有効なエッジが検出されなかった場合の、分岐フローの他の例を、図9(b)を参照して説明する。
 図9(b)におけるステップST17では、タッチペン14の指定位置に基づく4つの周辺領域A0・A1・A3・A5を大きな頂点として、図11(a)に示されるように、各周辺領域A0・A1・A3・A5の大きさ(円形とした場合の直径)を線の幅として、共通頂点を包含する周辺領域A0から各A1・A3・A5間を結ぶ各空間X1・Y1・Z1(以降、辺領域と呼称する)を設定する。周辺領域は面積を有するから、この周辺領域間を接続した空間である辺領域も面積を有する。周辺領域に頂点が含まれる前提において、辺領域内に2頂点を接続する辺が包含される蓋然性はきわめて高い。そして、各辺領域X1・Y1・Z1内でエッジ検出を行って頂点間の辺(即ち、線分の式)を抽出する。
 この場合、周辺領域A0(A1・A3・A5)における頂点の検出は点に対してであるのに対して、辺領域X1(Y1・Z1)における辺の検出は線に対してである。理論上は点である頂点の検出精度は局所条件に大きく依存するが、理論上は線である辺に対しては、撮影条件の悪い部分があっても、有効と判断されるエッジ部分を連結することで全体が推定できるため、エッジ検出の確率が高まり、例えば照明条件が不十分な環境下にあっても、未検出によるエラー頻度を低減できる。
 次のステップST18では、上記ステップST12と同様に周辺領域(例えばA0)の大きさに合わせた太さの辺により形成した直方体の疑似箱形BXを、図11(b)に示すように各辺領域X1・Y1・Z1内に検出された各エッジEx1・Ey1・Ez1に合わせて画面上にセットする(図12(a))。
 なお、頂点間を接続する辺を効率良く抽出するためには、辺領域を設定して、この辺領域内のみを探索するという概念は必須である。一方、サイズ計測に必要な頂点4つのうち共通頂点以外の1頂点のみが検出されなかったような場合は、理論上は当該頂点に接続する2辺のみを抽出すればよいことから、ステップST18(疑似箱形BXの位置合わせ)及び次に述べるステップST19(疑似箱形BX内のエッジ検出)の処理は省略してもよい。同様の理由で、上述した図9(a)のステップST12を省略してもよい。
 また、このようにエッジを検出する最終目的は、エッジで構成される線分を少なくとも二つ抽出して、これら二つの線分の交点(或いは最近接点)からパッケージObの頂点座標を求めることであるから、辺領域を間に持つ周辺領域(互いに隣接する周辺領域)は最低限3つ必要ということになる。
 次のステップST19では、ステップST18で、例えば図12(a)に示されるように疑似箱形BXの各辺に対応する各辺領域内でエッジ検出を行う。この場合も限られた狭い範囲に対する画像処理(エッジ処理等)で済むため、エッジ検出処理の負荷を低減し得る。
 次のステップST20では、疑似箱形BXの辺領域内でエッジ検出により抽出された線分を延長して、各延長線の交点を各頂点とする(なお、以降の説明では、当該線分又は延長線を一律にエッジと呼称することがある)。そして、当該交点は、図4のフローにおいて頂点位置が検出されなかった周辺領域における頂点位置とみなされる。即ち、図9(b)に示すフローでは、目押し点(点情報)を外囲する周辺領域(面情報)を得て、更に各周辺領域を結ぶ辺領域から辺(線情報、空間における直線の式)を抽出し、2直線の交点をもって頂点座標(点情報)を計算する。
 例えば図12(a)に示されるようにエッジEx2・Ex3・Ey2・Ey3・Ez2・Ez3が検出された場合には、図12(b)の二点鎖線で示されるように、各エッジEx2・Ex3・Ey2・Ey3・Ez2・Ez3を疑似箱形BXの辺領域内で延長し、各エッジEx2・Ex3・Ey2・Ey3・Ez2・Ez3及び各延長線による各交点を各頂点P1~P6とする。そして、ステップST15に進む。
 この場合、各エッジEx2・Ex3・Ey2・Ey3・Ez2・Ez3において、撮影条件の悪さにより捩れのように検出された場合には、各エッジ及び各延長線による交点が見出されない。そのような場合には、対応する周辺領域内で辺同士の距離が最短となる各辺間の中間位置の座標(最近接点)を頂点座標としてよい。
 ステップST15では、上記したように、ステップST20において頂点とされた各点により、パッケージObのサイズ測定に必要な3辺(辺x1・辺y1・辺z1)を決定するために必要な各頂点が全て求められたか否かを判別する。
 図示例の場合、疑似箱形BXの中央部分のY字状の3辺以外である外形部分の6辺に対応する各エッジEx2・Ex3・Ey2・Ey3・Ez2・Ez3が全て検出された場合であり、ステップST19では6箇所の頂点(P1~P6に対応)が求められている。この場合には、頂点P2・P3、P5・P6間がそれぞれ辺x1に相当し、頂点P3・P4、P1・P6間がそれぞれ辺y1に相当し、頂点P1・P2、P4・P5間がそれぞれ辺z1に相当する。なお、必ずしも6頂点P1~P6の全てが求められる必要はなく、パッケージObのサイズ測定に必要な3辺(辺x1・辺y1・辺z1)を決定するために必要な4頂点が求められればよく、上記と同様に頂点P1~P4が求められた場合でもよい。
 ステップST15で必要な4頂点が求められたと判定された場合にはステップST8に進み、ステップST8以降では、図4を用いて説明した処理を行ってパッケージObのサイズ測定を行う。
 このように本発明によれば、画面全体やパッケージObの全体に対してエッジ処理を行うことなく、タッチペン14による指定位置に対応させて領域を設定し、指定位置周辺の狭い領域内でエッジ検出・ブロックマッチング処理を実行すればよいため、画像処理負荷を大幅に低減できる。それにより、サイズ測定処理の高速化も可能となる。また、タッチペン14の操作である所謂目押しによる誤差範囲を考慮して周辺領域の大きさを設定しておくことにより、照明などの影響により領域内にエッジが検出されない場合でも、周辺領域を大きな頂点とみなして辺領域を設定或いは疑似箱形BXを合わせることにより、各辺のエッジを検出可能となり、エッジ検出ができない状態をできるだけ回避し得る。また、タッチペン14による指定位置をそのままパッケージObの頂点として用いるのではなく、領域を指定しかつ領域内で検出されたエッジにより確実に頂点を求めて、辺の長さを算出することから、目押しによる不確実性を排除してパッケージサイズを高精度に測定することができる。
 また、頂点座標を求める際に全ての辺を参照する必要はなく、例えば辺の抽出過程において最も信頼度が高いものから順に用いればよい。ここで信頼度は、例えば辺に対して連続してエッジ検出が行われた長さに基づいて計算することができる。例えば上記図12(a)のエッジEx3のように辺が途切れて検出された場合には、連続して検出されたエッジEx2の方が信頼度が高いと考えられる。他に、辺として検出されたエッジの周囲のコントラスト情報に基づいて信頼度を計算してもよい。サイズ測定のためのxyz軸方向の辺において、それぞれ互いに平行する各辺の信頼度を比較し、信頼度の高い辺を採用する。例えば上記図12(a)のように、x軸方向の各エッジEx1~Ex3の中でエッジEx2の信頼度が最も高かったら、そのエッジEx2をx軸方向の辺x1として、頂点座標の検出に用いる。他のy軸・z軸も同様である。これは、サイズ測定対象が直方体の箱状のパッケージObであるという特殊な対象であることを利用するものである。即ち、パッケージObの任意の一つの辺には平行な3つの辺が存在し(例えば、Ex1~Ex3)、パッケージObは直方体なので、サイズ測定では、平行な3辺のいずれの辺を用いて各頂点座標を求めてもよく、上記信頼度の最も高い辺を採用することができる。もっとも、ある辺の信頼度が高くても、この辺と交差する他の辺の信頼度が低いと頂点座標の精度は低下するから、実際の処理では、複数の平行な辺に対して信頼度のランクを付与し、頂点座標を求める際にランクの高い辺から優先的に使用するとよい。なお、パッケージの形状は、厳密には遠い部分ほど小さく見えるが、パッケージObの大きさに対する撮影距離・画角の設定により、近似的に平行な辺同士によるものとして取り扱うことができる。
 以上、述べてきたように、図9(b)のフローに示す例外処理では、画像処理部6(図2参照)は、4つの周辺領域(本実施形態ではA0・A1・A3・A5)のいずれかで頂点位置が検出されなかった場合には、頂点位置が検出されなかった周辺領域(例えばA0)と、これに隣接する少なくとも二つの他の周辺領域(例えばA1,A3)との間の空間(例えば、A0-A1間の辺領域X1とA0-A3間の辺領域Z1)において、少なくとも二つの辺(例えば、A0-A1間の辺Ex1とA0-A3間の辺Ez1)を抽出し、抽出された二つの辺の交点又は最近接点を、頂点位置が検出されなかった周辺領域(A0)における頂点位置とみなし、この頂点位置に基づいて、パッケージの辺の長さを算出する。
 以上、上記実施形態における三次元測距に関しては、所謂ステレオ法を例にして詳細に説明したが、目押し点の近傍に設定した周辺領域に限って頂点を探索するという観点で、本発明はステレオ法に限らず、他の測距方法と組み合わせることが可能である。このような測距方法としては、例えば、被測定対象と一緒に予めサイズが既知の基準物を撮影し、基準物のサイズから被測定対象のサイズを推定する方法(基準ラベル法)、投影光学系で発生させた正弦波状の格子パターンの位相を変えて被写体に投影し、これを1台のカメラで複数回撮影することで測定点の輝度変化から位相値を求める方法(正弦波パターン投影法)、正弦波パターン投影法を改良し、被測定対象に互いに位相をずらした正弦波縞パターン光投影し、モアレを含む画像から合成された位相値を求める方法(干渉縞投影撮像)、線状のレーザ光によって被測定対象を複数回走査/撮像し、基線長、走査角度、光入射角度で一意に定まる三角形に基づき、測定点までの距離を求める方法(光切断法)、被測定対象に照射したレーザパルスの発光タイミングから反射光を検出するまでの時間を計測し、光速Cに基づいて被測定対象までの距離を求める方法(TOF)等が知られている。
 例えば、撮像空間をメッシュ状に分割した各交点について上述の各方法を用いて三次元測距を行い、一方で測距と略同一タイミングで取得した画像に対してパッケージの頂点座標を指定することで、メッシュ交点座標を用いた補間を行って各頂点座標を計算することができる。もっとも、ステレオ法と基準ラベル法以外の測距方法では、頂点座標の指定と実際の測距が異なるタイミングで行われるため、測定精度の観点ではステレオ法や基準ラベル法を用いるのが望ましい。ここに汎用性の観点を加えると、基準ラベルが不要なステレオ法を用いるのが更に望ましい。
 以上、本発明を、その好適実施形態について説明したが、当業者であれば容易に理解できるように、本発明はこのような実施形態により限定されるものではなく、本発明の趣旨を逸脱しない範囲で適宜変更可能である。また、被写体をパッケージとして、4つの特徴点を求める例を示したが、ユーザが被写体の任意の二点間の距離を測る場合にも適用できるのは言うまでもない。また、上記実施形態に示した構成要素は必ずしも全てが必須なものではなく、本発明の趣旨を逸脱しない限りにおいて適宜取捨選択することが可能である。
 本発明に係るサイズ測定装置は、簡易な構成でパッケージサイズを高精度に測定することが可能であることから、運送業等の物流管理で用いるハンディターミナル等に好適に適用することができる。
1 サイズ測定装置
4 カメラ
6 画像処理部
7 表示部
7a タッチパネル
9 全体制御部
10 入力部
12 サイズ測定端末
13 制御装置
20 撮像素子
21 結像光学系
Ob パッケージ

Claims (12)

  1.  撮像された画像から被写体のサイズを測定するサイズ測定装置であって、
     被写体を撮像する撮像部と、
     前記撮像部で撮像された画像データを表示する表示部と、
     ユーザからの指示を入力する入力部と、
     前記表示部の表示された画像データに対して前記入力部から位置が指定されると、当該指定位置を含む周辺領域を設定する領域設定部と、
     前記領域設定部で設定された前記周辺領域において、測定対象の座標となる特徴点を決定する特徴点決定部と、を有するサイズ測定装置。
  2.  少なくとも二つの前記周辺領域において特徴点が決定された場合、当該二つの特徴点間の距離を前記撮像された画像データに基づいて算出する測定部を有する請求項1に記載のサイズ測定装置。
  3.  前記領域設定部で設定された前記周辺領域は前記表示部に表示される請求項1に記載のサイズ測定装置。
  4.  前記領域設定部で設定される前記周辺領域は円形である請求項1に記載のサイズ測定装置。
  5.  前記領域設定部で設定される前記周辺領域は矩形である請求項1に記載のサイズ測定装置。
  6.  前記撮像部は、被写体を異なる位置から同時に撮影するために所定の間隔で並べて配置された第1のカメラと第2のカメラを有し、前記測定部は前記第1及び第2のカメラにおける視差情報に基づいて演算処理を行い前記特徴点間の距離を算出する請求項1に記載のサイズ測定装置。
  7.  前記入力部と前記表示部はタッチパネルにより構成される請求項1に記載のサイズ測定装置。
  8.  前記撮像部は被写体として直方体のパッケージを撮像し、前記表示部の表示された画像に対して前記入力部から前記パッケージの3辺が集まる頂点と当該頂点に集まる3辺の該頂点とは相反する側の各端点との4点が測定対象位置として指定した場合、前記領域設定部は前記4点の指定位置に対してそれぞれ前記周辺領域を設定し、前記特徴点決定部は各前記周辺領域において特徴点を決定する請求項1に記載のサイズ測定装置。
  9.  前記4つの特徴点が決定された場合、前記4つの特徴点の位置に基づいて前記パッケージの辺の長さを算出する測定部を有する請求項8に記載のサイズ測定装置。
  10.  前記4点の指定位置に対して設定された4つの前記周辺領域のいずれかで特徴点が検出されなかった場合には、前記領域設定部は、前記4つの周辺領域の位置関係に基づき、ユーザが指定しなかった位置を包含する他の周辺領域を推定し、前記特徴点決定部は前記推定された周辺領域において特徴点を求めることを特徴とする請求項8に記載のサイズ測定装置。
  11.  前記4つの周辺領域のいずれかで特徴点が検出されなかった場合には、前記特徴点決定部は、前記特徴点が検出されなかった周辺領域と、これに隣接する少なくとも二つの他の周辺領域との間の空間において、少なくとも二つの辺を抽出し、抽出された前記二つの辺の交点又は最近接点を、前記特徴点が検出されなかった周辺領域に対応する特徴点とみなすことを特徴とする請求項8に記載のサイズ測定装置。
  12.  撮像された画像から被写体のサイズを測定するサイズ測定方法であって、
     被写体を撮像するステップと、
     前記撮像された画像データを表示するステップと、
     前記表示された画像データに対してユーザより位置が指定されると、当該指定位置を含む周辺領域を設定するステップと、
     前記周辺領域において、測定対象の座標となる特徴点を決定するステップと、を有するサイズ測定方法。
PCT/JP2013/003819 2012-07-02 2013-06-19 サイズ測定装置及びサイズ測定方法 WO2014006832A1 (ja)

Priority Applications (4)

Application Number Priority Date Filing Date Title
JP2014523572A JP6132275B2 (ja) 2012-07-02 2013-06-19 サイズ測定装置及びサイズ測定方法
GB1423377.9A GB2519006B (en) 2012-07-02 2013-06-19 Size measurement device and size measurement method
DE112013003338.0T DE112013003338B4 (de) 2012-07-02 2013-06-19 Größenmessvorrichtung und Größenmessverfahren
US14/585,627 US9607406B2 (en) 2012-07-02 2014-12-30 Size measurement device and size measurement method

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2012-148406 2012-07-02
JP2012148406 2012-07-02

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US14/585,627 Continuation-In-Part US9607406B2 (en) 2012-07-02 2014-12-30 Size measurement device and size measurement method

Publications (1)

Publication Number Publication Date
WO2014006832A1 true WO2014006832A1 (ja) 2014-01-09

Family

ID=49881608

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2013/003819 WO2014006832A1 (ja) 2012-07-02 2013-06-19 サイズ測定装置及びサイズ測定方法

Country Status (5)

Country Link
US (1) US9607406B2 (ja)
JP (1) JP6132275B2 (ja)
DE (1) DE112013003338B4 (ja)
GB (1) GB2519006B (ja)
WO (1) WO2014006832A1 (ja)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2015119746A1 (en) * 2014-02-04 2015-08-13 General Electric Company Automatic method and device for determining a or several geometric properties using touch data received via a touchscreen
JP2017535755A (ja) * 2014-09-24 2017-11-30 パナビジョン インターナショナル,エル.ピー. 動画カメラフォーカス用途における距離測定デバイス
JP2018510347A (ja) * 2015-03-31 2018-04-12 ベイジン ジンドン シャンケ インフォメーション テクノロジー カンパニー リミテッド 物体サイズを測定する機器、方法、および装置
JP2020112434A (ja) * 2019-01-11 2020-07-27 株式会社神戸製鋼所 測距装置および測距方法
JP2020134427A (ja) * 2019-02-25 2020-08-31 株式会社Nttドコモ 情報処理装置
US10964045B2 (en) 2017-07-05 2021-03-30 Sony Semiconductor Solutions Corporation Information processing device, information processing method, and individual imaging device for measurement of a size of a subject
US11733032B2 (en) 2018-09-28 2023-08-22 Panasonic Intellectual Property Management Co., Ltd. Measurement device and measurement method

Families Citing this family (28)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9625995B2 (en) 2013-03-15 2017-04-18 Leap Motion, Inc. Identifying an object in a field of view
US9741134B2 (en) * 2013-12-16 2017-08-22 Symbol Technologies, Llc Method and apparatus for dimensioning box object
US9392254B2 (en) * 2014-02-28 2016-07-12 John Clinton Barkley Game sizing camera
US20160180441A1 (en) * 2014-12-22 2016-06-23 Amazon Technologies, Inc. Item preview image generation
US9665960B1 (en) 2014-12-22 2017-05-30 Amazon Technologies, Inc. Image-based item location identification
US20160180193A1 (en) * 2014-12-22 2016-06-23 Amazon Technologies, Inc. Image-based complementary item selection
US9965793B1 (en) 2015-05-08 2018-05-08 Amazon Technologies, Inc. Item selection based on dimensional criteria
WO2016208404A1 (ja) * 2015-06-23 2016-12-29 ソニー株式会社 情報処理装置および方法、並びにプログラム
JP6141562B1 (ja) * 2015-07-29 2017-06-07 京セラ株式会社 視差算出装置、ステレオカメラ装置、車両及び視差算出方法
JP6564693B2 (ja) * 2015-11-25 2019-08-21 オリンパス株式会社 撮像装置、撮像装置の制御方法、及び判定プログラム
JP6649084B2 (ja) * 2015-12-28 2020-02-19 東芝テック株式会社 宅配システム
US10587858B2 (en) * 2016-03-14 2020-03-10 Symbol Technologies, Llc Device and method of dimensioning using digital images and depth data
DE102016014329A1 (de) 2016-12-01 2017-07-06 Daimler Ag Assistenzvorrichtung
CN106548480B (zh) * 2016-12-23 2023-05-26 蚌埠学院 一种基于机器视觉的农产品体积快速测量装置及测量方法
JP6602323B2 (ja) * 2017-01-13 2019-11-06 株式会社オプトエレクトロニクス 寸法測定装置、情報読取装置及び寸法測定方法
EP3486607B1 (de) * 2017-11-20 2021-09-01 Leica Geosystems AG Bildbasierte kantenvermessung
KR101986433B1 (ko) * 2017-11-28 2019-06-05 재단법인 다차원 스마트 아이티 융합시스템 연구단 시점 변환을 이용하는 영상 스티칭 방법 및 시스템
KR101997991B1 (ko) * 2017-11-29 2019-07-08 재단법인 다차원 스마트 아이티 융합시스템 연구단 시점 변환을 이용하는 영상 결합 방법 및 시스템
US10930001B2 (en) * 2018-05-29 2021-02-23 Zebra Technologies Corporation Data capture system and method for object dimensioning
CN109186461A (zh) * 2018-07-27 2019-01-11 南京阿凡达机器人科技有限公司 一种箱体大小的测量方法及测量设备
JP6699872B2 (ja) * 2018-09-10 2020-05-27 Necプラットフォームズ株式会社 荷物計測装置、荷物受付システム、荷物計測方法、及びプログラム
TWI696804B (zh) * 2019-01-09 2020-06-21 阿丹電子企業股份有限公司 體積量測裝置及體積量測方法
CN109816049B (zh) * 2019-02-22 2020-09-18 青岛理工大学 一种基于深度学习的装配监测方法、设备及可读存储介质
TWI709725B (zh) * 2019-12-03 2020-11-11 阿丹電子企業股份有限公司 箱體的體積量測裝置及體積量測方法
US11087481B2 (en) * 2020-01-08 2021-08-10 Himax Technologies Limited Method for detecting dimension of box based on depth map
TWI724926B (zh) * 2020-06-19 2021-04-11 阿丹電子企業股份有限公司 體積量測裝置的量測警示方法
US11830213B2 (en) 2020-11-05 2023-11-28 Streem, Llc Remote measurements from a live video stream
US11966555B2 (en) 2022-01-07 2024-04-23 Charles Allan Wolford Method and apparatus for increasing measurement accuracy using a camera enabled portable computing device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001082954A (ja) * 1999-09-13 2001-03-30 Fujitsu Ten Ltd 画像処理装置及び画像処理測距方法
JP2002222423A (ja) * 2001-01-25 2002-08-09 Fujitsu Ltd 物体認識方法および装置
JP2004219255A (ja) * 2003-01-15 2004-08-05 Matsushita Electric Ind Co Ltd サイズ測定装置、方法および測定プログラム
JP2010008352A (ja) * 2008-06-30 2010-01-14 3D Media Co Ltd 寸法測定方法及び寸法測定装置

Family Cites Families (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE69328230T2 (de) * 1992-12-01 2000-08-10 Canon Kk Entfernungbildverarbeitungsvorrichtung und -verfahren
US6192145B1 (en) * 1996-02-12 2001-02-20 Sarnoff Corporation Method and apparatus for three-dimensional scene processing using parallax geometry of pairs of points
US6092059A (en) * 1996-12-27 2000-07-18 Cognex Corporation Automatic classifier for real time inspection and classification
US6409383B1 (en) * 2000-03-14 2002-06-25 Eastman Kodak Company Automated and quantitative method for quality assurance of digital radiography imaging systems
WO2007117535A2 (en) * 2006-04-07 2007-10-18 Sick, Inc. Parcel imaging system and method
NO327899B1 (no) * 2007-07-13 2009-10-19 Tandberg Telecom As Fremgangsmate og system for automatisk kamerakontroll
JP2010003251A (ja) 2008-06-23 2010-01-07 Panasonic Corp 画像リサイズ処理装置及び画像リサイズ処理方法
CN102246201B (zh) 2008-12-12 2014-04-02 松下电器产业株式会社 图像处理装置及图像处理方法
US8908995B2 (en) * 2009-01-12 2014-12-09 Intermec Ip Corp. Semi-automatic dimensioning with imager on a portable device
US8284988B2 (en) * 2009-05-13 2012-10-09 Applied Vision Corporation System and method for dimensioning objects using stereoscopic imaging
JP5322287B2 (ja) 2009-05-28 2013-10-23 パナソニック株式会社 回転台付カメラ装置
KR20110054852A (ko) * 2009-11-18 2011-05-25 삼성전자주식회사 터치 스크린을 구비한 단말기 및 그 단말기에서 기하학적 데이터 측정 방법
SG189284A1 (en) * 2010-10-07 2013-05-31 Sungevity Rapid 3d modeling
US20130114883A1 (en) * 2011-11-04 2013-05-09 Industrial Technology Research Institute Apparatus for evaluating volume and method thereof
US9400929B2 (en) 2012-03-05 2016-07-26 Panasonic Intellectual Property Management Co., Ltd. Object detection device and method for detecting an object by performing a raster scan on a scan window
US9286530B2 (en) * 2012-07-17 2016-03-15 Cognex Corporation Handheld apparatus for quantifying component features

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001082954A (ja) * 1999-09-13 2001-03-30 Fujitsu Ten Ltd 画像処理装置及び画像処理測距方法
JP2002222423A (ja) * 2001-01-25 2002-08-09 Fujitsu Ltd 物体認識方法および装置
JP2004219255A (ja) * 2003-01-15 2004-08-05 Matsushita Electric Ind Co Ltd サイズ測定装置、方法および測定プログラム
JP2010008352A (ja) * 2008-06-30 2010-01-14 3D Media Co Ltd 寸法測定方法及び寸法測定装置

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2015119746A1 (en) * 2014-02-04 2015-08-13 General Electric Company Automatic method and device for determining a or several geometric properties using touch data received via a touchscreen
US9329763B2 (en) 2014-02-04 2016-05-03 General Electric Company Method and device for determining geometric property
JP2017535755A (ja) * 2014-09-24 2017-11-30 パナビジョン インターナショナル,エル.ピー. 動画カメラフォーカス用途における距離測定デバイス
US10587792B2 (en) 2014-09-24 2020-03-10 Panavision International, L.P. Distance measurement device
US11494929B2 (en) 2014-09-24 2022-11-08 Panavision International, L.P. Distance measurement device
JP2018510347A (ja) * 2015-03-31 2018-04-12 ベイジン ジンドン シャンケ インフォメーション テクノロジー カンパニー リミテッド 物体サイズを測定する機器、方法、および装置
US10964045B2 (en) 2017-07-05 2021-03-30 Sony Semiconductor Solutions Corporation Information processing device, information processing method, and individual imaging device for measurement of a size of a subject
US11733032B2 (en) 2018-09-28 2023-08-22 Panasonic Intellectual Property Management Co., Ltd. Measurement device and measurement method
JP2020112434A (ja) * 2019-01-11 2020-07-27 株式会社神戸製鋼所 測距装置および測距方法
JP7173872B2 (ja) 2019-01-11 2022-11-16 株式会社神戸製鋼所 測距装置および測距方法
JP2020134427A (ja) * 2019-02-25 2020-08-31 株式会社Nttドコモ 情報処理装置
JP7098554B2 (ja) 2019-02-25 2022-07-11 株式会社Nttドコモ 情報処理装置

Also Published As

Publication number Publication date
US9607406B2 (en) 2017-03-28
JP6132275B2 (ja) 2017-05-24
GB2519006B (en) 2018-05-16
DE112013003338B4 (de) 2017-09-07
DE112013003338T5 (de) 2015-03-19
GB201423377D0 (en) 2015-02-11
GB2519006A (en) 2015-04-08
JPWO2014006832A1 (ja) 2016-06-02
US20150187091A1 (en) 2015-07-02

Similar Documents

Publication Publication Date Title
JP6132275B2 (ja) サイズ測定装置及びサイズ測定方法
US10825198B2 (en) 3 dimensional coordinates calculating apparatus, 3 dimensional coordinates calculating method, 3 dimensional distance measuring apparatus and 3 dimensional distance measuring method using images
US9529945B2 (en) Robot simulation system which simulates takeout process of workpieces
US10096131B2 (en) Dimensional acquisition of packages
US8564655B2 (en) Three-dimensional measurement method and three-dimensional measurement apparatus
US20180253857A1 (en) Dimensional acquisition of packages
JP6223169B2 (ja) 情報処理装置、情報処理方法およびプログラム
JP2012058076A (ja) 3次元計測装置及び3次元計測方法
JP2010008352A (ja) 寸法測定方法及び寸法測定装置
KR20160003776A (ko) 자세 추정 방법 및 로봇
JP2013040848A (ja) 三次元計測装置、三次元計測方法およびプログラム
CN114087990A (zh) 体积尺寸标注器中的自动模式切换
JP7145432B2 (ja) 投影システム、画像処理装置および投影方法
JPWO2008053649A1 (ja) 広角画像取得方法及び広角ステレオカメラ装置
JP2013253799A (ja) サイズ測定装置
JP2014174088A (ja) 検査用具、ステレオカメラ検査装置及び検査方法
US11222433B2 (en) 3 dimensional coordinates calculating apparatus and 3 dimensional coordinates calculating method using photo images
JP4679293B2 (ja) 車載パノラマカメラシステム
JP3690581B2 (ja) 位置検出装置及びその方法、平面姿勢検出装置及びその方法
CN102881040A (zh) 一种数码相机移动拍摄三维重建方法
JP2013024773A (ja) 3次元計測方法
JP2017098859A (ja) 画像のキャリブレーション装置及びキャリブレーション方法
US20120056999A1 (en) Image measuring device and image measuring method
JP6545033B2 (ja) 三次元温度分布表示装置
US20130241882A1 (en) Optical touch system and optical touch position detecting method

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

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2014523572

Country of ref document: JP

Kind code of ref document: A

ENP Entry into the national phase

Ref document number: 1423377

Country of ref document: GB

Kind code of ref document: A

Free format text: PCT FILING DATE = 20130619

WWE Wipo information: entry into national phase

Ref document number: 1423377.9

Country of ref document: GB

WWE Wipo information: entry into national phase

Ref document number: 1120130033380

Country of ref document: DE

Ref document number: 112013003338

Country of ref document: DE

122 Ep: pct application non-entry in european phase

Ref document number: 13813658

Country of ref document: EP

Kind code of ref document: A1