[go: up one dir, main page]

JP2011076518A - Optical information reader and method for acquiring image data - Google Patents

Optical information reader and method for acquiring image data Download PDF

Info

Publication number
JP2011076518A
JP2011076518A JP2009229366A JP2009229366A JP2011076518A JP 2011076518 A JP2011076518 A JP 2011076518A JP 2009229366 A JP2009229366 A JP 2009229366A JP 2009229366 A JP2009229366 A JP 2009229366A JP 2011076518 A JP2011076518 A JP 2011076518A
Authority
JP
Japan
Prior art keywords
image
data
memory
image data
optical information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2009229366A
Other languages
Japanese (ja)
Inventor
Atsushi Nagaura
篤志 永浦
Yusuke Otsubo
祐介 大坪
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.)
Keyence Corp
Original Assignee
Keyence 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 Keyence Corp filed Critical Keyence Corp
Priority to JP2009229366A priority Critical patent/JP2011076518A/en
Publication of JP2011076518A publication Critical patent/JP2011076518A/en
Pending legal-status Critical Current

Links

Abstract

<P>PROBLEM TO BE SOLVED: To provide an optical information reader for flexible gradation conversion of picked-up images to meet users' needs without using dedicated elements and also to provide a method for acquiring image data. <P>SOLUTION: A gradation converting mean of a CPU 2 performs gradation conversion of an image picked up by an image sensor 1, stores the image in an internal memory 20, and transfers the image from the internal memory 20 to a memory 3. A gradation conversion table 23 that defines the rule of the conversion can be selected arbitrarily by a user, and thereby an optical information reader that has the flexible rule of the conversion can be achieved. <P>COPYRIGHT: (C)2011,JPO&INPIT

Description

本発明は2次元コード等を光学的に読み取る光学的情報読取技術に係り、特に2次元撮像素子を用いた光学的情報読取装置及び画像データ取込方法に関する。   The present invention relates to an optical information reading technique for optically reading a two-dimensional code and the like, and more particularly to an optical information reading apparatus and an image data capturing method using a two-dimensional image sensor.

例えば、1次元コードや2次元コード等の光学的情報を撮像し、その撮像した光学的情報をデコードすることにより光学的情報の読み取りを行うイメージセンシング方式の光学的情報読取装置が知られている。このイメージセンシング方式の光学的情報読取装置は、画像データをフレーム毎に解析して復号化が行われる。光学的情報読取装置においては、特に製造コストや消費電力の低減という観点から、撮像部にCMOSイメージセンサを用いた光学的情報読取装置が普及する傾向にある。一般にCMOSイメージセンサでは、撮像画像における高解像度化の要求によって情報量の大容量化が求められている。このためデータ出力が10ビットであるものが主流になりつつある。一方光学的情報読取装置本体においては、製造コストの削減や小型化、画像処理の高速化という観点から処理能力の向上及びメモリ容量の拡大には限界がある。またQRコード等の2次元コードを認識するためには、8ビットの画像データで十分である場合が多い。そこでCMOSイメージセンサからの出力データをあらかじめ定められた規則に則り、ビット数がより小さいデジタルデータに変換して画像データの取込みを行う光学的情報読取装置が提案されている。特許文献1には上位ビットに応じて10ビットのうちの8ビットのみを画像データとして取込むデータ取込装置が提案されている。   For example, there is known an image sensing type optical information reading apparatus that images optical information such as a one-dimensional code and a two-dimensional code, and reads the optical information by decoding the captured optical information. . This image sensing type optical information reading apparatus analyzes and decodes image data for each frame. In optical information reading devices, optical information reading devices using a CMOS image sensor in an image pickup unit tend to become widespread, particularly from the viewpoint of reducing manufacturing costs and power consumption. In general, in a CMOS image sensor, a large amount of information is required due to a demand for high resolution in a captured image. For this reason, data output of 10 bits is becoming mainstream. On the other hand, in the optical information reading apparatus main body, there is a limit to the improvement of the processing capability and the expansion of the memory capacity from the viewpoint of reduction of manufacturing cost, size reduction, and speeding up of image processing. Also, in order to recognize a two-dimensional code such as a QR code, 8-bit image data is often sufficient. Therefore, an optical information reading apparatus has been proposed in which output data from a CMOS image sensor is converted into digital data having a smaller number of bits in accordance with a predetermined rule and image data is taken in. Patent Document 1 proposes a data capturing device that captures only 8 bits out of 10 bits as image data in accordance with upper bits.

特開2003−6569号公報Japanese Patent Laid-Open No. 2003-669

従来の光学的情報読取装置では、CPU前段の専用回路でCMOSイメージセンサによる画像データの各画素の出力のうち、一部のビットのデータ出力を落し、残りのビットのデータ出力を有効な画像データとして取込みが可能である。しかし専用のCPLDやゲートアレー素子が必要となり、変換規則の変更が容易ではない。そのため撮像画像に対する解析の用途・精度を考慮してビット数の削減手法の変更ができないという欠点があった。   In the conventional optical information reading device, a part of the data output of each pixel of the image data by the CMOS image sensor is dropped in a dedicated circuit in front of the CPU, and the data output of the remaining bits is used as effective image data. Can be taken in as However, a dedicated CPLD or gate array element is required, and it is not easy to change the conversion rule. For this reason, there is a drawback in that the method for reducing the number of bits cannot be changed in consideration of the application and accuracy of analysis for the captured image.

本発明では上述した問題点に鑑みてなされたもので、専用の素子を用いることなくユーザの用途に柔軟に対応し、撮像画像に対する解析精度を考慮してビット数を削減して取込むことができる光学的情報読取装置及び画像データ取込方法を提供するものである。   The present invention has been made in view of the above-described problems, and can be flexibly adapted to the user's application without using a dedicated element, and can be captured by reducing the number of bits in consideration of analysis accuracy for a captured image. An optical information reading apparatus and an image data capturing method that can be used are provided.

この課題を解決するために、本発明の光学的情報読取装置は、読取対象を撮像する2次元撮像素子を有する撮像部と、CPUを有し、前記撮像部で撮像された読取対象をメモリに保持するときに画像処理してデコードする制御部と、前記撮像部で撮像された読取対象の画像を保持するメモリと、を有する光学的情報読取装置であって、前記制御部は、前記撮像部から画像データを受け、所定条件に基づく階調変換を実行し、階調変換後の画像データを前記メモリに保持する階調変換手段と、前記メモリに格納された階調変換後の画像データを読出し、デコードする演算手段と、を具備するものである。   In order to solve this problem, an optical information reading apparatus according to the present invention includes an image pickup unit having a two-dimensional image pickup device that picks up an image of a read target, and a CPU, and the read target imaged by the image pickup unit is stored in a memory. An optical information reading apparatus comprising: a control unit that performs image processing and decoding when holding; and a memory that holds an image to be read captured by the imaging unit, wherein the control unit includes the imaging unit A tone converting unit that receives the image data from the image, executes tone conversion based on a predetermined condition, and stores the image data after the tone conversion in the memory; and the image data after the tone conversion stored in the memory And an arithmetic means for reading and decoding.

ここで前記制御部のCPUは、内部メモリを有し、前記内部メモリは、撮像部より得られる行単位の画像データを保持する受信バッファと、前記メモリに転送する前の階調変換後の行単位の画像データを保持する送信バッファと、を有するようにしてもよい。   Here, the CPU of the control unit has an internal memory, and the internal memory has a reception buffer that holds image data in units of rows obtained from the imaging unit, and a row after gradation conversion before being transferred to the memory. A transmission buffer that holds image data of a unit.

ここで前記内部メモリはSRAMであり、前記受信バッファは少なくとも2つの受信バッファを有し、前記送信バッファは少なくとも2つの送信バッファを有し、前記階調変換手段は、前記撮像部で撮像された画像信号を行単位で前記2つの受信バッファに交互に保持するデータ受信処理、前記受信バッファの行単位の画像データを各画素のデータ数を削減して、交互に前記送信バッファに転送する階調変換処理、及び前記2つの送信バッファより交互に前記メモリに転送する転送処理を並列に実行するようにしてもよい。   Here, the internal memory is an SRAM, the reception buffer has at least two reception buffers, the transmission buffer has at least two transmission buffers, and the gradation converting means is imaged by the imaging unit. Data reception processing that alternately holds image signals in the two reception buffers in units of rows, gradation in which the image data in units of rows in the reception buffer is transferred to the transmission buffers alternately by reducing the number of data of each pixel The conversion process and the transfer process of alternately transferring to the memory from the two transmission buffers may be executed in parallel.

ここで前記撮像部は、L列M行の画像データを出力するイメージセンサを有し、前記階調変換手段は、画像処理に必要なi行からi+N行(1≦i<N≦L)までのデータを取込んで前記受信バッファに保持し、前記送信バッファの変換後のデータのうちjからj+K(1≦j<K≦M)までの列の画像データを送信バッファより前記メモリに出力するようにしてもよい。この場合に不要な画像データをメモリに保持する必要がなく、このためメモリの容量を削減することができ、ハードウェア資源を有効に活用することができる。   Here, the imaging unit includes an image sensor that outputs image data of L columns and M rows, and the gradation converting unit includes i rows to i + N rows (1 ≦ i <N ≦ L) necessary for image processing. Are stored in the reception buffer, and image data in columns from j to j + K (1 ≦ j <K ≦ M) among the converted data in the transmission buffer are output from the transmission buffer to the memory. You may do it. In this case, there is no need to store unnecessary image data in the memory, so that the capacity of the memory can be reduced, and hardware resources can be used effectively.

ここで前記制御部は、取込んだ画像に対してフィルタ処理の少なくとも一部もしくは全部を行って前記送信バッファに保持するようにしてもよい。   Here, the control unit may perform at least a part or all of the filtering process on the captured image and hold it in the transmission buffer.

この課題を解決するために、本発明の光学的情報読取装置のデータ取込方法は、撮像された画像信号を受信して前記画像信号を行単位で前記2つの受信バッファに交互に保持し、前記受信バッファの行単位の画像データを各画素のデータ数を削減して、交互に前記送信バッファに転送し、及び送信バッファより前記メモリへの転送する処理を並列に実行するものである。   In order to solve this problem, the data capturing method of the optical information reading apparatus of the present invention receives a captured image signal, and alternately holds the image signal in the two reception buffers in units of rows. The image data in units of rows of the reception buffer is reduced in the number of data of each pixel, transferred to the transmission buffer alternately, and transferred from the transmission buffer to the memory in parallel.

ここで前記制御部は、受信バッファに保持された画像データのうち夫々異なった階調変換処理を施し、前記送信バッファに保持し、複数の画像データを前記メモリに転送するものであり、前記演算手段は、前記メモリに保持されている複数の画素データに基づいてデコード処理を行うようにしてもよい。変換後の複数の画像データをメモリに保持するため、デコードの失敗の確率を少なくすることができる。ここで複数の画像データは、メモリの連続した領域に配置されるようにしてもよい。この場合に1枚の画像でデータのデコード処理が完了しなくても他の画像データのデータを用いてデコードすることができるため、待機時間を短縮することができるという効果が得られる。   Here, the control unit performs different gradation conversion processing among the image data held in the reception buffer, holds the data in the transmission buffer, and transfers a plurality of image data to the memory. The means may perform the decoding process based on a plurality of pixel data held in the memory. Since a plurality of converted image data is held in the memory, the probability of decoding failure can be reduced. Here, the plurality of image data may be arranged in a continuous area of the memory. In this case, since it is possible to perform decoding using data of other image data even if data decoding processing is not completed for one image, an effect of shortening the standby time can be obtained.

このような特徴を有する本発明によれば、ユーザが選択した変換規則で画像を階調変換してメモリに保持することができる。従ってユーザの用途に柔軟に対応した階調変換が可能となり、専用のハードウェアも不要となる。   According to the present invention having such a feature, it is possible to perform gradation conversion of an image according to a conversion rule selected by the user and hold it in a memory. Therefore, gradation conversion corresponding to the user's application can be performed flexibly, and no dedicated hardware is required.

図1は本発明の第1の実施の形態による2次元コードリーダの全体構成を示すブロック図である。FIG. 1 is a block diagram showing the overall configuration of a two-dimensional code reader according to the first embodiment of the present invention. 図2は本実施の形態によるCPU内部のSRAMとデータの移動を示す図である。FIG. 2 is a diagram showing the movement of SRAM and data in the CPU according to this embodiment. 図3は本実施の形態によるSRAMとイメージセンサのデータ及びメモリへの転送の詳細を示す図である。FIG. 3 is a diagram showing details of the transfer of the SRAM and image sensor data and memory according to the present embodiment. 図4はビット取込処理、階調変換処理、及びデータのメモリへの転送処理を示すタイムチャートである。FIG. 4 is a time chart showing a bit fetch process, a gradation conversion process, and a data transfer process to a memory. 図5Aは第1の方法による10ビットのデータの8ビットへの変換出力を示すグラフである。FIG. 5A is a graph showing the conversion output of 10-bit data to 8 bits according to the first method. 図5Bは第2の方法による10ビットのデータの8ビットへの変換出力を示すグラフである。FIG. 5B is a graph showing a conversion output of 10-bit data to 8 bits according to the second method. 図5Cは第3の方法による10ビットのデータの8ビットへの変換出力を示すグラフである。FIG. 5C is a graph showing a conversion output of 10-bit data to 8 bits according to the third method. 図6Aは本実施の形態による10ビットの画像を上位8ビットの画像に変換した画像データの一例を示す図である。FIG. 6A is a diagram illustrating an example of image data obtained by converting a 10-bit image into an upper 8-bit image according to the present embodiment. 図6Bは本実施の形態による10ビットの画像を中間8ビットの画像に変換した画像データの一例を示す図である。FIG. 6B is a diagram showing an example of image data obtained by converting a 10-bit image into an intermediate 8-bit image according to the present embodiment. 図6Cは本実施の形態による10ビットの画像を下位8ビットの画像に変換した画像データの一例を示す図である。FIG. 6C is a diagram showing an example of image data obtained by converting a 10-bit image into a lower 8-bit image according to the present embodiment. 図7はレーザマーカで記録したQRコードの一例を示す図である。FIG. 7 is a diagram showing an example of a QR code recorded with a laser marker. 図8はオリジナルのQRコードの一例を示す図である。FIG. 8 shows an example of an original QR code. 図9は本実施の形態による動作開始後の処理を示す図である。FIG. 9 is a diagram showing processing after the start of operation according to the present embodiment. 図10は本実施の形態による動作開始後のデータ取込処理を示すフローチャートである。FIG. 10 is a flowchart showing the data fetching process after the operation is started according to this embodiment. 図11はイメージセンサからの出力とCPUへの処理及びメモリへの取込画像を示す図である。FIG. 11 is a diagram showing an output from the image sensor, processing to the CPU, and a captured image to the memory. 図12はイメージセンサからの出力の画像及びCPUでの処理内容、メモリへの画像を示す図である。FIG. 12 is a diagram showing an image output from the image sensor, processing contents in the CPU, and an image to the memory. 図13は本発明の第3の実施の形態によるデータの取込処理を示す概略図である。FIG. 13 is a schematic diagram showing a data fetch process according to the third embodiment of the present invention. 図14は本発明の第3の実施の形態によるデータの取込処理を示す概略図である。FIG. 14 is a schematic diagram showing data fetching processing according to the third embodiment of the present invention. 図15は従来例によるデータ取込後のデコード処理を示すタイムチャートである。FIG. 15 is a time chart showing a decoding process after taking in data according to a conventional example. 図16は本実施の形態によるデータ取込後のデコード処理を示すタイムチャートである。FIG. 16 is a time chart showing a decoding process after taking in data according to the present embodiment.

図1は本発明の第1の実施の形態による2次元撮像素子を有するコードリーダの構成を示すブロック図である。この実施の形態によるコードリーダは、2次元コード等が印字された商品や製造物の搬送ラインに隣接して設置され、2次元コード等に記録された情報を読み取るものである。図1においてイメージセンサ1はCCD等の2次元撮像素子であり、搬送されてきた物体の2次元コード等を撮像する撮像部である。ここでイメージセンサ1は、各画素毎に例えば10ビットの階調を有する画像データを出力する。一方QRコード等の2次元コードを認識するためには、8ビットの画像データで十分である。そこで本実施の形態では、イメージセンサ1からの画像出力をCPU2の内部で10ビットから8ビットにデータを変換した後、メモリ3に取込むようにしている。通信制御部4は図示しない上位ホストからのコマンドを受け取り、デコード結果を転送するものである。又ROM5には10ビットの階調を有する画像データを8ビットの画像データに変換するための変換ルールのファイルを少なくとも1つ保持しており、複数の場合ユーザが選択できるようにしている。   FIG. 1 is a block diagram showing the configuration of a code reader having a two-dimensional image sensor according to the first embodiment of the present invention. The code reader according to this embodiment is installed adjacent to a product or product conveyance line on which a two-dimensional code or the like is printed, and reads information recorded on the two-dimensional code or the like. In FIG. 1, an image sensor 1 is a two-dimensional imaging device such as a CCD, and is an imaging unit that images a two-dimensional code or the like of a conveyed object. Here, the image sensor 1 outputs image data having, for example, a 10-bit gradation for each pixel. On the other hand, 8-bit image data is sufficient to recognize a two-dimensional code such as a QR code. Therefore, in this embodiment, the image output from the image sensor 1 is converted into data from 10 bits to 8 bits inside the CPU 2 and then taken into the memory 3. The communication control unit 4 receives a command from a host (not shown) and transfers a decoding result. The ROM 5 holds at least one conversion rule file for converting image data having 10-bit gradation into 8-bit image data, and a plurality of files can be selected by the user.

CPU2は撮像部で撮像された読取対象をメモリに保持するときに画像処理すると共に、メモリに保持された画像を用いてデコードを実行する制御部であり、その内部構成について説明する。CPU2内にはデータ転送のためのDMAコントローラ10、SRAM20及び演算器30が設けられている。SRAM20はデータを一時的に保持する内部メモリである。演算器30はメモリ3に保持された8ビットの1画面分の2次元コードの画像に基づいて2次元コードをデコードする演算手段である。SRAM20内には、転送されてきた1行分の画像データを一時保持する受信バッファ21、階調変換後の1行分の画像データを送信するまで保持する送信バッファ22、及び10ビットのデータを8ビットに変換する少なくとも1つの階調変換テーブル23の各領域を有している。CPU2はSRAM20を用いて撮像部から画像データを受け、所定条件に基づく階調変換を実行し、階調変換後の画像データをメモリに保持する階調変換手段の機能を達成している。   The CPU 2 is a control unit that performs image processing when the reading target imaged by the imaging unit is held in the memory, and executes decoding using the image held in the memory, and an internal configuration thereof will be described. In the CPU 2, a DMA controller 10, an SRAM 20, and an arithmetic unit 30 for data transfer are provided. The SRAM 20 is an internal memory that temporarily holds data. The computing unit 30 is computing means for decoding the two-dimensional code based on the 8-bit one-dimensional image of the two-dimensional code held in the memory 3. In the SRAM 20, a reception buffer 21 that temporarily holds the transferred image data for one row, a transmission buffer 22 that holds the image data for one row after gradation conversion, and 10-bit data are stored. Each area of at least one gradation conversion table 23 to be converted into 8 bits is provided. The CPU 2 uses the SRAM 20 to receive image data from the imaging unit, execute gradation conversion based on a predetermined condition, and achieve a function of gradation conversion means for holding the image data after gradation conversion in a memory.

図2は最も基本的なイメージセンサ1とCPU2内の内部のSRAM及びメモリ3の間のデータの移動を示す図である。データを取込む前にユーザはあらかじめROM5の変換ルールファイルを選択して、CPU2のSRAM20に階調変換テーブル23として保持している。図2に示すようにイメージセンサ1は2次元コードを含む画像を撮像した後、1画素当り10ビットの画像データを1行目より順次行単位で転送してくるものとする。CPU2内部では受信バッファ21にこのデータを取込む。そしてCPUのSRAM20内で階調変換テーブル23を用いて受信バッファ21に保持された10ビットのデータを8ビットのデータに変換し、送信バッファ22に保持する。そして送信バッファ22からメモリ3にデータを転送する。この処理を並列的に行うことによって画像取込時間を短縮している。   FIG. 2 is a diagram showing the movement of data between the most basic image sensor 1 and the internal SRAM and memory 3 in the CPU 2. Before fetching data, the user selects a conversion rule file in the ROM 5 in advance and holds it as a gradation conversion table 23 in the SRAM 20 of the CPU 2. As shown in FIG. 2, the image sensor 1 captures an image including a two-dimensional code, and then transfers 10-bit image data per pixel sequentially in units of rows from the first row. This data is taken into the reception buffer 21 inside the CPU 2. Then, the 10-bit data held in the reception buffer 21 is converted into 8-bit data using the gradation conversion table 23 in the SRAM 20 of the CPU, and held in the transmission buffer 22. Then, the data is transferred from the transmission buffer 22 to the memory 3. By performing this processing in parallel, the image capture time is shortened.

次に図3はCPU2内部のSRAM20とイメージセンサ1からのデータ及びメモリ3に転送するデータの詳細を示す。この実施の形態に示すようにCPU2内部のSRAM20には10ビットの1行分のデータを保持する受信バッファ21a,21b及び8ビットの1行分のデータを保持する送信バッファ22a,22bを有している。   Next, FIG. 3 shows details of data from the SRAM 20 and the image sensor 1 in the CPU 2 and data to be transferred to the memory 3. As shown in this embodiment, the SRAM 20 in the CPU 2 has reception buffers 21a and 21b for holding 10-bit data for one row and transmission buffers 22a and 22b for holding 8-bit data for one row. ing.

図4はデータ取込、データ変換及びデータ転送を並列に実行する状態を示すタイムチャートである。本図において期間Tには、イメージセンサ1から得られた10ビットの1行目のデータを受信バッファ21aに保持する。次に期間Tにはイメージセンサ1より2行目の10ビットのデータを受信し、受信バッファ21bに保持する。この期間Tには、同時に受信バッファ21aに保持されている1行目の10ビットの画像データを後述する規則に従って8ビットの画像に変換して、送信バッファ22aに順次転送していく。次の期間Tにはイメージセンサ1より得られる3行目の画像データを受信バッファ21aに取込み、更に受信バッファ21bに保持されている2行目のデータを8ビットの画像に変換して送信バッファ22bに転送する。このとき同時に送信バッファ22aの1行目の変換後のデータをメモリ3に転送する。期間Tにはイメージセンサ1より得られる4行目の画像データを受信バッファ21bに取込み、更に受信バッファ21aに保持されている3行目のデータを8ビットの画像に変換して送信バッファ22aに転送する。このとき同時に送信バッファ22bの2行目の変換後のデータをメモリ3に転送する。以降の期間T・・・TN,TN+1にも行番号をずらせて同様の処理を繰り返す。このように2つの受信バッファ21a,21b及び2つの送信バッファ22a,22bを備えることにより、データ取込、データ変換及びデータ転送処理を並列的に実行することができる。 FIG. 4 is a time chart showing a state in which data acquisition, data conversion, and data transfer are executed in parallel. The period T 1 in the figure, hold the first row of data 10 bits obtained from the image sensor 1 in the reception buffer 21a. Then the period T 2 receives a 10-bit data of the second line from the image sensor 1, is held in the reception buffer 21b. The period T 2, and converts the 8-bit image in accordance with the rules to be described later 10-bit image data of the first row held in the reception buffer 21a simultaneously, sequentially transferred to the transmission buffer 22a. In the next period T3, the third row of image data obtained from the image sensor 1 is taken into the reception buffer 21a, and the second row of data held in the reception buffer 21b is converted into an 8-bit image and transmitted. Transfer to buffer 22b. At the same time, the converted data in the first row of the transmission buffer 22a is transferred to the memory 3. Uptake in the reception buffer 21b the image data of the fourth line obtained from the image sensor 1 in the period T 4, and further converted data in the third row held in the 8-bit image to the receiving buffer 21a transmit buffer 22a Forward to. At the same time, the converted data in the second row of the transmission buffer 22b is transferred to the memory 3. Similar processing is repeated by shifting the row numbers in subsequent periods T 5 ... T N , T N + 1 . By providing the two reception buffers 21a and 21b and the two transmission buffers 22a and 22b as described above, data fetching, data conversion, and data transfer processing can be executed in parallel.

次にこの10ビットの画像データを8ビットの画像データに変換する3つの規則について説明する。図5A〜図5Cはイメージセンサからの10ビットの出力と8ビットの変換後の出力の関係を示す図である。第1の方法はイメージセンサの10ビットのうち下位2ビットを削除し、上位8ビットのみを変換後の8ビットの画像データとするものである。図5A(a)において左方に示す0〜1023はイメージセンサ1の出力、0〜255は変換後の8ビットの出力を示している。この場合には、図5A(b)のグラフに示すように1024階調の変化が256階調に直線的に変化することとなる。   Next, three rules for converting the 10-bit image data into 8-bit image data will be described. 5A to 5C are diagrams showing the relationship between the 10-bit output from the image sensor and the 8-bit converted output. The first method is to delete the lower 2 bits of the 10 bits of the image sensor and use only the upper 8 bits as converted 8-bit image data. 5A (a), 0 to 1023 shown on the left side indicate the output of the image sensor 1, and 0 to 255 indicate the 8-bit output after conversion. In this case, as shown in the graph of FIG. 5A (b), the change of 1024 gradations changes linearly to 256 gradations.

第2の方法は、10ビットのデータのうち上位の2ビットを削除し、下位8ビットを変換後の8ビットの画像データとするものである。この場合には、図5B(b)のグラフに示すように入力の0〜255階調までは直線的に変化するが、255で飽和し、それ以降は最高レベルを保持するものとなる。   In the second method, the upper 2 bits are deleted from the 10-bit data, and the lower 8 bits are converted into 8-bit image data after conversion. In this case, as shown in the graph of FIG. 5B (b), the input linearly changes from 0 to 255 gradations, but is saturated at 255, and thereafter the maximum level is maintained.

次に第3の方法は、入力となる10ビットのデータを対数項を含む関数を用いて8ビットのデータに変化させる略対数変換処理である。この場合には、例えば図5C(b)のグラフに示すように1024階調の変化が256階調に曲線状に変化するものとなる。この変換手法では係数を選択することにより種々の曲線とすることができる。   The third method is a substantially logarithmic conversion process in which 10-bit data to be input is changed to 8-bit data using a function including a logarithmic term. In this case, for example, as shown in the graph of FIG. 5C (b), the change of 1024 gradations changes to a curve of 256 gradations. In this conversion method, various curves can be obtained by selecting coefficients.

上記の3つの方法以外に中間の8ビットを選択する方法が考えられる。本実施の形態ではこれらのいずれかの変換のための入出力をテーブルとしてあらかじめ階調変換テーブル23に保持しておく。こうすれば変換テーブルの変更のみでハードウェアを変更せずに変換方法を変更することができる。変換方法は後述するように、ユーザが任意に選択できるようにしている。   In addition to the above three methods, a method of selecting intermediate 8 bits can be considered. In this embodiment, the input / output for any of these conversions is stored in advance in the gradation conversion table 23 as a table. In this way, it is possible to change the conversion method only by changing the conversion table without changing the hardware. As will be described later, the conversion method can be arbitrarily selected by the user.

図6Aは10ビットの画像データのうち、上位8ビットを用いて8ビットの画像データに変換した4つの画像の例を示す図、図6Bは10ビットの画像データのうち中間の8ビットにより構成された4つの画像の例を示す図、図6Cは10ビットの画像データのうち下位8ビットを用いて8ビットの画像データに変換した4つの画像の例を示す図である。又対数変換画像については上位8ビットの暗い部分と下位8ビットの明るい部分とを構成したような画像となる。   FIG. 6A is a diagram showing an example of four images converted into 8-bit image data using the upper 8 bits of 10-bit image data, and FIG. 6B is composed of intermediate 8 bits of 10-bit image data FIG. 6C is a diagram showing an example of four images converted into 8-bit image data using lower 8 bits of 10-bit image data. Further, the logarithmically converted image is an image in which a dark portion of upper 8 bits and a bright portion of lower 8 bits are configured.

このようにビット選択によって、メモリに保持する画像の特徴(明るさ、階調変化)を変化させることができ、メモリに格納された画像を用いてCPU2で実行するデコード可否にも影響を及ぼす。例えば、図6A〜図6Cで示す一番左のQRコードは、図6Aでは暗すぎるため、デコードが困難となるが、図6Cであればデコードが容易となる。一方、一番右のQRコードでは、図6Cでは明るすぎて、デコード困難となるが、図6Aであればデコード容易となる。すなわち、階調変化はデコード処理の際の白黒判別のし易さに影響を及ぼし、明るさは各白黒ドットやセルの膨張収縮によるコード情報の誤認識にもつながる。コードリーダ内には撮像条件を保持するための領域がバンクパラメータとして設けられており、2次元コード等の撮像条件と共に、ビット選択条件をバンクパラメータに設定する。当該パラメータに基づき画像を取り込むことにより、デコード成功率の向上につながる。   As described above, the bit selection can change the characteristics (brightness and gradation change) of the image held in the memory, which also affects the possibility of decoding performed by the CPU 2 using the image stored in the memory. For example, the leftmost QR code shown in FIGS. 6A to 6C is too dark in FIG. 6A and is difficult to decode, but in FIG. 6C, decoding is easy. On the other hand, the rightmost QR code is too bright in FIG. 6C and difficult to decode, but in FIG. 6A, it becomes easy to decode. That is, the gradation change affects the ease of black and white discrimination in the decoding process, and the brightness leads to erroneous recognition of code information due to expansion and contraction of each black and white dot or cell. An area for holding imaging conditions is provided as a bank parameter in the code reader, and a bit selection condition is set as a bank parameter together with imaging conditions such as a two-dimensional code. By capturing an image based on the parameters, the decoding success rate is improved.

次にフィルタ処理について説明する。10ビットのデータを8ビットのデータに変換する際に、同時にフィルタ処理を行うようにしてもよい。フィルタ処理は例えば膨張フィルタ処理や収縮フィルタ処理が考えられる。本実施の形態では1行単位で階調変換しているため、膨張フィルタ処理や収縮フィルタ処理についても行単位で行うことが可能となる。この場合の膨張フィルタ処理とは、注目画素の輝度データを隣接する2つの画素と注目画素の3つの中で最大輝度のデータに置き換える処理をいう。又収縮フィルタ処理とは、注目画素の輝度データを隣接する2つの画素と注目画素の3つの中で最小輝度のデータに置き換える処理をいう。フィルタ処理は例えばレーザマーカで記録した場合など図7に示すようにQRコードが点線となっていれば、そのままではデコードできない。一方元のQRコードの場合には図8に示すようにQRコードが直線になっており、デコードすることができる。このような場合フィルタ処理で画像を適宜変換してデコードできるようにする。   Next, the filtering process will be described. When converting 10-bit data into 8-bit data, filtering may be performed simultaneously. Examples of the filter processing include expansion filter processing and contraction filter processing. In the present embodiment, since gradation conversion is performed in units of one line, expansion filter processing and contraction filter processing can also be performed in units of rows. The expansion filter processing in this case refers to processing for replacing the luminance data of the target pixel with data of the maximum luminance among the three adjacent pixels and the target pixel. The contraction filter process is a process of replacing the luminance data of the target pixel with data of the minimum luminance among the three adjacent pixels and the target pixel. For example, if the QR code is a dotted line as shown in FIG. On the other hand, in the case of the original QR code, as shown in FIG. 8, the QR code is a straight line and can be decoded. In such a case, an image is appropriately converted by a filtering process so that it can be decoded.

次に本実施の形態による画像の取込処理の動作について説明する。図9は動作を開始した直後の処理を示すフローチャートである。この処理を開始すると、まずステップS1においてユーザに変換規則の選択を促す。次にステップS2においてユーザにフィルタの要否、種類の選択を促す。こうして変換規則とフィルタが選択されると、変換規則に基づいて入力データを出力データに変換するテーブルを作成する(ステップS3)。そしてこのテーブルをCPU2内のSRAM20に階調変換テーブル23として書込んでおく(ステップS4)。   Next, the operation of the image capturing process according to this embodiment will be described. FIG. 9 is a flowchart showing a process immediately after the operation is started. When this process is started, the user is first prompted to select a conversion rule in step S1. Next, in step S2, the user is prompted to select a filter necessity and type. When the conversion rule and the filter are selected in this way, a table for converting input data into output data based on the conversion rule is created (step S3). This table is written in the SRAM 20 in the CPU 2 as the gradation conversion table 23 (step S4).

次にデータの取込み後の処理について図10を用いて説明する。処理を開始すると、ステップS11においてイメージセンサ1から1行分のデータをSRAMの受信バッファ21に取得する。そしてステップS12において1行分のデータを階調変換する。次いでステップS13において画像データのフィルタ処理が必要かどうかを判別し、必要であれば1行分のデータのフィルタ処理を行う(ステップS14)。そしてステップS15において処理後のデータを送信バッファ22に保持する。ステップS16において1行分のデータをSRAM20からメモリ3に転送し、1画像全体の取込処理を終了したかどうかを判別する(S17)。処理が終了していなければステップS11に戻って同様の処理を繰り返す。処理が終了した場合には取込処理を終了する。尚ステップS12の処理はステップS15の直前であってもよい。   Next, the processing after taking in data will be described with reference to FIG. When the process is started, data for one row is acquired from the image sensor 1 in the reception buffer 21 of the SRAM in step S11. In step S12, the data for one row is subjected to gradation conversion. Next, in step S13, it is determined whether or not image data filtering is necessary, and if necessary, data filtering for one row is performed (step S14). In step S15, the processed data is held in the transmission buffer 22. In step S16, the data for one row is transferred from the SRAM 20 to the memory 3, and it is determined whether or not the capturing process for the entire image has been completed (S17). If the process has not ended, the process returns to step S11 and the same process is repeated. When the process is completed, the capture process is terminated. The process of step S12 may be performed immediately before step S15.

こうすればデータの階調変換処理等のための専用チップが不要となり、低コスト化を図ることができる。又階調変換のデータ処理はソフトウェア処理で実行しているため、上位8ビットの選択、下位8ビットの選択、又上下の1ビットを除く中間の8ビットの選択やログ変換等、自由な変換規則を任意に選択することができる。又フィルタ処理を階調変換とほぼ並列的に実行することができる。ここでフィルタ処理は不要であればステップS2のフィルタ選択やステップS13,S14を削除するようにしてもよい。   In this way, a dedicated chip for data gradation conversion processing or the like is not necessary, and the cost can be reduced. Since the data processing of gradation conversion is executed by software processing, free conversion such as selection of upper 8 bits, selection of lower 8 bits, intermediate 8 bits excluding upper and lower 1 bits, log conversion, etc. Rules can be chosen arbitrarily. Also, the filter process can be executed almost in parallel with the gradation conversion. Here, if filter processing is unnecessary, the filter selection in step S2 and steps S13 and S14 may be deleted.

次に本実施の形態の変形例について説明する。前述した第1の実施の形態のフィルタ処理では、行単位でフィルタ処理を行っていた。これに代えて隣接する3行単位で膨張フィルタ処理や収縮フィルタ処理を行うこともできる。この場合の膨張フィルタ処理とは、3×3画素の中心画素の輝度を隣接する周囲の9画素の中での最大輝度のデータに置き換える処理をいう。又収縮フィルタ処理とは、3×3画素の中心画素の輝度を周囲の9画素の中で最小輝度のデータに置き換える処理をいう。この場合には10ビットの画像データ受信用のバッファとして3行分を2組、即ち6つの受信バッファが必要であり、同様に送信バッファとしても3行分のバッファを2組、即ち6つの送信バッファが必要となる。このように行単位でのフィルタ処理を階調変換と同時に行うようにしておけば、フィルタ処理を短時間で行うことができる。又3×3画素のフィルタ処理を行う場合であっても、行単位でメモリ3に一旦保持した後、メモリ3から読出して改めてフィルタ処理を行うようにしてもよい。   Next, a modification of the present embodiment will be described. In the filter processing of the first embodiment described above, the filter processing is performed in units of rows. Alternatively, expansion filter processing and contraction filter processing can be performed in units of three adjacent rows. The expansion filter processing in this case refers to processing for replacing the luminance of the center pixel of 3 × 3 pixels with the data of the maximum luminance among the adjacent nine pixels. Shrinkage filter processing refers to processing for replacing the luminance of the central pixel of 3 × 3 pixels with data of the minimum luminance among the surrounding nine pixels. In this case, two sets of three rows, that is, six reception buffers are required as buffers for receiving 10-bit image data. Similarly, two sets of buffers for three rows, that is, six transmission buffers are also used as transmission buffers. A buffer is required. In this way, if the filtering process in units of rows is performed simultaneously with the gradation conversion, the filtering process can be performed in a short time. Further, even when 3 × 3 pixel filter processing is performed, the filter processing may be performed once after being held in the memory 3 in units of rows and then read out from the memory 3.

次に本発明の第2の実施の形態について説明する。本実施の形態はCPU2のSRAMへの取込画像の領域制限を行うものであり、基本的な構成は図1と同様である。イメージセンサ1から出力される画像データのうち、必要な領域は全領域のうちの一部である場合がある。このような場合には、不要な領域はメモリ3に取込む必要はなく、必要な領域のみを取込めば足りる。CCDやCMOSセンサ等の撮像素子には、露出時間やハードウェアのタイミングがセンサから出力する列数に依存して変化するものがある。そのため列単位で取込みの領域を制限した場合には、CCD等の画像撮像素子の露出時間のタイミングやハードウェアのタイミング設計が複雑となる。そこで本実施の形態では、行単位で必要な行のみを前述したように階調変換してメモリに取込むようにしている。   Next, a second embodiment of the present invention will be described. In the present embodiment, the area of the captured image in the SRAM of the CPU 2 is limited, and the basic configuration is the same as in FIG. Of the image data output from the image sensor 1, a necessary area may be a part of the entire area. In such a case, it is not necessary to fetch unnecessary areas into the memory 3, and it is sufficient to capture only necessary areas. Some image sensors such as CCD and CMOS sensors change the exposure time and hardware timing depending on the number of columns output from the sensor. Therefore, when the capture area is limited in units of columns, the exposure time timing of the image pickup device such as a CCD and the hardware timing design become complicated. Therefore, in the present embodiment, only the necessary rows in units of rows are subjected to gradation conversion as described above and taken into the memory.

イメージセンサ1はL行M列の10ビットのデータを出力するものとする。図11(a)はイメージセンサが出力する画像、図12(a)はこれに対応する画像データを示している。このL行M列の画像データ40のうち図11(a)に示すように、一部の領域のみに2次元コードが撮像されていたとすると、この領域を注目領域(ROI:region of interest)41とする。注目領域41を例えばi〜i+N行、j〜j+K列(1≦i<N≦L,1≦j<K≦M)とすると、この領域の画像情報のみがあれば2次元コードをデコードするには十分である。   Assume that the image sensor 1 outputs 10-bit data of L rows and M columns. FIG. 11A shows an image output from the image sensor, and FIG. 12A shows image data corresponding to the image. As shown in FIG. 11A in the image data 40 of L rows and M columns, if a two-dimensional code is captured only in a part of the region, this region is designated as a region of interest (ROI) 41. And If the region of interest 41 is, for example, i to i + N rows and j to j + K columns (1 ≦ i <N ≦ L, 1 ≦ j <K ≦ M), if there is only image information in this region, the two-dimensional code is decoded. Is enough.

従ってCPU2は図11(b)に示すように2次元コードデータの処理に必要な行、即ちハッチングを施していないi〜i+N行の全ての列のデータを受信バッファ21a,21bに交互に保持する。そしてこれらの行の10ビットを8ビットのデータに変換し、順次送信バッファ22a,22bに交互に保持する。このうちj〜j+K列目のデータのみをメモリ3に転送する。図11(c)はメモリ3上に構築された画像、図12(c)はその画像データを示している。   Therefore, as shown in FIG. 11B, the CPU 2 alternately holds the data necessary for the processing of the two-dimensional code data, that is, the data of all the columns of i to i + N rows that are not hatched in the reception buffers 21a and 21b. . Then, 10 bits in these rows are converted into 8-bit data, which are sequentially held in the transmission buffers 22a and 22b. Among these, only the data of the jth to j + K columns are transferred to the memory 3. FIG. 11C shows an image constructed on the memory 3, and FIG. 12C shows the image data.

例えばイメージセンサの画像データが480行752列の10ビット画像データである場合に、そのうち必要な領域は101行〜200行、101列〜200列とする。このとき101行〜200行の画像データのみをCPU2に取込み、10ビットから8ビットに変換してメモリ3に転送する。そして階調変換した101行〜200行のうち101列目から200列目までのデータをメモリ3に転送するようにすれば、メモリには100列100行分の8ビット画像データを得ることができる。これによって図12(c)に示すようにメモリ3に保持する必要があるデータを大幅に削減することができる。このような処理は2次元コードを対象とし、2次元コードが撮像された領域のみをメモリに取込む際に極めて有用となる。   For example, when the image data of the image sensor is 10-bit image data of 480 rows and 752 columns, the necessary areas are 101 to 200 rows and 101 to 200 columns. At this time, only the image data of the 101st to 200th lines are taken into the CPU 2 and converted from 10 bits to 8 bits and transferred to the memory 3. If the data from the 101st column to the 200th column among the 101th to 200th rows after the gradation conversion is transferred to the memory 3, 8-bit image data for 100 columns and 100 rows can be obtained in the memory. it can. As a result, as shown in FIG. 12C, the data that needs to be held in the memory 3 can be greatly reduced. Such processing is extremely useful when a two-dimensional code is targeted and only a region where the two-dimensional code is imaged is taken into the memory.

次に本発明の第3の実施の形態について説明する。この実施の形態では複数の変換規則を用いて階調変換された複数の画像データを保持するものであり、基本的な構成は図1と同様である。階調変換された1枚の画像データをメモリに保持した場合には、保持した後にメモリより読出し、演算器を用いてデコード処理が行われる。しかしイメージセンサの露出時間やゲイン設定が十分でなければ、再度撮像してメモリに撮像するか、階調変換規則を変更し、メモリに転送する必要がある。従って環境の変化によってデコードできない場合に、複数回の処理が必要となって時間がかかるという欠点があった。この実施の形態では複数の画像を同時に保持しておくものとする。図13はCPU2の構造とこの処理のイメージセンサからメモリへのデータ転送を示す図である。図13においてCPU2は第1の実施の形態のDMAコントローラ10,SRAM20及び演算器30を有している。この実施の形態においてSRAM20には受信バッファ21と送信バッファ25,26及び複数の階調変換テーブル23a,23bが設けられる。そして図示のようにイメージセンサ1からの出力をCPU2を介して10ビットデータのままで一旦メモリ3に保持する。その後CPU2はこれを読出し、受信バッファ21に保持する。そして異なる階調変換テーブル23a,23bを用いて階調変換し、2つの8ビットの画像データA,Bを作成して再びメモリ3に書き込む。このとき2つの8ビットの画像データA,Bは夫々異なった変換規則で変換された画像データである。   Next, a third embodiment of the present invention will be described. In this embodiment, a plurality of image data subjected to gradation conversion using a plurality of conversion rules is held, and the basic configuration is the same as in FIG. When one piece of image data subjected to gradation conversion is held in the memory, it is read from the memory after being held, and is decoded using an arithmetic unit. However, if the exposure time and gain setting of the image sensor are not sufficient, it is necessary to capture the image again and capture it in the memory, or change the gradation conversion rule and transfer it to the memory. Therefore, there is a disadvantage that it takes time because a plurality of processes are required when decoding cannot be performed due to environmental changes. In this embodiment, it is assumed that a plurality of images are held simultaneously. FIG. 13 is a diagram showing the structure of the CPU 2 and the data transfer from the image sensor to the memory in this process. In FIG. 13, the CPU 2 includes the DMA controller 10, SRAM 20, and arithmetic unit 30 according to the first embodiment. In this embodiment, the SRAM 20 is provided with a reception buffer 21, transmission buffers 25 and 26, and a plurality of gradation conversion tables 23a and 23b. Then, as shown in the figure, the output from the image sensor 1 is temporarily held in the memory 3 as it is with 10-bit data via the CPU 2. Thereafter, the CPU 2 reads it and holds it in the reception buffer 21. Then, gradation conversion is performed using different gradation conversion tables 23a and 23b, and two 8-bit image data A and B are created and written into the memory 3 again. At this time, the two 8-bit image data A and B are image data converted by different conversion rules.

こうして8ビットの2つの画像データを図2に示すように連続したメモリ領域に配置することで、まとめて1つの大きな画像データとして取り扱えば、後にフィルタ処理を行う場合にこれらをまとめて処理することができる。ここで2つの画像データA,Bは夫々異なった変換規則を用いるものとする。例えば前述したように、10ビットのうち上位8ビットの選択、10ビット中の中間の8ビットの選択、10ビット中の下位8ビットの選択、ログ変換などから任意の階調変換規則を選択して2つの画像データを生成するようにしてもよい。こうすれば1回の画像データの取込みで明るさなどの異なる8ビットの2枚の画像データをメモリ3の連続した領域に保持することができる。   Thus, by arranging two 8-bit image data in a continuous memory area as shown in FIG. 2, if they are handled together as one large image data, they will be processed together when filtering is performed later. Can do. Here, it is assumed that the two image data A and B use different conversion rules. For example, as described above, an arbitrary gradation conversion rule is selected from selection of upper 8 bits of 10 bits, selection of intermediate 8 bits of 10 bits, selection of lower 8 bits of 10 bits, log conversion, and the like. Two image data may be generated. In this way, two pieces of 8-bit image data having different brightness and the like can be held in a continuous area of the memory 3 by fetching the image data once.

又これに代えて図14に示すようにCPUの処理能力に余裕があれば、10ビットの画像データを一旦CPU2のSRAM20に保持し、このデータを用いて8ビットの画像データA,Bを夫々作成し、メモリ3に転送してもよい。このバッファには10ビットの画像データを保持するための受信バッファ21a,21bと8ビットの画像データを保持するための送信バッファ25a,25b,26a,26bを用いる。これによりデータの転送と2つの画像データへの階調変換及びデータ転送を並列して行うことができる。   Alternatively, as shown in FIG. 14, if the CPU has sufficient processing capacity, 10-bit image data is temporarily held in the SRAM 20 of the CPU 2, and 8-bit image data A and B are respectively stored using this data. It may be created and transferred to the memory 3. As this buffer, reception buffers 21a and 21b for holding 10-bit image data and transmission buffers 25a, 25b, 26a and 26b for holding 8-bit image data are used. Thereby, data transfer, gradation conversion to two image data, and data transfer can be performed in parallel.

ここで従来例と本実施の形態のデコードの時間を比較して説明する。例えばある条件で撮像した画像をデコードし、デコードに成功しない場合はタイムアウトし、次の撮像条件で撮像してこれをデコードするまで繰り返すものとする。一般的に撮像に要する時間を30ms、デコードに成功したときのデコードにかかる時間を20ms、デコードが成功しないときに処理を打ち切るタイムアウト時間を成功時間の5倍と仮定し100msとする。そして撮像条件、例えばゲインを変化させて条件A,B,Cとし、これらの条件A,B,Cで順にデコードするものとする。この場合、図15(a)に示すように条件Aで撮像しデコードしたが、デコードに成功せず、次いで条件Bで撮像しデコードしたが、デコードに成功せずいずれもタイムアウトし、条件Cで撮像してデコードが成功したとする。この場合は所要時間は310msとなる。次に例えば図15(b)に示すように撮像とデコードを繰り返し2回目にデコードに成功した場合には、所要時間は例えば180msとなる。又撮像とデコードを繰り返して1回目にデコードに成功した場合は、例えば図15(c)に示すように50msとなる。以上の3つの条件でデコードに成功する確率が等しいとすると、この場合の読取時間の期待値は180msとなる。   Here, the decoding time of the conventional example and this embodiment will be compared and described. For example, an image captured under a certain condition is decoded, and if the decoding is not successful, a time-out is performed, and the process is repeated until the image is captured under the next imaging condition and decoded. In general, it is assumed that the time required for imaging is 30 ms, the time required for decoding when decoding is successful is 20 ms, and the time-out time for aborting the processing when decoding is not successful is 100 ms assuming that the time is 5 times the success time. The imaging conditions, for example, gains are changed to obtain conditions A, B, and C, and these conditions A, B, and C are sequentially decoded. In this case, as shown in FIG. 15A, the image was captured and decoded under the condition A, but the decoding was not successful, and then the image was captured and decoded under the condition B. However, the decoding did not succeed and both timed out and the condition C Suppose that imaging and decoding were successful. In this case, the required time is 310 ms. Next, for example, as shown in FIG. 15B, when the imaging and decoding are repeated and the decoding succeeds for the second time, the required time is, for example, 180 ms. Further, when the image capture and decoding are repeated and decoding succeeds for the first time, for example, as shown in FIG. Assuming that the probability of successful decoding under the above three conditions is equal, the expected value of the reading time in this case is 180 ms.

一方本実施の形態において3枚の画像、例えば10ビットの上位8ビットの画像データA、上下1ビットを除く中位8ビットの画像データB及び下位8ビットの画像データCを作成し、メモリの連続した領域に配置し、3枚分の大きさの1枚の連結画像を生成してからデコード処理を行う場合について説明する。この場合10ビット画像の取得にかかる時間を30ms、10ビット画像をメモリ上の3つの画像データに展開するに要する時間を15ms、デコードが成功したときのデコードにかかる時間は画像のデータ量に比例する傾向があるので従来例に比べ3倍の60msとし、デコードが成功しないときに処理を打ち切るタイムアウト時間を成功時間の5倍と仮定し300msとする。ここで10ビットの画像を取り込んで3つの8ビット画像に展開し、通常画像をデコードした画像Cでデコードが成功した場合には、図16(a)に示すように105msを要する。同様にして画像Bでデコードに成功した場合には、図16(b)に示すように105msを要する。画像Aをデコードして成功した場合には図16(c)に示すように105msを要する。3倍の画像データを処理するのでデコード時間は従来例に比べ3倍の60msとなるが、A,B,Cのどの部分で成功しても読取時間は105msとなり、従来例で示した期待値よりも短く、且つばらつきがないという効果が得られる。   On the other hand, in this embodiment, three images, for example, 10 bits of upper 8 bits of image data A, middle 8 bits of image data B excluding upper and lower 1 bits, and lower 8 bits of image data C are created, and A case will be described in which decoding processing is performed after generating one connected image having a size of three images arranged in a continuous region. In this case, the time required for acquiring a 10-bit image is 30 ms, the time required for developing a 10-bit image into three image data in the memory is 15 ms, and the time required for decoding when decoding is successful is proportional to the amount of image data Therefore, it is assumed that the time-out time for aborting the process when decoding is not successful is assumed to be 5 times the success time and 300 ms. Here, when a 10-bit image is captured and developed into three 8-bit images, and decoding is successful with an image C obtained by decoding a normal image, 105 ms is required as shown in FIG. Similarly, when decoding is successful for image B, 105 ms is required as shown in FIG. If the image A is successfully decoded, 105 ms is required as shown in FIG. Since the image data of 3 times is processed, the decoding time is 60 ms, which is 3 times that of the conventional example. However, the reading time is 105 ms regardless of any part of A, B, C, and the expected value shown in the conventional example It is shorter than that and there is an effect that there is no variation.

尚この実施の形態では2種類の相異なる画像データをメモリに保持するようにしているが、3種類、又はそれ以上の画像データをメモリ3の連続した領域に保持するようにしてもよい。   In this embodiment, two types of different image data are held in the memory, but three or more types of image data may be held in a continuous area of the memory 3.

上述した各実施の形態では、階調変換テーブルを用いて10ビットを8ビットに変換するようにしているが、ビット数はこれに限定されるものではない。又階調変換テーブルに限らず、階調変換規則を数式として保持するものであってもよい。   In each of the embodiments described above, 10 bits are converted to 8 bits using the gradation conversion table, but the number of bits is not limited to this. In addition to the gradation conversion table, the gradation conversion rule may be held as a mathematical expression.

尚この実施の形態では2次元コードリーダを例にして説明したが、本発明による光学的情報読取装置は2次元コードリーダに限らず、2次元の画像情報を読取る種々の光学的情報読取装置にも適用することができる。   In this embodiment, the two-dimensional code reader has been described as an example. However, the optical information reading apparatus according to the present invention is not limited to the two-dimensional code reader, and may be various optical information reading apparatuses that read two-dimensional image information. Can also be applied.

本発明は2次元コード等を光学的に読み取る光学的情報読取装置において、ユーザの用途に対応しユーザが選択した変換規則で画像を階調変換してメモリに保持することができ、種々の使用状態での光学的情報読取装置に有用である。   The present invention is an optical information reading apparatus that optically reads a two-dimensional code or the like, and can convert the gradation of an image according to a conversion rule selected by the user in accordance with the user's application and hold it in a memory. It is useful for an optical information reader in a state.

1 イメージセンサ
2 CPU
3 メモリ
4 通信制御部
10 DMAコントローラ
20 SRAM
21,21a,21b 受信バッファ
22,22a,22b,25,25a,25b,26,26a,26b 送信バッファ
23,23a,23b 階調変換テーブル
30 演算器
40 画像データ
41 注目領域
1 Image sensor 2 CPU
3 Memory 4 Communication Control Unit 10 DMA Controller 20 SRAM
21, 21a, 21b Reception buffer 22, 22a, 22b, 25, 25a, 25b, 26, 26a, 26b Transmission buffer 23, 23a, 23b Gradation conversion table 30 Calculator 40 Image data 41 Area of interest

Claims (8)

読取対象を撮像する2次元撮像素子を有する撮像部と、
CPUを有し、前記撮像部で撮像された読取対象をメモリに保持するときに画像処理してデコードする制御部と、
前記撮像部で撮像された読取対象の画像を保持するメモリと、を有する光学的情報読取装置であって、
前記制御部は、前記撮像部から画像データを受け、所定条件に基づく階調変換を実行し、階調変換後の画像データを前記メモリに保持する階調変換手段と、
前記メモリに格納された階調変換後の画像データを読出し、デコードする演算手段と、を具備する光学的情報読取装置。
An imaging unit having a two-dimensional imaging device for imaging a reading target;
A control unit having a CPU and performing image processing and decoding when the reading target imaged by the imaging unit is held in a memory;
A memory for holding an image to be read imaged by the imaging unit;
The control unit receives image data from the imaging unit, executes gradation conversion based on a predetermined condition, and stores gradation-converted image data in the memory;
An optical information reading apparatus comprising: arithmetic means for reading and decoding image data after gradation conversion stored in the memory.
前記制御部のCPUは、内部メモリを有し、
前記内部メモリは、
撮像部より得られる行単位の画像データを保持する受信バッファと、
前記メモリに転送する前の階調変換後の行単位の画像データを保持する送信バッファと、を有する請求項1記載の光学的情報読取装置。
The CPU of the control unit has an internal memory,
The internal memory is
A reception buffer that holds line-by-line image data obtained from the imaging unit;
The optical information reading apparatus according to claim 1, further comprising: a transmission buffer that holds image data in units of rows after gradation conversion before being transferred to the memory.
前記内部メモリはSRAMであり、
前記受信バッファは少なくとも2つの受信バッファを有し、
前記送信バッファは少なくとも2つの送信バッファを有し、
前記階調変換手段は、前記撮像部で撮像された画像信号を行単位で前記2つの受信バッファに交互に保持するデータ受信処理、前記受信バッファの行単位の画像データを各画素のデータ数を削減して、交互に前記送信バッファに転送する階調変換処理、及び前記2つの送信バッファより交互に前記メモリに転送する転送処理を並列に実行する請求項2記載の光学的情報読取装置。
The internal memory is SRAM;
The receive buffer has at least two receive buffers;
The transmission buffer has at least two transmission buffers;
The gradation converting means is a data receiving process for alternately holding the image signals picked up by the image pickup unit in the two receiving buffers in units of rows, and sets the number of data of each pixel in the image data in units of rows of the receiving buffer. The optical information reading apparatus according to claim 2, wherein the gradation conversion process of reducing and transferring alternately to the transmission buffer and the transfer process of transferring alternately to the memory from the two transmission buffers are executed in parallel.
前記撮像部は、L列M行の画像データを出力するイメージセンサを有し、
前記階調変換手段は、画像処理に必要なi行からi+N行(1≦i<N≦L)までのデータを取込んで前記受信バッファに保持し、
前記送信バッファの変換後のデータのうちjからj+K(1≦j<K≦M)までの列の画像データを送信バッファより前記メモリに出力する請求項2又は3記載の光学的情報読取装置。
The imaging unit includes an image sensor that outputs image data of L columns and M rows,
The gradation converting means takes in data from i rows to i + N rows (1 ≦ i <N ≦ L) necessary for image processing and holds them in the reception buffer,
4. The optical information reading device according to claim 2, wherein image data of a column from j to j + K (1 ≦ j <K ≦ M) among the converted data of the transmission buffer is output from the transmission buffer to the memory.
前記制御部は、取込んだ画像に対してフィルタ処理の一部もしくは全部を行って前記送信バッファに保持する請求項2又は3記載の光学的情報読取装置。   The optical information reading apparatus according to claim 2, wherein the control unit performs part or all of the filtering process on the captured image and holds the image in the transmission buffer. 請求項3記載の光学的情報読取装置のデータ取込方法であって、
撮像された画像信号を受信して前記画像信号を行単位で前記2つの受信バッファに交互に保持し、前記受信バッファの行単位の画像データを各画素のデータ数を削減して、交互に前記送信バッファに転送し、
及び送信バッファより前記メモリへの転送する処理を並列に実行する光学的情報読取装置のデータ取込方法。
A data capturing method for an optical information reader according to claim 3,
The captured image signal is received, and the image signal is alternately held in the two reception buffers in units of rows, and the image data in units of rows of the reception buffer is reduced alternately in the number of pixels. Transfer to send buffer,
And a method of fetching data from the optical information reading apparatus, wherein the process of transferring data from the transmission buffer to the memory is executed in parallel.
前記制御部は、受信バッファに保持された画像データのうち夫々異なった階調変換処理を施し、前記送信バッファに保持し、複数の画像データを前記メモリに転送するものであり、
前記演算手段は、前記メモリに保持されている複数の画像データに基づいてデコード処理を行う請求項1〜5のいずれか1項記載の光学的情報読取装置。
The control unit performs different gradation conversion processing among the image data held in the reception buffer, holds the transmission buffer, and transfers a plurality of image data to the memory,
The optical information reading apparatus according to claim 1, wherein the arithmetic unit performs a decoding process based on a plurality of image data held in the memory.
複数の画像データは、メモリの連続した領域に配置される請求項7記載の光学的情報読取装置。   8. The optical information reading apparatus according to claim 7, wherein the plurality of image data are arranged in a continuous area of the memory.
JP2009229366A 2009-10-01 2009-10-01 Optical information reader and method for acquiring image data Pending JP2011076518A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2009229366A JP2011076518A (en) 2009-10-01 2009-10-01 Optical information reader and method for acquiring image data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2009229366A JP2011076518A (en) 2009-10-01 2009-10-01 Optical information reader and method for acquiring image data

Publications (1)

Publication Number Publication Date
JP2011076518A true JP2011076518A (en) 2011-04-14

Family

ID=44020408

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009229366A Pending JP2011076518A (en) 2009-10-01 2009-10-01 Optical information reader and method for acquiring image data

Country Status (1)

Country Link
JP (1) JP2011076518A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2014021025A1 (en) * 2012-08-02 2014-02-06 Hosoi Kazukuni Code-reading device and program
JP2015031539A (en) * 2013-07-31 2015-02-16 株式会社キーエンス Image processing device, image processing system, inspection method, and program

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2014021025A1 (en) * 2012-08-02 2014-02-06 Hosoi Kazukuni Code-reading device and program
JP2014032487A (en) * 2012-08-02 2014-02-20 Kazukuni Hosoi Code reader and program
JP2015031539A (en) * 2013-07-31 2015-02-16 株式会社キーエンス Image processing device, image processing system, inspection method, and program

Similar Documents

Publication Publication Date Title
TWI783316B (en) Method for performing fingerprint sensing, electronic module capable of performing fingerprint sensing, and computing apparatus
US10257447B2 (en) Imaging method, imaging device, and electronic device
JP4278918B2 (en) Image data processing apparatus and method
CN112565603B (en) Image processing method, device and electronic device
KR20190018760A (en) Method for generating high-dynamic range image, camera device, terminal and imaging method
CN114330400B (en) Two-dimensional code image processing method, system, device, electronic equipment and storage medium
US20080310746A1 (en) Apparatus and method for generating chain code
KR101364050B1 (en) Method and apparatus for image processing
JP2011076518A (en) Optical information reader and method for acquiring image data
KR100898984B1 (en) Image Processing Apparatus And Method
JP4164257B2 (en) Image processing apparatus, image processing method, program, and storage medium
US20240292120A1 (en) Image sensor
CN116055905B (en) Image sensor, camera module and electronic equipment
JP4449791B2 (en) Code reading device, code reading method and program
EP3844945B1 (en) Method and apparatus for dynamic image capturing based on motion information in image
JP4127187B2 (en) Code information reading apparatus and program
JP4168731B2 (en) Information reading apparatus and program
JP2014059712A (en) Optical information reading device
JP2003259220A (en) Image data processing device, imaging system, image data processing method, computer program, and computer-readable storage medium
JP2002083292A (en) Image signal processing device
CN113256763B (en) Electronic device, image processing method thereof, system-on-chip and medium
CN114630008B (en) Image processing method, device, storage medium and electronic equipment
JP4930172B2 (en) Optical information reader
CN113449580A (en) Method for performing fingerprint sensing, electronic module and computing device
JP2005122257A (en) Image processing apparatus and electronic apparatus