Summary of the invention
The object of the present invention is to provide a kind of two-dimensional positioning device, to overcome the deficiency of artificial tool setting mode based on machine vision.
Realize that technical scheme of the present invention is as follows: a kind of two-dimensional positioning device based on machine vision comprises the digital camera that is fixed on the lathe, the processor that links to each other with digital camera; Geometric properties on the selected workpiece is made the anchored object feature, described digital camera obtains the digital image information of this anchored object feature and is sent to processor, anchored object feature on the template matching algorithm identification workpiece of processor adopting image, adopt edge detection method to calculate the coordinate of described anchored object feature in viewing field of camera, obtain the coordinate of workpiece in lathe by coordinate transform.
As shown in Figure 1.Location geometric properties on the camera alignment pieces, these geometric properties can be circle, circular arc, right-angle side etc., the digital picture sending processor that photographs.Processor can be PC (PersonalComputer, personal computer) or IPC (Industrial Personal Computer, industrial personal computer) or embedded system.The physical dimension and the position coordinates of process software identification, calculating object, and be converted into the coordinate figure of workpiece coordinate system initial point in lathe coordinate system and give machine tool controller.
The coordinate transform mode as shown in Figure 2.Process software mates the digital picture and the geometric properties template of storage in advance, with the identification anchored object; According to the scale attributes and the edge detection algorithm of digital picture, try to achieve the phasor coordinate of location geometric properties in the visual field
, the phasor coordinate of camera in lathe coordinate system
Read from the current coordinate of numerically-controlled machine by processor, then location geometric properties coordinate vector is on the workpiece:
Can determine the position of workpiece in lathe coordinate system thus.
The present invention compared with prior art has following advantage:
(1) improved the location efficiency of numerically-controlled machine.
When employing was located based on the two-dimensional positioning device of machine vision, work efficiency greatly improved.
(2) bearing accuracy is not subjected to interference from human factor.
Based on the two-dimensional positioning device location good reproducibility of machine vision, position fixing process is finished by computing machine, and the mood when not being subjected to human factor such as operating personnel's technical merit and work is disturbed.
Embodiment
As shown in Figure 1, camera lens and camera connect firmly on numerically-controlled machine, and camera links by communication interface and processor.Anchored object feature on the workpiece is selected in advance, generally selects circle, right-angle side etc. for use, and its digital photo is pre-stored in the processor as template.To anchored object feature top, take pictures, and read digital photo by the processor instruction camera by the precalculated position mobile camera for lathe.Control program in the processor mates digital photo and template, identifies the anchored object feature in the digital photo, adopts edge detection method then, calculates the coordinate of this feature in digital photo.Anchored object feature shown in Figure 2 is a circle, and edge detection method can calculate the central coordinate of circle of this circle in digital photo, according to pixel and proportionate relationship in kind, can extrapolate the coordinate of this center of circle in viewing field of camera again.Viewing field of camera true origin shown in Figure 2 is defined in its upper left corner, and central coordinate of circle with vector representation is
![Figure C200710029513D00051](https://patentimages.storage.googleapis.com/d3/c6/59/eb2d565fbdd3d4/C200710029513D00051.png)
Camera and lathe connect firmly, and the coordinate of the viewing field of camera upper left corner (initial point) in lathe coordinate system can read from the current location of digital control system, establish reading and are
Then the coordinate of this center of circle in the numerically-controlled machine coordinate system is:
With this coordinate
Be converted into the initial point of workpiece coordinate system, be sent to digital control system, can finish the automatic tool preset process.