1. Technical Field
Embodiments of the present disclosure generally relate to measurement systems, and more particularly to a computing device and a method for controlling the motion of a mechanical arm to measure objects.
2. Description of Related Art
A mechanical arm may be used to examine an object. The object must be positioned on a test platform, and removed from the test platform when the examination is finished. During testing of the object positioned on the test platform, a central reference point of the end of the mechanical arm is hard to establish in relation to a center of the object. Therefore, improvements are desirable to improve the examination process.
In general, the term “module,” as used herein, refers to logic embodied in hardware or firmware, or to a collection of software instructions, written in a programming language, such as, for example, Java, C, or assembly. One or more software instructions in the modules may be embedded in firmware, such as in an EPROM. It will be appreciated that modules may comprise connected logic units, such as gates and flip-flops, and may comprise programmable units, such as programmable gate arrays or processors. The modules described herein may be implemented as either software and/or hardware modules and may be stored in any type of non-transitory computer-readable medium or computer storage device. The term “memory module” as used herein, may refer to individual pieces (sticks) of hardware with a memory function in a computing system.
In one end of the mechanical arm 2, as shown in
In the embodiment, the motion control unit 10 is stored in the storage device 12. Functions of the motion control unit 10 are described below and in
In one embodiment, the storage device 12 may be a magnetic or an optical storage device, such as a hard disk drive, an optical drive, a compact disc, a digital video disc, a tape drive, or other suitable storage medium. The processor 16 may be a central processing unit including a math co-processor, for example. The computing device 1 may be a server, a computer, a portable electronic device, or any other data processing device.
The first control module 100 controls the mechanical arm 2 to move horizontally so that the object 4 is within an image area of the image capturing device 3. The image area is illustrated in
The focus module 102 focuses the image capturing device 3 on the object 4. In detail, the focus module 102 controls the mechanical arm 2 to move, so that the image capturing device 3 is controlled to move forward or back along a imaginary line from approximate center of the object 4 to middle of the camera lens 30, and the object 4 is placed within a range of depth of field of the camera lens 30. The focus module 102 further determines an optimum image sharpness for capturing images of the object 4 based on a dimensional histogram statistic method.
The image analysis module 104 analyzes contours of the object 4 and obtains a central area of the object 4 according to the contours of the object 4. As shown in
The second control module 106 moves the mechanical arm 2 to focus the image capturing device 3 on the object 4 by aligning the center of the image area (shown as point “a” in
The first image obtaining module 108 records a position of the center “a” of the image area of the image capturing device 3 as a first position of the mechanical arm 2, and captures a first image of the object 4 using the camera lens 30 of the image capturing device 3 when the central area of the object 4 coincides with the center “a” of the image area.
The third control module 110 controls the mechanical arm 2 to move from the first position to a second position over a distance L (as shown in
The second image obtaining module 112 records a position of the center “b” of the image area of the image capturing device 3 as the second position of the mechanical arm 2, and captures a second image of the object 4 using the camera lens 30.
The calculation module 114 calculates a total apparent displacement value of the object 4, and calculates a distance between the object 4 and the camera lens 30 according to the first position, the second position of the mechanical arm 2 and the total apparent displacement value of the object 4.
For example, as shown in
where H is the distance between the central area P of the object 4 and the camera lens 30 in the vertical direction, and L is the distance between the center “a” of the image area and the center “b” of the image area. W is a width of the image area of the image capturing device 3, and h is a distance between the image area of the image capturing device 3 and the camera lens 30.
The correction module 116 compensates for the direction of movement of the camera lens 30 in relation to the object 4 by adjusting the mechanical arm 2 according to the distance between the central area P of the object 4 and the camera lens 30 in the vertical direction. For example, the correction module 116 enables a normal direction of the camera lens 30 parallel to a normal direction of the object 4 by adjusting the mechanical arm 2.
In step S400, the first control module 100 controls the mechanical arm 2 to move horizontally so that the object 4 is within an image area of the image capturing device 3. The image area is illustrated in
In step S402, the focus module 102 focuses the image capturing device 3 on the object 4. In detail, the focus module 102 controls the mechanical arm 2 to move, so that the image capturing device 3 is controlled to move forward or back along a imaginary line from approximate center of the object 4 to middle of the camera lens 30, and the object 4 is placed within a range of depth of field of the camera lens 30. The focus module 102 further determines an optimum image sharpness for capturing images of the object 4 based on a dimensional histogram statistic method.
In step S404, the image analysis module 104 analyzes contours of the object 4, and obtains a central area of the object 4 according to the contours of the object 4. As shown in
In step S406, the second control module 106 moves the mechanical arm 2 to focus the image capturing device 3 on the object 4 by aligning the center of the image area (shown as point “a” in
In step S408, the first image obtaining module 108 records a position of the center “a” of the image area as a first position of the mechanical arm 2, and captures a first image of the object 4 using the camera lens 30 of the image capturing device 3.
In step S410, the third control module 110 controls the mechanical arm 2 to move from the first position to a second position over a distance L (as shown in
In step S412, the second image obtaining module 112 records a position of the center “b” of the image area as a second position of the mechanical arm 2, and captures a second image of the object 4 using the camera lens 30 of the image capturing device 3.
In step S414, the calculation module 114 calculates a total apparent displacement value of the object 4 in the image area, and calculates a distance between the object 4 and the camera lens 30 according to the first position, the second position of the mechanical arm 2, and the total apparent displacement value of the object 4.
In step S416, the correction module 116 compensates for the direction of movement of the camera lens 30 in relation to the object 4 by adjusting the mechanical arm 2 according to the distance between the central area P of the object 4 and the camera lens 30 in the vertical direction.
Although certain inventive embodiments of the present disclosure have been specifically described, the present disclosure is not to be construed as being limited thereto. Various changes or modifications may be made to the present disclosure without departing from the scope and spirit of the present disclosure.
Number | Date | Country | Kind |
---|---|---|---|
100135695 | Oct 2011 | TW | national |