CN110688996A - Embedded automatic ruler reading device and method based on visual sensing - Google Patents

Embedded automatic ruler reading device and method based on visual sensing Download PDF

Info

Publication number
CN110688996A
CN110688996A CN201910898244.9A CN201910898244A CN110688996A CN 110688996 A CN110688996 A CN 110688996A CN 201910898244 A CN201910898244 A CN 201910898244A CN 110688996 A CN110688996 A CN 110688996A
Authority
CN
China
Prior art keywords
ruler
image
character
county
digital
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN201910898244.9A
Other languages
Chinese (zh)
Inventor
宋乐
刘忻羽
黄邦奎
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tianjin University
Original Assignee
Tianjin University
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 Tianjin University filed Critical Tianjin University
Priority to CN201910898244.9A priority Critical patent/CN110688996A/en
Publication of CN110688996A publication Critical patent/CN110688996A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/10Image acquisition
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/14Image acquisition
    • G06V30/148Segmentation of character regions
    • G06V30/153Segmentation of character regions using recognition of characters or words
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V2201/00Indexing scheme relating to image or video recognition or understanding
    • G06V2201/02Recognising information on displays, dials, clocks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Character Input (AREA)

Abstract

The invention discloses an embedded automatic ruler reading device and method based on visual sensing, comprising an image acquisition unit, a result display unit and an image processing unit; the image acquisition unit comprises an LED illumination light source and a digital camera; the result display unit comprises an LCD display screen; the image processing unit comprises an embedded main controller and an upper computer, the embedded main controller receives information collected by the camera and displays the image of the ruler to be identified and the reading result of the ruler to be identified on the LCD display screen, and the embedded main controller is communicated with the upper computer to realize remote transmission of the reading result of the ruler to be identified. The invention can realize the division, the positioning and the identification of the digital characters of the ruler, accurately read the scales of the ruler at the center of the view field, and display the current ruler image and the reading of the center of the view field on the embedded liquid crystal screen, thereby replacing human eyes to carry out automatic measurement, eliminating the gross error generated by manual reading, and simultaneously improving the efficiency and the precision of the reading.

Description

Embedded automatic ruler reading device and method based on visual sensing
Technical Field
The invention relates to a technology for realizing visual measurement by using an image recognition technology of visual sensing, in particular to an embedded automatic ruler reading device and method based on visual sensing.
Background
In a large number of current industrial fields, the traditional ruler-type method is still adopted for measuring the length, and the method is mature, reliable, low in cost and convenient for manual reading. However, experiments show that in the process of mass industrial production, higher precision and efficiency can be obtained by using a machine vision measuring method than an artificial vision detecting method, because of fatigue and inconsistency of an artificial vision measurer, and a plurality of measuring tasks are time-consuming and labor-consuming for manual work, so that the comprehensive measuring cost is greatly improved. Manual measurements have been reported to be only 80% effective at best. In contrast, visual measurements can ensure consistency in product measurements.
The computer vision measurement is to collect the image of a specific target by using a photoelectric imaging system, carry out digital processing by a computer or a special image processing module, and carry out identification detection on the size, the shape, the color and the like according to the information of the pixel distribution, the brightness, the color and the like of the image. Machine vision is characterized by automation, real-time, non-contact, and high accuracy, and emphasizes accuracy and speed, and reliability in industrial field environments, as compared to image processing systems in general. Computer vision is often used in place of artificial vision in certain applications or where artificial vision is difficult to meet.
Machine vision automatic measurement technology is generally adopted on foreign production lines, while in China, industrial vision systems are still in the concept lead-in period, and leading enterprises of various industries begin to turn the attention to the aspect of vision detection automation after solving the problem of production automation. Because of the capital, the technology, the politics and the like, a high-speed and high-precision machine vision detection system is always the core technology of foreign manufacturers for the Chinese strict sealing lock, only a few domestic enterprises adopt imported automatic detection machines, and the existing detection equipment and method are inevitably subjected to the strong impact of the foreign large enterprises, so that the vision detection technology for developing the independent intellectual property is required by the market and is also free from the technical monopoly of the foreign manufacturers.
Disclosure of Invention
The invention aims to overcome the defects in the prior art and provide an embedded automatic ruler reading device and method based on visual sensing, which can realize the segmentation, positioning and identification of the digital characters of a ruler, accurately read the scales of the ruler in the center of a view field and display the current ruler images and the reading of the center of the view field on an embedded liquid crystal screen, thereby replacing human eyes to carry out automatic measurement, eliminating the gross error generated by manual reading and simultaneously improving the reading efficiency and precision.
The technical scheme adopted by the invention is as follows: an embedded automatic ruler reading device based on visual sensing is arranged in a closed space, and a ruler to be identified is fixed on the inner side wall of the closed space; the embedded automatic ruler reading device comprises:
the image acquisition unit comprises an LED illumination light source and a digital camera, the LED illumination light source is arranged at the top of the closed space, and a camera of the digital camera is fixed in the closed space at a position opposite to the ruler to be identified;
a result display unit comprising an LCD display screen disposed outside the enclosed space; and the number of the first and second groups,
the image processing unit comprises an embedded main controller and an upper computer, the embedded main controller receives information collected by the camera and displays the ruler image to be identified and the reading result of the ruler to be identified on the LCD display screen; and the embedded main controller is communicated with the upper computer to realize the remote transmission of the reading result of the ruler to be identified.
Further, the digital camera is equipped with a camera chip that can be driven under WinCE.
Further, the embedded main controller adopts a Mini2440 embedded development board based on an ARM920T platform, and an S3C2440 microprocessor for data processing, a CPU core power supply chip for ensuring the running stability of the embedded automatic ruler reading device and a reset chip are arranged on the Mini2440 embedded development board.
The Mini2440 embedded development board receives information collected by the camera through a USB interface; and the Mini2440 embedded development board is communicated with an upper computer through a JTAG interface and a serial port.
The other technical scheme adopted by the invention is as follows: an embedded automatic ruler reading method based on visual sensing adopts the embedded automatic ruler reading device based on visual sensing, and the embedded automatic ruler reading method comprises the following steps:
step 1, pretreatment: preprocessing an original image acquired by the camera so as to eliminate information irrelevant to the target digital character in the image, enhance the detectability of the target digital character, simplify data, remove background stray points and highlight the characteristics of the ruler to be recognized;
step 2, character segmentation: positioning a ruler to be recognized in the image background, and positioning each digital character of the scale value on each integer digit in the ruler to be recognized;
and step 3, character recognition: respectively identifying each digital character by adopting a digital notation method to obtain integer scale value readings on the left side and the right side of the center of the view field, dividing a pixel difference value of the integer scale on the left side of the center of the view field by a pixel difference value of two integer scale on the left side and the right side of the center of the view field to obtain a decimal reading, and finally adding the decimal reading to the integer reading to obtain the reading of the center of the view field.
Further, in step 1, the pretreatment specifically includes:
step 1-1, gray level conversion: converting the color image collected by the camera into a gray image;
step 1-2, image binarization: changing the gray level image into a black-white binary image by binarization processing, and separating digital characters from an image background;
step 1-3, image corrosion: removing stray points of the image by adopting a corrosion algorithm, and corroding in the horizontal and vertical directions respectively so as to highlight the characteristics of the digital characters;
step 1-4, image denoising: and removing the image noise points by adopting median filtering.
Further, in step 2, the character segmentation specifically includes:
step 2-1, segmenting a ruler image area from a background image, finding out the upper edge position and the lower edge position of each digital character of a ruler scale mark and a scale value by using a Canny edge detection operator through a horizontal projection method, and then calibrating the positions of two centimeter scale marks on the left side and the right side of the center of a view field through a vertical projection method;
step 2-2, accurately positioning each digital character of each scale value, and segmenting all digital characters on all integer digits of the ruler to be recognized, wherein the steps comprise:
step 2-2-1, firstly, in the vertical height range area of the scale mark of the ruler, projecting each pixel of the image according to columns:
Figure BDA0002210962790000031
wherein F (i) is the sum of the number of pixels in the ith column, f (i, j) is the number of pixels in the jth row in the ith column, and n is the set number of columns;
step 2-2-2, counting the pixel values of each row after projection, positioning the scale mark of the integer digit of the ruler (4) to be identified according to the value of the pixel value, and positioning the approximate position of the scale value on the integer digit in the horizontal direction;
2-2-3, obtaining the vertical position range of the character region according to the upper and lower edge positions of each digital character of the scale values obtained in the step 2-1, and roughly positioning the position of each digital character of the left and right integer scale values of the center of the view field by utilizing the vertical position range of the character region and the width of a single character obtained by visual estimation;
and 2-2-4, vertically projecting each pixel point in the character region to obtain a pixel distribution map of each row of projection in the character region, and segmenting a single digital character rectangular region according to a pixel distribution difference value to finish the accurate positioning of each digital character.
Further, in step 3, the identifying each digit character by the digit notation method is: and 2, after the rectangular region of the digital character is segmented in the step 2, segmenting the rectangular region in the vertical and horizontal directions at different positions, recording the number of points which are changed from the pixels of the blank image region to the pixels of the digital character image region or from the pixels of the digital character image region to the pixels of the blank image region in a one-way alternate manner along the single direction according to the difference of the pixels of the blank image region and the digital character image region, and realizing the identification of the digital character according to the difference of the sum of the number of the points which are changed from the pixels of the blank image region to the pixels of the digital character image region in the one-way alternate manner of the pixels of all the segmenting lines of the digital character in the.
The method for respectively identifying each digital character by adopting the digital annotation method specifically comprises the following steps:
step 3-1, according to the figures of the digital characters from 0 to 9, selecting two segmentation straight lines in the vertical direction and three segmentation straight lines in the horizontal direction, wherein the segmentation straight lines in the vertical direction are positioned in
Figure BDA0002210962790000041
And
Figure BDA0002210962790000042
at the position of the dividing straight line in the horizontal direction
Figure BDA0002210962790000043
At least one of (1) and (b); edgeThe number of the pixel one-way alternate change points obtained by vertical line scanning is countx1/3Is provided with an edge
Figure BDA0002210962790000045
The number of the pixel one-way alternate change points obtained by vertical line scanning is countx1/2Edge of
Figure BDA0002210962790000046
The number of the pixel one-way alternate change points obtained by vertical line scanning is count2/3Edge of
Figure BDA0002210962790000047
The number of the pixel one-way alternate change points obtained by vertical line scanning is count1/2Edge of
Figure BDA0002210962790000048
The number of the pixel one-way alternate change points obtained by vertical line scanning is count1/3
Step 3-2, along with
Figure BDA0002210962790000049
Vertical line scan, if countx1/2If the result is 1, the numeric character recognition result is "1" or "4" or "7" and the process goes to step 3-3; if countx1/2If 2, the number character recognition result is 0; if countx1/2If the result is 3, the numeric character recognition result is "2" or "3" or "5" or "6" or "8" or "9" and the process goes to step 3-4;
step 3-3, along withHorizontal line scanning to get a county2/3Number, re-edge
Figure BDA00022109627900000411
Scanning by vertical line to obtain countx1/3Number, if county 2/31, and, countx1/3If the result is 0, the number character recognition result is 1; if county 2/32, and, countx1/3If the number is 1, the number character recognition result is 4; if county2/3=1=countx1/3If the number is 1, the number character recognition result is 7;
step 3-4, along with
Figure BDA0002210962790000051
Horizontal line scanning to get a county2/3Number, re-edge
Figure BDA0002210962790000052
Horizontal line scanning to get a county1/3Number, if county2/3=county1/3If 2, the number character recognition result is 8; if county 2/32, and, county1/3=1,The numeric character recognition result is "9"; if county 2/31, and, county1/3If 2, the number character recognition result is 6; fruit county2/3=county1/3If the result is 1, the numeric character recognition result is "2" or "3" or "5" and the process goes to step 3-5;
step 3-5, along withFrom numerical characters at height
Figure BDA0002210962790000054
Horizontal line left at width, county1/3Counting and thenFrom numerical characters at height
Figure BDA0002210962790000056
Scanning the horizontal line to the right at the width to obtain the county2/3Number, if county1/3=county2/3If the number is 1, the number character recognition result is 2; if county1/30, and, county2/3If the number is 1, the number character recognition result is 3; if county1/30, and, county2/3If 0, the numeric character recognition result is "5".
The invention has the beneficial effects that:
the embedded operation system based on the ARM has the advantages of small size, low power consumption, strong real-time performance, high cost performance, high stability and the like.
The data is transmitted to the upper computer in a serial port communication mode, and the data can be allowed to be transmitted remotely and stably.
The invention combines a vision measurement system with an embedded system, realizes automatic identification of ruler scales, thereby replacing human eyes to carry out automatic measurement, improves identification accuracy, improves identification reliability, eliminates a large error generated by manual reading, improves reading efficiency and precision, and has the characteristics of portability, low cost, high precision and the like.
Drawings
FIG. 1: the general framework diagram of the invention;
FIG. 2: the invention discloses a structural schematic diagram of an embedded automatic ruler reading device based on visual sensing;
FIG. 3: the invention relates to a circuit block diagram of an embedded automatic ruler reading device based on visual sensing;
FIG. 4: the invention discloses a ruler number character schematic diagram to be identified;
FIG. 5: the invention is a character segmentation schematic diagram;
FIG. 6 a: the figure 3 structure characteristic analysis diagram is shown in the invention;
FIG. 6 b: the figure "4" structural feature analysis of the invention is a schematic diagram;
FIG. 6 c: figure 7 structural feature analysis schematic diagram in the invention.
The attached drawings are marked as follows: 1-a closed space; 2-LED lighting source; 3-LCD display screen; 4-ruler to be identified; 5-Mini2440 Embedded development Board; 6-S3C2440 microprocessor; 7-a camera; 8-an upper computer; 9-USB interface; 10-JTAG interface; 11-a serial port; 12-power supply.
Detailed Description
In order to further understand the contents, features and effects of the present invention, the following embodiments are illustrated and described in detail with reference to the accompanying drawings:
fig. 1 is a general frame diagram of an embedded automatic ruler reading device and method based on visual sensing, which is divided into two parts, namely software and hardware. By means of a high-resolution industrial digital camera, the real-time requirement of hardware equipment can be fully met by combining a Mini2440 embedded development board 5 based on an ARM920T platform and taking an S3C2440 microprocessor 6 as a core with a WinCE embedded operation system, and meanwhile, the system has high adaptability and reliability, small code space, high running speed and less resource requirement; meanwhile, related algorithms are designed by using an Embedded Visual C + + tool, so that the division, the positioning and the recognition of the digital characters of the ruler are realized, the scales of the ruler in the center of the view field are accurately read, the preset precision requirement is met, and the stability is high; the Windows API mode is adopted to develop the serial port communication program, the transmission speed is moderate, the transmission distance is long, and the accuracy and the reliability of the data transmission of the communication program are high.
As shown in fig. 2, the embedded automatic ruler reading device based on visual sensing is arranged in an enclosed space 1, and a ruler 4 to be identified is a movable graduated scale which is accurate to 1mm and is fixed on the inner side wall of the enclosed space 1; the embedded automatic ruler reading device comprises an image acquisition unit, a result display unit and an image processing unit.
(1) Image acquisition unit
The image acquisition unit is used for acquiring ruler images and comprises an LED illumination light source 2 and a digital camera. In order to acquire high-quality images, the LED illuminating light source 2 and the camera 7 of the digital camera are used as image sensors, the LED illuminating light source 2 is arranged at the top of the closed space 1, and the camera 7 is fixed at a position, opposite to the ruler 4 to be identified, in the closed space 1. The camera 7 is selected according to the requirements of the embedded hardware platform and the embedded operating system. The LED illumination light source 2 is designed according to the image quality requirement, and the LED illumination light source 2 is low in energy consumption, long in service life, easy to obtain, controllable in intensity and convenient to obtain high-quality images for binarization and other processing.
(2) Result display unit
And the result display unit is used for displaying the liquid level ruler image and the liquid level ruler reading result in real time. The result display unit comprises an LCD display screen 3, and the LCD display screen 3 is arranged outside the closed space 1. Through the ruler 4 image of waiting to discern is directly perceived to the demonstration of LCD display screen 3, not only can realize the manual work and read 4 central scales of waiting to discern, make embedded automatic ruler device of reading also can the automatic display reading result moreover.
(3) Image processing unit
As shown in fig. 3, the image processing unit includes an embedded main controller, and the embedded main controller is disposed at the bottom of the enclosed space 1. The data acquisition, processing and transmission parts are integrated in the embedded main controller: the embedded main controller receives the information collected by the camera 7, realizes automatic identification of the scales of the ruler 4 to be identified at the center of the view field of the camera 7, and displays the image of the ruler 4 to be identified and the reading result of the ruler 4 to be identified on the LCD display screen 3. And running a corresponding high-precision identification algorithm according to the characteristics of the acquired ruler 4 image to be identified. The embedded main controller can also be communicated with the upper computer 8 through a network cable or a serial port, so that the remote transmission of the reading result of the ruler 4 to be identified is realized.
The embedded main controller adopts a Mini2440 embedded development board 5 based on an ARM920T platform, an S3C2440 microprocessor 6 is arranged on the Mini2440 embedded development board 5, and a CPU core power supply chip and a reset chip are further arranged to ensure the running stability of the embedded automatic ruler reading device; the Mini2440 embedded development board 5 is powered by a power supply 12. The digital camera is a high-resolution industrial digital camera and is provided with a camera chip capable of being driven under WinCE. The Mini2440 embedded development board 5 receives the information collected by the camera 7 through the USB interface 9, and communicates with the upper computer 8 through the JTAG interface 10 and the serial port 11.
The embedded hardware platform consists of the embedded main controller, the digital camera, the LCD display screen 3, the upper computer 8 and the embedded operating system.
After the embedded automatic ruler reading device based on visual sensing is built, digital images can be acquired, and image recognition is started. The invention relates to a method for an embedded automatic ruler reading device based on visual sensing, which comprises the following steps:
step 1, pretreatment: the original image collected by the camera 7 is preprocessed, so that information irrelevant to the target digital characters in the image is eliminated, the detectability of the target digital characters is enhanced, the data is simplified to the maximum extent, background stray points are removed, and the characteristics of the ruler 4 to be recognized are highlighted. The preprocessing of the original image of the ruler 4 to be recognized is mainly divided into the following steps:
step 1-1, gray level conversion: the image directly acquired by the camera 7 is in colour, and for subsequent image processing speed, the colour image is first converted into a grey-scale image. The invention adopts the average value of the brightness of R (red), G (green) and B (blue) components to carry out gray level processing.
Step 1-2, image binarization: the binarization processing can divide the image f (x, y) into two fields of a target object (the target object is a digital character in the invention) and a background, so that a gray image is changed into a black-white binary image, and the required target object part is separated from the complex image background, thereby being beneficial to the next processing. Considering that the resources of the embedded automatic scale reading device are limited, and the image acquisition unit is in a closed environment and is less interfered by the outside, a static histogram threshold is selected to determine the binarization threshold.
Step 1-3, image corrosion: and removing stray points of the image by adopting a corrosion algorithm, and corroding in the horizontal and vertical directions respectively so as to highlight the digital character characteristics.
Step 1-4, image denoising: the method can overcome the image detail blurring caused by linear filters such as least mean square filtering, mean filtering and the like, and is more effective to filtering pulse interference and image scanning noise.
Step 2, character segmentation: the character segmentation is used for positioning the ruler 4 to be recognized in the image background, and positioning each digital character of the scale value on each integer digit in the ruler 4 to be recognized, as shown in fig. 5, 0062 and 0063 are scale values on the integer digits of the ruler 4 to be recognized, 0 "" 0 "" 6 "" 2 "is each digital character of the scale value 0062, and 0" "0" "6" "3" is each digital character of the scale value 0063.
The method comprises the following specific steps:
and 2-1, segmenting a ruler image area from the background image, finding out the upper edge position and the lower edge position of each digital character of the ruler scale mark and the scale value by using a Canny edge detection operator through a horizontal projection method, and then calibrating the positions of the left and right two centimeter scale marks of the center of the field of view by using a vertical projection method.
And 2-2, accurately positioning each digital character of each scale value, and segmenting all digital characters on all integer digits of the ruler 4 to be recognized.
Firstly, in the vertical height range area of the scale mark of the ruler, each pixel of the image is projected according to columns:
Figure BDA0002210962790000081
wherein F (i) is the total number of pixels in the ith column, f (i, j) is the number of pixels in the jth row in the ith column, and n is the number of the set columns.
The pixel values of each column after projection are counted, and the scale mark of the integer number of the ruler 4 to be recognized is positioned according to the numerical value of the pixel value, and since the scale marks of the integer position are longer than the scale marks of other positions in the ruler 4 to be recognized, the approximate position of the scale value on the integer number in the horizontal direction is positioned by using the point.
And 2, obtaining the vertical position range of the character region according to the upper and lower edge positions of each digit character of the scale values obtained in the step 2-1, and roughly positioning each digit character position of the scale values on the left and right integer digits of the center of the view field by utilizing the vertical position range of the character region and the width of the target character obtained through visual estimation, namely roughly positioning the target character region.
And vertically projecting each pixel point in the character area to obtain a pixel distribution map of each line projection in the character area, and segmenting a single digital character rectangular area according to a pixel distribution difference value, as shown in a gray rectangular box in fig. 5, so as to finish the accurate positioning of each digital character.
And step 3, character recognition: respectively identifying each digit character by adopting a designed algorithm to obtain integral digit scale value readings on the left side and the right side of the center of a view field; then, the decimal place reading can be obtained by dividing the difference value of the pixels of the integral place scale positioned at the left side of the center of the view field by the difference value of the pixels of the integral place scale positioned at the left side and the right side of the center of the view field, and finally the decimal place reading is added to the integral place reading to obtain the reading of the center of the view field.
The digital characters of the measured ruler have regular characters and simple strokes, the stroke elements are similar (all are formed by straight line segments), and the structural features are relatively obvious, as shown in fig. 4. Therefore, the invention designs a simple digital annotation method to complete digital character recognition. After the digital character rectangular area is divided in the step 2, the rectangular area is divided in the vertical and horizontal directions at different positions, the number of points of the pixels which are changed from the pixels of the blank image area to the pixels of the digital character image area or from the pixels of the digital character image area to the pixels of the blank image area are recorded along a single direction according to the difference of the pixels of the blank image area and the digital character image area, and the digital character is recognized according to the difference of the sum of the number of the points of the pixels of the different digital characters on all the vertical and horizontal division straight lines, wherein the points of the pixels of the different digital character areas are changed in a unidirectional alternating manner, and the digital character recognition is realized as shown in fig. 6a-6 b.
By analyzing the features of 0-9, these 10 numbers, the numeric notation can be categorized as follows:
step 3-1, firstly, according to the figures of the digital characters from 0 to 9, selecting two segmentation straight lines in the vertical direction and three segmentation straight lines in the horizontal direction, wherein the segmentation straight lines in the vertical direction are positioned in
Figure BDA0002210962790000091
And
Figure BDA0002210962790000092
at the position of the dividing straight line in the horizontal direction
Figure BDA0002210962790000093
At least one of (1) and (b); edgeThe number of the pixel one-way alternate change points obtained by vertical line scanning is countx1/3Is provided with an edgeThe number of the pixel one-way alternate change points obtained by vertical line scanning is countx1/2Edge of
Figure BDA0002210962790000101
The number of the pixel one-way alternate change points obtained by vertical line scanning is count2/3Edge of
Figure BDA0002210962790000102
The number of the pixel one-way alternate change points obtained by vertical line scanning is count1/2Edge of
Figure BDA0002210962790000103
The number of the pixel one-way alternate change points obtained by vertical line scanning is count1/3
Step 3-2, along withVertical line scan, if countx1/2If the result is 1, the numeric character recognition result is "1" or "4" or "7" and the process goes to step 3-3; if countx1/2If 2, the number character recognition result is 0; if countx1/2If the result is 3, the numeric character recognition result is "2" or "3" or "5" or "6" or "8" or "9" and the process goes to step 3-4;
step 3-3, along with
Figure BDA0002210962790000105
Horizontal line scanning to get a county2/3Number, re-edge
Figure BDA0002210962790000106
Scanning by vertical line to obtain countx1/3Number, if county 2/31, and, countx1/3If the result is 0, the number character recognition result is 1; if county 2/32, and, countx1/3If the number is 1, the number character recognition result is 4; if county2/3=1=countx1/3If the number is 1, the number character recognition result is 7;
step 3-4, along with
Figure BDA0002210962790000107
Horizontal line scanning to get a county2/3Number, re-edge
Figure BDA0002210962790000108
Horizontal line scanning to get a county1/3Number, if county2/3=county1/3If 2, the number character recognition result is 8; if county 2/32, and, county1/3If the number is 1, the number character recognition result is 9; if county 2/31, and, county1/3If 2, the number character recognition result is 6; fruit county2/3=county1/3If the result is 1, the numeric character recognition result is "2" or "3" or "5" and the process goes to step 3-5;
step 3-5, along with
Figure BDA0002210962790000109
From numerical characters at height
Figure BDA00022109627900001010
Horizontal line left at width, county1/3Counting and then
Figure BDA00022109627900001011
From numerical characters at height
Figure BDA00022109627900001012
Scanning the horizontal line to the right at the width to obtain the county2/3Number, if county1/3=county2/3If the number is 1, the number character recognition result is 2; if county1/30, and, county2/3If the number is 1, the number character recognition result is 3; if county1/30, and, county2/3If 0, the numeric character recognition result is "5".
By adopting the digital annotation method, the specific characteristics of each character can be comprehensively considered to distinguish different points, a large number of numbers do not need to be learned and counted, the operation efficiency is high, and the method is suitable for an embedded system. Under the condition of stable movement of the ruler, the character recognition rate can reach more than 99%.
Although the preferred embodiments of the present invention have been described above with reference to the accompanying drawings, the present invention is not limited to the above-described embodiments, which are merely illustrative and not restrictive, and those skilled in the art can make many modifications without departing from the spirit and scope of the present invention as defined in the appended claims.

Claims (9)

1. An embedded automatic ruler reading device based on visual sensing is characterized in that the embedded automatic ruler reading device is arranged in a closed space (1), and a ruler (4) to be identified is fixed on the inner side wall of the closed space (1); the embedded automatic ruler reading device comprises:
the image acquisition unit comprises an LED illumination light source (2) and a digital camera, the LED illumination light source (2) is arranged at the top of the closed space (1), and a camera (7) of the digital camera is fixed in the closed space (1) at a position opposite to the ruler (4) to be identified;
a result display unit comprising an LCD display screen (3), said LCD display screen (3) being arranged outside said enclosed space (1); and the number of the first and second groups,
the image processing unit comprises an embedded main controller and an upper computer (8), the embedded main controller receives information collected by the camera (7) and displays an image of the ruler (4) to be identified and a reading result of the ruler (4) to be identified on the LCD display screen (3); the embedded main controller is communicated with the upper computer (8) to realize remote transmission of the reading result of the ruler (4) to be identified.
2. The embedded automatic ruler reading device based on visual sensing of claim 1, wherein the digital camera is equipped with a camera chip capable of being driven under WinCE.
3. The embedded automatic ruler reading device based on the visual sensing of claim 1, wherein the embedded main controller adopts a Mini2440 embedded development board (5) based on an ARM920T platform, an S3C2440 microprocessor (6) for data processing, a CPU core power chip for ensuring the running stability of the embedded automatic ruler reading device and a reset chip are arranged on the Mini2440 embedded development board (5).
4. The embedded automatic ruler reading device based on visual sensing of claim 3, wherein the Mini2440 embedded development board (5) receives the information collected by the camera (7) through a USB interface (9); the Mini2440 embedded development board (5) is communicated with the upper computer (8) through a JTAG interface (10) and a serial port (11).
5. A visual-sensing-based embedded automatic ruler reading method, which is characterized in that the visual-sensing-based embedded automatic ruler reading device according to any one of claims 1-4 is adopted, and the embedded automatic ruler reading method comprises the following steps:
step 1, pretreatment: preprocessing an original image acquired by the camera (7), thereby eliminating information irrelevant to the target digital character in the image, enhancing the detectability of the target digital character, simplifying data, removing background stray points, and highlighting the characteristics of the ruler (4) to be recognized;
step 2, character segmentation: positioning the ruler (4) to be recognized in the image background, and positioning each digital character of the scale value on each integer digit in the ruler (4) to be recognized;
and step 3, character recognition: respectively identifying each digital character by adopting a digital notation method to obtain integer scale value readings on the left side and the right side of the center of the view field, dividing a pixel difference value of the integer scale on the left side of the center of the view field by a pixel difference value of two integer scale on the left side and the right side of the center of the view field to obtain a decimal reading, and finally adding the decimal reading to the integer reading to obtain the reading of the center of the view field.
6. The method according to claim 5, wherein in step 1, the preprocessing specifically comprises:
step 1-1, gray level conversion: converting the color image collected by the camera (7) into a gray image;
step 1-2, image binarization: changing the gray level image into a black-white binary image by binarization processing, and separating digital characters from an image background;
step 1-3, image corrosion: removing stray points of the image by adopting a corrosion algorithm, and corroding in the horizontal and vertical directions respectively so as to highlight the characteristics of the digital characters;
step 1-4, image denoising: and removing the image noise points by adopting median filtering.
7. The embedded automatic ruler reading method based on visual sensing of claim 5, wherein in the step 2, the character segmentation specifically comprises:
step 2-1, segmenting a ruler image area from a background image, finding out the upper edge position and the lower edge position of each digital character of a ruler scale mark and a scale value by using a Canny edge detection operator through a horizontal projection method, and then calibrating the positions of two centimeter scale marks on the left side and the right side of the center of a view field through a vertical projection method;
2-2, accurately positioning each digit character of each scale value, and segmenting all digit characters on all integer digits of the ruler (4) to be recognized, wherein the steps comprise:
step 2-2-1, firstly, in the vertical height range area of the scale mark of the ruler, projecting each pixel of the image according to columns:
Figure FDA0002210962780000021
wherein F (i) is the sum of the number of pixels in the ith column, f (i, j) is the number of pixels in the jth row in the ith column, and n is the set number of columns;
step 2-2-2, counting the pixel values of each row after projection, positioning the scale mark of the integer digit of the ruler (4) to be identified according to the value of the pixel value, and positioning the approximate position of the scale value on the integer digit in the horizontal direction;
2-2-3, obtaining the vertical position range of the character region according to the upper and lower edge positions of each digital character of the scale values obtained in the step 2-1, and roughly positioning the position of each digital character of the left and right integer scale values of the center of the view field by utilizing the vertical position range of the character region and the width of a single character obtained by visual estimation;
and 2-2-4, vertically projecting each pixel point in the character region to obtain a pixel distribution map of each row of projection in the character region, and segmenting a single digital character rectangular region according to a pixel distribution difference value to finish the accurate positioning of each digital character.
8. The embedded automatic ruler reading method based on visual sensing of claim 5, wherein in step 3, the digital annotation method is adopted to identify each digital character as follows: and 2, after the rectangular region of the digital character is segmented in the step 2, segmenting the rectangular region in the vertical and horizontal directions at different positions, recording the number of points which are changed from the pixels of the blank image region to the pixels of the digital character image region or from the pixels of the digital character image region to the pixels of the blank image region in a one-way alternate manner along the single direction according to the difference of the pixels of the blank image region and the digital character image region, and realizing the identification of the digital character according to the difference of the sum of the number of the points which are changed from the pixels of the blank image region to the pixels of the digital character image region in the one-way alternate manner of the pixels of all the segmenting lines of the digital character in the.
9. The method according to claim 8, wherein the step of identifying each numeric character by using a numeric notation method comprises:
step 3-1, according to the figures of the digital characters from 0 to 9, selecting two segmentation straight lines in the vertical direction and three segmentation straight lines in the horizontal direction, wherein the segmentation straight lines in the vertical direction are positioned in
Figure FDA0002210962780000031
And
Figure FDA0002210962780000032
at the position of the dividing straight line in the horizontal direction
Figure FDA0002210962780000033
At least one of (1) and (b); edge
Figure FDA0002210962780000034
The number of the pixel one-way alternate change points obtained by vertical line scanning is countx1/3Is provided with an edge
Figure FDA0002210962780000035
The number of the pixel one-way alternate change points obtained by vertical line scanning is countx1/2Edge of
Figure FDA0002210962780000036
The number of the pixel one-way alternate change points obtained by vertical line scanning is count2/3Edge of
Figure FDA0002210962780000037
The number of the pixel one-way alternate change points obtained by vertical line scanning is count1/2Edge of
Figure FDA0002210962780000038
The number of the pixel one-way alternate change points obtained by vertical line scanning is count1/3
Step 3-2, along withVertical line scan, if countx1/2If the result is 1, the numeric character recognition result is "1" or "4" or "7" and the process goes to step 3-3; if countx1/2If 2, the number character recognition result is 0; if countx1/2If the result is 3, the numeric character recognition result is "2" or "3" or "5" or "6" or "8" or "9" and the process goes to step 3-4;
step 3-3, along with
Figure FDA0002210962780000041
Horizontal line scanning to get a county2/3Number, re-edge
Figure FDA0002210962780000042
Scanning by vertical line to obtain countx1/3Number, if county2/31, and, countx1/3If the result is 0, the number character recognition result is 1; if county2/32, and, countx1/3If the number is 1, the number character recognition result is 4; if county2/3=1=countx1/3If the number is 1, the number character recognition result is 7;
step 3-4, along with
Figure FDA0002210962780000043
Horizontal line scanning to get a county2/3Number, re-edge
Figure FDA0002210962780000044
Horizontal line scanning to get a county1/3Number, if county2/3=county1/3If 2, the number character recognition result is 8; if county2/32, and, county1/3If the number is 1, the number character recognition result is 9; if county2/31, and, county1/3If 2, the number character recognition result is 6; fruit county2/3=county1/3If the result is 1, the numeric character recognition result is "2" or "3" or "5" and the process goes to step 3-5;
step 3-5, along with
Figure FDA0002210962780000045
From numerical characters at height
Figure FDA0002210962780000046
Horizontal line left at width, county1/3Counting and thenFrom numerical characters at height
Figure FDA0002210962780000048
Scanning the horizontal line to the right at the width to obtain the county2/3Number, if county1/3=county2/3If the number is 1, the number character recognition result is 2; if county1/30, and, county2/3If the number is 1, the number character recognition result is 3; if county1/30, and, county2/3If 0, the numeric character recognition result is "5".
CN201910898244.9A 2019-09-23 2019-09-23 Embedded automatic ruler reading device and method based on visual sensing Pending CN110688996A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910898244.9A CN110688996A (en) 2019-09-23 2019-09-23 Embedded automatic ruler reading device and method based on visual sensing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910898244.9A CN110688996A (en) 2019-09-23 2019-09-23 Embedded automatic ruler reading device and method based on visual sensing

Publications (1)

Publication Number Publication Date
CN110688996A true CN110688996A (en) 2020-01-14

Family

ID=69109799

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910898244.9A Pending CN110688996A (en) 2019-09-23 2019-09-23 Embedded automatic ruler reading device and method based on visual sensing

Country Status (1)

Country Link
CN (1) CN110688996A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112033250A (en) * 2020-10-26 2020-12-04 湖南大学 Automatic calibrating device and calibrating method for steel ruler
CN112525042A (en) * 2020-12-29 2021-03-19 华侨大学 Visual micrometer for precisely measuring inner and outer diameters and wall thickness of hollow pipe
CN113566669A (en) * 2021-09-01 2021-10-29 武汉韵之鑫金属科技有限公司 Measuring tool for machining stainless steel plate
CN115014142A (en) * 2022-05-27 2022-09-06 河南大学 Steel tape scale error measuring method based on machine vision

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103177261A (en) * 2013-03-06 2013-06-26 北方民族大学 Image-recognition-technology-based cow milk yield auto-metering system and image recognition method therefor
CN108133216A (en) * 2017-11-21 2018-06-08 武汉中元华电科技股份有限公司 The charactron Recognition of Reading method that achievable decimal point based on machine vision is read

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103177261A (en) * 2013-03-06 2013-06-26 北方民族大学 Image-recognition-technology-based cow milk yield auto-metering system and image recognition method therefor
CN108133216A (en) * 2017-11-21 2018-06-08 武汉中元华电科技股份有限公司 The charactron Recognition of Reading method that achievable decimal point based on machine vision is read

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
宋乐等: "基于视觉传感的嵌入式自动读尺系统", 《传感器与微系统》 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112033250A (en) * 2020-10-26 2020-12-04 湖南大学 Automatic calibrating device and calibrating method for steel ruler
CN112033250B (en) * 2020-10-26 2021-02-02 湖南大学 Automatic calibrating device and calibrating method for steel ruler
CN112525042A (en) * 2020-12-29 2021-03-19 华侨大学 Visual micrometer for precisely measuring inner and outer diameters and wall thickness of hollow pipe
CN113566669A (en) * 2021-09-01 2021-10-29 武汉韵之鑫金属科技有限公司 Measuring tool for machining stainless steel plate
CN115014142A (en) * 2022-05-27 2022-09-06 河南大学 Steel tape scale error measuring method based on machine vision

Similar Documents

Publication Publication Date Title
CN110688996A (en) Embedded automatic ruler reading device and method based on visual sensing
CN103207987B (en) A kind of registration recognition methods of pointer instrument
CN111239158A (en) Automobile instrument panel detection system and detection method based on machine vision
CN102914545B (en) Gear defect detection method and system based on computer vision
CN103499303B (en) A kind of wool fineness method for automatic measurement
CN103196917B (en) Based on online roll bending material surface blemish detection system and the detection method thereof of CCD line-scan digital camera
CN103424409B (en) Vision detecting system based on DSP
CN107358627B (en) Fruit size detection method based on Kinect camera
CN106248686A (en) Glass surface defects based on machine vision detection device and method
CN109255787A (en) Silk ingot scratch detection system and method based on deep learning and image processing techniques
CN107014819A (en) A kind of solar panel surface defects detection system and method
CN105574161B (en) A kind of brand logo key element recognition methods, device and system
CN105300854A (en) Fog drop parameter measurement device and fog drop parameter measurement analysis method using device
CN109284718B (en) Inspection robot-oriented variable-view-angle multi-instrument simultaneous identification method
CN110567976B (en) Mobile phone cover plate silk-screen defect detection device and detection method based on machine vision
CN102565062B (en) Method for testing turbidity of liquid based on detection of image gray
CN106855951A (en) A kind of grain kind quality detecting method based on computer vision
CN105509659A (en) Image-processing-based flatness detection system
CN102988052B (en) Method and system for measuring foot length
CN106845545B (en) Image recognition method and device in automatic digital electric meter calibration device
CN107891012B (en) Pearl size and circularity sorting device based on equivalent algorithm
CN110940670B (en) Machine vision-based flexographic printing label printing first manuscript detection system and implementation method thereof
CN105423975A (en) Calibration system and method of large-size workpiece
CN202267464U (en) Mobile phone based device for rapidly detecting blade area
CN103824113A (en) Printed paper product number identification apparatus based on image identification technology, and identification method thereof

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20200114

WD01 Invention patent application deemed withdrawn after publication