TWI608422B - Optical character recognition device, optical character recognition method, and recording medium - Google Patents

Optical character recognition device, optical character recognition method, and recording medium Download PDF

Info

Publication number
TWI608422B
TWI608422B TW103124333A TW103124333A TWI608422B TW I608422 B TWI608422 B TW I608422B TW 103124333 A TW103124333 A TW 103124333A TW 103124333 A TW103124333 A TW 103124333A TW I608422 B TWI608422 B TW I608422B
Authority
TW
Taiwan
Prior art keywords
character string
candidate
date
container
character
Prior art date
Application number
TW103124333A
Other languages
Chinese (zh)
Other versions
TW201506800A (en
Inventor
Mei Zhang
Keigo Nakamura
Original Assignee
Yuyama Mfg Co Ltd
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 Yuyama Mfg Co Ltd filed Critical Yuyama Mfg Co Ltd
Publication of TW201506800A publication Critical patent/TW201506800A/en
Application granted granted Critical
Publication of TWI608422B publication Critical patent/TWI608422B/en

Links

Classifications

    • 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/18Extraction of features or characteristics of the image
    • G06V30/1801Detecting partial patterns, e.g. edges or contours, or configurations, e.g. loops, corners, strokes or intersections
    • G06V30/18019Detecting partial patterns, e.g. edges or contours, or configurations, e.g. loops, corners, strokes or intersections by matching or filtering
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61JCONTAINERS SPECIALLY ADAPTED FOR MEDICAL OR PHARMACEUTICAL PURPOSES; DEVICES OR METHODS SPECIALLY ADAPTED FOR BRINGING PHARMACEUTICAL PRODUCTS INTO PARTICULAR PHYSICAL OR ADMINISTERING FORMS; DEVICES FOR ADMINISTERING FOOD OR MEDICINES ORALLY; BABY COMFORTERS; DEVICES FOR RECEIVING SPITTLE
    • A61J2200/00General characteristics or adaptations
    • A61J2200/70Device provided with specific sensor or indicating means
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61JCONTAINERS SPECIALLY ADAPTED FOR MEDICAL OR PHARMACEUTICAL PURPOSES; DEVICES OR METHODS SPECIALLY ADAPTED FOR BRINGING PHARMACEUTICAL PRODUCTS INTO PARTICULAR PHYSICAL OR ADMINISTERING FORMS; DEVICES FOR ADMINISTERING FOOD OR MEDICINES ORALLY; BABY COMFORTERS; DEVICES FOR RECEIVING SPITTLE
    • A61J2205/00General identification or selection means
    • A61J2205/30Printed labels
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61JCONTAINERS SPECIALLY ADAPTED FOR MEDICAL OR PHARMACEUTICAL PURPOSES; DEVICES OR METHODS SPECIALLY ADAPTED FOR BRINGING PHARMACEUTICAL PRODUCTS INTO PARTICULAR PHYSICAL OR ADMINISTERING FORMS; DEVICES FOR ADMINISTERING FOOD OR MEDICINES ORALLY; BABY COMFORTERS; DEVICES FOR RECEIVING SPITTLE
    • A61J7/00Devices for administering medicines orally, e.g. spoons; Pill counting devices; Arrangements for time indication or reminder for taking medicine
    • A61J7/0015Devices specially adapted for taking medicines
    • A61J7/0046Cups, bottles or bags
    • 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)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Character Input (AREA)
  • Character Discrimination (AREA)
  • Image Analysis (AREA)
  • Medical Preparation Storing Or Oral Administration Devices (AREA)

Description

光學文字識別裝置、光學文字識別方法及記錄媒體 Optical character recognition device, optical character recognition method and recording medium

本發明係關於一種光學地識別字符串之光學文字識別裝置,尤其係關於一種識別表示日期之字符串之光學文字識別裝置。又,本發明係關於一種用以識別表示日期之字符串之光學文字識別方法、電腦程式及記錄媒體。 The present invention relates to an optical character recognition apparatus for optically recognizing a character string, and more particularly to an optical character recognition apparatus for recognizing a character string representing a date. Further, the present invention relates to an optical character recognition method, a computer program, and a recording medium for identifying a character string representing a date.

對於光學地識別列印於藥品之容器上之文字的裝置存在需求(參照專利文獻1)。例如於將暫時運送至病房而結果未使用之注射劑等藥品退還至保管庫之情形時,為了於下次使用時迅速且無誤地取出該藥品,必須根據藥品之種類、名稱及使用期限等進行分類而進行保管。若使用光學文字識別裝置,實現自動地進行該分類之退還裝置,則對於作業之效率化及錯誤之削減而言較為有效。又,由於在使用此種退還裝置保管藥品之情形時,記錄有藥品之保管場所,因此於下次使用時,亦可根據處方自動地取出恰當之藥品。 There is a need for an apparatus for optically identifying a character printed on a container of a medicine (refer to Patent Document 1). For example, when a drug such as an injection that has not been used for temporary delivery to a ward is returned to the storage, the medicine must be sorted according to the type, name, and expiration date of the medicine in order to promptly and unambiguously take out the medicine for the next use. And keep it. When an optical character recognition device is used and a return device that automatically performs the classification is realized, it is effective for work efficiency and reduction of errors. Moreover, since the storage place of the medicine is recorded when the medicine is stored by using such a returning device, the appropriate medicine can be automatically taken out according to the prescription at the time of the next use.

[先前技術文獻] [Previous Technical Literature] [專利文獻] [Patent Literature]

[專利文獻1]日本專利第4857768號公報。 [Patent Document 1] Japanese Patent No. 4857768.

於藉由光學文字識別裝置而光學地識別字符串之情形時,存在因字符串之圖像中所含之各種雜訊而產生誤識別之可能性。為了提高 識別之精度,必須預先自圖像去除雜訊。 When the character string is optically recognized by the optical character recognition device, there is a possibility that erroneous recognition occurs due to various noises contained in the image of the character string. To improve The accuracy of the recognition must be removed from the image in advance.

本發明解決以上問題,提供一種能以高於先前之精度識別表示日期之字符串的光學文字識別裝置、光學文字識別方法、電腦程式及記錄媒體。 The present invention solves the above problems, and provides an optical character recognition device, an optical character recognition method, a computer program, and a recording medium capable of recognizing a character string indicating a date higher than the previous precision.

根據本發明之第1態樣之光學文字識別裝置,其係光學地識別字符串者,上述光學文字識別裝置之特徵在於包括:第1處理機構,其自輸入圖像提取包含識別對象之對象物之目標區域;第2處理機構,其自上述目標區域所含之對象物中,提取包含至少1個字符串候補之對象物之候補對象物;及第3處理機構,其進行上述候補對象物之標記,並提取沿預先規定之方向延伸且相互鄰近之複數個對象物作為上述字符串候補,判斷上述字符串候補是否具有包含表示年之2位或4位數字、表示月之1位或2位數字、及預先規定之標點符號的日期之圖案,於上述字符串候補具有上述日期之圖案時,將上述字符串候補識別為日期。 According to the optical character recognition device of the first aspect of the present invention, the optical character recognition device is characterized in that the optical character recognition device includes a first processing unit that extracts an object including the recognition target from the input image. a target region; a second processing unit that extracts a candidate object including at least one character string candidate from the object included in the target region; and a third processing unit that performs the candidate object Marking, and extracting a plurality of objects extending in a predetermined direction and adjacent to each other as the character string candidate, and determining whether the character string candidate has a 2-digit or 4-digit number indicating a year, indicating 1 or 2 digits of the month The pattern of the number and the date of the predetermined punctuation mark recognizes the character string candidate as a date when the character string candidate has the pattern of the date.

根據本發明之第2態樣之光學文字識別裝置,其係如第1態樣之光學文字識別裝置,其特徵在於:上述第2處理機構係:檢測上述目標區域中所含之對象物之輪廓及邊緣,提取具有相互重合之輪廓及邊緣之對象物作為上述候補對象物。 An optical character recognition device according to a second aspect of the present invention is the optical character recognition device according to the first aspect, characterized in that the second processing means detects an outline of an object included in the target region. And an edge, and an object having contours and edges overlapping each other is extracted as the candidate object.

根據本發明之第3態樣之光學文字識別裝置,其係如第2態樣之光學文字識別裝置,其特徵在於:上述第2處理機構係:對上述目標區域應用索貝爾濾波法(Sobel Filter)而檢測第1邊 緣,對上述第1邊緣之附近之區域應用坎尼濾波法(Canny Filter)而檢測第2邊緣,使用上述第2邊緣作為上述目標區域中所含之對象物之邊緣。 An optical character recognition device according to a third aspect of the present invention is the optical character recognition device according to the second aspect, characterized in that the second processing means is: applying a Sobel filter to the target region (Sobel Filter) ) and detect the first side The edge is detected by applying a Canny filter to a region in the vicinity of the first edge, and the second edge is used as an edge of the object included in the target region.

根據本發明之第4態樣之光學文字識別裝置,其係如第1~第3中任一態樣之光學文字識別裝置,其特徵在於:上述第3處理機構係:進行上述字符串候補之對象物之標記並提取複數個文字候補,產生複數個限界框,該等複數個限界框分別為具有與上述字符串候補延伸之方向平行之寬度及與上述字符串候補延伸之方向正交之高度的矩形形狀,且分別包圍上述各文字候補,將上述各限界框以該限界框之高度越低則越擴大該限界框之寬度之方式變形,提取藉由變形而連結之限界框中所含之文字候補之組作為新的字符串候補。 An optical character recognition device according to a fourth aspect of the present invention, characterized in that the third processing means is configured to perform the character string candidate Marking the object and extracting a plurality of character candidates, generating a plurality of bounding boxes, wherein the plurality of bounding boxes respectively have a width parallel to a direction in which the character string candidates extend and a height orthogonal to a direction in which the character string candidates extend And each of the bounding frames is deformed so as to increase the width of the bounding frame as the height of the bounding frame is lower, and the bounding box included in the bounding box connected by the deformation is extracted. The group of text candidates is used as a new string candidate.

根據本發明之第5態樣之光學文字識別裝置,其係如第1~第4中任一態樣之光學文字識別裝置,其特徵在於:上述第3處理機構係:進行上述字符串候補之對象物之標記並提取複數個文字候補,刪除包含多於10個之文字候補之字符串候補。 An optical character recognition device according to a fifth aspect of the present invention, characterized in that the third processing means is configured to perform the character string candidate. Marking the object and extracting a plurality of character candidates, and deleting the character string candidates including more than 10 character candidates.

根據本發明之第6態樣之光學文字識別裝置,其係如第1~第5中任一態樣之光學文字識別裝置,其特徵在於:上述第3處理機構係:進行上述字符串候補之對象物之標記並提取複數個文字候補,僅刪除包含於與上述字符串候補延伸之方向正交之方向上包含2個以上對象物的文字候補之字符串候補。 An optical character recognition device according to a sixth aspect of the present invention, characterized in that the third processing means is configured to perform the character string candidate. The object object is marked and a plurality of character candidates are extracted, and only the character string candidates including the character candidates including two or more objects in the direction orthogonal to the direction in which the character string candidates extend are deleted.

根據本發明之第7態樣之光學文字識別裝置,其係如第1~第6中任一態樣之光學文字識別裝置,其特徵在於:上述第3處理機構係:檢測上述字符串候補之對象物之輪廓及邊緣,刪除上述邊緣之像素與上述輪廓之像素一致之部分為上述邊緣之像素之面積之60%以下的字符串候補。 An optical character recognition device according to a seventh aspect of the present invention, characterized in that the third processing means is configured to detect the character string candidate The outline and the edge of the object are deleted from the pixel of the edge and the pixel of the outline is a character string candidate of 60% or less of the area of the pixel of the edge.

根據本發明之第8態樣之光學文字識別裝置,其係如第1~第7中任一態樣之光學文字識別裝置,其特徵在於:上述第3處理機構係於上述字符串候補包含明顯不會誤認為數字之英文文字時,將上述字符串候補識別為非日期。 An optical character recognition device according to an eighth aspect of the present invention, characterized in that the third processing means includes the string candidate When the English character of the number is not mistaken, the above character string candidate is recognized as a non-date.

根據本發明之第9態樣之光學文字識別裝置,其係如第1~第8中任一態樣之光學文字識別裝置,其特徵在於:上述第3處理機構係於上述字符串候補包含表示月之2個數字、及接續於表示上述月之2個數字之後的至少1個其他文字時,且於表示上述月之2個數字間之距離大於表示上述月之2個數字與其他文字之距離及上述其他文字間之距離之平均值時,去除表示上述月之2個數字之1位數字及上述其他文字。 An optical character recognition device according to a ninth aspect of the present invention, characterized in that the third processing means includes the character string candidate 2 digits of the month, and at least one other character following the 2 digits of the month, and the distance between the 2 digits of the month is greater than the distance between the 2 digits of the month and other characters When the average value of the distance between the other characters is the same, the one-digit number indicating the two digits of the month and the other characters are removed.

根據本發明之第10態樣之光學文字識別裝置,其係如第1~第9中任一態樣之光學文字識別裝置,其特徵在於:上述輸入圖像係可旋轉地被保持之圓筒形狀之容器的圖像。 An optical character recognition device according to a tenth aspect of the present invention, characterized in that the input image is a cylinder that is rotatably held An image of a shape container.

根據本發明之第11態樣之光學文字識別裝置,其係如第10態樣之光學文字識別裝置,其特徵在於:上述第1處理機構係自上述輸入圖像中提取包含沿實質上與上述圓筒形狀之容器之旋轉軸正交之方向延伸的邊緣、及亮度高於預先規定之閾值之部分之區域,作為上述目標區域。 An optical character recognition device according to an eleventh aspect of the present invention, characterized in that the first processing means extracts the input image from the input image substantially An edge extending in a direction in which the rotation axis of the cylindrical container is orthogonal to each other and a region having a luminance higher than a predetermined threshold value are used as the target region.

根據本發明之第12態樣之光學文字識別裝置,其係如第10或第11 態樣之光學文字識別裝置,上述光學文字識別裝置之特徵在於:取得一面使上述容器旋轉一面拍攝之分別表示上述容器之不同角度之複數個輸入圖像,上述第3處理機構於1個輸入圖像之字符串候補僅包含「1」作為表示月之數字時,判斷其他輸入圖像之字符串候補是否僅包含「1」作為表示月之數字。 An optical character recognition device according to a twelfth aspect of the present invention is the tenth or eleventh An optical character recognition device according to the aspect of the invention, characterized in that the optical character recognition device is configured to obtain a plurality of input images respectively indicating different angles of the container while rotating the container, and the third processing mechanism is in one input image When the character string candidate contains only "1" as the number indicating the month, it is determined whether or not the character string candidate of the other input image contains only "1" as the number indicating the month.

根據本發明之第13態樣之光學文字識別裝置,其係如第10~第12中任一態樣之光學文字識別裝置,上述光學文字識別裝置之特徵在於包括:相機;攝影台,其係以可繞上述圓筒形狀之容器之旋轉軸旋轉之方式保持上述容器;及移動裝置,其使上述容器於至少1個保管庫與上述攝影台之間移動;且於上述容器上列印有表示上述容器中之藥品之使用期限之日期的字符串。 According to a thirteenth aspect of the present invention, there is provided an optical character recognition device according to any one of the tenth to twelfth aspects, wherein the optical character recognition device comprises: a camera; a photographing station; Holding the container so as to be rotatable about a rotation axis of the cylindrical container; and moving the device to move the container between at least one of the storage and the photographing table; and printing on the container A string of the date of use of the drug in the above container.

根據本發明之第14態樣之光學文字識別方法,其係光學地識別字符串者,上述光學文字識別方法之特徵在於包括:第1步驟,其係自輸入圖像提取包含識別對象之對象物之目標區域;第2步驟,其係自上述目標區域所含之對象物中,提取包含至少1個字符串候補之對象物之候補對象物;及第3步驟,其係進行上述候補對象物之標記,並提取沿預先規定之方向延伸且相互鄰近之複數個對象物作為上述字符串候補,判斷上述字符串候補是否具有包含表示年之2位或4位數字、表示月之1位或2 位數字、及預先規定之標點符號的日期之圖案,於上述字符串候補具有上述日期之圖案時,將上述字符串候補識別為日期。 According to a fourteenth aspect of the present invention, an optical character recognition method for optically recognizing a character string, wherein the optical character recognition method includes the first step of extracting an object including an identification object from an input image. a target region; a second step of extracting a candidate object including at least one character string candidate from the object included in the target region; and a third step of performing the candidate object Marking and extracting a plurality of objects extending in a predetermined direction and adjacent to each other as the character string candidate, and determining whether the character string candidate has a 2-digit or 4-digit number indicating the year, and indicates 1 or 2 of the month. The pattern of the digits and the date of the predetermined punctuation mark recognizes the character string candidate as a date when the character string candidate has the pattern of the date.

根據本發明之第15態樣之電腦程式,其係於藉由電腦而被執行時光學地識別字符串之電腦程式,上述電腦程式之特徵在於包括:第1步驟,其係自輸入圖像提取包含識別對象之對象物之目標區域;第2步驟,其係自上述目標區域所含之對象物中,提取包含至少1個字符串候補之對象物之候補對象物;及第3步驟,其係進行上述候補對象物之標記,並提取沿預先規定之方向延伸且相互鄰近之複數個對象物作為上述字符串候補,判斷上述字符串候補是否具有包含表示年之2位或4位數字、表示月之1位或2位數字、及預先規定之標點符號的日期之圖案,於上述字符串候補具有上述日期之圖案時,將上述字符串候補識別為日期。 A computer program according to a fifteenth aspect of the present invention, which is a computer program for optically recognizing a character string when executed by a computer, the computer program comprising: the first step of extracting from an input image a target region including an object to be identified; and a second step of extracting a candidate object including at least one character string candidate from the object included in the target region; and a third step Marking the candidate object, extracting a plurality of objects extending in a predetermined direction and adjacent to each other as the character string candidate, and determining whether the character string candidate includes a 2-digit or 4-digit number indicating the year, indicating the month The one or two digits and the pattern of the date of the predetermined punctuation mark recognize the character string candidate as the date when the character string candidate has the pattern of the date.

根據本發明之第16態樣之記錄媒體,其係儲存有於藉由電腦而被執行時光學地識別字符串之電腦程式之電腦可讀取之記錄媒體,其特徵在於上述電腦程式包括:第1步驟,其係自輸入圖像提取包含識別對象之對象物之目標區域;第2步驟,其係自上述目標區域所含之對象物中,提取包含至少1個字符串候補之對象物之候補對象物;及第3步驟,其係進行上述候補對象物之標記,並提取沿預先規定之方向延伸且相互鄰近之複數個對象物作為上述字符串候補,判斷上述字符串候補是否具有包含表示年之2位或4位數字、表示月之1位或2位數字、及預先規定之標點符號的日期之圖案,於上述字符串候補具有上述日期之圖案時,將上述字符串候補識別為日期。 A recording medium according to a sixteenth aspect of the present invention, which is a computer-readable recording medium storing a computer program for optically recognizing a character string when executed by a computer, wherein the computer program comprises: a first step of extracting a target region including an object to be recognized from the input image; and a second step of extracting an candidate including at least one character string candidate from the object included in the target region And a third step of performing marking of the candidate object, extracting a plurality of objects extending in a predetermined direction and adjacent to each other as the character string candidate, and determining whether the character string candidate has a representation year The pattern of the two or four digits, the one or two digits of the month, and the date of the predetermined punctuation mark, when the character string candidate has the pattern of the date, recognizes the character string candidate as the date.

根據本發明之第17態樣之光學文字識別裝置,其係如第1~第13中任一態樣之光學文字識別裝置,上述光學文字識別裝置之特徵在於:取得一面使上述容器旋轉一面拍攝之分別表示上述容器之不同角度之複數個輸入圖像,並連結上述複數個輸入圖像。 An optical character recognition device according to a seventeenth aspect of the present invention, wherein the optical character recognition device is characterized in that: the optical character recognition device is configured to take a side of the container while rotating A plurality of input images representing different angles of the containers are respectively connected to the plurality of input images.

本發明之光學文字識別裝置、光學文字識別方法、電腦程式及記錄媒體能以高於先前之精度識別表示日期之字符串。 The optical character recognition device, the optical character recognition method, the computer program, and the recording medium of the present invention can recognize a character string indicating a date higher than the previous precision.

1‧‧‧控制裝置 1‧‧‧Control device

2‧‧‧軌道 2‧‧‧ Track

3‧‧‧移動裝置 3‧‧‧Mobile devices

4~6‧‧‧相機 4~6‧‧‧ camera

7a、7b‧‧‧照明裝置 7a, 7b‧‧‧ lighting fixtures

8a、8b‧‧‧滾筒 8a, 8b‧‧‧roller

9‧‧‧個人電腦(PC) 9‧‧‧Personal Computer (PC)

10‧‧‧記錄媒體 10‧‧‧Recording media

11、12‧‧‧托盤 11, 12‧‧‧ tray

13、13a~13d‧‧‧容器 13, 13a~13d‧‧‧ containers

21‧‧‧目標區域 21‧‧‧ Target area

22‧‧‧經修整之目標區域 22‧‧‧Fixed target area

31‧‧‧字符串候補光罩 31‧‧‧String candidate mask

41‧‧‧字符串候補之限界框 41‧‧‧Boundary bounds for string candidates

41a、41b‧‧‧新的字符串候補之限界框 41a, 41b‧‧‧ new string candidate bounding box

42、42a‧‧‧文字候補之限界框 42. 42a‧‧‧ bounds box

43‧‧‧變形之文字候補之限界框 43‧‧‧The bounding box of the text of the variant

51‧‧‧文字候補 51‧‧‧ text alternate

D1~D10‧‧‧距離 D1~D10‧‧‧Distance

h1、h2‧‧‧高度 H1, h2‧‧‧ height

S1~S118‧‧‧步驟 S1~S118‧‧‧Steps

w1、w2‧‧‧寬度 W1, w2‧‧‧ width

圖1係表示本發明之第1實施形態之光學文字識別裝置之構成的方塊圖。 Fig. 1 is a block diagram showing the configuration of an optical character recognition device according to a first embodiment of the present invention.

圖2係表示第1例之列印有字符串之容器13a的俯視圖。 Fig. 2 is a plan view showing a container 13a in which a character string is printed in the first example.

圖3係表示第2例之列印有字符串之容器13b的俯視圖。 Fig. 3 is a plan view showing a container 13b in which a character string is printed in the second example.

圖4係表示第3例之列印有字符串之容器13c的俯視圖。 Fig. 4 is a plan view showing a container 13c in which a character string is printed in the third example.

圖5係表示第4例之列印有字符串之容器13d的俯視圖。 Fig. 5 is a plan view showing a container 13d in which a character string is printed in the fourth example.

圖6係表示藉由圖1之控制裝置1執行之日期檢測處理的流程圖。 Fig. 6 is a flow chart showing the date detecting process executed by the control device 1 of Fig. 1.

圖7係表示圖6之步驟S2中之目標區域提取處理之次常式的流程圖。 Fig. 7 is a flow chart showing the subroutine of the target region extraction processing in step S2 of Fig. 6.

圖8係表示圖6之步驟S4中之候補對象物提取處理之次常式的流程圖。 FIG. 8 is a flowchart showing a subroutine of the candidate object extraction processing in step S4 of FIG. 6.

圖9係表示圖6之步驟S6中之OCR處理之次常式的流程圖。 Fig. 9 is a flow chart showing the subroutine of the OCR processing in step S6 of Fig. 6.

圖10係表示圖9之步驟S51、S53、S55、S57中之OCR次常式之第1部分的流程圖。 Fig. 10 is a flow chart showing the first part of the OCR subroutine in steps S51, S53, S55, and S57 of Fig. 9.

圖11係表示圖9之步驟S51、S53、S55、S57中之OCR次常式之第2部分的流程圖。 Fig. 11 is a flow chart showing a second part of the OCR subroutine in steps S51, S53, S55, and S57 of Fig. 9.

圖12係表示圖11之步驟S68中之邊緣強度及區域亮度判定處理之 次常式的流程圖。 Figure 12 is a diagram showing the edge intensity and area brightness determination processing in step S68 of Figure 11 The subroutine flow chart.

圖13係表示圖11之步驟S69中之平均高度判定處理之次常式的流程圖。 Fig. 13 is a flow chart showing the subroutine of the average height determination processing in step S69 of Fig. 11.

圖14係表示圖11之步驟S72、S75中之日期圖案判定處理之次常式的流程圖。 Fig. 14 is a flowchart showing the subroutine of the date pattern determination processing in steps S72 and S75 of Fig. 11.

圖15係表示圖7之步驟S21中所提取之圖像中的亮度較高之部分之例的圖。 Fig. 15 is a view showing an example of a portion where the luminance in the image extracted in step S21 of Fig. 7 is high.

圖16係表示圖7之步驟S22中所提取之圖像中的長縱邊緣之例的圖。 Fig. 16 is a view showing an example of long longitudinal edges in the image extracted in step S22 of Fig. 7.

圖17係使圖15之亮度較高之部分及圖16之較長縱邊緣重合而成之圖。 Fig. 17 is a view in which the portion having the higher luminance of Fig. 15 and the longer longitudinal edge of Fig. 16 are overlapped.

圖18係表示包含圖15之亮度較高之部分及圖16之較長縱邊緣之目標區域21的圖。 Fig. 18 is a view showing a target region 21 including a portion having a higher luminance of Fig. 15 and a longer longitudinal edge of Fig. 16.

圖19係表示圖8之步驟S31中所提取之明對象物之例的圖。 Fig. 19 is a view showing an example of a bright object extracted in step S31 of Fig. 8.

圖20係表示圖8之步驟S33中所提取之暗對象物之例的圖。 Fig. 20 is a view showing an example of a dark object extracted in step S33 of Fig. 8.

圖21係表示圖8之步驟S31中之使用移動平均濾波法之明對象物之提取的圖。 Fig. 21 is a view showing the extraction of the bright object using the moving average filtering method in step S31 of Fig. 8.

圖22A係表示包含明對象物及暗對象物之圖像之圖。 Fig. 22A is a view showing an image including a bright object and a dark object.

圖22B係表示自圖22A之圖像之明對象物之提取的圖。 Fig. 22B is a view showing the extraction of the object from the image of Fig. 22A.

圖22C係表示自圖22A之圖像之暗對象物之提取的圖。 Fig. 22C is a view showing the extraction of a dark object from the image of Fig. 22A.

圖23係表示圖8之步驟S35中使用索貝爾濾波法而提取之圖像中之邊緣之例的圖。 Fig. 23 is a view showing an example of edges in an image extracted by the Sobel filtering method in step S35 of Fig. 8.

圖24係表示於圖8之步驟S36中將除步驟S35中所提取之邊緣以外之區域刪除後之圖像之例的圖。 Fig. 24 is a view showing an example of an image obtained by deleting an area other than the edge extracted in step S35 in step S36 of Fig. 8.

圖25係表示於圖8之步驟S37中使用閾值15之坎尼濾波法而提取之圖像中之邊緣之例的圖。 Fig. 25 is a view showing an example of edges in an image extracted using the Canni filter method of the threshold value 15 in step S37 of Fig. 8.

圖26係表示於圖8之步驟S37中使用閾值4之坎尼濾波法而提取之圖像中之邊緣之例的圖。 Fig. 26 is a view showing an example of an edge in an image extracted by the Canni filter method of the threshold 4 in step S37 of Fig. 8.

圖27表示係於圖8之步驟S38中所提取之明對象物之候補對象物之例的圖。 FIG. 27 is a view showing an example of a candidate object of the bright object extracted in step S38 of FIG. 8.

圖28係表示於圖8之步驟S39中所提取之暗對象物之候補對象物之例的圖。 FIG. 28 is a view showing an example of a candidate object of a dark object extracted in step S39 of FIG. 8.

圖29A係表示對象物之例之圖。 Fig. 29A is a view showing an example of an object.

圖29B係表示使用閾值200而提取之圖29A之二值化圖像的圖。 FIG. 29B is a diagram showing the binarized image of FIG. 29A extracted using the threshold 200.

圖29C係表示圖29B之輪廓之圖。 Fig. 29C is a view showing the outline of Fig. 29B.

圖29D係表示使用閾值50而提取之圖29A之邊緣的圖。 Figure 29D is a diagram showing the edge of Figure 29A extracted using threshold 50.

圖29E係表示使用閾值200而提取之圖29A之邊緣的圖。 Figure 29E is a diagram showing the edge of Figure 29A extracted using the threshold 200.

圖29F係表示文字之輪廓及邊緣之圖。 Figure 29F is a diagram showing the outline and edges of a character.

圖30係表示圖10之步驟S61中所提取之字符串候補之例的圖。 Fig. 30 is a view showing an example of character string candidates extracted in step S61 of Fig. 10;

圖31係表示圖10之步驟S61中之字符串候補之提取的圖。 Fig. 31 is a view showing the extraction of character string candidates in step S61 of Fig. 10.

圖32係表示圖10之步驟S62中所提取之文字候補及所產生之限界框之例的圖。 Fig. 32 is a view showing an example of a character candidate extracted in step S62 of Fig. 10 and a boundary block generated.

圖33A係表示圖10之步驟S61中所提取之字符串候補之例的圖。 Fig. 33A is a view showing an example of character string candidates extracted in step S61 of Fig. 10;

圖33B係表示圖10之步驟S62中所提取之文字候補及所產生之限界框42之例的圖。 Fig. 33B is a view showing an example of the character candidates extracted in step S62 of Fig. 10 and the resulting bounding block 42.

圖33C係表示圖10之步驟S63中變形之限界框43之例的圖。 Fig. 33C is a view showing an example of the bounding frame 43 of the deformation in the step S63 of Fig. 10.

圖33D係圖10之步驟S64中所提取之新的字符串候補之例之圖。 Fig. 33D is a diagram showing an example of a new character string candidate extracted in step S64 of Fig. 10.

圖34A係表示圖10之步驟S61中所提取之字符串候補之其他例的圖。 Fig. 34A is a view showing another example of the character string candidates extracted in step S61 of Fig. 10;

圖34B係表示圖10之步驟S62中所提取之文字候補及所產生之限界框42之其他例的圖。 Fig. 34B is a view showing another example of the character candidates extracted in step S62 of Fig. 10 and the resulting bounding block 42.

圖35係表示於圖10之步驟S65、S66、S67中刪除一部分之字符串 候補後之字符串候補之例的圖。 Figure 35 is a diagram showing the deletion of a part of the string in steps S65, S66, and S67 of Figure 10 A diagram of an example of a candidate for a candidate after the candidate.

圖36A係表示圖10之步驟S64中所提取之字符串候補之例的圖。 Fig. 36A is a view showing an example of character string candidates extracted in step S64 of Fig. 10;

圖36B係表示圖36A之字符串候補中所含之各文字候補之高度方向上之對象物之個數的圖。 FIG. 36B is a view showing the number of objects in the height direction of each character candidate included in the character string candidate of FIG. 36A.

圖37A係表示圖10之步驟S64中所提取之字符串候補之其他例的圖。 Fig. 37A is a view showing another example of the character string candidates extracted in step S64 of Fig. 10;

圖37B係表示圖37A之字符串候補中所含之各文字候補之高度方向上之對象物之個數的圖。 37B is a view showing the number of objects in the height direction of each character candidate included in the character string candidate of FIG. 37A.

圖38A係表示輸入圖像之例之圖。 Fig. 38A is a view showing an example of an input image.

圖38B係表示自圖38A之圖像提取之明對象物之候補對象物的圖。 Fig. 38B is a view showing a candidate object of the bright object extracted from the image of Fig. 38A.

圖38C係表示圖38B之候補對象物之輪廓的圖。 Fig. 38C is a view showing the outline of the candidate object of Fig. 38B.

圖38D係表示自圖38A之圖像提取之邊緣的圖。 Figure 38D is a diagram showing the edges extracted from the image of Figure 38A.

圖39A係表示輸入圖像之例之圖。 Fig. 39A is a view showing an example of an input image.

圖39B係表示自圖39A之圖像提取之暗對象物之候補對象物的圖。 Fig. 39B is a view showing a candidate object of a dark object extracted from the image of Fig. 39A.

圖39C係表示圖39B之候補對象物之輪廓的圖。 Fig. 39C is a view showing the outline of the candidate object of Fig. 39B.

圖39D係表示自圖39A之圖像提取之邊緣的圖。 Figure 39D is a diagram showing the edge extracted from the image of Figure 39A.

圖40係表示用以對圖11之步驟S68中之邊緣強度及區域亮度判定處理進行說明之輸入圖像之例的圖。 Fig. 40 is a view showing an example of an input image for explaining the edge intensity and the area brightness determination processing in step S68 of Fig. 11.

圖41係表示圖12之步驟S90中所選擇之字符串候補之例的圖。 Fig. 41 is a view showing an example of character string candidates selected in step S90 of Fig. 12;

圖42係表示藉由圖11之步驟S68中之邊緣強度及區域亮度判定處理而處理之字符串候補之例的圖。 Fig. 42 is a view showing an example of character string candidates processed by the edge intensity and region luminance determination processing in step S68 of Fig. 11;

圖43A係表示圖13之步驟S101中所選擇之字符串候補之例的圖。 Fig. 43A is a view showing an example of character string candidates selected in step S101 of Fig. 13;

圖43B係表示圖13之步驟S104中所提取之新的字符串候補之例之圖。 Fig. 43B is a view showing an example of a new character string candidate extracted in step S104 of Fig. 13;

圖44係表示藉由本發明之第2實施形態之光學文字識別裝置的控制裝置1執行之日期檢測處理之流程圖。 Fig. 44 is a flow chart showing the date detection processing executed by the control device 1 of the optical character recognition device according to the second embodiment of the present invention.

圖45係表示藉由本發明之第3實施形態之光學文字識別裝置的控制裝置1執行之日期檢測處理的流程圖。 Fig. 45 is a flowchart showing the date detection processing executed by the control device 1 of the optical character recognition device according to the third embodiment of the present invention.

圖46係表示圖45之步驟S15中之連結圖像之日期檢測處理之次常式的流程圖。 Fig. 46 is a flow chart showing the subroutine of the date detection processing of the concatenated image in step S15 of Fig. 45.

圖47係表示藉由本發明之第4實施形態之光學文字識別裝置的控制裝置1執行之日期檢測處理之日期圖案判定處理之次常式的流程圖。 FIG. 47 is a flowchart showing a subroutine of the date pattern determination processing of the date detection processing executed by the control device 1 of the optical character recognition device according to the fourth embodiment of the present invention.

圖48係表示包含日期之字符串及其他文字之字符串候補之例的圖。 Fig. 48 is a view showing an example of a character string candidate including a character string of a date and other characters.

第1實施形態. The first embodiment.

圖1係表示本發明之第1實施形態之光學文字識別裝置之構成的方塊圖。圖1之光學文字識別裝置係光學地識別列印於圓筒形狀之容器13之表面之日期的字符串。 Fig. 1 is a block diagram showing the configuration of an optical character recognition device according to a first embodiment of the present invention. The optical character recognition device of Fig. 1 is a character string optically identifying the date printed on the surface of the cylindrical container 13.

圖1之光學文字識別裝置包括:控制裝置1、軌道2、移動裝置3、相機4~6、照明裝置7a、7b、及滾筒8a、8b。至少2個滾筒8a、8b係相互平行地設置,且包括於控制裝置1之控制下動作之驅動裝置,藉此,將容器13可旋轉地保持。光學文字識別裝置進而包括收容容器13之至少1個托盤(或保管庫)11、12。移動裝置3係於控制裝置1之控制下,使容器13於托盤11、12及滾筒8a、8b之間移動。相機4~6係分別設置於托盤11、12及滾筒8a、8b上,於容器13位於托盤11、12及滾筒8a、8b上時分別取得容器13之圖像,並傳送至控制裝置1。照明裝置7a、7b對滾筒8a、8b上之容器13進行照明。滾筒8a、8b及照明裝置7a、7b係作為容器13用之攝影台而發揮功能。光學文字識別裝置亦可 包括以可繞圓筒形狀之容器13之旋轉軸旋轉之方式保持容器13之其他機構,代替滾筒8a、8b。控制裝置1對於自相機5傳送之容器13之圖像,參照圖6~圖14執行下述之日期檢測處理,並識別列印於容器13之表面之日期。於移動裝置3上亦可設置追加之相機。控制裝置1亦可連接於依照自記錄媒體10讀取之電腦程式而動作之外部之個人電腦(PC,personal computer)9。 The optical character recognition device of Fig. 1 includes a control device 1, a track 2, a moving device 3, cameras 4-6, illumination devices 7a, 7b, and rollers 8a, 8b. At least two rollers 8a, 8b are disposed in parallel with each other and include a driving device that operates under the control of the control device 1, whereby the container 13 is rotatably held. The optical character recognition device further includes at least one tray (or storage) 11, 12 that houses the container 13. The mobile device 3 is moved under the control of the control device 1 to move the container 13 between the trays 11, 12 and the rollers 8a, 8b. The cameras 4 to 6 are respectively disposed on the trays 11 and 12 and the rollers 8a and 8b. When the containers 13 are placed on the trays 11 and 12 and the rollers 8a and 8b, the images of the containers 13 are respectively taken and transmitted to the control device 1. The illuminating devices 7a, 7b illuminate the containers 13 on the drums 8a, 8b. The rollers 8a and 8b and the illuminating devices 7a and 7b function as a photographic table for the container 13. Optical character recognition device can also Instead of the rollers 8a, 8b, other mechanisms for holding the container 13 in a manner rotatable about the axis of rotation of the cylindrical container 13 are included. The control device 1 performs the following date detection processing on the image of the container 13 transported from the camera 5 with reference to Figs. 6 to 14 and recognizes the date printed on the surface of the container 13. An additional camera can also be provided on the mobile device 3. The control device 1 can also be connected to a personal computer (PC) 9 that operates in accordance with a computer program read from the recording medium 10.

容器13係例如為藥品之容器(安瓿),於容器13上列印有表示容器13中之藥品之使用期限之日期的字符串。例如於自病房退還此種容器13並放置於托盤11上時,光學文字識別裝置使用移動裝置3而使容器13自托盤11移動至滾筒8a、8b上,且於滾筒8a、8b上光學地識別列印於容器13上之使用期限之日期。繼而,光學文字識別裝置係根據識別出之日期,決定是要保管容器還是廢棄容器,並使用移動裝置3,將容器13移動至適當之保管庫或與垃圾箱關聯之其他托盤12上。 The container 13 is, for example, a container (ampoules) for medicines, and a character string indicating the date of use of the medicine in the container 13 is printed on the container 13. For example, when such a container 13 is returned from the ward and placed on the tray 11, the optical character recognition device uses the moving device 3 to move the container 13 from the tray 11 to the rollers 8a, 8b, and optically recognizes the rollers 8a, 8b. The date of expiration date printed on the container 13. Then, the optical character recognition device determines whether to store the container or the waste container based on the date of identification, and uses the moving device 3 to move the container 13 to an appropriate storage or other tray 12 associated with the garbage can.

圖2~圖5係表示列印於容器13上之字符串之例。圖2係表示第1例之列印有字符串之容器13a的俯視圖。圖3係表示第2例之列印有字符串之容器13b的俯視圖。圖4係表示第3例之列印有字符串之容器13c的俯視圖。圖5係表示第4例之列印有字符串之容器13d的俯視圖。字符串係既可列印於貼在容器上之標籤上,亦可直接列印於容器上。又,字符串之朝向既可與圓筒形狀之容器13之旋轉軸平行,亦可與容器13之旋轉軸正交,或者亦可混雜該等朝向之字符串。 2 to 5 show an example of a character string printed on the container 13. Fig. 2 is a plan view showing a container 13a in which a character string is printed in the first example. Fig. 3 is a plan view showing a container 13b in which a character string is printed in the second example. Fig. 4 is a plan view showing a container 13c in which a character string is printed in the third example. Fig. 5 is a plan view showing a container 13d in which a character string is printed in the fourth example. The string can be printed either on the label attached to the container or directly on the container. Further, the orientation of the character string may be parallel to the rotation axis of the cylindrical container 13, or may be orthogonal to the rotation axis of the container 13, or may be mixed with the orientation strings.

控制裝置1係作為自輸入圖像提取包含識別對象之對象物之目標區域的第1處理機構而動作。又,控制裝置1係作為自目標區域中所含之對象物提取包含至少1個字符串候補之對象物之候補對象物的第2處理機構而動作。又,控制裝置1係作為第3處理機構而動作,該第3處理機構進行候補對象物之標記,並提取沿預先規定之方向延伸且相互鄰近之複數個對象物作為字符串候補,判斷字符串候補是否具有包含 表示年之2位或4位數字、表示月之1位或2位數字、預先規定之標點符號(punctuation mark)的日期之圖案,於字符串候補具有日期之圖案時,識別出字符串候補為日期。 The control device 1 operates as a first processing unit that extracts a target region including an object to be recognized from an input image. In addition, the control device 1 operates as a second processing unit that extracts a candidate object including at least one character string candidate from the object included in the target region. Further, the control device 1 operates as a third processing unit that marks the candidate object and extracts a plurality of objects extending in a predetermined direction and adjacent to each other as character string candidates, and determines the character string. Whether the candidate has an inclusion A pattern indicating the date of 2 or 4 digits of the year, the 1st or 2 digits of the month, and the date of the pre-defined punctuation mark. When the character string candidate has a date pattern, the character string candidate is recognized as date.

以下,參照圖6~圖14,對藉由圖1之控制裝置1執行之日期檢測處理進行說明。 Hereinafter, the date detection processing executed by the control device 1 of Fig. 1 will be described with reference to Figs. 6 to 14 .

圖6係表示藉由圖1之控制裝置1執行之日期檢測處理的流程圖。控制裝置1一面使用滾筒8a、8b使容器13每次旋轉固定角度(例如15度),一面藉由相機5對容器13進行拍攝,從而取得分別表示容器13之不同之角度的複數個圖像(輸入圖像)。作為相機5,使用具有充足之解像度者,以光學地識別列印於容器13上之字符串。例如容器13具有直徑10~40mm,例如可使用以像素數3840×2748(約1000萬像素)對包括容器13在內之120×90mm之範圍進行拍攝之黑白相機。於該情形時,容器13上之1mm相當於32像素。於圖6之步驟S1中,控制裝置1取得容器13之複數個圖像中之其中一個。於步驟S2中,控制裝置1執行目標區域提取處理。 Fig. 6 is a flow chart showing the date detecting process executed by the control device 1 of Fig. 1. The control device 1 uses the rollers 8a and 8b to rotate the container 13 by a fixed angle (for example, 15 degrees) each time, and the container 13 photographs the container 13 to obtain a plurality of images respectively indicating different angles of the container 13 ( Enter the image). As the camera 5, a person having sufficient resolution is used to optically recognize the character string printed on the container 13. For example, the container 13 has a diameter of 10 to 40 mm, and for example, a black-and-white camera that photographs a range of 120 × 90 mm including the container 13 in a pixel number of 3840 × 2748 (about 10 million pixels) can be used. In this case, 1 mm on the container 13 corresponds to 32 pixels. In step S1 of FIG. 6, the control device 1 acquires one of a plurality of images of the container 13. In step S2, the control device 1 performs target region extraction processing.

圖7係表示圖6之步驟S2中之目標區域提取處理之次常式的流程圖。 Fig. 7 is a flow chart showing the subroutine of the target region extraction processing in step S2 of Fig. 6.

於圖7之步驟S21中,控制裝置1自步驟S1中所取得之圖像,提取亮度高於預先規定之閾值之部分(例如包括照明之反射之部分)。控制裝置1例如於像素之亮度在0~255之範圍內變化時,例如提取具有高於220之亮度之部分。圖15係表示圖7之步驟S21中所提取之圖像中之亮度較高之部分之例的圖。此處,輸入圖像係圖5之容器13d之圖像。 In step S21 of Fig. 7, the control device 1 extracts a portion having a luminance higher than a predetermined threshold (for example, a portion including reflection of illumination) from the image acquired in step S1. The control device 1 extracts, for example, a portion having a luminance higher than 220 when the luminance of the pixel is varied in the range of 0 to 255. Fig. 15 is a view showing an example of a portion where the luminance in the image extracted in step S21 of Fig. 7 is high. Here, the input image is an image of the container 13d of FIG.

繼而,於圖7之步驟S22中,控制裝置1自步驟S1中所取得之圖像,提取沿實質上與圓筒形狀之容器13之旋轉軸正交之方向延伸的長邊緣(縱邊緣)。雖然於容器13之背景中存在滾筒8a、8b,但由於滾筒8a、8b係與容器13之旋轉軸平行地延伸,因此可藉由提取縱邊緣而去 除滾筒8a、8b之影響。 Then, in step S22 of Fig. 7, the control device 1 extracts a long edge (longitudinal edge) extending in a direction substantially perpendicular to the rotation axis of the cylindrical container 13 from the image acquired in step S1. Although the rollers 8a, 8b are present in the background of the container 13, since the rollers 8a, 8b extend parallel to the axis of rotation of the container 13, they can be removed by extracting the longitudinal edges. Except for the influence of the rollers 8a, 8b.

為了於步驟S22中提取邊緣,可使用下式之索貝爾(Sobe1)濾波法。 In order to extract the edge in step S22, a Sobe1 filtering method of the following formula may be used.

藉由索貝爾濾波法提取之邊緣中之較短者,例如未滿足55像素之長度者係作為雜訊而被刪除。圖16係表示圖7之步驟S22中所提取之圖像中之較長縱邊緣之例的圖。圖5之容器13d之旋轉軸係與圖5之X軸平行,因此於步驟S22中,提取沿實質上與圖5之Y軸平行之方向延伸的邊緣。 The shorter of the edges extracted by the Sobel filtering method, for example, those that do not satisfy the length of 55 pixels are deleted as noise. Fig. 16 is a view showing an example of a longer vertical edge in the image extracted in step S22 of Fig. 7. The rotation axis of the container 13d of Fig. 5 is parallel to the X-axis of Fig. 5, so in step S22, an edge extending in a direction substantially parallel to the Y-axis of Fig. 5 is extracted.

於圖7之步驟S23中,控制裝置1提取包含亮度較高之部分及縱邊緣之矩形區域(寬度w1×高度h1)作為目標區域,並刪除目標區域之外部之區域。圖17係使圖15之亮度較高之部分及圖16之較長縱邊緣重合而成之圖。圖18係表示包含圖15之亮度較高之部分及圖16之較長縱邊緣之目標區域21的圖。目標區域係被認為包含識別對象之字符串之對象物的區域。 In step S23 of Fig. 7, the control device 1 extracts a rectangular region (width w1 × height h1) including a portion having a high luminance and a vertical edge as a target region, and deletes an area outside the target region. Fig. 17 is a view in which the portion having the higher luminance of Fig. 15 and the longer longitudinal edge of Fig. 16 are overlapped. Fig. 18 is a view showing a target region 21 including a portion having a higher luminance of Fig. 15 and a longer longitudinal edge of Fig. 16. The target area is an area that is considered to contain an object that identifies a character string of the object.

再次參照圖6,於執行步驟S2之目標區域提取處理後,於步驟S3中,控制裝置1判斷目標區域之提取是否成功,於YES時進入步驟S4,於NO時進入步驟S10。於步驟S4中,控制裝置1執行候補對象物提取處理。 Referring again to FIG. 6, after the target region extraction processing of step S2 is performed, in step S3, the control device 1 determines whether or not the extraction of the target region is successful. If YES, the process proceeds to step S4, and when NO, the process proceeds to step S10. In step S4, the control device 1 executes candidate object extraction processing.

圖8係表示圖6之步驟S4中之候補對象物提取處理之次常式的流程圖。 FIG. 8 is a flowchart showing a subroutine of the candidate object extraction processing in step S4 of FIG. 6.

於圖8之步驟S31中,控制裝置1藉由對目標區域之圖像應用移動 平均濾波法,而提取較周圍更明亮之明對象物,對圖像進行二值化。於黑底中白字之字符串係被提取為明對象物。由於照明之進行方式存在不均,因此無法僅藉由進行單純之二值化而檢測對象物。因此,使用利用移動平均濾波法之二值化方法(動態閾值法)。圖21係表示圖8之步驟S31中之使用移動平均濾波法之明對象物之提取的圖。根據圖21所示之原理,控制裝置1根據輸入圖像(此處為目標區域之圖像)之亮度,計算其局部之平均亮度,並提取具有高於局部之平均亮度加上特定之偏差量而得之亮度的亮度之對象物(即,與周圍相比具有突出之亮度之對象物)作為明對象物。為了計算局部之平均亮度而參照之局部之區域之尺寸係根據整個目標區域之尺寸決定。圖19係表示圖8之步驟S31中所提取之明對象物之例的圖。繼而,於步驟S32中,控制裝置1對二值化之明對象物之輪廓進行檢測。 In step S31 of FIG. 8, the control device 1 applies a movement to the image of the target area. The average filtering method extracts objects that are brighter than the surrounding and binarizes the image. A string of white characters in a black background is extracted as a bright object. Since there is unevenness in the manner in which illumination is performed, it is not possible to detect an object by simply performing binarization. Therefore, a binarization method (dynamic threshold method) using a moving average filtering method is used. Fig. 21 is a view showing the extraction of the bright object using the moving average filtering method in step S31 of Fig. 8. According to the principle shown in Fig. 21, the control device 1 calculates the local average brightness based on the brightness of the input image (here, the image of the target area), and extracts the average brightness above the local plus the specific amount of deviation. The object of the brightness obtained by the brightness (that is, the object having the outstanding brightness compared with the surroundings) is used as the bright object. The size of the area to be referred to in order to calculate the local average brightness is determined according to the size of the entire target area. Fig. 19 is a view showing an example of a bright object extracted in step S31 of Fig. 8. Then, in step S32, the control device 1 detects the contour of the binarized object.

繼而,於圖8之步驟S33~S34中,對暗對象物進行與步驟S31~S32中對明對象物進行之處理相同之處理。於步驟S33中,控制裝置1藉由對目標區域之圖像應用移動平均濾波法,而提取比周圍更暗之暗對象物,對圖像進行二值化。於白底中黑字之字符串係被提取為暗對象物。圖20係表示圖8之步驟S33中所提取之暗對象物之例的圖。於步驟S34中,控制裝置1對經二值化之暗對象物之輪廓進行檢測。 Then, in steps S33 to S34 of FIG. 8, the dark object is subjected to the same processing as the processing of the bright object in steps S31 to S32. In step S33, the control device 1 extracts a dark object darker than the surroundings by applying a moving average filtering method to the image of the target area, and binarizes the image. The string of black characters in the white background is extracted as a dark object. Fig. 20 is a view showing an example of a dark object extracted in step S33 of Fig. 8. In step S34, the control device 1 detects the contour of the binarized dark object.

圖22A係表示包含明對象物及暗對象物之圖像之圖。圖22B係表示自圖22A之圖像之明對象物之提取的圖。圖22C係表示自圖22A之圖像之暗對象物之提取的圖。1個字符串係被認為為明對象物及暗對象物之其中一個。由於在圖8之步驟S31~S34中提取明對象物及暗對象物之兩者,因此可確實地檢測列印於容器13上之日期。 Fig. 22A is a view showing an image including a bright object and a dark object. Fig. 22B is a view showing the extraction of the object from the image of Fig. 22A. Fig. 22C is a view showing the extraction of a dark object from the image of Fig. 22A. One character string is considered to be one of a bright object and a dark object. Since both the bright object and the dark object are extracted in steps S31 to S34 of Fig. 8, the date printed on the container 13 can be surely detected.

繼而,於圖8之步驟S35中,控制裝置1使用下式之索貝爾濾波法提取目標區域之圖像中之邊緣。 Then, in step S35 of Fig. 8, the control device 1 extracts the edge in the image of the target area using the Sobel filtering method of the following formula.

此處,b係表示將運算子B應用於某像素所得之結果,c係表示將運算子C應用於相同之像素所得之結果。圖23係表示於圖8之步驟S35中使用索貝爾濾波法而提取之圖像中之邊緣之例的圖。 Here, b is a result obtained by applying the operator B to a certain pixel, and c is a result obtained by applying the operator C to the same pixel. Fig. 23 is a view showing an example of edges in an image extracted by the Sobel filtering method in step S35 of Fig. 8.

繼而,於圖8之步驟S36中,控制裝置1自目標區域之圖像,將除步驟S35中所提取之邊緣以外之區域刪除。圖24係表示於在圖8之步驟S36中將除步驟S35中所提取之邊緣以外之區域刪除後之圖像之例的圖。繼而,於圖8之步驟S37中,控制裝置1對進行了步驟S36之刪除後之圖像應用坎尼(Canny)濾波法,而提取圖像中之邊緣。 Then, in step S36 of Fig. 8, the control device 1 deletes the area other than the edge extracted in step S35 from the image of the target area. Fig. 24 is a view showing an example of an image obtained by deleting an area other than the edge extracted in step S35 in step S36 of Fig. 8. Then, in step S37 of Fig. 8, the control device 1 applies the Canny filtering method to the image subjected to the deletion in step S36, and extracts the edges in the image.

坎尼邊緣檢測方法包括以下3個步驟。作為第1步驟,於圖像中計算下式之斜率之大小g(x,y)及斜率之朝向d(x,y)。 The Canney edge detection method includes the following three steps. As a first step, the magnitude g(x, y) of the slope of the following equation and the direction d(x, y) of the slope are calculated in the image.

此處,fx(x,y)係表示關於具有標準偏差σ之高斯函數之x方向的一階求微與像素值函數之折積,fy(x,y)係表示關於相同之高斯函數之y方向之一階求微與像素值函數之折積。 Here, f x (x, y) represents a product of a first-order numeracy and a pixel value function with respect to the x direction of the Gaussian function having the standard deviation σ, and f y (x, y) represents the same Gaussian function. The first order of the y direction is a product of the product of the pixel and the value of the pixel value.

作為坎尼邊緣檢測方法之第2步驟,藉由求出斜率之大小g(x,y)之最大值,而檢測邊緣。此時,使用注目像素之周圍8像素,推算相對於斜率之朝向d(x,y)內插之斜率之大小,並比較該等推算值,藉此判斷注目像素之斜率之大小g(x,y)是否具有真正的最大值。 As the second step of the Canney edge detection method, the edge is detected by finding the maximum value of the magnitude g(x, y) of the slope. At this time, using the 8 pixels around the pixel of interest, the magnitude of the slope of the interpolation with respect to the slope d(x, y) is estimated, and the estimated values are compared, thereby determining the magnitude of the slope of the pixel of interest g(x, y) Is there a true maximum?

作為坎尼邊緣檢測方法之第3步驟,設定高閾值Th_H及低閾值Th_L,進行有滯後之閾值判斷。於斜率之大小g(x,y)大於高閾值Th_H時,將該像素判斷為邊緣。於斜率之大小g(x,y)小於低閾值Th_L時,判斷該像素並非為邊緣。於斜率之大小g(x,y)處於高閾值Th_H與低閾值Th_L之間時,僅於該像素與被檢測為邊緣之像素鄰接時,判斷為邊緣。 As a third step of the Canney edge detection method, the high threshold Th_H and the low threshold Th_L are set, and the threshold value with hysteresis is determined. When the magnitude of the slope g(x, y) is greater than the high threshold Th_H, the pixel is judged as an edge. When the magnitude of the slope g(x, y) is less than the low threshold Th_L, it is judged that the pixel is not an edge. When the magnitude g(x, y) of the slope is between the high threshold Th_H and the low threshold Th_L, the edge is determined only when the pixel is adjacent to the pixel detected as the edge.

於本揭示之例中,於步驟S37中,使用具有高斯函數之標準偏差σ=1.4、高閾值Th_H=10、及低閾值Th_L=5之坎尼濾波法。閾值之可取值之範圍係0~255。 In the example of the present disclosure, in step S37, a Canny filtering method having a standard deviation σ=1.4, a high threshold Th_H=10, and a low threshold Th_L=5 of a Gaussian function is used. The range of threshold values is 0~255.

於圖8之步驟40中,使用兩種坎尼濾波法提取兩種邊緣,以於之後之步驟S38、S39、及下述之圖10之步驟S67之兩者中使用。圖25係表示於圖8之步驟S37中使用閾值15之坎尼濾波法而提取之圖像中之邊 緣之例的圖。圖26係表示於圖8之步驟S37中使用閾值4之坎尼濾波法而提取之圖像中之邊緣之例的圖。於本揭示之例中,於步驟S38、S39中使用圖26之邊緣,於圖10之步驟S67中使用圖25之邊緣。 In step 40 of Figure 8, the two edges are extracted using two Canny filtering methods for use in both subsequent steps S38, S39, and step S67 of Figure 10 below. Figure 25 is a view showing the edge in the image extracted by the Canni filter method using the threshold of 15 in the step S37 of Figure 8. A diagram of the example of the edge. Fig. 26 is a view showing an example of an edge in an image extracted by the Canni filter method of the threshold 4 in step S37 of Fig. 8. In the example of the present disclosure, the edges of FIG. 26 are used in steps S38, S39, and the edges of FIG. 25 are used in step S67 of FIG.

若使用索貝爾濾波法提取邊緣,則為高速,但所提取之邊緣之寬度會變寬。若使用坎尼濾波法提取邊緣,則為低速,但可提取詳細之邊緣。另一方面,於本實施形態中,暫時使用索貝爾濾波法提取邊緣(步驟S35),並將除所提取之邊緣以外之區域刪除(步驟S36),僅將坎尼濾波法應用於使用索貝爾濾波法而提取之邊緣之附近之區域,而提取邊緣(步驟S37),並將該邊緣用作目標區域中所含之對象物之邊緣。如此,藉由組合索貝爾濾波法及坎尼濾波法,與僅使用坎尼濾波法之情形相比,邊緣之提取提速變成約10倍。 If the edge is extracted using Sobel filtering, it is high speed, but the width of the extracted edge will be wider. If the edge is extracted using Canny filtering, it is low speed, but the detailed edge can be extracted. On the other hand, in the present embodiment, the edge is temporarily extracted using the Sobel filter method (step S35), and the area other than the extracted edge is deleted (step S36), and only the Caney filter method is applied to the use of Sobel The region near the edge is extracted by the filtering method, and the edge is extracted (step S37), and the edge is used as the edge of the object contained in the target region. Thus, by combining the Sobel filtering method and the Canny filtering method, the extraction speed of the edge becomes about 10 times as compared with the case where only the Canny filtering method is used.

繼而,於圖8之步驟S38中,控制裝置1提取具有輪廓及邊緣、且輪廓及邊緣相互重合且實質上一致之明對象物,作為候補對象物。圖27係表示圖8之步驟S38中所提取之明對象物之候補對象物之例的圖。繼而,於圖8之步驟S39中,控制裝置1提取具有輪廓及邊緣、且輪廓及邊緣相互重合且實質上一致之暗對象物,作為候補對象物。圖28係表示圖8之步驟S39中所提取之暗對象物之候補對象物之例的圖。 Then, in step S38 of FIG. 8, the control device 1 extracts a bright object having a contour and an edge and having a contour and an edge overlapping each other and substantially matching each other as a candidate object. FIG. 27 is a view showing an example of a candidate object of the bright object extracted in step S38 of FIG. 8. Then, in step S39 of FIG. 8, the control device 1 extracts a dark object having a contour and an edge and having a contour and an edge overlapping each other and substantially matching each other as a candidate object. FIG. 28 is a view showing an example of a candidate object of a dark object extracted in step S39 of FIG. 8.

圖29A係表示對象物之例之圖。圖29B係表示使用閾值200而提取之圖29A之二值化圖像的圖。圖29C係表示圖29B之輪廓之圖。圖29D係表示使用閾值50而提取之圖29A之邊緣的圖。圖29E係表示使用閾值200而提取之圖29A之邊緣的圖。圖29F係表示文字之輪廓及邊緣之圖。圖29A之對象物係例如於像素之亮度在0~255之範圍內變化時,包含亮度0之部分、亮度128之部分、及亮度255之部分。圖29A之對象物之輪廓係作為其二值化圖像(圖29B)之輪廓而獲得(圖29C)。圖29A之對象物之邊緣係作為亮度突然變化之部分而獲得,藉由使用不同之閾值而提取不同之邊緣(圖29D、圖29E)。如圖29C~圖29E所 示,通常,對象物之輪廓及邊緣不一定一致。但是,認為文字之對象物始終具有閉合之邊緣,對象物之輪廓及邊緣一致。因此,可藉由提取具有實質上一致之輪廓及邊緣之對象物,而提取文字之對象物。邊緣與輪廓不一致之對象物係作為雜訊而被刪除。 Fig. 29A is a view showing an example of an object. FIG. 29B is a diagram showing the binarized image of FIG. 29A extracted using the threshold 200. Fig. 29C is a view showing the outline of Fig. 29B. Figure 29D is a diagram showing the edge of Figure 29A extracted using threshold 50. Figure 29E is a diagram showing the edge of Figure 29A extracted using the threshold 200. Figure 29F is a diagram showing the outline and edges of a character. The object of FIG. 29A includes, for example, a portion of luminance 0, a portion of luminance 128, and a portion of luminance 255 when the luminance of the pixel varies from 0 to 255. The outline of the object of Fig. 29A is obtained as the outline of its binarized image (Fig. 29B) (Fig. 29C). The edge of the object of Fig. 29A is obtained as a part of sudden change in luminance, and different edges are extracted by using different threshold values (Fig. 29D, Fig. 29E). As shown in Figure 29C~29E Generally, the outline and edge of the object are not necessarily the same. However, it is considered that the object of the character always has a closed edge, and the contour and edge of the object are identical. Therefore, an object of a character can be extracted by extracting an object having a substantially uniform contour and an edge. Objects whose edges and contours are inconsistent are deleted as noise.

繼而,於圖6之步驟S5中,控制裝置1判斷候補對象物之提取是否成功,於YES時進入步驟S6,於NO時進入步驟S10。於步驟S6中,控制裝置1執行OCR(Optical Character Recognition,光學字元識別)處理。 Then, in step S5 of FIG. 6, the control device 1 determines whether or not the extraction of the candidate object is successful. If YES, the process proceeds to step S6, and when NO, the process proceeds to step S10. In step S6, the control device 1 performs OCR (Optical Character Recognition) processing.

圖9係表示圖6之步驟S6中之OCR處理之次常式的流程圖。由於無法獲知識別對象之字符串是明對象物,還是暗對象物,又,無法獲知識別對象之字符串是與圖5之X軸平行地延伸,還是與Y軸平行地延伸,因此針對所有其等之組合執行圖10及圖11之OCR次常式。於假定識別裝置之字符串為明對象物時,使用圖8之步驟S38中所提取之明對象物之候補對象物。於假定識別裝置之字符串為暗對象物時,使用圖8之步驟S39中所提取之暗對象物之候補對象物。於假定識別裝置之字符串與X軸平行地延伸時,直接使用目標區域之圖像。於假定識別裝置之字符串與Y軸平行地延伸時,將目標區域之圖像旋轉90度而進行使用。 Fig. 9 is a flow chart showing the subroutine of the OCR processing in step S6 of Fig. 6. Since it is impossible to know whether the character string of the recognition object is a clear object or a dark object, and it is impossible to know whether the character string of the recognition object extends parallel to the X-axis of FIG. 5 or parallel to the Y-axis, for all of them The combination of the above performs the OCR subroutine of FIGS. 10 and 11. When the character string of the hypothetical recognition device is a bright object, the candidate object of the bright object extracted in step S38 of Fig. 8 is used. When the character string of the hypothetical recognition device is a dark object, the candidate object of the dark object extracted in step S39 of Fig. 8 is used. The image of the target area is directly used when the character string of the recognition device is extended in parallel with the X axis. When the character string of the recognition device is extended in parallel with the Y-axis, the image of the target region is rotated by 90 degrees for use.

於圖9之步驟S51中,控制裝置1假定識別裝置之字符串為與X軸平行地延伸之明對象物,並執行OCR次常式。於步驟S52中,控制裝置1判斷OCR是否成功,於YES時進入圖6之步驟S7,於NO時進入步驟S53。於步驟S53中,控制裝置1假定識別裝置之字符串為與Y軸平行地延伸之明對象物,並執行OCR次常式。於步驟S54中,控制裝置1判斷OCR是否成功,於YES時進入圖6之步驟S7,於NO時進入步驟S55。於步驟S55中,控制裝置1假定識別裝置之字符串為與X軸平行地延伸之暗對象物,並執行OCR次常式。於步驟S56中,控制裝置1判 斷OCR是否成功,於YES時進入圖6之步驟S7,於NO時進入步驟S57。於步驟S57中,控制裝置1假定識別裝置之字符串為與Y軸平行地延伸之暗對象物,並執行OCR次常式,其後進入圖6之步驟S7。 In step S51 of Fig. 9, the control device 1 assumes that the character string of the recognition device is a bright object extending in parallel with the X-axis, and executes the OCR secondary routine. In step S52, the control device 1 determines whether the OCR is successful, and proceeds to step S7 of Fig. 6 when YES, and proceeds to step S53 when NO. In step S53, the control device 1 assumes that the character string of the recognition device is a bright object extending in parallel with the Y-axis, and executes the OCR secondary routine. In step S54, the control device 1 determines whether the OCR is successful, and proceeds to step S7 of Fig. 6 when YES, and proceeds to step S55 when NO. In step S55, the control device 1 assumes that the character string of the recognition device is a dark object extending in parallel with the X-axis, and executes the OCR secondary routine. In step S56, the control device 1 determines Whether or not the OCR is successful is successful, and when YES, the process proceeds to step S7 of FIG. 6, and when NO, the process proceeds to step S57. In step S57, the control device 1 assumes that the character string of the recognition device is a dark object extending in parallel with the Y-axis, and executes the OCR secondary routine, and thereafter proceeds to step S7 of FIG.

圖10係表示圖9之步驟S51、S53、S55、S57中之OCR次常式之第1部分的流程圖。圖11係表示圖9之步驟S51、S53、S55、S57中之OCR次常式之第2部分的流程圖。 Fig. 10 is a flow chart showing the first part of the OCR subroutine in steps S51, S53, S55, and S57 of Fig. 9. Fig. 11 is a flow chart showing a second part of the OCR subroutine in steps S51, S53, S55, and S57 of Fig. 9.

於圖10之步驟S61中,控制裝置1進行候補對象物之標記,並提取沿預先規定之方向延伸且相互鄰近之複數個對象物作為字符串候補。圖30係表示圖10之步驟S61中所提取之字符串候補之例的圖。圖31係表示圖10之步驟S61中之字符串候補之提取的圖。於圖31中,用以提取字符串候補之字符串候補光罩31例如具有寬度w2=75像素、高度h2=3像素。於配置於某位置之字符串候補光罩31亦包含1個候補對象物之像素時,判斷字符串候補光罩31內之區域為字符串候補之一部分。於整個目標區域之範圍內掃描字符串候補光罩31,並對個別之連結之字符串候補賦予標籤。 In step S61 of FIG. 10, the control device 1 performs marking of the candidate object, and extracts a plurality of objects extending in a predetermined direction and adjacent to each other as character string candidates. Fig. 30 is a view showing an example of character string candidates extracted in step S61 of Fig. 10; Fig. 31 is a view showing the extraction of character string candidates in step S61 of Fig. 10. In FIG. 31, the character string candidate mask 31 for extracting character string candidates has, for example, a width w2 = 75 pixels and a height h2 = 3 pixels. When the character string candidate mask 31 disposed at a certain position also includes pixels of one candidate object, it is determined that the region in the character string candidate mask 31 is one of the character string candidates. The character string candidate mask 31 is scanned over the entire target area, and labels are assigned to the individual character string candidates.

於在步驟S61中進行候補對象物之標記並提取字符串候補時,存在提取鄰近之複數個字符串作為1個字符串候補之可能性。因此,暫時使字符串候補與文字候補分離,根據各文字候補之特徵量(寬度及高度),使具有類似之特徵量之文字候補再結合作為字符串候補。於圖10之步驟S62中,控制裝置1進行各字符串候補中之對象物之標記,並提取該字符串候補中所含之複數個文字候補,而產生各文字候補之限界框。各限界框係分別為具有與字符串候補延伸之方向平行之寬度及與字符串候補延伸之方向正交之高度的矩形形狀,且分別包圍各文字候補之最小外接矩形。於步驟S63中,控制裝置1根據該寬度及高度,使各限界框以該限界框之高度越低則越擴大該限界框之寬度之方式變形。於步驟S64中,控制裝置1提取藉由變形而連結之限界框中所 含之文字候補之組作為新的字符串候補。圖32係表示圖10之步驟S62中所提取之文字候補及所產生之限界框之例的圖。 When the candidate object is marked in step S61 and the character string candidate is extracted, there is a possibility that a plurality of adjacent character strings are extracted as one character string candidate. Therefore, the character string candidates are temporarily separated from the character candidates, and the character candidates having similar feature amounts are recombined as character string candidates based on the feature amounts (width and height) of the character candidates. In step S62 of FIG. 10, the control device 1 performs marking of the object in each character string candidate, and extracts a plurality of character candidates included in the character string candidate, thereby generating a bounding box of each character candidate. Each of the bounding frames is a rectangular shape having a width parallel to the direction in which the character string candidates extend and a height orthogonal to the direction in which the character string candidates extend, and each of which surrounds the minimum circumscribed rectangle of each character candidate. In step S63, the control device 1 deforms each of the bounding frames so as to increase the width of the bounding frame as the height of the bounding frame decreases as the width and height. In step S64, the control device 1 extracts the bounding box connected by the deformation. The group of text candidates is included as a new string candidate. Fig. 32 is a view showing an example of a character candidate extracted in step S62 of Fig. 10 and a boundary block generated.

圖33A係表示圖10之步驟S61中所提取之字符串候補之例的圖。圖33B係表示圖10之步驟S62中所提取之文字候補及所產生之限界框42之例的圖。圖33C係表示圖10之步驟S63中變形之限界框43之例的圖。圖33D係表示圖10之步驟S64中所提取之新的字符串候補之例的圖。雖然圖33A之字符串候補包含2個字符串「2012.1」及「abc」,但被提取為1個字符串候補。為了進行說明,於圖33A中表示字符串候補之限界框41。繼而,如圖33B所示,進行圖33A之字符串候補中之對象物之標記,並提取該字符串候補中所含之複數個文字候補,而產生各文字候補之限界框42。各文字候補之限界框42具有寬度w3及高度h3。繼而,如圖33C所示,根據其寬度及高度,使各限界框變形。變形後之限界框43之寬度w3'及高度h3'係藉由下式而獲得。 Fig. 33A is a view showing an example of character string candidates extracted in step S61 of Fig. 10; Fig. 33B is a view showing an example of the character candidates extracted in step S62 of Fig. 10 and the resulting bounding block 42. Fig. 33C is a view showing an example of the bounding frame 43 of the deformation in the step S63 of Fig. 10. Fig. 33D is a view showing an example of a new character string candidate extracted in step S64 of Fig. 10. Although the character string candidate of FIG. 33A includes two character strings "2012.1" and "abc", it is extracted as one character string candidate. For the sake of explanation, the bounding box 41 of the character string candidate is shown in FIG. 33A. Then, as shown in FIG. 33B, the object object in the character string candidate of FIG. 33A is marked, and a plurality of character candidates included in the character string candidate are extracted, and a bounding box 42 for each character candidate is generated. The bounding box 42 of each character candidate has a width w3 and a height h3. Then, as shown in Fig. 33C, the bounding frames are deformed in accordance with the width and height thereof. The width w3' and the height h3' of the bounding frame 43 after the deformation are obtained by the following formula.

[數8]h3'=h3 [Number 8] h 3' = h 3

此處,W係各文字候補之限界框42之寬度之最大值,H係各文字候補之限界框42之高度之最大值。 Here, W is the maximum value of the width of the bounding box 42 of each character candidate, and H is the maximum value of the height of the bounding box 42 of each character candidate.

如圖33C所示,各文字候補之限界框係以高度h3越低則越擴大寬度w3之方式變形。因此,「.」與「1」之距離大於「1」與「a」之距離,但於變形後之限界框43中,「.」及「1」連結,「1」及「a」被分離。如圖33D所示,提取藉由變形而連結之限界框中所含之文字候補 之組作為新的字符串候補。為了進行說明,於圖33D中表示新的字符串候補之限界框41a、41b。 As shown in FIG. 33C, the bounding frame of each character candidate is deformed so as to increase the width w3 as the height h3 is lower. Therefore, the distance between "." and "1" is greater than the distance between "1" and "a". However, in the boundary box 43 after the deformation, "." and "1" are linked, and "1" and "a" are separated. . As shown in FIG. 33D, the character candidates included in the bounding box linked by the deformation are extracted. The group is used as a new string candidate. For the sake of explanation, the new character string candidate bounding boxes 41a, 41b are shown in Fig. 33D.

圖34A係表示圖10之步驟S61中所提取之字符串候補之其他例的圖。圖34B係表示圖10之步驟S62中所提取之文字候補及所產生之限界框42之其他例的圖。於在步驟S64中藉由變形而連結之限界框中所含之文字候補之組未被提取為新的字符串候補時,圖34A之字符串候補中所含之對象物係作為雜訊而被刪除。 Fig. 34A is a view showing another example of the character string candidates extracted in step S61 of Fig. 10; Fig. 34B is a view showing another example of the character candidates extracted in step S62 of Fig. 10 and the resulting bounding block 42. When the group of character candidates included in the bounding box connected by the deformation in step S64 is not extracted as a new character string candidate, the object included in the character string candidate of FIG. 34A is used as noise. delete.

繼而,於步驟S65~S67中,為了防止誤識別,刪除明顯並非為日期之字符串之字符串候補。 Then, in steps S65 to S67, in order to prevent erroneous recognition, a character string candidate that is not a character string of a date is deleted.

於圖10之步驟S65中,控制裝置1刪除包含多於10個之文字候補之字符串候補。認為日期之字符串至多包含10個以下之文字。因此,包含多於10個之文字候補之字符串候補係作為雜訊被刪除。 In step S65 of Fig. 10, the control device 1 deletes the character string candidates including more than ten character candidates. The date string is considered to contain at most 10 characters. Therefore, the character string candidate including more than ten character candidates is deleted as noise.

繼而,於步驟S66中,控制裝置1刪除僅包含於高度方向包含2個以上之對象物之文字候補的字符串候補。此處,對於各文字候補,沿高度方向連結該文字候補中所含之對象物,並計數連結後之對象物之個數。數字「0」~「9」係單一之經連結之對象物。因此,若字符串候補為日期,則該字符串候補中所含之全部之文字候補應該於高度方向只包含1個對象物。然而,於雖然為日期之字符串,但是考慮到因雜訊等而存在於高度方向包含2個以上之對象物之文字候補的可能性(於存在多餘之對象物之情形時,於連結之對象物被切斷之情形時等),將僅包含於高度方向包含2個以上之對象物之文字候補的字符串候補作為雜訊而進行刪除。圖36A係表示圖10之步驟S64中所提取之字符串候補之例的圖。圖36B係表示圖36A之字符串候補中所含之各文字候補之高度方向上之對象物之個數的圖。於圖36B之文字候補51上表示各文字候補之高度方向上之對象物之個數。 Then, in step S66, the control device 1 deletes the character string candidates including only the character candidates including two or more objects in the height direction. Here, for each character candidate, the object included in the character candidate is connected in the height direction, and the number of connected objects is counted. The numbers "0" to "9" are single connected objects. Therefore, if the character string candidate is a date, all the character candidates included in the character string candidate should include only one object in the height direction. However, although it is a character string of a date, it is considered that there is a possibility that a character candidate including two or more objects in the height direction is present due to noise or the like (in the case where there is an extra object, the object to be connected) When the object is cut, the character string candidate including only the character candidates including two or more objects in the height direction is deleted as noise. Fig. 36A is a view showing an example of character string candidates extracted in step S64 of Fig. 10; FIG. 36B is a view showing the number of objects in the height direction of each character candidate included in the character string candidate of FIG. 36A. The number of objects in the height direction of each character candidate is indicated on the character candidate 51 of Fig. 36B.

圖37A係表示圖10之步驟S64中所提取之字符串候補之其他例的 圖。圖37B係表示圖37A之字符串候補中所含之各文字候補之高度方向上之對象物之個數的圖。圖37A及圖37B係雖然字符串沿縱向延伸,但誤處理為沿橫向延伸者之例。如圖37B所示,由於各文字候補之高度方向上之對象物之個數全部為2個以上,因此圖37A及圖37B之字符串候補係作為雜訊而被刪除。 37A is a view showing another example of the character string candidates extracted in step S64 of FIG. Figure. 37B is a view showing the number of objects in the height direction of each character candidate included in the character string candidate of FIG. 37A. 37A and 37B are examples in which the character string extends in the longitudinal direction, but the erroneous processing is extended in the lateral direction. As shown in FIG. 37B, since the number of objects in the height direction of each character candidate is two or more, the character string candidates of FIGS. 37A and 37B are deleted as noise.

繼而,於步驟S67中,控制裝置1於自刪除各對象物中之邊緣之像素與輪廓之像素一致的部分為邊緣之像素之面積(像素數)之60%以下的字符串候補之某區域,提取明對象物及暗對象物之候補對象物時,僅於其等之其中一個中包含正確之字符串候補。認為於正確地提取之候補對象物中,其邊緣之像素實質上與輪廓之像素一致。另一方面,自另一候補對象物提取之字符串候補係作為雜訊而被刪除。作為對象物之邊緣,使用圖8之步驟S37中所提取之邊緣。圖38A係表示輸入圖像之例之圖。圖38B係表示自圖38A之圖像提取之明對象物之候補對象物的圖。圖38C係表示圖38B之候補對象物之輪廓的圖。圖38D係表示自圖38A之圖像提取之邊緣的圖。圖39A係表示輸入圖像之例之圖。圖39B係表示自圖39A之圖像提取之暗對象物之候補對象物的圖。圖39C係表示圖39B之候補對象物之輪廓的圖。圖39D係表示自圖39A之圖像提取之邊緣的圖。圖38A及圖39A之輸入圖像包含暗對象物。因此,雖然圖39C之輪廓與圖39D之邊緣實質上一致,但圖38C之輪廓與圖38D之不一致。 Then, in step S67, the control device 1 selects a region of the character string candidate that is 60% or less of the area (pixel number) of the pixel of the edge from the portion where the pixel at the edge of each object is removed from the contour pixel. When the candidate object of the bright object or the dark object is extracted, only the correct character string candidate is included in one of the objects. It is considered that in the candidate object that is correctly extracted, the pixels at the edges substantially coincide with the pixels of the outline. On the other hand, the character string candidate extracted from another candidate object is deleted as noise. As the edge of the object, the edge extracted in step S37 of Fig. 8 is used. Fig. 38A is a view showing an example of an input image. Fig. 38B is a view showing a candidate object of the bright object extracted from the image of Fig. 38A. Fig. 38C is a view showing the outline of the candidate object of Fig. 38B. Figure 38D is a diagram showing the edges extracted from the image of Figure 38A. Fig. 39A is a view showing an example of an input image. Fig. 39B is a view showing a candidate object of a dark object extracted from the image of Fig. 39A. Fig. 39C is a view showing the outline of the candidate object of Fig. 39B. Figure 39D is a diagram showing the edge extracted from the image of Figure 39A. The input image of Figures 38A and 39A contains dark objects. Thus, although the outline of FIG. 39C is substantially identical to the edge of FIG. 39D, the outline of FIG. 38C is inconsistent with that of FIG. 38D.

圖35係表示於圖10之步驟S65、S66、S67中刪除一部分之字符串候補後之字符串候補之例的圖。與圖30相比,可知雜訊已削減。 FIG. 35 is a view showing an example of character string candidates after a part of the character string candidates are deleted in steps S65, S66, and S67 of FIG. Compared with Fig. 30, it is known that the noise has been reduced.

繼而,於圖11之步驟S68中,控制裝置1執行邊緣強度及區域亮度判定處理。 Then, in step S68 of Fig. 11, the control device 1 performs edge intensity and area brightness determination processing.

圖12係表示圖11之步驟S68中之邊緣強度及區域亮度判定處理之次常式的流程圖。 Fig. 12 is a flow chart showing the subroutine of the edge intensity and area brightness determination processing in step S68 of Fig. 11.

於圖12之步驟S90中,控制裝置1選擇1個字符串候補。於步驟S91中,控制裝置1提取文字候補之區域之輪廓並使其擴大。此處,藉由向文字候補之區域之輪廓的像素添加1像素而使其擴大。於步驟S92中,控制裝置1對步驟S91中擴大之輪廓應用坎尼濾波法,而檢測字符串候補之區域之邊緣。此處,使用具有高斯函數之標準偏差σ=1、高閾值Th_H=30、及低閾值Th_L=10之坎尼濾波法。 In step S90 of Fig. 12, the control device 1 selects one character string candidate. In step S91, the control device 1 extracts and enlarges the outline of the character candidate region. Here, it is expanded by adding 1 pixel to the pixel of the outline of the character candidate region. In step S92, the control device 1 applies the Canni filter method to the contour expanded in step S91, and detects the edge of the region of the character string candidate. Here, a Canny filtering method having a Gaussian function standard deviation σ=1, a high threshold Th_H=30, and a low threshold Th_L=10 is used.

於步驟S93中,控制裝置1計算字符串候補之區域之邊緣強度的平均值edge_M及偏差edge_D。根據邊緣強度之平均值edge_M及偏差edge_D,使用下式計算邊緣強度之基準範圍之下限edge_L及上限edge_H。 In step S93, the control device 1 calculates the average value edge_M and the deviation edge_D of the edge strength of the region of the character string candidate. Based on the average edge value of the edge strength edge_M and the deviation edge_D, the lower limit edge_L and the upper limit edge_H of the reference range of the edge strength are calculated using the following equation.

[數9]edge_L=edge_M-min(15,edge_D)×1.2 [Number 9] edge_L = edge_M -min (15, edge_D ) × 1.2

[數10]edge_H=edge_M+edge_D×2 [Number 10] edge_H = edge_M + edge_D × 2

繼而,於步驟S94中,控制裝置1計算字符串候補之區域之亮度的平均值I_M及偏差I_D。根據亮度之平均值I_M及偏差I_D,使用下式計算亮度之基準範圍之下限I_L及上限I_H。 Then, in step S94, the control device 1 calculates the average value I_M and the deviation I_D of the luminance of the region of the character string candidate. Based on the average value I_M of the luminance and the deviation I_D, the lower limit I_L and the upper limit I_H of the reference range of the luminance are calculated using the following equation.

[數11]I_L=I_M-min(15,I_D)×1.2 [Formula 11] I_L = I_M -min (15 , I_D) × 1.2

[數12]I_H=I_M+I_D×2 [Formula 12] I_H = I_M + I_D × 2

於步驟S95中,控制裝置1選擇所選擇之字符串候補中之1個文字候補。於步驟S96中,控制裝置1計算所選擇之文字候補之區域的邊緣強度之平均值。於步驟S97中,控制裝置1計算所選擇之文字候補之區域之亮度之平均值。於驟S98中,控制裝置1於所選擇之文字候補具有基準範圍外之邊緣強度及亮度之情形時,刪除該文字候補。詳細而言,將具有未達下限edge_L之邊緣強度或大於上限edge_H之邊緣強度的文字候補係作為雜訊而刪除。又,將具有未達下限I_L之亮度或大於上限I_H之亮度的文字候補係作為雜訊而刪除。 In step S95, the control device 1 selects one of the selected character string candidates. In step S96, the control device 1 calculates an average value of the edge intensities of the regions of the selected character candidates. In step S97, the control device 1 calculates the average value of the brightness of the region of the selected character candidate. In step S98, when the selected character candidate has the edge intensity and the brightness outside the reference range, the control device 1 deletes the character candidate. In detail, a character candidate having an edge strength that does not reach the lower limit edge_L or an edge intensity that is greater than the upper limit edge_H is deleted as noise. Further, the character candidate system having the luminance that is less than the lower limit I_L or the luminance greater than the upper limit I_H is deleted as noise.

繼而,於步驟S99中,控制裝置1判斷是否有未處理之文字候補,於YES時進入步驟S95,於NO時進入步驟S100。於步驟S100中,控制裝置1判斷是否有未處理之字符串候補,於YES時進入步驟S90,於NO時進入圖11之步驟S69。 Then, in step S99, the control device 1 determines whether there is an unprocessed character candidate. If YES, the process proceeds to step S95, and if NO, the process proceeds to step S100. In step S100, the control device 1 determines whether there is an unprocessed character string candidate. If YES, the process proceeds to step S90, and when NO, the process proceeds to step S69 of FIG.

圖40係表示用以對圖11之步驟S68中之邊緣強度及區域亮度判定處理進行說明之輸入圖像之例的圖。圖41係表示圖12之步驟S90中所選擇之字符串候補之例的圖。圖42係表示藉由圖11之步驟S68中之邊緣強度及區域亮度判定處理而經處理之字符串候補之例的圖。根據圖40~圖42可知,基於邊緣強度及區域亮度而削減了雜訊。 Fig. 40 is a view showing an example of an input image for explaining the edge intensity and the area brightness determination processing in step S68 of Fig. 11. Fig. 41 is a view showing an example of character string candidates selected in step S90 of Fig. 12; Fig. 42 is a view showing an example of character string candidates processed by the edge intensity and region luminance determination processing in step S68 of Fig. 11; As can be seen from FIGS. 40 to 42, the noise is reduced based on the edge intensity and the area brightness.

於圖11之步驟S69中,控制裝置1執行平均高度判定處理。 In step S69 of Fig. 11, the control device 1 performs an average height determination process.

圖13係表示圖11之步驟S69中之平均高度判定處理之次常式的流程圖。於步驟S101中,控制裝置1選擇1個字符串候補。於步驟S102中,控制裝置1沿高度方向連結各文字候補中所含之對象物。為了沿高度方向連結對象物,沿高度方向進行封閉處理(即,進行區域之擴張處理,繼而進行收縮處理)。於步驟S103中,控制裝置1計算各文字候補之高度之平均值及偏差,而決定高度之基準範圍。為了決定高度之基準範圍,亦可計算字符串候補中之各對象物之高度之中間值,代替計算平均及偏差。於該情形時,例如亦可將5像素以上且高度之中 間值之1.1倍以下的範圍作為基準範圍。於步驟S104中,控制裝置1刪除不具有規定範圍之高度之文字候補,並自原來的字符串候補,提取藉由文字候補之刪除而分離出之新的字符串候補。圖43A係表示圖13之步驟S101中所選擇之字符串候補之例的圖。圖43B係表示圖13之步驟S104中所提取之新的字符串候補之例之圖。文字候補42a係作為雜訊而被刪除,並提取新的字符串候補41c、41d。繼而,於圖13之步驟S105中,控制裝置1判斷是否有未處理之字符串候補,於YES時進入步驟S101,於NO時進入圖11之步驟S70。 Fig. 13 is a flow chart showing the subroutine of the average height determination processing in step S69 of Fig. 11. In step S101, the control device 1 selects one character string candidate. In step S102, the control device 1 connects the objects included in the character candidates in the height direction. In order to connect the object in the height direction, the sealing process is performed in the height direction (that is, the expansion process of the region is performed, and then the shrinkage process is performed). In step S103, the control device 1 calculates the average value and the deviation of the heights of the character candidates, and determines the reference range of the height. In order to determine the reference range of the height, the intermediate value of the height of each object in the character string candidate may be calculated instead of calculating the average and the deviation. In this case, for example, it may be more than 5 pixels in height. A range of 1.1 times or less of the inter-value is used as a reference range. In step S104, the control device 1 deletes the character candidates that do not have the height of the predetermined range, and extracts new character string candidates separated by the deletion of the character candidates from the original character string candidates. Fig. 43A is a view showing an example of character string candidates selected in step S101 of Fig. 13; Fig. 43B is a view showing an example of a new character string candidate extracted in step S104 of Fig. 13; The character candidate 42a is deleted as noise, and new character string candidates 41c and 41d are extracted. Then, in step S105 of Fig. 13, the control device 1 determines whether or not there is an unprocessed character string candidate. If YES, the process proceeds to step S101, and when NO, the process proceeds to step S70 of Fig. 11.

於圖11之步驟S70中,控制裝置1判斷字符串候補之個數是否為0,於YES時進入圖9之步驟S52、S54、S56或圖6之步驟S7,於NO時進入步驟S71。於步驟S71中,控制裝置1選擇1個字符串候補。於步驟S72中,控制裝置1執行日期圖案判定處理。 In step S70 of Fig. 11, the control device 1 determines whether or not the number of character string candidates is 0. If YES, the process proceeds to steps S52, S54, and S56 of Fig. 9 or step S7 of Fig. 6, and when NO, the process proceeds to step S71. In step S71, the control device 1 selects one character string candidate. In step S72, the control device 1 executes date pattern determination processing.

圖14係表示圖11之步驟S72、S75中之日期圖案判定處理之次常式的流程圖。 Fig. 14 is a flowchart showing the subroutine of the date pattern determination processing in steps S72 and S75 of Fig. 11.

控制裝置1將具有包含表示年之2位或4位數字、表示月之1位或2位數字、及預先規定之標點符號的複數個日期圖案之表保持於內部。若以「2012年7月」為例,則日期例如具有以下圖案。 The control device 1 holds therein a table including a plurality of date patterns indicating two or four digits of the year, one or two digits representing the month, and a predetermined punctuation mark. If "July 2012" is taken as an example, the date has, for example, the following pattern.

各日期圖案係特定出數字及標點符號以何種方式排列。 Each date pattern is in which the number and punctuation are specified.

於圖14之步驟S111中,控制裝置1對字符串候補進行字母數字用 OCR。於步驟S112中,控制裝置1選擇保持於內部之表中之日期圖案中之1個日期圖案。控制裝置1於以下步驟中,判斷步驟S111中所識別之字符串與步驟S112中所選擇之日期圖案是否一致。於步驟S113中,控制裝置1判斷字符串與日期圖案是否一致,於YES時進入步驟S114,於NO時進入步驟S115。於步驟S114中,控制裝置1判斷字符串是否包含「明顯不會誤認為數字之英文文字」,於YES時進入步驟S115,於NO時進入步驟S117。「明顯不會誤認為數字之英文文字」例如包括「O」、「o」、「C」、「c」、「U」、「u」、「Z」、「z」、「n」、「L」、「l」、「I」、「J」、「D」。於字符串包含「明顯不會誤認為數字之英文文字」時,識別出字符串並非日期。於步驟S115中,控制裝置1判斷是否已使用全部之日期圖案,於YES時進入圖11之步驟S73(或步驟S76),於NO時返回至步驟S112,並選擇其他日期圖案。於步驟S117中,控制裝置1判斷字符串中之文字之高度是否固定,於YES時進入步驟S116,於NO時返回至步驟S113。於步驟S116中,控制裝置1判斷字符串是否包含英文文字,於YES時進入步驟S117,於NO時進入步驟S118。於步驟S117中,控制裝置1對字符串候補進行數字用OCR,即便字符串候補包含英文文字,亦將其識別為數字。 In step S111 of FIG. 14, the control device 1 performs alphanumeric use for character string candidates. OCR. In step S112, the control device 1 selects one of the date patterns held in the internal table. In the following steps, the control device 1 determines whether or not the character string recognized in step S111 coincides with the date pattern selected in step S112. In step S113, the control device 1 determines whether or not the character string and the date pattern match. If YES, the process proceeds to step S114, and if NO, the process proceeds to step S115. In step S114, the control device 1 determines whether or not the character string includes "English characters that are clearly not mistaken for the number". If YES, the process proceeds to step S115, and if NO, the process proceeds to step S117. "It is obvious that the English text of the number is not mistaken." For example, "O", "o", "C", "c", "U", "u", "Z", "z", "n", " L", "l", "I", "J", "D". When the string contains "English text that is obviously not mistaken for numbers", it is recognized that the string is not a date. In step S115, the control device 1 determines whether or not all of the date patterns have been used. If YES, the process proceeds to step S73 of FIG. 11 (or step S76). If NO, the process returns to step S112, and other date patterns are selected. In step S117, the control device 1 determines whether or not the height of the character in the character string is fixed. If YES, the process proceeds to step S116, and if NO, the process returns to step S113. In step S116, the control device 1 determines whether the character string contains the English character, and if YES, the process proceeds to step S117, and if NO, the process proceeds to step S118. In step S117, the control device 1 performs digital OCR on the character string candidate, and recognizes the character string candidate as a number even if it contains English characters.

於步驟S117之後,亦可進行傾斜修正。可藉由進行傾斜修正,而無誤地識別包含「1」之字符串。 After step S117, tilt correction can also be performed. The string containing "1" can be recognized without any mistake by performing the tilt correction.

於圖14之步驟S118中,控制裝置1判斷字符串是否為日期,於YES時進入圖11之步驟S73(或步驟S76),於NO時返回至步驟S113。 In step S118 of Fig. 14, the control device 1 determines whether the character string is the date, and if YES, proceeds to step S73 of Fig. 11 (or step S76), and returns to step S113 when NO.

於圖11之步驟S73中,控制裝置1判斷日期圖案之判定是否成功,於YES時進入圖9之步驟S52、S54、S56或圖6之步驟S7,於NO時進入步驟S74。於步驟S74中,控制裝置1使字符串候補旋轉180度。於步驟S75中,控制裝置1對旋轉180度之字符串候補執行與上述者相同之日期圖案判定處理。於步驟S76中,控制裝置1判斷日期圖案之判定 是否成功,於YES時進入圖9之步驟S52、S54、S56或圖6之步驟S7,於NO時進入步驟S77。於步驟S77中,控制裝置1判斷是否有未處理之字符串候補,於YES時返回至步驟S71,於NO時進入圖9之步驟S52、S54、S56或圖6之步驟S7步驟S。 In step S73 of Fig. 11, the control device 1 judges whether or not the determination of the date pattern is successful. If YES, the process proceeds to steps S52, S54, and S56 of Fig. 9 or step S7 of Fig. 6, and when NO, the process proceeds to step S74. In step S74, the control device 1 rotates the character string candidate by 180 degrees. In step S75, the control device 1 executes the same date pattern determination processing as the above-described character string candidate rotated by 180 degrees. In step S76, the control device 1 determines the determination of the date pattern. If it is successful, the process proceeds to step S52, S54, S56 of Fig. 9 or step S7 of Fig. 6 at the time of YES, and proceeds to step S77 when NO. In step S77, the control device 1 determines whether or not there is an unprocessed character string candidate. If YES, the process returns to step S71. If NO, the process proceeds to steps S52, S54, and S56 of FIG. 9 or step S7 of step S7 of FIG.

於圖6之步驟S7中,控制裝置1判斷OCR是否成功,即,表示使用期限之日期之字符串之提取是否成功,於YES時進入步驟S8,於NO時進入步驟S10。於識別出月為「1」之情形時,存在實際上為「10」~「12」,但因容器13之角度等而誤識別為「1」之可能性。於以下步驟中,於1個輸入圖像之字符串候補僅包含「1」作為表示月之數字時,判斷其他輸入圖像之字符串候補是否僅包含「1」作為表示月之數字。於步驟S8中,控制裝置1判斷月是否為「1」,於YES時進入步驟S9,於NO時進入步驟S12。於步驟S9中,控制裝置1判斷是否對相同之日期檢測了2次,於YES時進入步驟S12,於NO時進入步驟S10。於步驟S10中,控制裝置1判斷是否已使容器13轉一圈,於YES時進入步驟S13,於NO時進入步驟S11。於步驟S11中,控制裝置1使容器13旋轉。例如於使容器13每次旋轉15度之情形時,合計可取得24個輸入圖像。又,為了即便於容器13之直徑不同之情形時亦對應於每個固定之角度取得圖像,亦可使容器13旋轉2周並檢測直徑,一面以固定之時間間隔取得容器13之圖像,一面根據其直徑以不同之速度使容器13旋轉。於步驟S12中,控制裝置1輸出日期。於步驟S13中,控制裝置1輸出錯誤。 In step S7 of Fig. 6, the control device 1 determines whether the OCR is successful, that is, whether the extraction of the character string indicating the date of the expiration date is successful, and proceeds to step S8 when YES, and proceeds to step S10 when NO. When it is found that the month is "1", there is a possibility that it is actually "10" to "12", but it is erroneously recognized as "1" due to the angle of the container 13. In the following procedure, when the character string candidate of one input image includes only "1" as the number indicating the month, it is determined whether or not the character string candidate of the other input image includes only "1" as the number indicating the month. In step S8, the control device 1 determines whether the month is "1", and proceeds to step S9 when YES, and proceeds to step S12 when NO. In step S9, the control device 1 determines whether or not the same date has been detected twice, and if YES, the process proceeds to step S12, and when NO, the process proceeds to step S10. In step S10, the control device 1 determines whether or not the container 13 has been rotated once, and proceeds to step S13 when YES, and proceeds to step S11 when NO. In step S11, the control device 1 rotates the container 13. For example, when the container 13 is rotated by 15 degrees each time, a total of 24 input images can be obtained. Further, in order to obtain an image corresponding to each fixed angle even when the diameter of the container 13 is different, the container 13 can be rotated for two weeks and the diameter can be detected, and the image of the container 13 can be obtained at a fixed time interval. The container 13 is rotated at a different speed depending on its diameter. In step S12, the control device 1 outputs the date. In step S13, the control device 1 outputs an error.

如以上所說明般,根據本實施形態之光學文字識別裝置,可藉由於光學地識別字符串前,預先去除字符串之圖像中所含之各種雜訊,而以高於先前之精度識別表示日期之字符串。 As described above, according to the optical character recognition apparatus of the present embodiment, the various noises contained in the image of the character string can be removed in advance by optically recognizing the character string, and the representation can be expressed higher than the previous precision. A string of dates.

輸入圖像並不限定於圓筒形狀之容器之圖像,亦可為其他圖像(平坦之物體之圖像、或任意之圖像資料)。 The input image is not limited to an image of a cylindrical container, and may be other images (an image of a flat object or an arbitrary image data).

於控制裝置1連接於外部之PC 9時,圖6~圖14之日期檢測處理係亦可至少部分性地藉由PC 9而執行。 When the control device 1 is connected to the external PC 9, the date detection processing of FIGS. 6 to 14 can also be performed at least partially by the PC 9.

如以上所說明般,亦可實施識別表示日期之字符串之光學文字識別方法。又,此種光學文字識別方法亦可作為於藉由電腦執行時光學地識別字符串之電腦程式而實施。又,此種電腦程式亦可儲存於可藉由電腦進行讀取之記錄媒體中。例如,於將此種電腦程式儲存於圖1之記錄媒體10中,且PC 9自記錄媒體10讀取電腦程式時,依照該電腦程式實施光學文字識別方法。 As described above, an optical character recognition method for recognizing a character string indicating a date can also be implemented. Moreover, such an optical character recognition method can also be implemented as a computer program that optically recognizes a character string when executed by a computer. Moreover, such a computer program can also be stored in a recording medium that can be read by a computer. For example, when such a computer program is stored in the recording medium 10 of FIG. 1, and the PC 9 reads the computer program from the recording medium 10, the optical character recognition method is implemented in accordance with the computer program.

第2實施形態. Second embodiment.

第1實施形態之光學文字識別裝置係只要日期包含預先規定之標點符號,且以具有通常之字體之文字進行列印,便能以高於先前之精度識別表示日期之字符串。然而,為了識別包含特殊之標點符號之日期(例如「2015/5」、「2015 5」)、以具有特殊之字體(例如包含相互分離之複數個點者)之文字進行列印之日期等(以下,稱為特殊圖案),必須放寬圖6~圖14之日期檢測處理中之各種判斷之條件(閾值等),並提取多個字符串候補。由於若放寬日期檢測處理中之判斷之條件,則雜訊增多,執行日期檢測處理所需之時間變長,因此期望可一面抑制執行時間之增長,一面識別特殊圖案之日期。 The optical character recognition device according to the first embodiment can recognize a character string indicating a date higher than the previous precision as long as the date includes a predetermined punctuation mark and is printed in a character having a normal font. However, in order to identify the date (such as "2015/5", "2015 5") containing special punctuation marks, the date of printing with a special font (for example, a number of points separated from each other), etc. ( Hereinafter, it is called a special pattern), and it is necessary to widen various conditions (threshold values, etc.) in the date detection processing of FIGS. 6 to 14 and extract a plurality of character string candidates. Since the condition for the judgment in the date detection processing is relaxed, the amount of noise increases, and the time required for the execution date detection processing becomes long. Therefore, it is desirable to recognize the date of the special pattern while suppressing the increase in the execution time.

圖44係表示藉由本發明之第2實施形態之光學文字識別裝置之控制裝置1執行之日期檢測處理的流程圖。圖44之步驟S1~S12係與圖6之步驟S1~S12相同。圖44之日期檢測處理包括步驟S14之特殊圖案之日期檢測處理代替圖1之步驟S13。於步驟S14之特殊圖案之日期檢測處理中,設定較圖44之步驟S2、S4及S6中所使用者更寬鬆之判斷之條件(閾值等),並執行圖6之日期檢測處理。列印有特殊圖案之日期之容器之種類及數量較少,列印於大部分之容器上之日期係可藉由執行在某種程度上設定有限定條件之日期檢測處理而識別。 Fig. 44 is a flowchart showing the date detection processing executed by the control device 1 of the optical character recognition device according to the second embodiment of the present invention. Steps S1 to S12 of Fig. 44 are the same as steps S1 to S12 of Fig. 6. The date detection processing of Fig. 44 includes the date detection processing of the special pattern of step S14 instead of step S13 of Fig. 1. In the date detection processing of the special pattern in step S14, conditions (threshold values, etc.) which are more relaxed than the users in steps S2, S4, and S6 of Fig. 44 are set, and the date detection processing of Fig. 6 is executed. The types and quantities of containers on which the date of the special pattern is printed are small, and the date printed on most of the containers can be identified by performing a date detection process that is set to some extent with a limited condition.

根據圖44之日期檢測處理,由於僅於執行圖44之步驟S1~S11無法識別日期之字符串時,執行步驟S14之特殊圖案之日期檢測處理,因此可一面抑制執行時間之增長,一面識別特殊圖案之日期。 According to the date detection processing of FIG. 44, since the date detection processing of the special pattern of step S14 is executed only when the character string of the date cannot be recognized by the steps S1 to S11 of FIG. 44, it is possible to recognize the special while suppressing the increase of the execution time. The date of the pattern.

第3實施形態. Third embodiment.

根據第1實施形態之光學文字識別裝置,由於取得分別表示容器13之不同角度之複數個圖像(輸入圖像),因此於日期之字符串與圓筒形狀之容器之旋轉軸正交時(圖3及圖4),存在日期之整體未納入1個圖像中之可能性。於日期之字符串遍及圓筒形狀之容器之側面之半周以上時,無法取得包含日期之整體之圖像。 According to the optical character recognition device of the first embodiment, since a plurality of images (input images) respectively indicating different angles of the container 13 are obtained, when the character string of the date is orthogonal to the rotation axis of the cylindrical container ( Figures 3 and 4) show the possibility that the entire date is not included in one image. When the character string of the date is over half a week of the side of the cylindrical container, the image including the entire date cannot be obtained.

圖45係表示藉由本發明之第3實施形態之光學文字識別裝置之控制裝置1執行之日期檢測處理的流程圖。圖45之步驟S1~S12係與圖6之步驟S1~S12相同。圖45之日期檢測處理包括步驟S15之連結圖像之日期檢測處理,代替圖1之步驟S13。圖46係表示圖45之步驟S15中之連結圖像之日期檢測處理之次常式的流程圖。如上所述,控制裝置1一面使用滾筒8a、8b使容器13每次旋轉固定角度,一面藉由相機5對容器13進行拍攝,從而取得分別表示容器13之不同角度之複數個圖像。於圖46之步驟S1A中,控制裝置1使包含容器13之相互鄰接之部分的複數個圖像連結而產生1個連結圖像。詳細而言,控制裝置1藉由於相互鄰接之2個圖像中識別類似之對象物,而使該等圖像連結。連結圖像係展開容器之側面而成之平面圖像。控制裝置1針對於容器13之曲面彎曲之部分,將容器13之寬度作為圓柱之直徑,並使用射影變換而於平面內進行修正。圖46之步驟S2~S9、S12及S13係與圖6之步驟步驟S2~S9、S12及S13相同。 Fig. 45 is a flowchart showing the date detection processing executed by the control device 1 of the optical character recognition device according to the third embodiment of the present invention. Steps S1 to S12 of Fig. 45 are the same as steps S1 to S12 of Fig. 6. The date detection processing of Fig. 45 includes the date detection processing of the concatenated image of step S15 instead of step S13 of Fig. 1. Fig. 46 is a flow chart showing the subroutine of the date detection processing of the concatenated image in step S15 of Fig. 45. As described above, the control device 1 photographs the container 13 by the camera 5 while rotating the container 13 by a fixed angle with the rollers 8a and 8b, thereby obtaining a plurality of images respectively indicating different angles of the container 13. In step S1A of Fig. 46, the control device 1 connects a plurality of images including the mutually adjacent portions of the container 13 to generate one connected image. Specifically, the control device 1 connects the images by recognizing similar objects among the two adjacent images. The connected image is a planar image of the side of the container. The control device 1 corrects the width of the container 13 as the diameter of the cylinder with respect to the curved portion of the curved surface of the container 13, and corrects it in a plane using projective transformation. Steps S2 to S9, S12 and S13 of Fig. 46 are the same as steps S2 to S9, S12 and S13 of Fig. 6.

由於為了連結圖像之產生而花費某種程度之時間,控制裝置1亦可於執行圖45之步驟S15前預先產生連結圖像。 Since it takes a certain amount of time to generate a link image, the control device 1 can also generate a link image in advance before executing step S15 of FIG.

先前,為了產生圓筒形狀之物體之側面之圖像,已知有線陣相 機。然而,為了使用線陣相機,除了花費線陣相機本身之成本以外,亦花費設置用以以高精度使物體旋轉之機構之成本。由於藥品之容器具有各種各樣之形狀及尺寸,因此為了進行利用線陣相機之拍攝,用以以充分之精度使其旋轉之成本變得非常大。另一方面,根據圖45之日期檢測處理,使藉由通常之相機拍攝之複數個圖像連結而產生連結圖像,藉此可抑制成本之増加。 Previously, in order to produce an image of the side of a cylindrical shaped object, a wire array was known. machine. However, in order to use a line camera, in addition to the cost of the line camera itself, it is also costly to provide a mechanism for rotating the object with high precision. Since the container of the medicine has various shapes and sizes, in order to perform photographing using the line camera, the cost for rotating it with sufficient precision becomes very large. On the other hand, according to the date detection processing of FIG. 45, a plurality of images captured by a normal camera are connected to generate a connected image, whereby the increase in cost can be suppressed.

根據圖45之日期檢測處理,由於僅於執行圖45之步驟S1~S11無法識別日期之字符串時,執行步驟S15之連結圖像之日期檢測處理,因此可一面抑制執行時間之增長,一面識別未納入1個圖像中之日期。 According to the date detection processing of FIG. 45, since the date of the link image in step S15 is executed only when the character string of the date cannot be recognized in steps S1 to S11 of FIG. 45, it is possible to recognize the increase in the execution time while recognizing the execution time. Date not included in 1 image.

第4實施形態. Fourth embodiment.

於在日期之字符串之正後面(右側)有其他文字(「O」、「J」、「Z」等)時,存在誤識別其他文字為日期之一部分之可能性。因此,必須自字符串候補去除此種並非日期之一部分之其他文字。 When there are other characters ("O", "J", "Z", etc.) just after the string of the date (on the right side), there is a possibility that the other characters are mistakenly recognized as one of the dates. Therefore, it is necessary to remove other words that are not part of the date from the string candidates.

圖47係表示藉由本發明之第4實施形態之光學文字識別裝置的控制裝置1執行之日期檢測處理之日期圖案判定處理之次常式的流程圖。圖47之日期圖案判定處理係於圖11之步驟S72及S75中執行,且於圖14之步驟S113及S114之間包括追加之步驟S121及S122。於圖47之步驟S121中,控制裝置1於與日期圖案一致之字符串之表示月之數字為「10」、「11」、「12」之任一者時,根據以下說明之基準,判斷於日期之後是否有其他文字,於YES時進入步驟S122,於NO時進入步驟S114。 FIG. 47 is a flowchart showing a subroutine of the date pattern determination processing of the date detection processing executed by the control device 1 of the optical character recognition device according to the fourth embodiment of the present invention. The date pattern determination processing of Fig. 47 is executed in steps S72 and S75 of Fig. 11, and steps S121 and S122 are added between steps S113 and S114 of Fig. 14. In step S121 of FIG. 47, when the number indicating the month of the character string matching the date pattern is "10", "11", or "12", the control device 1 judges based on the criteria described below. Whether there is another character after the date, the process proceeds to step S122 when YES, and the process proceeds to step S114 when NO.

圖48係表示包含日期之字符串及其他文字之字符串候補之例的圖。於日期「2016.1」之後存在其他文字「CJ932」。若將「C」誤識別為「0」,則與日期圖案一致之字符串被誤識別為「2016.10」。控制裝置1於檢測日期之字符串「2016.10」時,判斷其最後之「0」實際 上是否為日期之一部分。 Fig. 48 is a view showing an example of a character string candidate including a character string of a date and other characters. There is another text "CJ932" after the date "2016.1". If "C" is misidentified as "0", the character string matching the date pattern is misidentified as "2016.10". When the control device 1 detects the date string "2016.10", it judges the last "0" actually. Is it a part of the date?

圖48之文字間之距離D1~D10係以像素數為單位,例如如下所述。 The distances D1 to D10 between the characters in Fig. 48 are in units of pixels, for example, as described below.

為了判斷「2016.10」之最後之「0」是否為日期之一部分,首先考慮比較日期之文字間之距離D1~D6之情形。於該情形時,由於最後之「1」與「0」之距離(「1」與「C」之距離)D6同「.」與「1」之距離D5為相同程度,因此不能判斷「2016.10」之最後之「0」並非日期之一部分。 In order to determine whether the last "0" of "2016.10" is part of the date, first consider the case where the distance between the characters of the date is D1~D6. In this case, since the distance between the last "1" and "0" (the distance between "1" and "C") D6 is the same as the distance D5 between "." and "1", "2016.10" cannot be judged. The last "0" is not part of the date.

於本實施形態中,為了判斷「2016.10」之最後之「0」是否為日期之一部分,比較距離D6與「2016.10」之後之文字間之距離D7~D10之平均值。於距離D6大於距離D7~D10之平均值時,控制裝置1判斷「2016.10」之最後之「0」並非日期之一部分,並於步驟S122中去除文字「CJ932」。另一方面,於距離D6為距離D7~D10之平均值以下時,控制裝置1判斷「2016.10」之最後之「0」為日期之一部分。藉此,即便於日期之字符串之正後面存在其他文字,亦能以高精度識別表示日期之字符串。 In the present embodiment, in order to determine whether or not the last "0" of "2016.10" is one of the dates, the average value of the distances D7 to D10 between the distances D6 and the characters after "2016.10" is compared. When the distance D6 is greater than the average value of the distances D7 to D10, the control device 1 judges that the last "0" of "2016.10" is not one of the dates, and the character "CJ932" is removed in step S122. On the other hand, when the distance D6 is equal to or less than the average value of the distances D7 to D10, the control device 1 determines that the last "0" of "2016.10" is one of the dates. Thereby, even if there are other characters just after the string of the date, the character string indicating the date can be recognized with high precision.

如以上所說明般,控制裝置1於字符串候補包含表示月之2個數字、後續於表示月之2個數字之至少1個其他文字時,且於表示月之2 個數字間之距離大於表示月之2個數字與其他文字之距離及其他文字間之距離之平均值時(步驟S121),去除表示月之2個數字之1位數字及其他文字(步驟S122)。 As described above, the control device 1 includes, when the character string candidate includes two digits of the month, and at least one other character following the two digits of the month, and indicates the month 2 When the distance between the numbers is greater than the average of the distance between the two digits of the month and other characters and the distance between other characters (step S121), the one digit of the two digits representing the month and other characters are removed (step S122). .

[產業上之可利用性] [Industrial availability]

本發明之光學文字識別裝置、光學文字識別方法、電腦程式及記錄媒體能以高於先前之精度識別表示日期之字符串。 The optical character recognition device, the optical character recognition method, the computer program, and the recording medium of the present invention can recognize a character string indicating a date higher than the previous precision.

S1~S13‧‧‧步驟 S1~S13‧‧‧Steps

Claims (14)

一種光學文字識別裝置,其係光學地識別字符串者,上述光學文字識別裝置之特徵在於包括:第1處理機構,其自輸入圖像提取包含識別對象之對象物之目標區域,該輸入圖像包含容器之圖像或貼於上述容器之標籤之圖像;第2處理機構,其自上述目標區域所含之對象物中,提取包含至少1個字符串候補之對象物之候補對象物;及第3處理機構,其進行上述候補對象物之標記,提取沿預先規定之方向延伸且相互鄰近之複數個對象物作為上述字符串候補,並判斷上述字符串候補是否具有包含表示年之2位或4位數字、表示月之1位或2位數字、及預先規定之標點符號的日期之圖案,於上述字符串候補具有上述日期之圖案時,將上述字符串候補識別為日期;且上述輸入圖像係可旋轉地被保持之圓筒形狀之容器的圖像;上述光學文字識別裝置取得一面使上述容器旋轉一面拍攝之分別表示上述容器之不同角度的複數個輸入圖像;上述第3處理機構係於1個輸入圖像之字符串候補僅包含「1」作為表示月之數字時,判斷其他輸入圖像之字符串候補是否僅包含「1」作為表示月之數字。 An optical character recognition device that optically recognizes a character string, wherein the optical character recognition device includes: a first processing unit that extracts a target region including an object to be recognized from an input image, the input image An image including a container or an image attached to the label of the container; and a second processing unit that extracts a candidate object including at least one character string candidate from the object included in the target region; The third processing unit performs marking of the candidate object, extracts a plurality of objects extending in a predetermined direction and adjacent to each other as the character string candidate, and determines whether the character string candidate includes two digits indicating the year or a four-digit number, a pattern indicating a date of one or two digits of the month, and a date of a predetermined punctuation mark, and identifying the character string candidate as a date when the character string candidate has the pattern of the date; and the input map An image of a cylindrically shaped container that is rotatably held; the optical character recognition device takes one side to rotate the container a plurality of input images respectively indicating different angles of the containers, and the third processing means determining other input images when the character string candidates of one input image include only "1" as the number indicating the month Whether the character string candidate contains only "1" as the number indicating the month. 如請求項1之光學文字識別裝置,其中上述第2處理機構係:檢測上述目標區域中所含之對象物之輪廓及邊緣,提取具有相互重合之輪廓及邊緣之對象物作為上述候補對象物。 The optical character recognition device according to claim 1, wherein the second processing means detects an outline and an edge of the object included in the target area, and extracts an object having a contour and an edge overlapping each other as the candidate object. 如請求項2之光學文字識別裝置,其中上述第2處理機構係: 對上述目標區域應用索貝爾濾波法而檢測第1邊緣,對上述第1邊緣之附近之區域應用坎尼濾波法而檢測第2邊緣,使用上述第2邊緣作為上述目標區域中所含之對象物之邊緣。 The optical character recognition device of claim 2, wherein the second processing mechanism is: Applying a Sobel filtering method to the target region to detect a first edge, applying a Canni filter method to a region near the first edge to detect a second edge, and using the second edge as an object included in the target region The edge. 如請求項1之光學文字識別裝置,其中上述第3處理機構係:進行上述字符串候補之對象物之標記,並提取複數個文字候補,產生複數個限界框,該等複數個限界框分別為具有與上述字符串候補延伸之方向平行之寬度及與上述字符串候補延伸之方向正交之高度的矩形形狀,且分別包圍上述各文字候補,將上述各限界框以該限界框之高度越低則越擴大該限界框之寬度之方式變形,提取藉由變形而連結之限界框中所含之文字候補之組作為新的字符串候補。 The optical character recognition device according to claim 1, wherein the third processing means performs: marking the object of the character string candidate, extracting a plurality of character candidates, and generating a plurality of bounding boxes, wherein the plurality of bounding boxes are respectively And a rectangular shape having a width parallel to a direction in which the character string candidate extends and a height orthogonal to a direction in which the character string candidate extends, and surrounding each of the character candidates, wherein each of the bounding boxes has a lower height of the bounding frame Then, the width of the bounding frame is expanded to be deformed, and the group of character candidates included in the bounding box connected by the deformation is extracted as a new character string candidate. 如請求項1之光學文字識別裝置,其中上述第3處理機構係:進行上述字符串候補之對象物之標記,並提取複數個文字候補,刪除包含多於10個之文字候補之字符串候補。 The optical character recognition device according to claim 1, wherein the third processing means performs the marking of the object of the character string candidate, extracts a plurality of character candidates, and deletes a character string candidate including more than ten character candidates. 如請求項1之光學文字識別裝置,其中上述第3處理機構係:進行上述字符串候補之對象物之標記,並提取複數個文字候補,僅刪除包含於與上述字符串候補延伸之方向正交之方向上包含2個以上對象物的文字候補之字符串候補。 The optical character recognition device according to claim 1, wherein the third processing means performs the marking of the object of the character string candidate, extracts a plurality of character candidates, and deletes only the direction orthogonal to the direction of the character string candidate extension. The character string candidate of the character candidate of two or more objects is included in the direction. 如請求項1之光學文字識別裝置,其中上述第3處理機構係:檢測上述字符串候補之對象物之輪廓及邊緣,刪除上述邊緣之像素與上述輪廓之像素一致之部分為上述邊 緣之像素之面積之60%以下的字符串候補。 The optical character recognition device according to claim 1, wherein the third processing means detects an outline and an edge of the object of the character string candidate, and deletes a portion of the pixel of the edge that matches a pixel of the contour as the edge A string candidate of 60% or less of the area of the pixel. 如請求項1之光學文字識別裝置,其中上述第3處理機構係於上述字符串候補包含明顯不會誤判為數字之英文文字時,將上述字符串候補識別為非日期。 The optical character recognition device according to claim 1, wherein the third processing means recognizes the character string candidate as a non-date when the character string candidate includes an English character that is not significantly misjudged as a number. 如請求項1之光學文字識別裝置,其中上述第3處理機構係於上述字符串候補包含表示月之2個數字、及接續於表示上述月之2個數字之後的至少1個其他文字時,且於表示上述月之2個數字間之距離大於表示上述月之2個數字與其他文字之距離及上述其他文字間之距離之平均值時,去除表示上述月之2個數字之1位數字及上述其他文字。 The optical character recognition device according to claim 1, wherein the third processing means is configured to include at least one other character indicating the month and two characters subsequent to the two digits of the month, and When the distance between the two digits of the month is greater than the average of the distance between the two digits of the month and other characters and the distance between the other characters, the one digit of the two digits of the month is removed and the above Other text. 如請求項1之光學文字識別裝置,其中上述第1處理機構係自上述輸入圖像中提取包含沿實質上與上述圓筒形狀之容器之旋轉軸正交的方向延伸之邊緣、及亮度高於預先規定之閾值之部分的區域,作為上述目標區域。 The optical character recognition device of claim 1, wherein the first processing means extracts an edge extending from a direction substantially orthogonal to a rotation axis of the cylindrical container from the input image, and the brightness is higher than A region of a predetermined threshold value is used as the target region. 如請求項1之光學文字識別裝置,其中上述光學文字識別裝置包括:相機;攝影台,其係以可繞上述圓筒形狀之容器之旋轉軸旋轉之方式保持上述容器;及移動裝置,其使上述容器於至少1個保管庫與上述攝影台之間移動;且於上述容器上列印有表示上述容器中之藥品之使用期限之日期的字符串;上述光學文字識別裝置進而包括:第4處理機構,其基於由上述第3處理機構所識別之日期,判斷上述容器是否保管於至少1個保管庫。 An optical character recognition device according to claim 1, wherein said optical character recognition device comprises: a camera; a photographing table that holds said container in such a manner as to be rotatable about a rotation axis of said cylindrical container; and a moving device that enables The container moves between at least one of the storages and the imaging table; and a character string indicating a date of use of the medicine in the container is printed on the container; the optical character recognition device further includes: fourth processing The mechanism determines whether the container is stored in at least one of the storages based on the date recognized by the third processing unit. 一種光學文字識別方法,其係光學地識別字符串者,上述光學文字識別方法之特徵在於包括:第1步驟,其係自輸入圖像提取包含識別對象之對象物之目標區域,該輸入圖像包含容器之圖像或貼於上述容器之標籤之圖像;第2步驟,其係自上述目標區域所含之對象物中,提取包含至少1個字符串候補之對象物之候補對象物;及第3步驟,其係進行上述候補對象物之標記,並提取沿預先規定之方向延伸且相互鄰近之複數個對象物作為上述字符串候補,判斷上述字符串候補是否具有包含表示年之2位或4位數字、表示月之1位或2位數字、及預先規定之標點符號的日期之圖案,於上述字符串候補具有上述日期之圖案時,將上述字符串候補識別為日期;且上述輸入圖像係可旋轉地被保持之圓筒形狀之容器的圖像;上述光學文字識別方法進而包括取得一面使上述容器旋轉一面拍攝之分別表示上述容器之不同角度的複數個輸入圖像之步驟;上述第3步驟係於1個輸入圖像之字符串候補僅包含「1」作為表示月之數字時,判斷其他輸入圖像之字符串候補是否僅包含「1」作為表示月之數字。 An optical character recognition method for optically recognizing a character string, wherein the optical character recognition method includes: a first step of extracting, from an input image, a target area including an object to be recognized, the input image An image including a container or an image attached to the label of the container; and a second step of extracting a candidate object including at least one character string candidate from the object included in the target region; In the third step, the candidate object is marked, and a plurality of objects extending in a predetermined direction and adjacent to each other are extracted as the character string candidates, and it is determined whether the character string candidate includes two digits representing the year or a four-digit number, a pattern indicating a date of one or two digits of the month, and a date of a predetermined punctuation mark, and identifying the character string candidate as a date when the character string candidate has the pattern of the date; and the input map An image of a cylindrically shaped container that is rotatably held; the optical character recognition method further includes taking one side of the container a step of rotating a plurality of input images respectively indicating different angles of the container; and the third step is to determine other input when the character string candidate of one input image includes only "1" as the number indicating the month Whether the character string candidate of the image contains only "1" as the number indicating the month. 一種記錄媒體,其係儲存有於藉由電腦而被執行時光學地識別字符串之電腦程式之電腦可讀取之記錄媒體,其特徵在於上述電腦程式包括:第1步驟,其係自輸入圖像提取包含識別對象之對象物之目標區域,該輸入圖像包含容器之圖像或貼於上述容器之標籤之圖像; 第2步驟,其係自上述目標區域所含之對象物中,提取包含至少1個字符串候補之對象物之候補對象物;及第3步驟,其係進行上述候補對象物之標記,並提取沿預先規定之方向延伸且相互鄰近之複數個對象物作為上述字符串候補,判斷上述字符串候補是否具有包含表示年之2位或4位數字、表示月之1位或2位數字、及預先規定之標點符號的日期之圖案,於上述字符串候補具有上述日期之圖案時,將上述字符串候補識別為日期;且上述輸入圖像係可旋轉地被保持之圓筒形狀之容器的圖像;上述電腦程式進而包括取得一面使上述容器旋轉一面拍攝之分別表示上述容器之不同角度的複數個輸入圖像之步驟;上述第3步驟係於1個輸入圖像之字符串候補僅包含「1」作為表示月之數字時,判斷其他輸入圖像之字符串候補是否僅包含「1」作為表示月之數字。 A recording medium, which is a computer readable recording medium storing a computer program for optically recognizing a character string when executed by a computer, characterized in that the computer program comprises: a first step, which is a self-input diagram For example, extracting a target area of an object including the recognition object, the input image comprising an image of the container or an image attached to the label of the container; In the second step, the candidate object including the object of at least one character string candidate is extracted from the object included in the target region; and the third step is to mark the candidate object and extract the object a plurality of objects extending in a predetermined direction and adjacent to each other as the character string candidate, and determining whether the character string candidate includes a 2-digit or 4-digit number indicating a year, a 1-digit or 2-digit number indicating a month, and a predetermined a pattern of a date of the predetermined punctuation mark, wherein the character string candidate is recognized as a date when the character string candidate has the pattern of the date; and the input image is an image of a cylindrical container rotatably held The computer program further includes a step of obtaining a plurality of input images respectively indicating different angles of the container while rotating the container; and the third step is that the character string candidate for one input image includes only "1" When the number of the month is displayed, it is determined whether or not the character string candidate of the other input image contains only "1" as the number indicating the month. 一種光學文字識別裝置,其係光學地識別字符串者,上述光學文字識別裝置之特徵在於包括:第1處理機構,其自輸入圖像提取包含識別對象之對象物之目標區域;第2處理機構,其自上述目標區域所含之對象物中,提取包含至少1個字符串候補之對象物之候補對象物;及第3處理機構,其進行上述候補對象物之標記,提取沿預先規定之方向延伸且相互鄰近之複數個對象物作為上述字符串候補,於上述字符串候補具有預先規定之日期之圖案時,將上述字符串候補識別為日期;且上述輸入圖像係可旋轉地被保持之圓筒形狀之容器的圖像;上述第1處理機構係自上述輸入圖像中提取包含沿實質上與上 述圓筒形狀之容器之旋轉軸正交的方向延伸之邊緣、及亮度高於預先規定之閾值之部分的區域,作為上述目標區域。 An optical character recognition device that optically recognizes a character string, wherein the optical character recognition device includes: a first processing unit that extracts a target region including an object to be recognized from an input image; and a second processing mechanism And extracting, from the object included in the target area, a candidate object including at least one character string candidate; and a third processing unit that marks the candidate object and extracts the direction in a predetermined direction a plurality of objects extending and adjacent to each other as the character string candidate, and when the character string candidate has a pattern of a predetermined date, the character string candidate is recognized as a date; and the input image is rotatably held An image of a cylindrical container; the first processing mechanism extracting from the input image includes substantially along An edge extending in a direction orthogonal to a rotation axis of the cylindrical container and a region having a luminance higher than a predetermined threshold value are referred to as the target region.
TW103124333A 2013-07-16 2014-07-15 Optical character recognition device, optical character recognition method, and recording medium TWI608422B (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2013147546 2013-07-16

Publications (2)

Publication Number Publication Date
TW201506800A TW201506800A (en) 2015-02-16
TWI608422B true TWI608422B (en) 2017-12-11

Family

ID=52346186

Family Applications (1)

Application Number Title Priority Date Filing Date
TW103124333A TWI608422B (en) 2013-07-16 2014-07-15 Optical character recognition device, optical character recognition method, and recording medium

Country Status (4)

Country Link
JP (1) JP6344389B2 (en)
CN (1) CN105431866A (en)
TW (1) TWI608422B (en)
WO (1) WO2015008732A1 (en)

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106156767A (en) * 2016-03-02 2016-11-23 平安科技(深圳)有限公司 Driving license effect duration extraction method, server and terminal
CN106407976B (en) * 2016-08-30 2019-11-05 百度在线网络技术(北京)有限公司 The generation of image character identification model and perpendicular column character picture recognition methods and device
JP6401806B2 (en) * 2017-02-14 2018-10-10 株式会社Pfu Date identification device, date identification method, and date identification program
JP6480985B2 (en) * 2017-07-03 2019-03-13 ファナック株式会社 NC program converter
JP6949596B2 (en) 2017-07-20 2021-10-13 東芝テック株式会社 Product data processing device and product data processing program
CN110414496B (en) * 2018-04-26 2022-05-27 百度在线网络技术(北京)有限公司 Similar word recognition method and device, computer equipment and storage medium
TWI685796B (en) * 2018-05-31 2020-02-21 國立中興大學 A method for character pattern recognition
CN110490192A (en) * 2019-07-16 2019-11-22 广东工业大学 A kind of commodity production date tag detection method and system
TWI797531B (en) * 2020-12-31 2023-04-01 國立臺北科技大學 Pharmacy management system
KR20230137814A (en) * 2022-03-22 2023-10-05 이충열 Method for processing images obtained from shooting device operatively connected to computing apparatus and system using the same
CN115396661A (en) * 2022-07-29 2022-11-25 北京奇艺世纪科技有限公司 Method and device for determining decoding performance of equipment, electronic equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5405015A (en) * 1993-08-11 1995-04-11 Videojet Systems International, Inc. System and method for seeking and presenting an area for reading with a vision system
TW200641708A (en) * 2005-05-25 2006-12-01 Systex Corp Fast inquiry system and method for merchandise data
JP2009294704A (en) * 2008-06-02 2009-12-17 Mitsubishi Heavy Ind Ltd License number recognition device and license number recognition method
JP2010115339A (en) * 2008-11-13 2010-05-27 Ookuma Electronic Co Ltd Information reader of empty container for injection liquid
US20110150346A1 (en) * 2009-12-19 2011-06-23 Richard Panetta Method and Apparatus for Identifying Embossed Characters
JP2012137841A (en) * 2010-12-24 2012-07-19 Institute Of National Colleges Of Technology Japan Picking system and picking method

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3890840B2 (en) * 1999-12-22 2007-03-07 富士通株式会社 Image processing apparatus, image processing method, and computer-readable recording medium recording image processing program
JP2004178044A (en) * 2002-11-25 2004-06-24 Mitsubishi Electric Corp Attribute extraction method, its device and attribute extraction program
JP2009199102A (en) * 2008-02-19 2009-09-03 Fujitsu Ltd Character recognition program, character recognition device and character recognition method
JP2011521520A (en) * 2008-04-16 2011-07-21 ワイコフ, リチャード ダレル Portable multimedia receiver and transmitter
CN101968865B (en) * 2010-11-17 2013-12-11 上海合合信息科技发展有限公司 Method for adding reminding event in electronic calendar
JP5647919B2 (en) * 2011-03-07 2015-01-07 株式会社Nttドコモ Character recognition device, character recognition method, character recognition system, and character recognition program

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5405015A (en) * 1993-08-11 1995-04-11 Videojet Systems International, Inc. System and method for seeking and presenting an area for reading with a vision system
TW200641708A (en) * 2005-05-25 2006-12-01 Systex Corp Fast inquiry system and method for merchandise data
JP2009294704A (en) * 2008-06-02 2009-12-17 Mitsubishi Heavy Ind Ltd License number recognition device and license number recognition method
JP2010115339A (en) * 2008-11-13 2010-05-27 Ookuma Electronic Co Ltd Information reader of empty container for injection liquid
US20110150346A1 (en) * 2009-12-19 2011-06-23 Richard Panetta Method and Apparatus for Identifying Embossed Characters
JP2012137841A (en) * 2010-12-24 2012-07-19 Institute Of National Colleges Of Technology Japan Picking system and picking method

Also Published As

Publication number Publication date
CN105431866A (en) 2016-03-23
WO2015008732A1 (en) 2015-01-22
JPWO2015008732A1 (en) 2017-03-02
TW201506800A (en) 2015-02-16
JP6344389B2 (en) 2018-06-20

Similar Documents

Publication Publication Date Title
TWI608422B (en) Optical character recognition device, optical character recognition method, and recording medium
JP3124296B2 (en) How to detect the position and direction of the fiducial mark
JP6143111B2 (en) Object identification device, object identification method, and program
TWI455034B (en) Barcode recognion method and a computer product thereof
US8971569B2 (en) Marker processing method, marker processing device, marker, object having a marker, and marker processing program
JP6831951B2 (en) Image recognition system
JP6458239B1 (en) Image recognition system
TWI751426B (en) Image processing system, image processing method and program product
TWI725465B (en) Image processing system, image processing method and program product
CN113903024A (en) Handwritten bill numerical value information identification method, system, medium and device
JP2007081458A (en) Image processing apparatus and control method of image processing apparatus
US8396301B2 (en) System and method for document location and recognition
JP4904330B2 (en) Method and apparatus for extracting text from an image
US20200210664A1 (en) Optically Readable Markers
JP6628336B2 (en) Information processing system
Duong et al. Vision inspection system for pharmaceuticals
CN113658039A (en) Method for determining splicing sequence of label images of medicine bottles
JP7449505B2 (en) information processing system
JP2017173925A (en) Optical character recognition device
JP6885563B2 (en) Display status judgment system
CN116469090A (en) Method and device for detecting code spraying pattern, electronic equipment and storage medium
CN115984185A (en) Paper towel package defect detection method, device and system and storage medium
JP6890849B2 (en) Information processing system
JP5280337B2 (en) Character recognition method and character recognition device
JP2010091525A (en) Pattern matching method of electronic component