Code reading device and code reading method
The code reading device accurately detects workpieces by integrating imaging and distance sensors with detection logic, addressing the issue of missed detections in thin workpieces.
Patent Information
- Application Number
- JP2023019187
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-02-10
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2043-02-10
AI Technical Summary
Existing code reading devices struggle to accurately detect thin workpieces like paper media due to similar distance measurements with the reference surface, leading to missed detections.
A code reading device equipped with an imaging unit, decoder, distance sensor, and control unit that utilizes both distance and light amount information to accurately detect the presence of a workpiece by applying detection logic based on predetermined rules.
Enables precise detection of workpieces, including thin ones, by combining distance and light measurement data to enhance detection accuracy.
Smart Images

Figure 2024113913000001_ABST
Abstract
Description
[Technical field]
[0001] The present invention relates to a technology for reading codes by irradiating light towards a workpiece having a code to be read, receiving the light reflected by the workpiece, and generating a code image, and in particular to a technology for detecting the presence or absence of a workpiece. [Background technology]
[0002] Patent Document 1 proposes a technology for reading a workpiece with a code to be read by holding the workpiece over a code reader fixed to a stand. When reading a code with a stationary code reader that is used in such a state that the workpiece is fixed to a stand or installed at an installation location, a method is conceivable in which detection of the workpiece by a distance sensor is used as a trigger to start reading the code attached to the workpiece, as in Patent Document 2. Specifically, the distance from the distance sensor to a predetermined reference surface (e.g., the surface of a desk) is stored as a reference value, and the workpiece can be detected based on the amount of change in the distance measured by the distance sensor from the reference value. [Prior art documents] [Patent documents]
[0003] [Patent Document 1] US8550357 [Patent Document 2] US6637893 Summary of the Invention [Problem to be solved by the invention]
[0004] However, when a thin workpiece such as a paper medium is held near the reference surface, the distance between the distance sensor and the workpiece is almost the same as the reference value, so the workpiece may not be detected.
[0005] The present invention has been made in consideration of the above-mentioned problems, and has an object to make it possible to accurately detect the presence of a workpiece using a distance sensor. [Means for solving the problem]
[0006] The code reading device of the present invention comprises an imaging unit that receives light reflected by a workpiece having a code to be read and generates a code image; a decode execution unit that executes decoding of the code image generated by the imaging unit; a distance sensor that emits light into the field of view of the imaging unit, receives the light reflected by the workpiece, and measures the distance to the workpiece and the amount of light reflected from the workpiece based on the received light; a detection unit that detects the presence or absence of a workpiece within the field of view based on the result of measurement performed by the distance sensor; and a control unit that drives the imaging unit based on the result detected by the detection unit, and the detection unit acquires distance information regarding the distance measured by the distance sensor and light amount information regarding the amount of light measured by the distance sensor, and detects the presence or absence of a workpiece within the field of view based on a predetermined rule using both the distance information and the light amount information.
[0007] The code reading method of the present invention includes the steps of receiving light reflected from a workpiece having a code to be read, emitting light into the field of view of an imaging unit which generates a code image, receiving the light reflected from the workpiece, and measuring the distance to the workpiece and the amount of light reflected from the workpiece based on the received light using a distance sensor, detecting the presence or absence of a workpiece within the field of view based on the result of the measurement performed by the distance sensor using a detection unit, and driving the imaging unit using a control unit based on the result detected by the detection unit, wherein the detection unit acquires distance information regarding the distance measured by the distance sensor and light amount information regarding the amount of light measured by the distance sensor, and detects the presence or absence of a workpiece within the field of view based on a predetermined rule using both the distance information and the light amount information. Effect of the Invention
[0008] In the present invention configured as above, it is possible to accurately detect the presence of a workpiece using the distance sensor. [Brief description of the drawings]
[0009] [Figure 1] FIG. 2 is a side view showing a schematic configuration of the code reading device. [Diagram 2] FIG. 2 is a block diagram showing an outline of an electrical configuration of the code reading device shown in FIG. [Diagram 3] 4 is a front view showing a schematic diagram of a diffusion member provided in the head portion and an illumination board provided behind the diffusion member; FIG. [Figure 4A] FIG. 2 is a side view showing an example of a specific external configuration of the code reading device. [Figure 4B] FIG. 2 is a perspective view showing an example of a specific external configuration of a code reading device. [Diagram 5] FIG. [Figure 6] FIG. 4 is a perspective view showing an attachment portion of the finger bar provided on the head portion. [Figure 7] FIG. 4 is a perspective view showing an attachment portion of the finger bar provided at the grip end portion. [Figure 8] 5 is a flowchart showing an example of a detection mode for detecting a workpiece held over the code reading device. [Figure 9] 9 is a flow chart illustrating an example of detection logic executed in FIG. 8. [Figure 10A] FIG. 13 is a diagram showing a variation in holding direction. [Figure 10B] FIG. 13 is a diagram showing a variation in holding direction. [Figure 10C] 11A and 11B are diagrams showing a schematic diagram of a difference in time change in output of a distance sensor according to a difference in holding direction. [Figure 11] 10 is a flowchart showing a second modified example of the detection logic. [Figure 12A] 10 is a flowchart showing an example of a detection mode. [Figure 12B] 11 is a flowchart showing an example of an external trigger mode. [Figure 13A] 10B is a diagram showing a schematic example of a state in which a workpiece is held over the code reading device of FIG. 10A; [Figure 13B]10B is a diagram showing a schematic example of a state in which a workpiece is held over the code reading device of FIG. 10A; DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0010] Fig. 1 is a side view showing a schematic configuration of a code reading device, and Fig. 2 is a block diagram showing an outline of the electrical configuration of the code reading device in Fig. 1. Here, a front-rear direction Dfs is appropriately shown in which the side of the workpiece W relative to the code reading device 1 is designated as the front side Sf and the opposite side of the workpiece W relative to the code reading device 1 is designated as the rear side Sb in a state in which the code reading device 1 faces the surface Wf of the workpiece W to read the code attached to the surface Wf of the workpiece W with the code reading device 1.
[0011] As shown in FIG. 1, the code reading device 1 includes a head portion 11, a grip portion 12, and a grip end portion 13. The grip portion 12 extends in an axial direction Da intersecting the front-rear direction Dfs between the head portion 11 and the grip end portion 13. In other words, the head portion 11 is provided at one end of the grip portion 12, and the grip end portion 13 is provided at the other end (the end opposite to the one end) of the grip portion 12. The head portion 11 has a head body 111, the grip portion 12 has a grip body 121, and the grip end portion 13 has a grip end body 131, and the head body 111, the grip body 121, and the grip end body 131 form a housing 14 that houses each part built into the code reading device 1. A user can carry the code reading device 1 by holding the grip body 121 of the code reading device 1.
[0012] The head body 111 of the head unit 11 has an opening 112 that opens on the front side Sf, and a placement panel 113 is provided at the end of the rear side Sb (in other words, the back side) of the opening 112. When reading a code, the opening 112 faces the surface Wf of the workpiece W, and the placement panel 113 faces the surface Wf of the workpiece W via the opening 112. The head unit 11 also has an illumination unit 2, an imaging unit 3, a distance measurement unit 4, and a display SP shown in FIG. 2. The illumination unit 2, the imaging unit 3, the distance measurement unit 4, and the display SP are stored in the head unit 11. In particular, a part of the illumination unit 2, the imaging unit 3, and the distance measurement unit 4 are provided on the placement panel 113.
[0013] The illumination unit 2 irradiates the surface Wf of the workpiece W with illumination light Li, and the imaging unit 3 captures the reflected light Lr from the surface Wf of the workpiece W with the camera 31A or 31B to generate a code image Ic. The illumination light Li is irradiated from the illumination unit 2 to the surface Wf of the workpiece W through an opening 112, and the reflected light Lr is generated by reflecting the illumination light Li on the surface Wf of the workpiece W, and the reflected light Lr is incident on the camera 31A or 31B of the imaging unit 3 from the surface Wf of the workpiece W through the opening 112.
[0014] The illumination unit 2 has a diffuse illumination unit 27, a direct illumination unit 28, and a polarized illumination unit 29. The diffuse illumination unit 27 has a light source E, and diffuses the light emitted from the light source E before irradiating it onto the surface Wf of the workpiece W. The direct illumination unit 28 has a light source 281, and directly irradiates the light emitted from the light source 281 onto the surface Wf of the workpiece W without diffusing it. The polarized illumination unit 29 has a light source 291, and polarizes the light emitted from the light source 291 before irradiating it onto the surface Wf of the workpiece W. Details of the illumination unit 2 will be described later.
[0015] The imaging unit 3 has two cameras 31A and 31B. Each of the cameras 31A and 31B has a field of view, and captures an image of the field of view by collecting light incident on a collecting lens, which is an objective lens, on a solid-state imaging element by the collecting lens. That is, each of the cameras 31A and 31B collects reflected light Lr on the solid-state imaging element by a collecting lens facing the surface Wf of the workpiece W present in the field of view. The solid-state imaging element generates a code image Ic by receiving the reflected light Lr collected by the collecting lens. The optical axis Ac of each of the cameras 31A and 31B (i.e., the optical axis Ac of the collecting lens of each of the cameras 31A and 31B) is parallel to the above-mentioned front-rear direction Dfs.
[0016] The distance measurement unit 4 measures the distance to the surface Wf of the workpiece W by measuring the time it takes for light irradiated from the distance measurement unit 4 through the opening 112 to be reflected by the surface Wf of the workpiece W and return to the distance measurement unit 4 through the opening 112.
[0017] The grip portion 12 has a trigger switch 122 provided on the front side Sf of the grip body 121. A user can operate the trigger switch 122 with a finger while holding the grip body 121 in his / her hand.
[0018] The code reading device 1 also includes a controller 6 that controls each part of the code reading device 1, and a storage unit 7 that stores data used in the code reading device 1 and data generated by the code reading device 1. The controller 6 and storage unit 7 are housed in a housing 14. The controller 6 is a processor, i.e., a CPU (Central Processing Unit). The storage unit 7 is implemented by using an SSD (Solid State Drive). and memory devices such as a floppy disk drive (HDD).
[0019] The controller 6 causes the lighting unit 2 to perform an illumination operation of irradiating the surface Wf of the workpiece W with illumination light Li, and causes the imaging unit 3 to perform an imaging operation of receiving the reflected light Lr with a solid-state imaging element to generate a code image Ic. Furthermore, the controller 6 acquires the code image Ic generated by the imaging unit 3 and decodes the code image Ic. In this way, code reading is performed by a series of operations including the illumination operation by the lighting unit 2, the imaging operation by the imaging unit 3, and the decoding by the controller 6. For example, when the controller 6 detects an operation of the trigger switch 122 by the user, it performs code reading. The result of the code reading, i.e., the decoded result Rd, which is the result of the controller 6 decoding the code image Ic, is stored in the memory unit 7.
[0020] Next, the configuration of the head unit 11, particularly the configuration of the illumination unit 2 provided in the head unit 11, will be described in detail. FIG. 3 is a front view showing a diffusion member provided in the head unit and an illumination board provided behind the diffusion member. FIG. 3 shows a length direction Dl and a width direction Dw. Here, the length direction Dl and the width direction Dw are perpendicular to each other and perpendicular to the front-rear direction Dfs. Also shown are one side Dl1 of the length direction Dl (the side from the grip end portion 13 toward the head unit 11) and the other side Dl2 of the length direction Dl (the opposite side of the one side Dl1), and one side Dw1 of the width direction Dw and the other side Dw2 of the width direction Dw (the opposite side of the one side Dw1).
[0021] The illumination unit 2 has a diffusion member 21 and an illumination board 25 arranged on the rear side Sb of the diffusion member 21 in the front-rear direction Dfs. The diffusion member 21 constitutes a part of the head main body 111 described above. Note that in Fig. 3, the illumination board 25 hidden by the diffusion member 21 in front view from the front side Sf in the front-rear direction Dfs is indicated by a dashed line.
[0022] The diffusion member 21 has an aperture defining portion 211 which is a wall surface surrounding the above-mentioned aperture 112 opened on the front side Sf. The aperture defining portion 211 has a top diffusion plate 212 provided on one side Dl1 of the aperture 112 in the length direction Dl, and a bottom plate 213 provided on the other side Dl2 of the aperture 112. Furthermore, the aperture defining portion 211 has a right diffusion plate 214 provided on one side Dl1 of the aperture 112, and a left diffusion plate 215 provided on the other side Dl2 of the aperture 112 in the width direction Dw. Ends on both sides of the top diffusion plate 212 in the width direction Dw are bent toward the other side Dl2 toward the right diffusion plate 214 and the left diffusion plate 215. In the longitudinal direction Dl, the end of the other side Dl2 of the right diffusion plate 214 is bent toward the other side Dw2 toward the bottom plate 213, and the end of the other side Dl2 of the left diffusion plate 215 is bent toward the one side Dw1 toward the bottom plate 213.
[0023] The top diffusion plate 212, the right diffusion plate 214, and the left diffusion plate 215 diffuse the light passing through them from the rear side Sb to the front side Sf, and emit the light to the front side Sf. Specifically, the back surface (light incident surface) of the rear side Sb of each of the top diffusion plate 212, the right diffusion plate 214, and the left diffusion plate 215 is textured, and the light is diffused by the textured back surface. However, the configuration for imparting the light diffusion function to the top diffusion plate 212, the right diffusion plate 214, and the left diffusion plate 215 is not limited to the textured surface, and the light diffusion function may be imparted by, for example, processing the top diffusion plate 212, the right diffusion plate 214, and the left diffusion plate 215 to a milky white color.
[0024] Each of the plates 212, 213, 214, and 215 defining the opening 112 has a tapered shape inclined with respect to the front-rear direction Dfs so that the area of the opening 112 in a cross section perpendicular to the optical axis Ac of the condenser lens 311A (FIG. 1) of the camera 31A becomes wider toward the front side Sf in the front-rear direction Dfs. In other words, each of the plates 212, 213, 214, and 215 has a tapered shape inclined with respect to the front-rear direction Dfs so as to move away from the optical axis Ac toward the front side Sf in the front-rear direction Dfs (optical axis direction).
[0025] The illumination board 25 is disposed on the rear side Sb of the plates 212, 213, 214, and 215 having such a tapered shape. The illumination board 25 has a board 251 and a plurality of light sources E arranged on the surface of the front side Sf of the board 251. The light sources E are, for example, LEDs (Light Emitting Diodes), and emit light to the front side Sf toward the top diffusion plate 212, the right diffusion plate 214, or the left diffusion plate 215. The light emitted from the light sources E and incident on the top diffusion plate 212, the right diffusion plate 214, or the left diffusion plate 215 from the rear side Sb is diffused as it passes through the diffusion plate 212, 214, or 215, and is emitted from the diffusion plate 212, 214, or 215 to the front side Sf.
[0026] That is, the light emitted from the light source E of the illumination board 25 passes through the diffusion member 21 at the diffusion plates 212, 214, and 215. At this time, the light from the light source E is diffused by the diffusion member 21 as it passes through the diffusion member 21. The diffused light thus generated by diffusing the light with the diffusion member 21 is irradiated onto the surface Wf of the workpiece W as uniform planar illumination light Li.
[0027] In this way, the above-mentioned diffuse illumination unit 27 (FIG. 2) is configured by the diffusion member 21 and the illumination board 25. Furthermore, as described above, the illumination unit 2 has a direct illumination unit 28 that directly irradiates light from the light source 281 toward the surface Wf of the workpiece W without diffusing it, and a polarized illumination unit 29 that irradiates light (P waves or S waves) obtained by polarizing the light from the light source 291 toward the surface Wf of the workpiece W. As shown in FIG. 3, the direct illumination unit 28 and the polarized illumination unit 29 are arranged on the arrangement panel 113.
[0028] Therefore, the controller 6 can selectively execute "diffuse lighting" in which the light source E of the diffuse lighting unit 27 is turned on to irradiate the workpiece W with diffused light, "direct lighting" in which the light source 281 of the direct lighting unit 28 is turned on to irradiate the workpiece W with light from the light source 281 without diffusing it, and "polarized lighting" in which the light source 291 of the polarized lighting unit 29 is turned on to irradiate the workpiece W with polarized light.
[0029] As described above, the imaging unit 3 has two cameras 31A and 31B, which are provided on the arrangement panel 113. Specifically, as shown in Fig. 3, the condenser lenses 311A and 311B (objective lenses) of the cameras 31A and 31B, respectively, are fitted into the arrangement panel 113. The camera 31A condenses the reflected light Lr from the surface Wf of the workpiece W onto a solid-state imaging element by the condenser lens 311A, and causes the solid-state imaging element to generate a code image Ic. Similarly, the camera 31B condenses the reflected light Lr from the surface Wf of the workpiece W onto a solid-state imaging element by the condenser lens 311B, and causes the solid-state imaging element to generate a code image Ic.
[0030] Condenser lens 311A of camera 31A and condenser lens 311B of camera 31B have different focal lengths, and for example, the focal length of condenser lens 311A is shorter than the focal length of condenser lens 311B. In other words, camera 31A is a close-range camera that captures images at closer distances than camera 31B, and conversely, camera 31B is a long-range camera that captures images at farther distances than camera 31A.
[0031] The arrangement panel 113 is also provided with a distance measurement unit 4. The distance measurement unit 4 has a distance sensor 41, which is a TOF (Time of Fight) camera. The distance sensor 41 has a light emitting unit 42 that emits light toward the field of view of the cameras 31A and 31B, and a light receiving unit 43 that receives light returned from the field of view of the cameras 31A and 31B. Based on the time from when the light emitting unit 42 emits light to when the light receiving unit 43 receives the light, the distance measurement unit 4 measures the distance to an object (including a workpiece W) present in the field of view of the cameras 31A and 31B. The distance measurement unit 4 may be configured to detect a workpiece present in the entire field of view, or may be configured to detect only a workpiece present in a partial area of the field of view. In other words, the detection area of the distance measurement unit 4 may be configured to overlap with the entire field of view, or may be configured to overlap with only a partial area of the field of view.
[0032] 4A and 4B are a side view and a perspective view showing an example of a specific external configuration of the code reading device. As described above, the grip body 121 of the grip section 12 extends in the axial direction Da between the head body 111 of the head section 11 and the grip end body 131 of the grip end section 13. The grip body 121 inclines in the front-rear direction Dfs so as to move toward the rear side Sb as it moves away from the head body 111. In other words, the grip body 121 inclines toward the rear side Sb with respect to the head body 111. This grip body 121 extends from the end of the rear side Sb of the head body 111, and the head body 111 protrudes from the grip body 121 to the front side Sf (in other words, toward the trigger switch 122 side).
[0033] The grip end body 131 of the grip end portion 13 protrudes from the grip body 121 of the grip portion 12 toward the trigger switch 122. The trigger switch 122 arranged on the front side Sf of the grip body 121 is provided at the end of the grip body 121 on the head body 111 side.
[0034] The grip end body 131 has a bottom surface 132 and a front surface 133. The bottom surface 132 is provided at an end of the grip end body 131 on the opposite side to the grip body 121 in the axial direction Da, and the front surface 133 extends from an end of the front side Sf of the bottom surface 132 to the trigger switch 122 side (in other words, the grip body 121 side) in the axial direction Da. The bottom surface 132 is provided so as to intersect with the axial direction Da, and an end of the bottom surface 132 on the front surface 133 side is chamfered so as to bend toward the front surface 133. The front surface 133 is provided so that an end of the front surface 133 on the trigger switch 122 side is located forward Sf of the end of the front surface 133 on the opposite side to the trigger switch 122.
[0035] Furthermore, as shown in Fig. 4B, the code reader 1 includes a finger bar 15 that is detachably attached to the housing 14. Next, the configuration of the finger bar 15 and the configuration for attaching the finger bar 15 to the housing 14 will be described with reference to Figs. 5, 6, and 7. Here, Fig. 5 is a perspective view showing the configuration of the finger bar, Fig. 6 is a perspective view showing the attachment portion of the finger bar provided in the head portion, and Fig. 7 is a perspective view showing the attachment portion of the finger bar provided in the grip end portion.
[0036] The finger bar 15 has a stay plate 16 extending from the grip end portion 13 to the head portion 11 on the front side Sf of the grip portion 12. This stay plate 16 is provided at a distance from the grip portion 12 in the front-rear direction Dfs. One end 161 of the stay plate 16 is supported by the head portion 11, and the other end 162 of the stay plate 16 (opposite to the one end) is supported by the grip end portion 13. Specifically, the end 161 of the stay plate 16 is detachably attached to an attachment portion 114 provided at an end of the front side Sf of the head main body 111, and the end 162 of the stay plate 16 is detachably attached to an attachment portion 134 provided at an end of the front side Sf of the grip end main body 131.
[0037] As shown in FIG. 4B, the slide claw 17 is built into the end of the stay plate 16 on the end 161 side. Meanwhile, the stay plate 16 is provided with an opening 163 that opens on the front side Sf, and the slide claw 17 is exposed to the front side Sf through the opening 163. Therefore, the user can operate the slide claw 17 through the opening 163. The slide claw 17 is slidable relative to the stay plate 16 between a protruding position where it protrudes from the end 161 of the stay plate 16 and a stored position where it fits inside the stay plate 16 from the end 161 of the stay plate 16. Meanwhile, as shown in FIG. 6, the mounting part 114 of the head body 111 has a pair of engagement holes 115. The pair of engagement holes 115 are open on the surface of the head body 111 on the grip end body 131 side. The slide claw 17 that faces the pair of engagement holes 115 from the grip end body 131 side engages with the pair of engagement holes 115 by being positioned at the protruding position, and disengages from the pair of engagement holes 115 by being positioned at the stored position.
[0038] As shown in Fig. 5, an end 162 of the stay plate 16 is provided with a pair of engagement protrusions 164. In contrast, as shown in Fig. 7, the mounting portion 134 of the grip end body 131 has a pair of engagement holes 135. The pair of engagement holes 135 are open on the surface of the grip end body 131 facing the head body 111. The pair of engagement protrusions 164 of the stay plate 16 can be engaged with and disengaged from the pair of engagement holes 135 of the grip end body 131 from the head body 111 side.
[0039] The finger bar 15 also has a support plate 18 extending from a middle portion 165 between ends 161 and 162 of the stay plate 16 to the rear side Sb (in other words, toward the grip body 121). As shown in Fig. 5, an engagement hole 182 is provided at an end 181 of the rear side Sb of the support plate 18. A support portion 123 is provided at the front side Sf of the grip body 121, and the engagement hole 182 of the support plate 18 can be engaged with and disengaged from the front side Sf of the support portion 123 of the grip body 121. This support portion 123 is provided on the grip end body 131 side of the trigger switch 122.
[0040] Therefore, the user A pair of engagement projections 164 on the end 162 of the stay plate 16 are engaged with a pair of engagement holes 135 of the grip end body 131, While the slide claws 17 are positioned at the storage position, the ends 161 of the stay plate 16 are opposed to the pair of engagement holes 115 of the head body 111, and the engagement holes 182 of the support plate 18 are fitted into the support portions 123. Slide the slide claw 17 from the retracted position to the extended position. By carrying out the above steps, the finger bar 15 can be attached to the housing 14 of the code reading device 1.
[0041] As described above, the stay plate 16 is provided at a distance from the grip body 121 to the front side Sf, and spaces S1 and S2 are provided between the stay plate 16 and the grip body 121. Here, the space S1 is provided closer to the head body 111 than the support plate 18, and the space S2 is provided closer to the grip end body 131 than the support plate 18. Therefore, a user can hold the grip part 12 with his / her hand by inserting, for example, his / her index finger into the space S1 and his / her middle finger, ring finger, and little finger into the space S2. In addition, the trigger switch 122 faces the space S1 from the grip body 121 side, and the user can operate the trigger switch 122 with his / her index finger inserted into the space S1. This finger bar 15 allows the user to carry things other than the code reader 1 while carrying the code reader 1 in his / her hand, improving the gripping performance of the code reader 1.
[0042] Furthermore, the finger bar 15 has a plurality of mounting holes 166 penetrating the stay plate 16. Therefore, as shown in Figures 10A and 10B, the finger bar 15 can be fastened to a support base provided separately from the code reading device 1 by screwing a screw inserted into the mounting hole 166 into the support base. In other words, a user can use the code reading device 1 in a state in which the code reading device 1 is fixed to the support base. Also, since the plurality of mounting holes 166 are provided on surfaces of the stay plate 16 having different inclinations, the same support base can be fixed at different angles as shown in Figures 10A and 10B.
[0043] Incidentally, when the code reading device 1 is used while fixed to a support stand, a user can perform an operation (tap reading) in which a work W (such as a piece of paper) bearing a code to be read is held over the code reading device 1 to have the code reading device 1 read the code. At this time, the controller 6 of the code reading device 1 detects that the work W has been held over the code reading device 1, and executes the following control to read the code bearing the work W.
[0044] 8 is a flowchart showing an example of a detection mode for detecting a workpiece held over a code reader. This flowchart is executed under the control of the controller 6. In step S101, the controller 6 determines whether a predetermined sampling period (e.g., 15 ms) has elapsed since the previous data measurement by the distance sensor 41. Then, when the sampling period has elapsed ("YES" in step S101), the controller 6 causes the distance sensor 41 to measure the distance and the amount of light, and obtains the results (step S102).
[0045] Specifically, in step S102, the distance sensor 41 irradiates light from the light emitting unit 42 to the field of view (camera field of view) of the cameras 31A and 31B, and checks whether the light receiving unit 43 receives the light. If the light receiving unit 43 receives the light within a predetermined timeout period, the distance sensor 41 outputs to the controller 6 a distance corresponding to the time from the light emitting unit 42 irradiating the light to the light receiving unit 43 receiving the light as a distance measurement result, and outputs to the controller 6 the amount of light (amount of photons) received by the light receiving unit 43 as a light amount measurement result. On the other hand, if the light receiving unit 43 does not receive the light even after the predetermined timeout period has elapsed, the distance sensor 41 outputs a measurement failure indicating that the distance measurement has failed as a distance measurement result to the controller 6, and outputs zero as a light amount measurement result to the controller 6. In this way, the controller 6 acquires the distance measurement result and the light amount measurement result from the distance sensor 41 at each sampling period (step S102).
[0046] Furthermore, the controller 6 stores the distance measurement results and light quantity measurement results acquired at each sampling period in the storage unit 7 in association with the time at which they were acquired (step S103). That is, the distance measurement results and light quantity measurement results measured in the past are accumulated in the storage unit 7 together with the measurement times.
[0047] In step S104, the controller 6 executes a detection logic, which will be described later with reference to FIG. 9. This detection logic detects the workpiece W in the field of view based on the measurement result in step S102. In step S105, it is determined whether or not the detection of the workpiece W in step S104 is successful. If the detection of the workpiece W is successful (if "YES" in step S105), the controller 6 executes code reading (step S106). That is, as described above, a series of operations (code reading) such as the illumination operation by the illumination unit 2, the imaging operation by the imaging unit 3, and the decoding by the controller 6 are executed. On the other hand, if the detection of the workpiece W fails (if "NO" in step S105), the process returns to step S101. Also, after the execution of the code reading in step S106, if a notification of the end of the detection mode is received, the process ends, and if not, the process returns to the initial step S101.
[0048] Fig. 9 is a flowchart showing an example of the detection logic executed in Fig. 8. This flowchart is executed under the control of the controller 6. Step S201 is executed every time step S102 is executed. In this step S201, the controller 6 determines whether or not the distance measurement result (current measured distance Dc) measured by the distance sensor 41 in the most recently executed step S102 indicates a measurement failure. If the current measured distance Dc indicates a measurement failure ("YES" in step S201), the controller 6 determines that detection of the workpiece W has failed (step S208).
[0049] On the other hand, if the currently measured distance Dc indicates a successful measurement, in other words, a finite distance ("NO" in step S201), the controller 6 reads out from the memory unit 7 a distance measurement result (previously measured distance Dp) measured a predetermined period before the measurement time of the currently measured distance Dc, and judges whether the previously measured distance Dp indicates a measurement failure. This predetermined period is a period longer than the sampling period, such as 300 to 500 ms. If the previously measured distance Dp indicates a measurement failure ("YES" in step S202), the controller 6 judges that the detection of the workpiece W was successful (step S207). In other words, since the measurement of the distance to the workpiece W failed in the past, while the measurement of the distance to the workpiece W has succeeded in the present, it can be judged that the workpiece W has been held in the field of view of the camera between the past and the present.
[0050] If the previously measured distance Dp indicates successful measurement ("NO" in step S202), the controller 6 executes step S203. In step S203, the controller 6 acquires the light amount measurement result (currently measured light amount Pc) measured by the distance sensor 41 in the most recently executed step S102, and reads out the light amount measurement result (previously measured light amount Pp) measured a predetermined period before the measurement time of the currently measured light amount Pc from the storage unit 7. Then, the controller 6 determines whether or not a first light amount condition is satisfied, that is, the currently measured light amount Pc is equal to or greater than the light amount threshold Pth and the previously measured light amount Pp is equal to or greater than the light amount threshold Pth (step S203).
[0051] If the first light quantity condition in step S203 is satisfied (if "YES" in step S203), the controller 6 judges whether or not a distance fluctuation condition is satisfied, that is, the distance fluctuation amount obtained by subtracting the currently measured distance Dc from the previously measured distance Dp is equal to or greater than the distance fluctuation threshold Dfth (step S204). If the distance fluctuation condition is satisfied (if "YES" in step S204), the controller 6 judges that the detection of the workpiece W has been successful (step S207). In other words, since the first light quantity condition in step S203 is satisfied, it can be judged that both the previously measured light quantity Pp and the currently measured light quantity Pc are sufficient light quantities. Therefore, it can be judged that both the previously measured distance Dp measured simultaneously with the previously measured light quantity Pp and the currently measured distance Dc measured simultaneously with the currently measured light quantity Pc are highly reliable. Therefore, if the value obtained by subtracting the current measured distance Dc from the past measured distance Dp is large, in other words, if it can be determined that an object in the camera's field of view has approached the code reading device 1 (if "YES" in step S204), it can be determined that the workpiece W has been held in the camera's field of view between the past and the present.
[0052] If the distance change condition of step S204 is not satisfied (if "NO" in step S204), the controller 6 judges whether or not a light amount change condition is satisfied, that is, the absolute value of the difference between the past measured light amount Pp and the current measured light amount Pc is equal to or greater than the light amount change threshold Pfth (step S206). If the light amount change condition is satisfied (if "YES" in step S206), the controller 6 judges that the detection of the workpiece W has been successful (step S207). In other words, since the first light amount condition of step S203 is satisfied, it can be judged that both the past measured light amount Pp and the current measured light amount Pc are sufficient light amounts. Therefore, it can be judged that both the past measured light amount Pp and the current measured light amount Pc are highly reliable. Therefore, if the amount of change between the past measured light amount Pp and the current measured light amount Pc is large (if "YES" in step S206), it can be judged that the workpiece W has been held in the camera field of view between the past and the present. On the other hand, if the light amount variation condition is not satisfied ("NO" in step S206), the controller 6 determines that the detection of the workpiece W has failed (step S208).
[0053] If the first light intensity condition in step S203 is not satisfied (if "NO" in step S203), the controller 6 determines whether or not a second light intensity condition is satisfied, such that the currently measured light intensity Pc is less than the light intensity threshold Pth and the previously measured light intensity Pp is less than the light intensity threshold Pth (step S205). If the second light intensity condition is satisfied (if "YES" in step S205), the controller 6 determines that the detection of the workpiece W has failed (step S208).
[0054] On the other hand, if the second light quantity condition is not satisfied (if "NO" in step S205), step S206 is executed in the same manner as described above. That is, if the second light quantity condition is not satisfied, one of the current measured light quantity Pc and the past measured light quantity Pp is equal to or greater than the light quantity threshold Pth, and the other is less than the light quantity threshold Pth. Therefore, there is a possibility that the measured light quantity has greatly changed because a workpiece W was held in the camera field of view between the present and the past. Specifically, when a workpiece W that reflects light is held in the camera field of view, the current measured light quantity Pc is equal to or greater than the light quantity threshold Pth, whereas when a workpiece W that absorbs light is held in the camera field of view, the current measured light quantity Pc is less than the light quantity threshold Pth. Therefore, after executing step S206, it is finally determined whether the workpiece W has been detected successfully (step S207) or not (step S208).
[0055] In the embodiment described above, not only the current measured distance Dc and the past measured distance Dp (distance information) indicating the distance measured by the distance sensor 41, but also the current measured light amount Pc and the past measured light amount Pp (light amount information) indicating the light amount measured by the distance sensor 41 are acquired by the controller 6 (detection unit) from the distance sensor 41. Then, the controller 6 acquires the measured distances Dc and Dp related to the distance measured by the distance sensor 41 and the measured light amounts Pc and Pp related to the light amounts measured by the distance sensor 41, and detects the presence or absence of the workpiece W within the field of view based on the detection logic (predetermined rule) of FIG. 9 using both the measured distances Dc and Dp and the measured light amounts Pc and Pp. As a result, it becomes possible to accurately detect the presence of the workpiece W using the distance sensor 41.
[0056] The detection logic also includes a detection criterion related to distance (step S204) and a detection criterion related to light quantity (step S206). Even if the measured distances Dc and Dp do not satisfy the detection criterion related to distance (step S204: NO), the controller 6 detects that the workpiece W is present within the field of view if the measured light quantities Pc and Pp satisfy the detection criterion related to light quantity (step S206: YES) (step S207). In this configuration, even if the detection criterion related to distance (step S204) is not satisfied when the workpiece W enters the field of view of the cameras 31A and 31B, the presence of the workpiece W can be detected as long as the detection criterion related to light quantity (step S206) is satisfied.
[0057] The detection logic also includes a determination as to whether the measured light amounts Pc, Pp are equal to or greater than the light amount threshold Pth (step S203). If the measured light amounts Pc, Pp are equal to or greater than the light amount threshold Pth ("YES" in step S203), the controller 6 determines whether the measured distances Dc, Dp satisfy the detection criteria for distance (step S204). On the other hand, if at least one of the measured light amounts Pc, Pp is less than the light amount threshold Pth ("NO" in step S203), the controller 6 determines whether the measured light amounts Pc, Pp satisfy the detection criteria for light amount (step S206), and detects the presence or absence of a workpiece within the field of view based on the result of determining whether the measured light amounts Pc, Pp satisfy the detection criteria for light amount (step S206), regardless of whether the measured distances Dc, Dp satisfy the detection criteria for distance (step S204). In this configuration, when the measured light amounts Pc, Pp are equal to or greater than the light amount threshold Pth, the reliability of the measured distances Dc, Dp is high, and the workpiece W can be accurately detected based on the measured distances Dc, Dp. When the measured light amounts Pc, Pp are less than the light amount threshold Pth, the reliability of the measured distances Dc, Dp is low, and the workpiece W is detected based on the measured light amounts Pc, Pp rather than the measured distances Dc, Dp. In this case, even if one of the measured light amounts Pc, Pp is small, the workpiece W can be accurately detected based on the large change between the measured light amounts Pc, Pp.
[0058] The detection logic also includes a determination as to whether the measured light amounts Pc and Pp are equal to or greater than the light amount threshold Pth (step S203). If the measured light amounts Pc and Pp are equal to or greater than the light amount threshold Pth and the measured distances Dc and Dp are determined not to satisfy the distance-related detection criteria (step S204) ("NO" in step S204), the controller 6 determines whether the measured light amounts Pc and Pp satisfy the light amount-related detection criteria (step S206). Then, the controller 6 detects the presence or absence of the workpiece W in the field of view based on the determination result (result of step S206) of whether the light amount-related detection criteria are satisfied. In this configuration, even if a thin workpiece comes near the surface (reference surface) of the desk on which the support table is placed, the workpiece W can be accurately detected based on the change between the measured light amounts Pc and Pp.
[0059] The previously measured distance Dp is also stored in the memory unit 7. If the value obtained by subtracting the currently measured distance Dc most recently acquired by the distance sensor 41 from the previously measured distance Dp previously acquired by the distance sensor 41 and stored in the memory unit 7 is equal to or greater than the distance change threshold Dfth, the controller 6 determines that the measured distances Dc, Dp satisfy the distance detection criteria ("YES" in step S204). In this configuration, it is possible to accurately detect that the workpiece W has entered the field of view based on the changes in the previously and latest measured distances Dp, Dc.
[0060] The previously measured light amount Pp is also stored in the memory unit 7. If the absolute value of the current measured light amount Pc most recently acquired by the distance sensor 41 subtracted from the previously measured light amount Pp acquired in the past by the distance sensor 41 and stored in the memory unit 7 is equal to or greater than the light amount fluctuation threshold value Pfth, the controller 6 determines that the measured light amounts Pc and Pp satisfy the detection criteria for light amount ("YES" in step S206). With this configuration, it is possible to accurately detect that the workpiece W has entered the field of view based on the changes in the previously and latest measured light amounts Pp and Pc.
[0061] In the case of holding-up reading, various directions are assumed in which the workpiece W is held up to the code reading device 1. Fig. 10A is a diagram showing a variation in holding-up direction, and Fig. 10C is a diagram showing a difference in the time change in the output of the distance sensor according to the difference in holding-up direction. Fig. 10A shows a reference plane Ref on which a support stand for supporting the code reading device 1 used for holding-up reading is placed.
[0062] As shown in FIG. 10A, when the distance sensor 41 detects the workpiece W moved by the user in the holding direction Mh perpendicular to the front-rear direction Dfs, the output of the distance sensor 41 changes as shown in the "holding direction Mh" column in FIG. 10C. That is, before the workpiece W is held over the distance sensor 41, the distance measured by the distance sensor 41 is the reference plane distance, which is the distance from the distance sensor 41 to the reference plane Ref. On the other hand, at the moment when the workpiece W is held over the distance sensor 41, the distance measured by the distance sensor 41 changes sharply from the reference plane distance to the workpiece distance. Here, the workpiece distance is the distance from the distance sensor 41 to the workpiece W. On the other hand, as shown in FIG. 10A, when the distance sensor 41 detects the workpiece W moved by the user in the holding direction Mv parallel to the front-rear direction Dfs, the workpiece W approaches the distance sensor 41 gradually. Therefore, as shown in the "holding direction Mv" column in FIG. 10C, the distance measured by distance sensor 41 changes gradually from the reference surface distance to the work distance.
[0063] While the former type of abrupt change is easy to detect, the latter type of gradual change is difficult to detect. Therefore, when the user holds the workpiece W from the holding direction Mv, the workpiece W may not be detected accurately. In contrast, in the above embodiment, the workpiece W can be detected accurately even when held in the latter manner.
[0064] That is, the past measured distance Dp is stored in the memory unit 7. The memory unit 7 stores the past measured distance Dp repeatedly measured by the distance sensor 41. On the other hand, as illustrated in the column of "holding direction Mv" in FIG. 10C, the controller 6 detects the presence or absence of the workpiece W in the field of view based on the difference between the past measured distance Dp measured by the distance sensor 41 at a past time Tp (first time) and stored in the memory unit 7, and the latest current measured distance Dc measured by the distance sensor 41 at a current time Tc (second time) a predetermined period of time has elapsed since the past time Tp (step S204). In this configuration, the workpiece W can be accurately detected even when the change in the measured distance over time is gradual, such as when the workpiece W is held from the direction in which the distance sensor 41 emits light (front-back direction Dfs).
[0065] The past measured light amount Pp is also stored in the memory unit 7. The memory unit 7 stores the past measured light amount Pp repeatedly measured by the distance sensor 41. In response to this, the controller 6 detects the presence or absence of the workpiece W in the field of view based on the difference between the past measured light amount Pp measured by the distance sensor 41 at a past time Tp (first time) and stored in the memory unit 7, and the latest current measured light amount Pc measured by the distance sensor 41 at a current time Tc (second time) a predetermined period of time has elapsed since the past time Tp (step S206). In this configuration, the workpiece W can be accurately detected even if the change in the measured light amount over time is gradual, such as when the workpiece W is held from the direction in which the distance sensor 41 emits light (front-back direction Dfs).
[0066] The distance sensor 41 also repeatedly measures the distance and the amount of light. In response to this, when the controller 6 determines that the distance sensor 41 has transitioned from a state in which the distance sensor 41 has failed to repeatedly measure the distance to a state in which the distance sensor 41 has successfully measured the distance ("YES" in step S202), it detects that the workpiece W is within the field of view (step S207). In this configuration, if there is a change from a state in which the background of the workpiece W seen from the distance sensor 41 cannot be measured by the distance sensor 41 (for example, a state in which the reference surface Ref serving as the background is black) or a state in which the workpiece W is farther from the distance sensor 41 than the distance that can be measured by the distance sensor 41, the state in which the distance sensor 41 has failed to measure the distance transitions to a state in which it has succeeded, and the workpiece W can be detected within the field of view. This improves the degree of freedom of the installation environment of the code reading device 1.
[0067] Further, the past measured light amount Pp is stored in the memory unit 7. This memory unit 7 stores the past measured light amount Pp repeatedly measured by the distance sensor 41. In response to this, when one of the current measured light amount Pc measured by the distance sensor 41 and the past measured light amount Pp measured by the distance sensor 41 and stored in the memory unit 7 is less than the light amount threshold Pth (when "NO" in step S205), the controller 6 calculates the amount of change between the current measured light amount Pc and the past measured light amount Pp, and detects the presence or absence of the workpiece W in the field of view based on the amount of change in the light amount, regardless of the measured distances Dc and Dp measured by the distance sensor 41. In other words, when one of the current measured light amount Pc and the past measured light amount Pp is small, the reliability of the current measured distance Dc or the past measured distance Dp acquired simultaneously with the one of the light amounts is low, while there is a high possibility that the surrounding environment has changed. Therefore, when either the current measured light amount Pc or the past measured light amount Pp is less than the threshold value, the workpiece W can be accurately detected based on the change in light amount indicated by the current and past light amount information Pc, Pp, without using the change in distance indicated by the current and past distance information Dc, Dp.
[0068] As described above, in this embodiment, the code reading device 1 corresponds to an example of a "code reading device" of the present invention, the work W corresponds to an example of a "work" of the present invention, the illumination unit 2 corresponds to an example of an "illumination unit" of the present invention, the imaging unit 3 corresponds to an example of an "imaging unit" of the present invention, the controller 6 corresponds to an example of a "decode execution unit" of the present invention, the distance sensor 41 corresponds to an example of a "distance sensor" of the present invention, the controller 6 corresponds to an example of a "detection unit" of the present invention, the controller 6 corresponds to an example of a "control unit" of the present invention, the detection logic corresponds to an example of a "predetermined rule" of the present invention, and the memory unit 7 corresponds to an example of a "memory unit" of the present invention.
[0069] The present invention is not limited to the above embodiment, and various modifications can be made to the above without departing from the spirit of the present invention. For example, the contents of the detection logic in FIG. 9 may be modified as appropriate, as shown in the following example.
[0070] In the first modified detection logic, the detection criterion in step S204 is different from the above example. That is, in step S204, the controller 6 calculates a differential value by dividing the difference between the past measured distance Dp measured by the distance sensor 41 at a past time Tp (first time) and stored in the memory unit 7 and the current measured distance Dc measured by the distance sensor 41 at a time Tc (second time) after the time Tp and stored in the memory unit 7 by the elapsed time from the time Tp to the time Tc. If the differential value is equal to or greater than a predetermined threshold, the controller 6 judges "YES" in step S204, and if the differential value is less than the predetermined threshold, the controller 6 judges "NO" in step S204. In this configuration, the change in the measured distances Dp and Dc between the present and the past is calculated as a differential value, and it is possible to accurately detect that the workpiece W has entered the field of view based on the differential value. In addition, since the differential value calculated based on past values that were obtained so long ago that they are meaningless for comparison will be small, it is possible to prevent detection of the workpiece W from being performed based on such past values.
[0071] FIG. 11 is a flowchart showing a second modified example of the detection logic. Here, the differences from the example of FIG. 9 will be mainly described, and the common points will be denoted by corresponding reference numerals and will not be described as appropriate. In this second modified example, when the controller 6 determines in step S202 that the previously measured distance Dp indicates successful measurement ("NO" in step S202), it executes step S204 without executing step S203 in FIG. 9. In step S204, the controller 6 determines whether or not a distance change condition is satisfied, that is, the distance change amount obtained by subtracting the currently measured distance Dc from the previously measured distance Dp is equal to or greater than the distance change threshold Dfth. If the distance change condition is satisfied ("YES" in step S204), the controller 6 determines that the detection of the workpiece W has been successful (step S207).
[0072] On the other hand, if the distance variation condition is not satisfied (if "NO" in step S204), the controller 6 executes step S206. In step S206, the controller 6 determines whether or not the light quantity variation condition is satisfied, that is, the absolute value of the difference between the previously measured light quantity Pp and the currently measured light quantity Pc is equal to or greater than the light quantity variation threshold value Pfth. If the light quantity variation condition is satisfied (if "YES" in step S206), the controller 6 determines that the detection of the workpiece W has been successful (step S207). On the other hand, if the light quantity variation condition is not satisfied (if "NO" in step S206), the controller 6 determines that the detection of the workpiece W has failed (step S208).
[0073] Furthermore, the user can set the controller 6 to execute either the detection mode or the external trigger mode, for example, by performing an operation on the display SP.
[0074] FIG. 12A is a flowchart showing an example of the detection mode. In the detection mode of FIG. 12A, steps S101 to S105 are executed in the same manner as in the detection mode of FIG. 8. Also, if the detection of the workpiece W is successful ("YES" in step S105), the controller 6 selects one of the cameras 31A and 31B based on the current measurement distance Dc measured by the distance sensor 41. That is, as described above, since the focal lengths of the cameras 31A and 31B are different, one suitable for imaging the workpiece W located at the current measurement distance Dc is selected (step S107). Then, the controller 6 executes code reading using the one camera selected in step S107 (step S106). Also, after executing the code reading in step S106, if a notification of the end of the detection mode is received, the process ends, and if not, the process returns to the first step S101.
[0075] On the other hand, if the external trigger mode is set (step S301: NO), the controller 6 executes the external trigger mode of 13B (step S303). FIG. 12B is a flow chart showing an example of the external trigger mode. In step S401, the controller 6 judges whether or not a trigger has been received from an external device that executes wired or wireless communication. When a trigger is received from the external device (step S401: YES), the controller 6 measures the current measurement distance Dc by the distance sensor 41 (step S402). Then, the controller 6 selects one of the cameras 31A and 31B based on the current measurement distance Dc measured by the distance sensor 41 (step S403). Then, the controller 6 executes code reading using the one camera selected in step S107 (step S404). After executing the code reading in step S404, if a notification of the end of the external trigger mode has been received, the process ends, and if not, the process returns to the initial step S401.
[0076] Note that the entity that gives a trigger to the controller 6 in step S401 in the external trigger mode is not limited to an external device, and may be a user operating the trigger switch 122. In this case, in step S401, the controller 6 checks whether the user has operated the trigger switch 122 (external trigger).
[0077] In this way, the controller 6 (mode switching unit) switches between an external trigger mode (first mode) in which the illumination unit 2 and the imaging unit 3 are driven to read a code based on an external trigger, and a detection mode (second mode) in which the illumination unit 2 and the imaging unit 3 are driven to read a code when the distance sensor 41 detects a workpiece W in the field of view. When the distance sensor 41 is switched to the external trigger mode, it measures the distance based on an external trigger (step S402), and when the distance sensor 41 is switched to the detection mode, it repeatedly measures the amount of light and the distance (step S102). In this configuration, the external trigger mode in which illumination and imaging are performed based on an external trigger, and the detection mode in which illumination and imaging are performed using the detection of the workpiece W by the distance sensor 41 as a trigger without an external trigger can be executed, allowing flexible use according to the user's usage scene. In addition, by repeatedly measuring with the distance sensor 41, the distance measurement unit 4 can automatically detect that the workpiece W has entered the field of view.
[0078] The imaging unit 3 also includes a camera 31A (first camera) and a camera 31B (second camera) for imaging at a longer distance than the camera 31A. When the controller 6 switches to the detection mode and the controller 6 detects a workpiece W within the field of view using the distance sensor 41, the controller 6 selects one of the cameras 31A and 31B based on the current measurement distance Dc measured by the distance sensor 41 (step S107), and causes the selected camera to generate a code image Ic (step S106). In this configuration, imaging can be performed using the optimal camera according to the distance, so the range in which holding the workpiece W over the workpiece W to read the code can be expanded, and the freedom of installation of the code reading device 1 is improved.
[0079] Fig. 13A is a schematic diagram showing an example of a state in which a workpiece is held over the code reading device 1 of Fig. 10A, in which there is no reference plane Ref as in Fig. 10A. When the code reading device 1 is fixed to a support base via the mounting hole 166, if a workpiece is not held over it, the distance measurement by the distance sensor 41 fails (step S201). When a workpiece W is held over this code reading device 1, the distance sensor 41 is able to measure the distance L1 to the workpiece surface Wf, and so the workpiece is successfully detected (step S202).
[0080] FIG. 13B is a diagram showing an example of a state in which a workpiece is held over the code reading device of FIG. 10A. When the code reading device 1 is fixed to the support base via the mounting hole 166, the distance sensor 41 measures the distance L2 to the reference surface Ref. In this state, when a thin workpiece W is held over the reference surface Ref, the distance sensor 41 measures the distance L3 to the workpiece. At this time, if the difference between L2 and L3 is less than the threshold Dfth in step S204, the workpiece W cannot be detected by a conventional method that judges only by distance. However, in the case of the code reading device 1 according to this embodiment, if the absolute value of the difference between the amount of light measured before the workpiece W is held over (the amount of light reflected by the reference surface Ref) and the amount of light measured when the workpiece W is held over (the amount of light reflected by the surface Wf) is equal to or greater than the threshold Pfth in step S206, the workpiece can be detected (step S207).
[0081] The code reading device 1 is a portable code reading device 1 including a head unit 11 that houses the illumination unit 2, the imaging unit 3, and the distance sensor 41, and a grip unit 12 that extends from the head unit 11. When the controller 6 switches to the external trigger mode, the user can grip the grip unit 12 to operate the code reading device 1. On the other hand, when the controller 6 switches to the detection mode, the code reading device 1 can operate with the head unit 11 or the grip end unit 13 fixed to an external support base via the finger bar 15. This configuration allows for flexible usage (holding the grip unit 12, fixing to a support base) according to the user's usage scene. The finger bar 15 does not need to be extended from the grip end unit 13 to the head unit 11, and may be provided, for example, in a limited range from the grip end unit 13 to a midway position (middle portion 165).
[0082] The device also includes a grip portion 12 extending from the head portion 11 in the axial direction Da, a grip end portion 13 provided at an end of the grip portion 12 on the opposite side of the head portion 11 in the axial direction Da, and a finger bar 15 (plate-shaped member) extending from the grip end portion 13 toward the head portion 11 on the front side Sf (field of vision) of the grip portion 12. Spaces S1 and S2 for the user's hands to grip the grip portion 12 are provided between the finger bar 15 and the grip portion 12, and the finger bar 15 is provided with an attachment hole 166 for attachment to a support base. In this configuration, the finger bar 15 allows the code reader 1 to be held up to read while attached to an external support base. The finger bar 15 also improves the ease of gripping by the user. [Industrial Applicability]
[0083] This invention relates to a technology for reading codes by shining light towards a workpiece having a code to be read, receiving the light reflected by the workpiece, and generating a code image, and is particularly applicable to technology in general for detecting the presence or absence of a workpiece. [Explanation of symbols]
[0084] 1...Code reader W…Work 2. Lighting section 3. Imaging unit 6...Controller (decoding execution unit, detection unit, control unit) 41...Distance sensor 7...Storage section
Claims
1. an imaging unit that receives light reflected from a workpiece having a code to be read and generates a code image; a decoding execution unit that executes decoding of the code image generated by the imaging unit; a distance sensor that emits light into a field of view of the imaging unit, receives the light reflected by the workpiece, and measures a distance to the workpiece and an amount of light reflected from the workpiece and reaching the workpiece based on the received light; A detection unit that detects the presence or absence of the workpiece within the field of view based on a result of measurement performed by the distance sensor; a control unit that drives the imaging unit based on the result of detection by the detection unit; Equipped with The detection unit acquires distance information regarding the distance measured by the distance sensor and light amount information regarding the light amount measured by the distance sensor, and detects the presence or absence of the workpiece within the field of view based on a predetermined rule using both the distance information and the light amount information. A code reading device comprising:
2. the predetermined rule includes a detection criterion related to distance and a detection criterion related to light amount, The detection unit detects that the workpiece is within the field of view when the light quantity information satisfies the detection criterion regarding the light quantity even if the distance information does not satisfy the detection criterion regarding the distance.
2. The code reader according to claim 1.
3. the predetermined rule includes a determination as to whether or not the amount of light indicated by the light amount information is equal to or greater than a threshold value related to the amount of light, The detection unit is When the amount of light indicated by the light amount information is equal to or greater than the threshold value for the amount of light, it is determined whether or not the distance indicated by the distance information satisfies a detection criterion for the distance; When the light amount indicated by the light amount information is less than the threshold value for the light amount, it is determined whether or not the light amount information satisfies a detection criterion for the light amount, and the presence or absence of the workpiece within the field of view is detected based on the result of determining whether or not the light amount information satisfies the detection criterion for the light amount, regardless of whether or not the distance information satisfies the detection criterion for the distance.
3. The code reader according to claim 2.
4. the predetermined rule includes a determination as to whether or not the amount of light indicated by the light amount information is equal to or greater than a threshold value related to the amount of light, The detection unit is When the light amount indicated by the light amount information is equal to or greater than the threshold value for the light amount, and when it is determined that the distance indicated by the distance information does not satisfy the detection criterion for the distance, it is determined whether or not the light amount information satisfies the detection criterion for the light amount, and the presence or absence of the workpiece within the field of view is detected based on the determination result of whether or not the detection criterion for the light amount is satisfied.
3. The code reader according to claim 2.
5. A storage unit that stores the distance information, The detection unit is When a value obtained by subtracting a distance indicated by the distance information most recently acquired by the distance sensor from a distance indicated by distance information previously acquired by the distance sensor and stored in the memory unit is equal to or greater than a threshold value for the distance, it is determined that the distance information satisfies the detection criterion for the distance.
3. The code reader according to claim 2.
6. A storage unit for storing the light amount information, The detection unit is when an absolute value of a value obtained by subtracting the amount of light indicated by the light amount information most recently acquired by the distance sensor from the amount of light indicated by the light amount information previously acquired by the distance sensor and stored in the storage unit is equal to or greater than a threshold value regarding the amount of light, it is determined that the light amount information satisfies the detection standard regarding the amount of light; 3. The code reader according to claim 2.
7. A storage unit that stores the distance information, The storage unit stores the distance information repeatedly measured by the distance sensor, The detection unit calculates a differential value by dividing a difference between past distance information measured by the distance sensor at a first time and stored in the memory unit and latest distance information measured by the distance sensor at a second time after the first time by an elapsed time from the first time to the second time, and detects the presence or absence of the workpiece within the field of view based on the differential value.
3. The code reader according to claim 2.
8. A storage unit for storing the light amount information, The storage unit stores the light amount information repeatedly measured by the distance sensor, The detection unit calculates a differential value by dividing a difference between past light amount information measured by the distance sensor at a first time and stored in the memory unit and latest light amount information measured by the distance sensor at a second time after the first time by an elapsed time from the first time to the second time, and detects the presence or absence of the workpiece within the field of view based on the differential value.
3. The code reader according to claim 2.
9. A storage unit that stores the distance information, The storage unit stores the distance information repeatedly measured by the distance sensor, The detection unit detects the presence or absence of the workpiece within the field of view based on a difference between past distance information measured by the distance sensor at a first time and stored in the memory unit and latest distance information measured by the distance sensor at a second time a predetermined period of time has elapsed from the first time.
3. The code reader according to claim 2.
10. A storage unit for storing the light amount information, The storage unit stores the light amount information repeatedly measured by the distance sensor, The detection unit detects the presence or absence of the workpiece within the field of view based on a difference between past light amount information measured by the distance sensor at a first time and stored in the memory unit and latest light amount information measured by the distance sensor at a second time a predetermined period of time has elapsed from the first time.
3. The code reader according to claim 2.
11. The distance sensor repeatedly measures distance and light amount; When the detection unit determines that the distance sensor has transitioned from a state in which the distance measurement repeatedly performed by the distance sensor has failed to a state in which the distance measurement repeatedly performed by the distance sensor has succeeded, the detection unit detects that the workpiece is within the field of view.
2. The code reader according to claim 1.
12. A storage unit for storing the light amount information, The storage unit stores the light amount information repeatedly measured by the distance sensor, The detection unit is When the light amount indicated by one of the latest light amount information measured by the distance sensor and the past light amount information measured by the distance sensor and stored in the storage unit is less than a threshold value, a change amount between the latest light amount information and the past light amount information is calculated; Detecting the presence or absence of the workpiece within the field of view based on the amount of change, regardless of the distance information measured by the distance sensor.
2. The code reader according to claim 1.
13. Further comprising an illumination unit for irradiating light toward the workpiece, Further provided with a mode switching unit that switches between a first mode in which the control unit drives the illumination unit and the imaging unit based on an external trigger and a second mode in which the control unit drives the illumination unit and the imaging unit when the detection unit detects the workpiece within the field of view, The distance sensor is When the mode switching unit has switched to the first mode, a distance is measured based on the external trigger; When the mode switching unit has switched to the second mode, the measurement of the light amount and the distance is repeatedly performed.
2. The code reader according to claim 1.
14. the imaging unit includes a first camera and a second camera for imaging an object at a longer distance than the first camera; When the mode switching unit switches to the second mode, when the detection unit detects the workpiece within the field of view, the control unit selects one of the first camera and the second camera based on the distance information indicating the distance measured by the distance sensor, and causes the selected one camera to generate a code image.
14. A code reading device according to claim 13.
15. The code reading device is a portable code reading device including a head unit that houses the illumination unit, the imaging unit, and the distance sensor, and a grip unit that extends from the head unit, When the mode switching unit has switched to the first mode, the code reading device becomes operable when a user grips the grip unit, When the mode switching unit switches to the second mode, the code reading device is operable with the head unit or the grip unit fixed to an external support unit.
14. A code reading device according to claim 13.
16. A grip portion extending axially from the head portion; A grip end portion provided at an end of the grip portion opposite to the head portion in the axial direction; A plate-like member extending from the grip end portion toward the head portion on the field of view side of the grip portion; Further equipped with A space for a user's hand to hold the grip portion is provided between the plate-like member and the grip portion, The plate-like member is provided with a mounting hole for mounting to the support portion.
16. A code reading device according to claim 15.
17. a step of receiving light reflected by a workpiece having a code to be read, emitting light into a field of view of an imaging unit that generates a code image, receiving the light reflected by the workpiece, and measuring the distance to the workpiece and the amount of light reflected from the workpiece and reaching the workpiece using a distance sensor based on the received light; A step of detecting the presence or absence of the workpiece within the field of view by a detection unit based on a result of measurement performed by the distance sensor; driving the imaging unit by a control unit based on the result detected by the detection unit; Equipped with The detection unit acquires distance information regarding the distance measured by the distance sensor and light amount information regarding the light amount measured by the distance sensor, and detects the presence or absence of the workpiece within the field of view based on a predetermined rule using both the distance information and the light amount information. A code reading method comprising the steps of:
Citation Information
Patent Citations
Code reader
JP1994314348A
Optical information reading apparatus and optical information reading method
JP2011034360A
Optical information reading device
JP2022055007A
Image processing device for extracting foreground object and image processing method thereof
US20150117717A1
Presentation imaging system
US6637893B2
