Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP7800473B2 - Information processing device - Google Patents
[go: Go Back, main page]

JP7800473B2 - Information processing device - Google Patents

Information processing device

Info

Publication number
JP7800473B2
JP7800473B2 JP2023018514A JP2023018514A JP7800473B2 JP 7800473 B2 JP7800473 B2 JP 7800473B2 JP 2023018514 A JP2023018514 A JP 2023018514A JP 2023018514 A JP2023018514 A JP 2023018514A JP 7800473 B2 JP7800473 B2 JP 7800473B2
Authority
JP
Japan
Prior art keywords
ellipse
point
image
coordinates
coordinate
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2023018514A
Other languages
Japanese (ja)
Other versions
JP2024113491A (en
Inventor
雄一郎 大塚
伸一 竹内
淳 田端
真吾 則竹
涼 柳川
豊 桑島
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Toyota Motor Corp
Original Assignee
Toyota Motor Corp
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 Toyota Motor Corp filed Critical Toyota Motor Corp
Priority to JP2023018514A priority Critical patent/JP7800473B2/en
Publication of JP2024113491A publication Critical patent/JP2024113491A/en
Application granted granted Critical
Publication of JP7800473B2 publication Critical patent/JP7800473B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Character Input (AREA)

Description

本発明は、情報処理装置に関する。 The present invention relates to an information processing device.

従来より、撮影画像に含まれるX軸方向に並んだ文字列やY軸方向に並んだ文字列を検出する技術が知られている(例えば特許文献1~5参照)。また、X軸方向又はY軸方向に対して傾いた文字列をX軸方向又はY軸方向に平行になるように回転し、回転された文字列を読み取る技術も知られている。さらに、文字認識を行う前に、エッジ抽出などの画像処理を行う技術が知られている。 Technologies for detecting character strings aligned along the X-axis or Y-axis in a captured image have been known (see, for example, Patent Documents 1 to 5). Also known is a technique for rotating character strings tilted relative to the X-axis or Y-axis so that they are parallel to the X-axis or Y-axis, and then reading the rotated character string. Furthermore, techniques for performing image processing such as edge extraction before character recognition are known.

特開2012-103755号公報JP 2012-103755 A 特開平7-121658号公報Japanese Patent Application Publication No. 7-121658 特開平9-237318号公報Japanese Patent Application Publication No. 9-237318 特開2019-128727号公報Japanese Patent Application Laid-Open No. 2019-128727 特開2022-52716号公報Japanese Patent Application Laid-Open No. 2022-52716

例えば、矩形の紙に2行の文字列を記入し、その紙を円柱に巻き付け、当該円柱の画像を撮影した場合には、左右の端に向かって行くほど、各文字列の並びが下がったり、左右の端に近い文字の大きさが小さくなったり、文字列間の幅が狭くなったりする。この状態だと、文字認識により文字列の各文字を正確に読み取れない場合がある。 For example, if you write two lines of text on a rectangular piece of paper, wrap that paper around a cylinder, and then photograph an image of the cylinder, the characters will be lower in alignment, the characters closer to the left and right edges will be smaller, and the space between characters will be narrower. In this state, character recognition may not be able to accurately read each character in the text.

そこで、本発明では、湾曲状に配置された文字列の文字認識の精度を向上させることができる情報処理装置を提供することを目的とする。 Therefore, the present invention aims to provide an information processing device that can improve the accuracy of character recognition for character strings arranged in a curved shape.

本発明に係る情報処理装置は、湾曲状に配置された文字列が記載された曲面を有する対象物の画像を入力する入力手段と、前記画像から前記文字列の複数の上端点を通過する第1楕円及び前記画像から前記文字列の複数の下端点を通過する第2楕円を検出する検出手段と、前記第1楕円及び前記第2楕円の中心座標、前記第1楕円及び前記第2楕円の長軸の半径、並びに前記第1楕円及び前記第2楕円の短軸の半径に基づいて、前記対象物の曲面の画像を平面の画像に変換する変換手段とを備えることを特徴とする。 The information processing device according to the present invention comprises an input means for inputting an image of an object having a curved surface on which a character string arranged in a curved shape is written; a detection means for detecting from the image a first ellipse that passes through multiple upper endpoints of the character string and a second ellipse that passes through multiple lower endpoints of the character string; and a conversion means for converting the image of the curved surface of the object into an image of a plane based on the central coordinates of the first ellipse and the second ellipse, the radii of the major axes of the first ellipse and the second ellipse, and the radii of the minor axes of the first ellipse and the second ellipse.

上記構成において、前記対象物は円柱であり、前記変換手段は、前記第1楕円及び前記第2楕円の中心座標のY座標の差分を前記平面の画像のY方向の長さHとし、前記第1楕円及び前記第2楕円のいずれか一方の周長の半分の長さを前記平面の画像のX方向の長さWとし、前記平面の画像の右下端を原点とし、上向き及び左向きを正とし、前記平面の画像の任意の点Rの座標を(x、y)とし、前記第1楕円及び前記第2楕円の長軸の半径が水平方向から時計回りに回転する角度をθとするとき、前記点Rの座標xと前記長さWとから前記角度θを算出し、前記点Rを通過する垂直な線分の上端点及び下端点を点P、点Qとした場合に、前記点P及び前記点Qの座標に対応する前記円柱上の点P’及び点Q’の座標を前記第1楕円及び前記第2楕円の中心座標、長軸の半径、短軸の半径並びに前記角度θに基づいて算出し、前記点P’及び前記点Q’のY座標をy:(H-y)に内分する点の座標を前記点Rの座標に対応する前記円柱上の点R’のZ座標とし、前記点P’及び前記点Q’のいずれかの一方のX座標及びY座標を点R’のX座標及びY座標とすることで、前記点R’のX座標、Y座標及びZ座標を算出し、前記点R’の色を周辺の画素から双線形補間で検出し、前記点R’の色を前記点Rの色として設定してもよい。 In the above configuration, the object is a cylinder, and the conversion means defines the difference between the Y coordinates of the centers of the first ellipse and the second ellipse as the Y-direction length H of the planar image, defines half the perimeter of either the first ellipse or the second ellipse as the X-direction length W of the planar image, defines the lower right end of the planar image as the origin, defines upward and leftward directions as positive, defines the coordinates of an arbitrary point R on the planar image as (x, y), and defines the angle by which the radii of the major axes of the first ellipse and the second ellipse rotate clockwise from the horizontal direction as θ. The conversion means calculates the angle θ from the coordinate x of point R and the length W, and defines the upper and lower endpoints of a vertical line segment passing through point R as points P. , point Q, the coordinates of points P' and Q' on the cylinder corresponding to the coordinates of point P and point Q may be calculated based on the central coordinates, major axis radius, minor axis radius, and angle θ of the first and second ellipses, the coordinates of the points that internally divide the Y coordinates of points P' and Q' in the equation y:(H-y) may be set as the Z coordinate of point R' on the cylinder corresponding to the coordinates of point R, and the X and Y coordinates of either point P' or point Q' may be set as the X and Y coordinates of point R', thereby calculating the X, Y, and Z coordinates of point R', and detecting the color of point R' from surrounding pixels using bilinear interpolation, and setting the color of point R' as the color of point R.

上記構成において、前記文字列が複数行の文字列で構成される場合には、前記第1楕円は前記複数行の文字列のうち最上行の文字列における複数の上端点を通過する楕円であり、前記第2楕円は前記複数行の文字列のうち最下行の文字列における複数の下端点を通過する楕円であってもよい。 In the above configuration, if the character string is composed of multiple lines of character strings, the first ellipse may be an ellipse that passes through multiple upper endpoints of the topmost character string of the multiple lines of character strings, and the second ellipse may be an ellipse that passes through multiple lower endpoints of the bottommost character string of the multiple lines of character strings.

本発明に係る情報処理装置は、湾曲状に配置された文字列が記載された曲面を有する円柱を撮影した撮影画像を入力として、文字列の文字認識の結果を出力する学習モデルを用いて、文字列の文字認識の結果を取得してもよい。学習モデルは、ニューラルネットワークなどの公知の機械学習アルゴリズムを利用して生成する。 The information processing device according to the present invention may input a captured image of a curved cylinder on which a character string arranged in a curved shape is written, and obtain the results of character recognition of the character string using a learning model that outputs the results of character recognition of the character string. The learning model is generated using a well-known machine learning algorithm such as a neural network.

本発明によれば、湾曲状に配置された文字列の文字認識の精度を向上させることができる。 This invention can improve the accuracy of character recognition for character strings arranged in a curved pattern.

図1は、本実施の形態に係る情報処理装置を示すブロック図である。FIG. 1 is a block diagram showing an information processing apparatus according to the present embodiment. 図2は、情報処理装置で実行される処理を示すフローチャートである。FIG. 2 is a flowchart showing the process executed by the information processing device. 図3(A)(B)は、図2のステップS8の楕円フィッティング処理の説明図である。3A and 3B are diagrams illustrating the ellipse fitting process in step S8 of FIG. 図4は、図2のステップS9の画像変換処理の説明図である。FIG. 4 is an explanatory diagram of the image conversion process in step S9 of FIG. 図5は、図2のステップS9の画像変換処理後の文字列の一例を示す図である。FIG. 5 is a diagram showing an example of a character string after the image conversion process in step S9 of FIG.

以下、本発明を実施するための形態について図面を参照して説明する。 The following describes an embodiment of the present invention with reference to the drawings.

図1は、本実施の形態に係る情報処理装置を示すブロック図である。図1の情報処理装置100は、プロセッサとしてのCPU(Central Processing Unit)101と、メモリとしてのRAM(Random Access Memory)102及びROM(Read Only Memory)103と、HDD(Hard Disk Drive)104と、インタフェース(IF)105と、ネットワークインタフェース(IF)106とを備えている。情報処理装置100は、例えば、コンピュータ、サーバまたはスマートフォンによって実現することができる。CPU101は、バス107を介してRAM102、ROM103、HDD104、IF105及びネットワークIF106に接続されている。IF105又はネットワークIF106は入力手段として機能し、CPU101は検出手段及び変換手段として機能する。 FIG. 1 is a block diagram showing an information processing device according to this embodiment. The information processing device 100 in FIG. 1 includes a CPU (Central Processing Unit) 101 as a processor, RAM (Random Access Memory) 102 and ROM (Read Only Memory) 103 as memories, a HDD (Hard Disk Drive) 104, an interface (IF) 105, and a network interface (IF) 106. The information processing device 100 can be realized, for example, by a computer, a server, or a smartphone. The CPU 101 is connected to the RAM 102, ROM 103, HDD 104, IF 105, and network IF 106 via a bus 107. IF 105 or network IF 106 functions as an input means, and the CPU 101 functions as a detection means and a conversion means.

IF105は、例えばUSB(Universal Serial Bus)であり、撮像装置としてのカメラ110に接続されている。本実施の形態では、カメラ110は、情報処理装置100の外部に接続されているが、情報処理装置100に内蔵されていてもよい。ネットワークIF106は、情報処理装置100を外部のネットワークに接続するためのインタフェースである。カメラ110は、ネットワークIF106を介して情報処理装置100に接続されていてもよい。 IF 105 is, for example, a USB (Universal Serial Bus) and is connected to a camera 110 serving as an imaging device. In this embodiment, the camera 110 is connected externally to the information processing device 100, but may also be built into the information processing device 100. Network IF 106 is an interface for connecting the information processing device 100 to an external network. The camera 110 may be connected to the information processing device 100 via network IF 106.

HDD104は、カメラ110で撮影された画像や、各種の画像処理や文字認識処理を実行するためのプログラムを記憶する。なお、このプログラムは後述するフローチャートに応じたものである。さらに、HDD104は、各種の画像処理の結果や文字認識処理の結果を記憶する。HDD104に代えて、SSD(Solid State Drive)を採用してもよい。 The HDD 104 stores images captured by the camera 110 and programs for executing various image processing and character recognition processes. These programs correspond to the flowcharts described below. The HDD 104 also stores the results of various image processing and character recognition processes. An SSD (Solid State Drive) may be used instead of the HDD 104.

図2は、情報処理装置100で実行される処理を示すフローチャートである。図2の処理は、HDD104に格納されたプログラムに基づいてCPU101によって実現される。 Figure 2 is a flowchart showing the processing executed by the information processing device 100. The processing in Figure 2 is implemented by the CPU 101 based on a program stored in the HDD 104.

まず、カメラ110で撮影された画像を入力する(ステップS1)。本実施の形態では、カメラ110で撮影される対象物は、湾曲状に配置された文字列が記載された曲面を有する円柱である。文字列は、文字、数字、符号、及び記号などを含む。曲面を有する円柱は、例えば、回転シャフト、ボルト、又はプラグなどの部品である。例えば、湾曲状に配置された文字列とは、円柱の曲面に沿って直線状に記載されている製品名や型番号などの文字列である。円柱の撮影画像では、左右の端に向かって行くほど、文字列の並びが下がったり又は上がったりして、文字列が湾曲状に配置される(例えば、図3(A)参照)。 First, an image captured by camera 110 is input (step S1). In this embodiment, the object captured by camera 110 is a cylinder with a curved surface on which a string of characters is written in a curved manner. The string of characters includes letters, numbers, codes, and symbols. A curved cylinder is, for example, a component such as a rotating shaft, bolt, or plug. For example, a string of characters written in a curved manner is a string of characters such as a product name or model number written in a straight line along the curved surface of the cylinder. In the captured image of the cylinder, the string of characters is arranged in a curved manner, with the arrangement of the characters descending or ascending as you move toward the left or right end (see, for example, Figure 3 (A)).

次に、CPU101は、撮影画像から対象物を検出し(ステップS2)、湾曲状に配置された文字列が記載された曲面の領域を抽出する(ステップS3)。次いで、CPU101は、S3で抽出された領域の画像からαチャンネルの除去処理を行う(ステップS4)。αチャンネルとは、各画素に対し色表現のデータとは別にもたせた補助データであり、一般に画素の不透明度(opacity)を表現する。 Next, CPU 101 detects the object from the captured image (step S2) and extracts the curved surface area where the curved text is written (step S3). Next, CPU 101 performs a process to remove the alpha channel from the image of the area extracted in S3 (step S4). The alpha channel is auxiliary data provided for each pixel in addition to the color representation data, and generally represents the opacity of the pixel.

次いで、CPU101は、αチャンネル除去後の画像に二値化処理を実行し(ステップS5)、二値化処理後の画像に含まれる文字列の線幅を拡大又は縮小する処理を行う(ステップS6)。文字列の線幅が予め設定された閾値の範囲よりも大きい場合には、文字列の線幅を予め設定された閾値の範囲に収まるように縮小し、文字列の線幅が予め設定された閾値の範囲よりも小さい場合には、文字列の線幅を予め設定された閾値に収まるように拡大する。 Next, the CPU 101 performs binarization processing on the image after the alpha channel has been removed (step S5), and performs processing to enlarge or reduce the line width of the character string included in the image after the binarization processing (step S6). If the line width of the character string is larger than the range of a preset threshold, the line width of the character string is reduced to fit within the range of the preset threshold; if the line width of the character string is smaller than the range of the preset threshold, the line width of the character string is enlarged to fit within the preset threshold.

次いで、CPU101は、線幅の拡大又は縮小処理後の画像から、対象物の外形形状に対応する外枠を除去する(ステップS7)。対象物の外形形状に対応する外枠は文字認識に不要な情報であるため除去される。 Next, the CPU 101 removes the outer frame corresponding to the outer shape of the object from the image after line width expansion or reduction processing (step S7). The outer frame corresponding to the outer shape of the object is removed because it is information unnecessary for character recognition.

次いで、CPU101は、外枠除去後の画像、すなわち、湾曲状に配置された文字列の画像に対して、楕円フィッティング処理を実行する(ステップS8)。楕円フィッティング処理の詳細は後述する。 Next, the CPU 101 performs an ellipse fitting process on the image after the outer frame has been removed, i.e., the image of the character string arranged in a curved shape (step S8). Details of the ellipse fitting process will be described later.

次いで、CPU101は、楕円フィッティング処理で検出された複数の楕円の情報に基づいて、対象物の曲面に記載された湾曲状に配列された文字列が直線状に配列されるように、対象物の曲面の画像を平面の画像に変換する画像変換処理を実行する(ステップS9)。画像変換処理の詳細は後述する。 Next, based on the information about the multiple ellipses detected in the ellipse fitting process, the CPU 101 performs image conversion processing to convert the image of the curved surface of the object into a flat image so that the curvedly arranged character strings written on the curved surface of the object are arranged in a straight line (step S9). Details of the image conversion processing will be described later.

次いで、CPU101は、画像変換処理後の平面の画像に対して、光学文字認識処理(Optical Character Recognition)を実行し(ステップS10)、光学文字認識処理の処理結果を出力し(ステップS11)、図2の処理を終了する。光学文字認識処理の処理結果は、HDD104に記憶されてもよいし、又はネットワークIF106又はIF105を介して不図示の外部装置に出力されてもよい。 Next, CPU 101 performs optical character recognition (OCR) on the planar image after image conversion (step S10), outputs the results of the OCR (step S11), and ends the processing in FIG. 2. The results of the OCR may be stored in HDD 104, or may be output to an external device (not shown) via network IF 106 or IF 105.

図2のステップS2~ステップS10の処理は、機械学習により実行してもよい。この場合、情報処理装置100は、例えば湾曲状に配置された文字列が記載された曲面を有する円柱を撮影した撮影画像を入力として、文字列の文字認識の結果を出力する学習モデルを用いて、文字列の文字認識の結果を取得する。学習モデルは、ニューラルネットワークなどの公知の機械学習アルゴリズムを利用して生成する。機械学習アルゴリズムに入力する教師データは、例えば、カメラ110によって、湾曲状に配置された文字列が記載された曲面を有する円柱を様々な条件で撮影し、得られる撮影画像に文字列の文字認識の結果を紐づけることで作成することができる。 The processing of steps S2 to S10 in FIG. 2 may be performed by machine learning. In this case, the information processing device 100 acquires the results of character recognition of a string of characters using a learning model that takes as input, for example, a captured image of a cylinder with a curved surface on which a string of characters is written in a curved manner, and outputs the results of character recognition of the string of characters. The learning model is generated using a well-known machine learning algorithm such as a neural network. The training data to be input into the machine learning algorithm can be created, for example, by using the camera 110 to capture images of a cylinder with a curved surface on which a string of characters is written in a curved manner under various conditions, and linking the results of character recognition of the string of characters to the captured images obtained.

図3(A)(B)は、図2のステップS8の楕円フィッティング処理の説明図である。図3(A)に示すように、円柱の曲面に「ABCD 1234-EF」の2行の文字列が記載されているとする。 Figures 3(A) and (B) are explanatory diagrams of the ellipse fitting process in step S8 of Figure 2. As shown in Figure 3(A), assume that two lines of text, "ABCD 1234-EF," are written on the curved surface of a cylinder.

楕円フィッティング処理では、CPU101は、「A」「B」「C」「D」「1」「2」「3」「4」「E」「F」のそれぞれの塊を検出し、各塊の上端点と下端点とを抽出する。各塊の上端点と下端点とを抽出した状態を図3(A)の右図に示す。 In the ellipse fitting process, CPU 101 detects each of the blocks "A," "B," "C," "D," "1," "2," "3," "4," "E," and "F," and extracts the top and bottom endpoints of each block. The state after the top and bottom endpoints of each block have been extracted is shown in the right diagram of Figure 3(A).

円柱の曲面に「ABCD 1234-EF」の2行の文字列が記載されている場合、1行目の「ABCD」の複数の上端点と、1行目の「ABCD」の複数の下端点と、2行目の「1234-EF」の複数の上端点と、2行目の「1234-EF」の複数の下端点との、4つの点群ができる。ただし、「-」は連結として省かれ、「1234」と「EF」で分けて6つの点群ができる。また「E」「F」などの平らな部分は、端点が1点ではなく多数表示されている。 If two lines of text, "ABCD 1234-EF," are written on the curved surface of a cylinder, four point clouds will be created: the multiple upper endpoints of "ABCD" on the first line, the multiple lower endpoints of "ABCD" on the first line, the multiple upper endpoints of "1234-EF" on the second line, and the multiple lower endpoints of "1234-EF" on the second line. However, "-" is omitted as a connection, resulting in six point clouds, separated by "1234" and "EF." Additionally, flat parts such as "E" and "F" have multiple endpoints displayed instead of just one.

次に、図3(B)に示すように、CPU101は、1行目の「ABCD」の複数の上端点の点群と、1行目の「ABCD」の複数の下端点の点群と、2行目の「1234-EF」の複数の上端点の点群と、2行目の「1234-EF」の複数の下端点の点群とのそれぞれから楕円E1~E4を検出する。楕円E1は1行目の「ABCD」の複数の上端点の点群を通過し、楕円E2は1行目の「ABCD」の複数の下端点の点群を通過し、楕円E3は2行目の「1234-EF」の複数の上端点の点群を通過し、楕円E4は2行目の「1234-EF」の複数の下端点の点群を通過する。CPU101は、各点群に対して楕円フィッティングを実施し、最急降下法で楕円の最適値を見つける。 Next, as shown in FIG. 3(B), CPU 101 detects ellipses E1 to E4 from the point cloud of the multiple upper endpoints of "ABCD" on the first line, the point cloud of the multiple lower endpoints of "ABCD" on the first line, the point cloud of the multiple upper endpoints of "1234-EF" on the second line, and the point cloud of the multiple lower endpoints of "1234-EF" on the second line. Ellipse E1 passes through the point cloud of the multiple upper endpoints of "ABCD" on the first line, ellipse E2 passes through the point cloud of the multiple lower endpoints of "ABCD" on the first line, ellipse E3 passes through the point cloud of the multiple upper endpoints of "1234-EF" on the second line, and ellipse E4 passes through the point cloud of the multiple lower endpoints of "1234-EF" on the second line. CPU 101 performs ellipse fitting on each point cloud and finds the optimal value of the ellipse using the steepest descent method.

図3(B)に示すように、CPU101は、4つの同じ大きさの楕円E1~E4を検出し、楕円E1~E4の中心点は上下に並び、楕円E1~E4の上下左右を固定する。この楕円検出によって円柱の傾きを把握することができる。 As shown in Figure 3 (B), the CPU 101 detects four ellipses E1 to E4 of the same size, aligns the center points of the ellipses E1 to E4 vertically, and fixes the top, bottom, left, and right of the ellipses E1 to E4. This ellipse detection makes it possible to determine the tilt of the cylinder.

楕円フィッティングに使用される楕円は、以下の式(1)で示される。
g(x,y)=ax+bxy+cy+dx+ey+f (1)
D=4ac-b>0かつg(x,y)=0のとき、x,yは楕円上の点である。
The ellipse used for ellipse fitting is given by the following equation (1).
g(x,y)= ax2 +bxy+ cy2 +dx+ey+f (1)
If D=4ac−b 2 >0 and g(x,y)=0, then x,y are points on the ellipse.

楕円フィッティングでは、Σ[g(x,y)]が最小となる係数a,b,c,d,eを求めることにより、一番点群の近くを通る楕円の式が得られる。また、楕円フィッティングでは、下記式(2)(3)の複数の楕円の中心のx座標及び長径が共通になるように同時フィッティングを行う。なお、各楕円の長軸及び短軸がx軸及びy軸にそれぞれ沿っている場合、係数b=0となる。
楕円E1 a1x+c1y+d1x+e1y+f1=0 (2)
楕円Em amx+cmy+dmx+emy+fm=0 (m=2以上の整数) (3)
In ellipse fitting, the equation of the ellipse that passes closest to the point cloud is obtained by finding the coefficients a, b, c, d, and e that minimize Σ[g(x, y)] 2 . Furthermore, in ellipse fitting, simultaneous fitting is performed so that the x-coordinate of the center and the major axis of multiple ellipses in the following equations (2) and (3) are the same. Note that if the major and minor axes of each ellipse are aligned with the x-axis and y-axis, respectively, the coefficient b = 0.
Ellipse E1 a1x 2 + c1y 2 + d1x + e1y + f1 = 0 (2)
Ellipse Em amx 2 + cmy 2 + dmx + emy + fm = 0 (m = integer greater than or equal to 2) (3)

なお、楕円フィッティング手法としては、例えば、以下の文献1を参考にすることができる。
文献1:Andrew Fitzgibbon,Maurizio Pilu,“Direct linear least squares fitting of an ellipse”,November 2000,IEEE Transactions on Pattern Analysis and Machine Intelligence 21(5)
As an ellipse fitting method, for example, the following document 1 can be referred to.
Reference 1: Andrew Fitzgibbon, Maurizio Pilu, “Direct linear least squares fitting of an ellipse”, November 2000, IEEE Transactions on Pattern Analysis and Machine Intelligence 21(5)

図3(B)では、CPU101は、4つの点群のそれぞれから楕円E1~E4を検出しているが、文字列が複数行の文字列で構成される場合には、CPU101は、複数行の文字列のうち最上行の文字列における複数の上端点を通過する楕円E1と、複数行の文字列のうち最下行の文字列における複数の下端点を通過する楕円E4とを検出してもよい。この場合、検出される楕円の個数を減らすことができるので、CPU101による計算量を削減でき、処理時間を低減できる。 In Figure 3(B), CPU 101 detects ellipses E1 to E4 from each of the four point groups. However, if the character string consists of multiple lines of character strings, CPU 101 may detect ellipse E1 that passes through multiple upper endpoints of the topmost line of the character string, and ellipse E4 that passes through multiple lower endpoints of the bottommost line of the character string. In this case, the number of ellipses detected can be reduced, thereby reducing the amount of calculations performed by CPU 101 and shortening processing time.

図4は、図2のステップS9の画像変換処理の説明図である。図5は、図2のステップS9の画像変換処理後の文字列の一例を示す図である。まず、CPU101は、画像変換処理前の楕円フィッティング処理において、予め、楕円E1の中心点C1の座標(Cx1、Cy1)、楕円E4の中心点C2の座標(Cx2、Cy2)、楕円E1の長軸の半径A1、楕円E4の長軸の半径A2、楕円E1の短軸の半径B1、楕円E4の短軸の半径B2を検出しているものとする。 Figure 4 is an explanatory diagram of the image conversion process of step S9 in Figure 2. Figure 5 is a diagram showing an example of a character string after the image conversion process of step S9 in Figure 2. First, it is assumed that the CPU 101 has previously detected the coordinates (Cx1, Cy1) of the center point C1 of the ellipse E1, the coordinates (Cx2, Cy2) of the center point C2 of the ellipse E4, the radius A1 of the major axis of the ellipse E1, the radius A2 of the major axis of the ellipse E4, the radius B1 of the minor axis of the ellipse E1, and the radius B2 of the minor axis of the ellipse E4 in the ellipse fitting process before the image conversion process.

画像変換処理では、図4に示すように、CPU101は、楕円フィッティング処理で検出された楕円E1及びE4の中心点C1及びC2の座標、楕円E1及びE4の長軸の半径A1及びA2、並びに楕円E1及びE4の短軸の半径B1及びB2に基づいて、対象物(円柱β)の曲面に記載された湾曲状に配列された文字列が直線状に配列されるように、対象物の曲面の画像を平面画像αに変換する。 In the image conversion process, as shown in Figure 4, the CPU 101 converts the image of the curved surface of the object (cylinder β) into a flat image α based on the coordinates of the center points C1 and C2 of the ellipses E1 and E4 detected in the ellipse fitting process, the radii A1 and A2 of the major axes of the ellipses E1 and E4, and the radii B1 and B2 of the minor axes of the ellipses E1 and E4, so that the curvedly arranged character strings written on the curved surface of the object (cylinder β) are arranged in a straight line.

CPU101は、楕円E1及び楕円E4の中心点C1及びC2のY座標の差分(=Cy1-Cy2)を平面画像αのY方向の長さHとして算出し、楕円E1及び楕円E4のいずれか一方の周長の半分の長さを平面画像αのX方向の長さWとして算出する。長さH及び長さWは四捨五入により整数にする。例えば、楕円E1及び楕円E4の周長の半分の長さは、下記式(4)(5)によりそれぞれ算出することができる。
楕円E1の周長の半分の長さ=π[(3(A1+B1)-√(A1+3B1)(3A1+B1))]/2 (4)
楕円E4の周長の半分の長さ=π[(3(A2+B2)-√(A2+3B2)(3A2+B2))]/2 (5)
The CPU 101 calculates the difference (= Cy1 - Cy2) between the Y coordinates of the center points C1 and C2 of the ellipses E1 and E4 as the length H in the Y direction of the planar image α, and calculates half the perimeter of either the ellipse E1 or the ellipse E4 as the length W in the X direction of the planar image α. The lengths H and W are rounded off to integers. For example, half the perimeters of the ellipses E1 and E4 can be calculated using the following formulas (4) and (5), respectively.
Half the perimeter of the ellipse E1 = π [(3(A1 + B1) - √(A1 + 3B1) (3A1 + B1))] / 2 (4)
Half the perimeter of ellipse E4 = π [(3(A2 + B2) - √(A2 + 3B2) (3A2 + B2))] / 2 (5)

平面画像αの右下端を原点Oとし、上向き及び左向きを正とし、平面画像αの任意の点Rの座標を(x、y)とする。 Let the bottom right corner of the planar image α be the origin O, the upward and leftward directions be positive, and the coordinates of any point R on the planar image α be (x, y).

次に、CPU101は、以下の(A)~(D)の手順に従って点R(x、y)の色を求める。
(A)楕円E1及び楕円E4の長軸の半径A1及びA2が水平方向から時計回りに回転する角度をθとするとき、CPU101は点Rの座標xと長さWとから角度θを算出する。
対象物は円柱βなので、長さWはW=πr(rは円の半径)で表し、点Rの座標xはx=2πr×θ/2π=rθで表すことができる。したがって、角度θは、θ=x/r=x/(W/π)=πx/Wと表すことができる。このため、角度θは点Rの座標xと長さWとから算出できる。
Next, the CPU 101 determines the color of the point R(x, y) according to the following procedures (A) to (D).
(A) When the angle at which the radii A1 and A2 of the major axes of the ellipse E1 and the ellipse E4 rotate clockwise from the horizontal direction is θ, the CPU 101 calculates the angle θ from the coordinate x and length W of the point R.
Because the object is a cylinder β, the length W can be expressed as W = πr (r is the radius of the circle), and the coordinate x of point R can be expressed as x = 2πr × θ/2π = rθ. Therefore, the angle θ can be expressed as θ = x/r = x/(W/π) = πx/W. Therefore, the angle θ can be calculated from the coordinate x of point R and the length W.

(B)点Rを通過する垂直な線分の上端点及び下端点を点P、点Qとした場合に、CPU101は点P及び前記点Qの座標に対応する楕円E1及び楕円E4の点P’及び点Q’の座標を楕円E1及びE4の中心点C1及びC2の座標、楕円E1及びE4の長軸の半径A1及びA2、楕円E1及びE4の短軸の半径B1及びB2並びに角度θに基づいて算出する。
点P’の座標は(Cx1+A1cosθ,Cy1-B1sinθ)となり、点Q’の座標は(Cx2+A2cosθ,Cy2-B2sinθ)となる。
(B) If the upper and lower endpoints of a vertical line segment passing through point R are points P and Q, the CPU 101 calculates the coordinates of points P' and Q' of ellipses E1 and E4 corresponding to the coordinates of point P and point Q based on the coordinates of center points C1 and C2 of ellipses E1 and E4, radii A1 and A2 of the major axes of ellipses E1 and E4, radii B1 and B2 of the minor axes of ellipses E1 and E4, and angle θ.
The coordinates of point P' are (Cx1+A1cos θ, Cy1-B1sin θ), and the coordinates of point Q' are (Cx2+A2cos θ, Cy2-B2sin θ).

(C)CPU101は点P’及び点Q’のY座標をy:(H-y)に内分する点の座標を点Rの座標に対応する円柱β上の点R’のZ座標とし、点P’及び点Q’のいずれかの一方のX座標及びY座標を点R’のX座標及びY座標とすることで、点R’のX座標、Y座標及びZ座標を算出する。
例えば、点R’のX座標、Y座標及びZ座標は(Cx2+A2cosθ,Cy2-B2sinθ,y)と表すことができる。
(C) The CPU 101 calculates the X, Y, and Z coordinates of point R' by setting the coordinates of the point that divides the Y coordinates of points P' and Q' internally into y:(H-y) as the Z coordinate of point R' on the cylinder β that corresponds to the coordinates of point R, and setting the X and Y coordinates of either point P' or point Q' as the X and Y coordinates of point R'.
For example, the X, Y and Z coordinates of point R' can be expressed as (Cx2+A2cos θ, Cy2-B2sin θ, y).

(D)CPU101は点R’の色を周辺の4つの画素から双線形補間で検出し、点R’の色を点Rの色として設定する。例えば、上記4つの画素は、点R’に隣接する右上、右下、左上及び左下の画素である。双線形補間(Bi-linear interpolation)は、周囲の4つの画素を用いた公知の補間法であるので、その詳細な説明は省略する。 (D) The CPU 101 detects the color of point R' using bilinear interpolation from the four surrounding pixels and sets the color of point R' as the color of point R. For example, the four pixels are the upper right, lower right, upper left, and lower left pixels adjacent to point R'. Bilinear interpolation is a well-known interpolation method that uses the four surrounding pixels, so a detailed explanation of it will be omitted.

平面画像αのすべての点に対して、上述した(A)~(D)の手順を繰り返すことで、対象物(円柱β)の曲面の画像を平面画像αに変換することができる。これにより、図3(A)の曲面に記載された湾曲状に配置された文字列は、図5に示すように平面画像α上で直線状に配列される。 By repeating steps (A) through (D) above for all points on the planar image α, the image of the curved surface of the object (cylinder β) can be converted into the planar image α. As a result, the curved character strings written on the curved surface in Figure 3(A) are arranged in a straight line on the planar image α, as shown in Figure 5.

以上説明したように、本実施形態によれば、情報処理装置100は、湾曲状に配置された文字列が記載された曲面を有する対象物の画像を入力するIF105又はネットワークIF106と、画像から文字列の複数の上端点を通過する楕円E1(第1楕円)及び画像から文字列の複数の下端点を通過する楕円E4(第2楕円)を検出し、楕円E1及び楕円E4の中心座標、楕円E1及び楕円E4の長軸の半径A1及びA2、並びに楕円E1及び楕円E4の短軸の半径B1及びB2に基づいて、対象物の曲面の画像を平面画像αに変換するCPU101とを備えている。これにより、対象物の曲面の画像を平面画像αに変換することができる。また、図3(A)の対象物の曲面に記載された湾曲状に配列された文字列は、図5に示すように平面画像α上で直線状に配列されるので、湾曲状に配置された文字列の文字認識の精度を向上させることができる。 As described above, according to this embodiment, the information processing device 100 includes an IF 105 or network IF 106 that inputs an image of an object having a curved surface on which a character string arranged in a curved manner is written, and a CPU 101 that detects from the image an ellipse E1 (first ellipse) that passes through multiple upper endpoints of the character string and an ellipse E4 (second ellipse) that passes through multiple lower endpoints of the character string, and converts the image of the curved surface of the object into a planar image α based on the center coordinates of the ellipse E1 and the ellipse E4, the radii A1 and A2 of the major axes of the ellipses E1 and E4, and the radii B1 and B2 of the minor axes of the ellipses E1 and E4. This allows the image of the curved surface of the object to be converted into a planar image α. Furthermore, since the character strings arranged in a curved manner on the curved surface of the object in FIG. 3(A) are arranged in a linear manner on the planar image α as shown in FIG. 5, the accuracy of character recognition of character strings arranged in a curved manner can be improved.

また、対象物は円柱であり、CPU101は、楕円E1及び楕円E4の中心座標のY座標の差分を平面画像αのY方向の長さHとし、楕円E1及び楕円E4のいずれか一方の周長の半分の長さを平面画像αのX方向の長さWとし、平面画像αの右下端を原点とし、上向き及び左向きを正とし、平面画像αの任意の点Rの座標を(x、y)とする。また、CPU101は、平面画像αの長軸の半径が水平方向から時計回りに回転する角度をθとするとき、点Rの座標xと長さWとから角度θを算出し、点Rを通過する垂直な線分の上端点及び下端点を点P、点Qとした場合に、点P及び点Qの座標に対応する円柱上の点P’及び点Q’の座標を楕円E1及び楕円E4の中心点C1及びC2、長軸の半径A1及びA2、短軸の半径B1及びB2並びに角度θに基づいて算出する。さらに、CPU101は、点P’及び点Q’のY座標をy:(H-y)に内分する点の座標を点Rの座標に対応する円柱上の点R’のZ座標とし、点P’及び点Q’のいずれか一方のX座標及びY座標を点R’のX座標及びY座標とすることで、点R’のX座標、Y座標及びZ座標を算出し、点R’の色を周辺の画素から双線形補間で検出し、点R’の色を点Rの色として設定する。これにより、対象物の曲面の画像を平面画像αに変換することができる。 The object is a cylinder, and the CPU 101 defines the difference between the Y coordinates of the centers of ellipses E1 and E4 as the Y-direction length H of the planar image α, defines half the perimeter of either ellipse E1 or E4 as the X-direction length W of the planar image α, defines the lower right end of the planar image α as the origin, defines upward and leftward directions as positive, and defines the coordinates of any point R on the planar image α as (x, y). Furthermore, when the angle at which the radius of the major axis of the planar image α rotates clockwise from the horizontal is defined as θ, the CPU 101 calculates the angle θ from the coordinate x of point R and the length W. If the upper and lower endpoints of a vertical line segment passing through point R are defined as points P and B2, the CPU 101 calculates the coordinates of points P' and Q' on the cylinder corresponding to the coordinates of points P and Q based on the center points C1 and C2 of the ellipses E1 and E4, the radii A1 and A2 of the major axes, the radii B1 and B2 of the minor axes, and the angle θ. Furthermore, the CPU 101 sets the coordinates of the point that divides the Y coordinates of points P' and Q' internally in the ratio y:(H-y) as the Z coordinate of point R' on the cylinder corresponding to the coordinates of point R, and sets the X and Y coordinates of either point P' or point Q' as the X and Y coordinates of point R' to calculate the X, Y, and Z coordinates of point R', detects the color of point R' from surrounding pixels using bilinear interpolation, and sets the color of point R' as the color of point R. In this way, the image of the curved surface of the object can be converted into a planar image α.

以上本発明の好ましい実施形態について詳述したが、本発明は係る特定の実施形態に限定されるものではなく、特許請求の範囲に記載された本発明の要旨の範囲内において、種々の変形・変更が可能である。 Although the preferred embodiment of the present invention has been described in detail above, the present invention is not limited to such specific embodiment, and various modifications and variations are possible within the scope of the gist of the present invention as set forth in the claims.

100 情報処理装置
101 CPU
102 RAM
103 ROM
104 HDD
105 インタフェース
106 ネットワークインタフェース
107 バス
110 カメラ
100 Information processing device 101 CPU
102 RAM
103 ROM
104 HDD
105 Interface 106 Network interface 107 Bus 110 Camera

Claims (3)

湾曲状に配置された文字列が記載された曲面を有する対象物の画像を入力する入力手段と、
前記画像から前記文字列の複数の上端点を通過する第1楕円及び前記画像から前記文字列の複数の下端点を通過する第2楕円を検出する検出手段と、
前記第1楕円及び前記第2楕円の中心座標、前記第1楕円及び前記第2楕円の長軸の半径、並びに前記第1楕円及び前記第2楕円の短軸の半径に基づいて、前記対象物の曲面の画像を平面の画像に変換する変換手段と
を備えることを特徴とする情報処理装置。
an input means for inputting an image of an object having a curved surface on which character strings arranged in a curved shape are written;
a detection means for detecting a first ellipse passing through a plurality of upper endpoints of the character string from the image and a second ellipse passing through a plurality of lower endpoints of the character string from the image;
and a conversion means for converting an image of the curved surface of the object into an image of a plane based on the central coordinates of the first ellipse and the second ellipse, the radii of the major axes of the first ellipse and the second ellipse, and the radii of the minor axes of the first ellipse and the second ellipse.
前記対象物は円柱であり、
前記変換手段は、
前記第1楕円及び前記第2楕円の中心座標のY座標の差分を前記平面の画像のY方向の長さHとし、
前記第1楕円及び前記第2楕円のいずれか一方の周長の半分の長さを前記平面の画像のX方向の長さWとし、
前記平面の画像の右下端を原点とし、上向き及び左向きを正とし、前記平面の画像の任意の点Rの座標を(x、y)とし、
前記第1楕円及び前記第2楕円の長軸の半径が水平方向から時計回りに回転する角度をθとするとき、前記点Rの座標xと前記長さWとから前記角度θを算出し、
前記点Rを通過する垂直な線分の上端点及び下端点を点P、点Qとした場合に、前記点P及び前記点Qの座標に対応する前記円柱上の点P’及び点Q’の座標を前記第1楕円及び前記第2楕円の中心座標、長軸の半径、短軸の半径並びに前記角度θに基づいて算出し、
前記点P’及び前記点Q’のY座標をy:(H-y)に内分する点の座標を前記点Rの座標に対応する前記円柱上の点R’のZ座標とし、前記点P’及び前記点Q’のいずれかの一方のX座標及びY座標を点R’のX座標及びY座標とすることで、前記点R’のX座標、Y座標及びZ座標を算出し、
前記点R’の色を周辺の画素から双線形補間で検出し、前記点R’の色を前記点Rの色として設定する
ことを特徴とする請求項1に記載の情報処理装置。
the object is a cylinder,
The conversion means
a difference between the Y coordinates of the centers of the first ellipse and the second ellipse is defined as a length H in the Y direction of the image of the plane;
a length W in the X direction of the image of the plane is set to half the perimeter of either the first ellipse or the second ellipse;
The lower right corner of the image of the plane is set as the origin, and the upward and leftward directions are set as positive directions. The coordinates of an arbitrary point R in the image of the plane are set as (x, y),
When the angle at which the radii of the major axes of the first ellipse and the second ellipse rotate clockwise from the horizontal direction is defined as θ, the angle θ is calculated from the coordinate x of the point R and the length W;
When the upper and lower end points of a vertical line segment passing through the point R are defined as points P and Q, the coordinates of points P' and Q' on the cylinder corresponding to the coordinates of the point P and the point Q are calculated based on the central coordinates of the first ellipse and the second ellipse, the radius of the major axis, the radius of the minor axis, and the angle θ;
The coordinates of the point that divides the Y coordinates of the points P' and Q' internally into y:(H-y) are set as the Z coordinate of the point R' on the cylinder that corresponds to the coordinates of the point R, and the X coordinate and Y coordinate of either the point P' or the point Q' are set as the X coordinate and Y coordinate of the point R', thereby calculating the X coordinate, Y coordinate and Z coordinate of the point R';
2. The information processing apparatus according to claim 1, wherein the color of said point R' is detected from surrounding pixels by bilinear interpolation, and the color of said point R' is set as the color of said point R.
前記文字列が複数行の文字列で構成される場合には、前記第1楕円は前記複数行の文字列のうち最上行の文字列における複数の上端点を通過する楕円であり、前記第2楕円は前記複数行の文字列のうち最下行の文字列における複数の下端点を通過する楕円であることを特徴とする請求項1又は2に記載の情報処理装置。
3. The information processing device according to claim 1, wherein, when the character string is composed of multiple lines of character strings, the first ellipse is an ellipse that passes through multiple upper endpoints of the topmost character string of the multiple lines of character strings, and the second ellipse is an ellipse that passes through multiple lower endpoints of the bottommost character string of the multiple lines of character strings.
JP2023018514A 2023-02-09 2023-02-09 Information processing device Active JP7800473B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2023018514A JP7800473B2 (en) 2023-02-09 2023-02-09 Information processing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2023018514A JP7800473B2 (en) 2023-02-09 2023-02-09 Information processing device

Publications (2)

Publication Number Publication Date
JP2024113491A JP2024113491A (en) 2024-08-22
JP7800473B2 true JP7800473B2 (en) 2026-01-16

Family

ID=92425504

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2023018514A Active JP7800473B2 (en) 2023-02-09 2023-02-09 Information processing device

Country Status (1)

Country Link
JP (1) JP7800473B2 (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017203777A1 (en) 2016-05-23 2017-11-30 ソニー株式会社 Electronic device, control method for electronic device, and program

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017203777A1 (en) 2016-05-23 2017-11-30 ソニー株式会社 Electronic device, control method for electronic device, and program

Also Published As

Publication number Publication date
JP2024113491A (en) 2024-08-22

Similar Documents

Publication Publication Date Title
JP5082637B2 (en) Image processing program, image processing method, and image processing apparatus
CN111598074A (en) Edge detection method and apparatus, electronic device, and storage medium
US9959475B2 (en) Table data recovering in case of image distortion
CN114529922B (en) A method for identifying table structure of wireless frame table image
CN115273098A (en) Text detection method, device, equipment and storage medium
JP7800473B2 (en) Information processing device
CN114529923B (en) Method for detecting merging cells of table
AU2015201663A1 (en) Dewarping from multiple text columns
JP4869365B2 (en) Image processing apparatus and image processing method
KR100350854B1 (en) System and method of rotating binary images
JP6121768B2 (en) Image detection apparatus, control program, and image detection method
JP4324417B2 (en) Image processing apparatus and image processing method
JPH05174182A (en) Document tilt angle detection method and document tilt angle detection device
Kar et al. Line reconstruction and segmentation of words and characters using measures of central tendency and measures of dispersion
KR20250179300A (en) Vehicle mileage recognition method and apparatus
JP4869364B2 (en) Image processing apparatus and image processing method
JPH04239391A (en) Pattern normalizing system
Wu et al. Gender classification by using human nose features
US20210216748A1 (en) Probability acquisition apparatus and probability acquisition method
JP2025006464A (en) Character Recognition Device
JP2024177917A (en) Symbol Identification Method
JPS5837780A (en) Character recognizing method
JPS62114080A (en) Character recognizing system
Asavareongchai et al. Recognition of Thai characters and text from document templates
CN116469105A (en) Image recognition method, device, computer equipment, and computer-readable storage medium

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20250221

TRDD Decision of grant or rejection written
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20251125

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20251202

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20251215

R150 Certificate of patent or registration of utility model

Ref document number: 7800473

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150