JP2005045514A - Image processor and image processing method - Google Patents
Image processor and image processing method Download PDFInfo
- Publication number
- JP2005045514A JP2005045514A JP2003202664A JP2003202664A JP2005045514A JP 2005045514 A JP2005045514 A JP 2005045514A JP 2003202664 A JP2003202664 A JP 2003202664A JP 2003202664 A JP2003202664 A JP 2003202664A JP 2005045514 A JP2005045514 A JP 2005045514A
- Authority
- JP
- Japan
- Prior art keywords
- data
- image
- distortion correction
- image processing
- memory
- 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.)
- Granted
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 8
- 238000012545 processing Methods 0.000 claims abstract description 204
- 230000015654 memory Effects 0.000 claims abstract description 143
- 238000012937 correction Methods 0.000 claims abstract description 128
- 239000000872 buffer Substances 0.000 claims abstract description 94
- 238000000034 method Methods 0.000 claims description 59
- 230000008569 process Effects 0.000 claims description 46
- 238000006243 chemical reaction Methods 0.000 claims description 38
- 230000005540 biological transmission Effects 0.000 claims description 19
- 238000012544 monitoring process Methods 0.000 claims description 10
- 238000001514 detection method Methods 0.000 claims description 8
- 238000012546 transfer Methods 0.000 abstract description 19
- 238000010586 diagram Methods 0.000 description 33
- 230000006870 function Effects 0.000 description 9
- 238000003384 imaging method Methods 0.000 description 9
- 230000003287 optical effect Effects 0.000 description 9
- 241000226585 Antennaria plantaginifolia Species 0.000 description 4
- 230000004075 alteration Effects 0.000 description 4
- 230000006835 compression Effects 0.000 description 4
- 238000007906 compression Methods 0.000 description 4
- 238000005070 sampling Methods 0.000 description 4
- 230000008859 change Effects 0.000 description 3
- 230000007547 defect Effects 0.000 description 3
- 230000004044 response Effects 0.000 description 3
- 238000010408 sweeping Methods 0.000 description 3
- 230000003111 delayed effect Effects 0.000 description 2
- 230000006872 improvement Effects 0.000 description 2
- 230000005764 inhibitory process Effects 0.000 description 2
- 239000002699 waste material Substances 0.000 description 2
- 101100115215 Caenorhabditis elegans cul-2 gene Proteins 0.000 description 1
- 230000002411 adverse Effects 0.000 description 1
- 238000005452 bending Methods 0.000 description 1
- FFBHFFJDDLITSX-UHFFFAOYSA-N benzyl N-[2-hydroxy-4-(3-oxomorpholin-4-yl)phenyl]carbamate Chemical compound OC1=C(NC(=O)OCC2=CC=CC=C2)C=CC(=C1)N1CCOCC1=O FFBHFFJDDLITSX-UHFFFAOYSA-N 0.000 description 1
- 230000003247 decreasing effect Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 238000007781 pre-processing Methods 0.000 description 1
- 230000009467 reduction Effects 0.000 description 1
- GGCZERPQGJTIQP-UHFFFAOYSA-N sodium;9,10-dioxoanthracene-2-sulfonic acid Chemical compound [Na+].C1=CC=C2C(=O)C3=CC(S(=O)(=O)O)=CC=C3C(=O)C2=C1 GGCZERPQGJTIQP-UHFFFAOYSA-N 0.000 description 1
Images
Landscapes
- Image Input (AREA)
- Image Processing (AREA)
- Editing Of Facsimile Originals (AREA)
- Studio Devices (AREA)
Abstract
Description
【0001】
【発明の属する技術分野】
本発明は、主に、デジタルカメラ等の電子的撮像装置に用いられる画像処理装置及び画像処理方法に関し、特に、回路規模やデータ転送量を増大させること無く、歪補正機能を実現する画像処理装置及び画像処理方法に関する。
【0002】
【従来の技術】
デジタルカメラ,銀塩カメラを問わず、一般的にカメラの光学系においては歪曲収差が現れる。また、現在発売されているカメラでは、光学ズームが可能な機種が殆どであり、その場合、ワイド端からテレ端にかけて、歪曲収差の状態が変化する。ワイド端では樽型歪が多く、テレ端では糸巻き型歪が多い。
【0003】
歪曲収差は、例えば格子状の被写体を撮影すると、樽型歪、糸巻き型歪として観測される。
【0004】
図23(a)は格子状の被写体、(b)は樽型歪を生じた撮影画像、(c)は糸巻き型歪を生じた撮影画像である。
【0005】
ところで、デジタルカメラにおいては、CCD等の撮像素子のデータに対し、様々な画像処理を行なった後、JPEG等の圧縮方式で圧縮したデータをメモリカード等の記録媒体に記録する。
【0006】
図24(a)は一般的なデジタルカメラで行われている画像処理手順の概念を示している。CCDから取り込まれた撮像信号は、プリプロセスで画素欠陥処理やA/D変換等の処理が行われ、SDRAM等のフレームメモリに記憶される。次に、フレームメモリに記憶された画像データが読み出されて、イメージプロセス1、イメージプロセス2、…、イメージプロセスNにより各種の画像処理が行われる。画像処理後の画像データは、さらにJPEG等の圧縮方式で圧縮されて、記録媒体としてのメモリカード等へ記録される。
【0007】
図24(b)は従来のデジタルカメラの画像処理装置のブロック図(例えば特開2000−312327号公報での従来例)を示している。
【0008】
図24(b)において、従来の画像処理装置は、バス103にCPU104と共にプリプロセス回路102,複数のイメージプロセス回路106−1〜106−n,JPEG処理部107,フレームメモリ105及び記録媒体としてのメモリカード等108が接続されている。そして、CPU104の制御により、CCD101からの撮像信号がプリプロセス回路102で画素欠陥処理やA/D変換等が施された後、バス103を通してフレームメモリ105に一旦記憶される。次に、フレームメモリ105から画像データを読み出し、バス103を通してイメージプロセス回路106−1に入力して所定の画像処理を行い、再びバス103を通してフレームメモリ105に書き直す。以下同様にして、バス103を介してフレームメモリ105とイメージプロセス回路106−2〜106−nとの間でデータのやり取りを順次行って、最後にJPEG処理部107でJPEG圧縮処理を行い、画像処理したデータをフレームメモリ105に一旦記憶し、フレームメモリ105から読み出した処理データをメモリカード等108に記録するようになっている。以上の各段のイメージプロセス及びJPEG処理では、小領域(ブロックライン)を単位として画像処理が行われる。
【0009】
一方、従来、この画像処理の一部として歪補正を行う先行技術が開示されている。例えば、特開6−181530号公報、特開10−224695号公報がある。
【0010】
特開6−181530号公報には、撮影時における撮像ズームレンズの撮像ポジションが歪曲収差の大きいポジション内であることが検出手段にて検出されている場合には、この撮像ズームレンズによって生じた像の幾何学的歪みを、固体撮像素子の撮像データを幾何学的変形に基づき読み出すことにより補正することが記載されている。
【0011】
特開10−224695号公報には、光学系を経由した光を受光する固体撮像デバイスで撮像したデータをランダムアクセスビデオメモリに記憶し、ランダム読み出しタイミング発生回路は光学系によって生ずる収差を補正するための収差補正データを有し、この収差補正データに基づいて固体撮像デバイスによって生成された信号を所定の順に読み出してビデオ信号を生成することで、光学系の歪曲収差を補正することが記載されている。
【0012】
【特許文献1】
特開2000−312327号公報(第3頁、図19)
【0013】
【特許文献2】
特開6−181530号公報(第1,2頁、図2)
【0014】
【特許文献3】
特開10−224695号公報(第1−3頁、図1)
【0015】
【発明が解決しようとする課題】
しかしながら、特許文献1の従来例では、フレームメモリと各イメージプロセス回路間のデータのやり取りが多く、バスのデータ転送量が増大する。
【0016】
特許文献2では、1ラインを処理するのに、大容量バッファメモリが必要である。また、バッファメモリの容量で処理できる画像サイズが制限されてしまう。
【0017】
また、特許文献3では、ランダムアクセスで処理するのに、バッファメモリは必要ないが、一般的にSDRAM等のランダムアクセスビデオメモリをランダムアクセスすると、転送時間がかかる。
【0018】
そこで、本発明は上記の問題に鑑み、バスの転送量やメモリの容量を大きく増大させることなく、歪補正処理を実現できる画像処理装置及び画像処理方法を提供することを目的とするものである。
【0019】
【課題を解決するための手段】
請求項1の発明は、画像データに対して歪補正処理を行う歪補正手段を有する画像処理装置において、前記歪補正手段は、前記画像データの一部を格納するメモリ部と、前記メモリ部に対するデータの書き込みおよび読み込みを制御するメモリ制御部と、を有し、前記メモリ部から読み出した画像データに対する補間演算を行うことを特徴とする。
【0020】
この構成では、内部バッファとしてのメモリ部に画像データの一部を格納して、そのデータを利用して歪補正処理のための補間演算を行うことができる。
【0021】
請求項2の発明は、請求項1の画像処理装置において、前記メモリ制御部は、前記メモリ部への書き込みの際は、列方向に一列に並んだ一定数分の画素からなる画像データ(ユニットライン:UL)を単位として書き込むように制御し、前記メモリ部からの読み出しの際は、歪補正処理後の画像が前記ULを単位として出力されるように、前記メモリ部に格納された画像データに対して読み出し制御することを特徴とする。
【0022】
この構成では、メモリ部に対してULを単位として書き込み、読み出しを行うので、メモリ部のバッファ容量としては光学的歪量に応じて数UL分、すなわち少なくとも1UL分の容量があればよく、バスの転送量やメモリの容量を大きく増大させることなく、歪補正を実現できる。
【0023】
請求項3の発明は、請求項2の画像処理装置において、前記メモリ制御部は、前記ULの最初に処理される画素の座標位置に対して、行方向に対して前側および後側に所定幅の領域(それぞれpreULB、postULB)を設け、前記ULの処理中は他の処理によって前記領域が上書きされないよう制御することを特徴とする。
【0024】
この構成により、処理に必要なバッファとしてのメモリ部の前記preULB、postULBの領域のデータが上書きされないよう確保できる。
【0025】
請求項4の発明は、請求項2又は3の画像処理装置において、前記メモリ制御部は、さらに、前記ULの処理中に、前記歪補正手段の前段からのデータを入力するために開放可能なバッファ量を算出するバッファ開放量算出回路と、前記歪補正手段の後段に対するデータ送信の可否を判定するデータ送信可否判定回路とを有し、前記バッファ開放量算出回路には、前記ULの処理における最初の画素に対する補間座標を中心として前記postULBが入力され、データ送信可否判定回路には前記preULBが入力され、バッファ開放量算出回路は前記バッファ開放量を前記postULBの値を参照して算出し、データ送信可否判定回路は前記preULBの値を参照してデータ送信可否の判定を行うことを特徴とする。
【0026】
この構成により、処理に必要なバッファとしてのメモリ部を少ない容量で効率的に使用することができる。
【0027】
請求項5の発明は、請求項3又は4の画像処理装置において、前記preULB値、postULB値は、それぞれ歪中心に対して前側と後側とで異なる値を設定可能であることを特徴とする。
【0028】
この構成では、図14のように、歪中心の左右ではpreULB、postULBの値が異なることに基づいて、これらの値を、どちらにも対応できるよう、図15のように大きく取ると、処理に必要なバッファを広く確保しておかなければならず、バッファの無駄である。歪中心前後でpreULB、postULBを変化することにより、内部バッファの使い方に無駄をなくし、小さなバッファ容量で比較的大きな歪補正を行うことが可能となる。
【0029】
請求項6の発明は、請求項1〜4のいずれか1つの画像処理装置において、前記画像処理装置は、さらにバッファの空き領域を検出するバッファ空き容量監視回路を有し、該バッファ空き容量監視回路によりバッファ内の空き領域が検出されると、該空き領域へのデータの書き込みを可能とすることを特徴とする。
【0030】
この構成により、データ出力中に入力も可能なパイプライン的な動作を可能とする。
【0031】
請求項7の発明は、請求項1の画像処理装置において、前記メモリ部は、データのリード動作とライト動作が同時に可能な複数のメモリからなり、前記メモリ制御部は、さらに、前記メモリ部へのデータ書込み制御を行う書込みアドレス生成回路と、前記メモリ部に格納されている画像データから補間演算に必要なデータを同時に読み出すためのアドレスを生成する読出しアドレス生成回路と、を有し、前記データ書込み制御は、同時に読み出すデータをそれぞれ異なるメモリに書き込むものであることを特徴とする。
【0032】
この構成によれば、バッファ内にある画像データから、補間演算に必要なデータとして任意の座標の周辺の複数の画素(例えば、16画素)情報を同時に読み出すことが可能となり、演算処理を速やかに行える。
【0033】
請求項8の発明は、請求項3〜5のいずれか1つの画像処理装置において、前記画像処理装置は、さらに、歪補正処理された座標が前記ULの処理における最初の画像に対する補間座標に対し、列方向に前記preULB、postULBを逸脱する座標が生成された時、若しくは、歪補正された座標が前段から入力されない座標となった時にエラーを検出して出力するエラー検出回路を有することを特徴とする。
【0034】
この構成では、パラメータの誤入力や、歪補正量の見積もりが過少だった時にエラー検出回路が検知してCPUに知らせる。特に、preULB、postULBの設定オーバー(図13参照)については、事前に正確な見積もりを行えない場合があるので、オーバーする量をCPUに通知することで設定値を修正しやすくする。
【0035】
請求項9の発明は、請求項3〜5のいずれか1つの画像処理装置において、前記エラー出力がなされたときはレジスタを再設定して画像処理を再実行することが可能であることを特徴とする。
【0036】
請求項10の発明は、請求項2〜6のいずれか1つの画像処理装置において、1ULの処理終了後、次の1ULまたはさらにその次の1ULの処理を開始する際の最初の補間座標が演算された後に1UL単位の処理を終了することを特徴とする。
【0037】
この構成では、1UL処理が終わった後に開放できるバッファの量は、次のUL先頭座標が決まらなければ分からない(図17参照)ことを利用する。内部バッファは小さいので、使わなくなったデータが格納されている部分をできるだけ早くに開放する為、次のUL先頭座標を算出して開放量を取得(図18参照)し、バッファを開放することで内部バッファを有効に利用することができる。
【0038】
請求項11の発明は、画像データに対して歪補正処理を行う画像処理方法において、前記歪補正処理を行うに際は、データの書き込みおよび読み込みが制御されるメモリ部に、前記画像データの一部を格納し、該メモリ部から読み出した画像データに対して補間演算を行うことを特徴とする。
【0039】
この方法では、内部バッファとしてのメモリ部に画像データの一部を格納して、そのデータを利用して歪補正処理のための補間演算を行うことができる。
【0040】
請求項12の発明は、請求項3〜5のいずれか1つに記載の画像処理装置において、前記画像処理装置は、さらに、前記歪補正手段が歪補正処理を行う入力画像範囲を算出する歪補正範囲算出部を有することを特徴とする。
【0041】
請求項13の発明は、請求項12記載の画像処理装置において、前記歪補正範囲算出部は、所定の歪補正式を適用して座標変換可能であり、歪補正後の出力画像範囲において、周辺4辺の各辺に対応する画素を座標変換して生成した変換座標の最大値と最小値、および4頂点に対応する画素を座標変換して生成した変換座標、の少なくともいずれかを算出し、前記preULBおよびpostULBは、前記歪補正範囲算出部の出力結果から算出することを特徴とする。
【0042】
これらの構成では、前述したpre,postULBはレジスタに設定されるが、それらの値を生成するためには、歪の変形を考慮して画像データの入力範囲を算出可能とするサポート機能が必要となる。このサポート機能は、歪補正手段の歪補正処理機能に対して歪補正範囲算出部として設けられる。
【0043】
【発明の実施の形態】
発明の実施の形態について図面を参照して説明する。
図1は本発明の一実施の形態の画像処理装置の全体構成を示すブロック図である。図2は図1における歪補正処理部の構成を示すブロック図である。
【0044】
図1の画像処理装置においては、バス3に接続された各部の制御を行うCPU4の制御により、CCD1からの撮像信号をプリプロセス回路2で画素欠陥処理やA/D変換等を行い、得られた画像データを、バス3を介してフレームメモリ5に一旦記憶する。フレームメモリ5は、SDRAM等で構成され、画像処理前のデータ及び画像処理後のデータを格納するメモリである。次いで、フレームメモリ5から読み出した画像データをバス3を介して、第1データ順序変換部6に入力する。第1データ順序変換部6は、後に図26(a)で説明するように、ブロック単位のデータを記憶可能なメモリを複数、ここでは2つ備えている。第1データ順序変換部6は、 フレームメモリ5から行方向にデータを読み出して記憶した後、列方向にデータを順に読み出し、イメージプロセス回路7に出力する。
【0045】
イメージプロセス回路7は入力したデータに対して所定の画像処理を行って次段の歪補正手段としての歪補正処理部8に転送する。歪補正処理部8は入力したデータに対して歪補正処理を行って次段の第2データ順序変換部9へ転送する。第2データ順序変換部9は、後に図26(b)で説明するように、ブロック単位のデータを記憶可能なメモリを複数、ここでは2つ備えている。第2データ順序変換部9は、 歪補正処理部8から列方向にデータを読み出して記憶した後、行方向にデータを順に読み出し、JPEG処理部10に転送する。そして、JPEG処理部10でJPEG圧縮処理を行い、処理データをフレームメモリ5に一旦記憶し、フレームメモリ5から読み出した処理データをメモリカード等11に記録するようになっている。
【0046】
歪補正処理部8は、図2に示すように、歪補正後の補正画像の位置(補間位置という、X,Y)とこれに対応した歪補正前の元の画像の位置(X’,Y’)を生成する補間座標生成部81と、歪補正処理部8の前段ブロックの回路からの画像データの一部を一時的に格納しておくバッファメモリ(以下、単にバッファ)としての内部メモリ部82と、その内部メモリ部82に対する書き込み及び読み出しの制御を行うメモリ制御部83と、変換した歪補正前の画像位置の座標(X’,Y’)に従って画像処理をしてデータの歪補正をする補間演算部84と、を有して構成されている。
【0047】
補間座標生成部81は、図2に示すように、補間座標(X,Y)を生成する座標生成部811と、生成された補間座標(X,Y)に対して所定の歪補正式[式1](後述する)を適用して変換した補正前の座標(X’,Y’)を出力する歪補正座標変換部812と、座標生成部811からの補間座標(X,Y)と歪補正座標変換部812からの変換座標(X’,Y’)とを選択的に出力可能なセレクタ813と、で構成されている。歪補正処理部8における座標生成部811,歪補正座標変換部812,セレクタ813,メモリ制御部83については、制御データを格納した制御レジスタ85に設定された各ブロックに対する設定値に従って動作する。また、処理結果のステータスなどをCPUから参照することができる。
【0048】
以上のように構成された本発明による画像処理装置においては、上記第1データ順序変換部6からJPEG処理部10までは、バス3を介することなく、該バス3とは異なる情報伝達経路でパイプライン処理可能なように接続されていて、画像データを、2次元的な画素配列における所定のブロック単位で転送して処理するようになっている。このようにバス3を介したデータ転送は、フレームメモリ5から第1データ順序変換部6への転送と、JPEG処理部10からフレームメモリ5への転送及びフレームメモリ5からメモリカード11への転送だけとなり、したがってフレームメモリと各イメージプロセス回路との間でデータのやりとりを行っていた従来例(図24(b))と比べて、バス3によるデータ転送量を大幅に低減させることができ、バス3の負荷を大幅に軽減することが可能となる。また、この図1に示す例においては、画像処理を行うイメージプロセス回路7を1つのみ設けているが、複数あっても構わない。さらに、図では、イメージプロセス回路7の後段に歪補正処理部8が設けられているが、逆の構成であっても構わない。
【0049】
初段のイメージプロセス回路7と2段目のイメージプロセス回路である歪補正処理部8で構成されるイメージプロセス回路部では、各イメージプロセス回路7,8の前段或いは内部にパイプラインレジスタとして、図示しない小容量のメモリが配置されていて、該小メモリを介して、各イメージプロセス回路7,8がパイプライン処理動作を行うように構成されている。これらの小容量のメモリは、各イメージプロセス回路7,8で空間的な画像処理を行う場合、画像処理に必要な周辺データの記憶をするために、また画像データをブロック単位で読み出して配列換えなどを行って処理する必要があるために、設けられている。
【0050】
イメージプロセス回路7からイメージプロセス回路8へのデータ転送は、後段のイメージプロセス回路である歪補正処理部8の内部メモリ部82に空きがあると、歪補正処理部8から前段のイメージプロセス回路7に対してリクエスト(REQ)を送信し、これに対して前段のイメージプロセス回路7からリクエスト受付(GRANT)を受信すると同時にバッファである内部メモリ部82の空き情報を1つ減らす。後段ブロックの歪補正処理部8でこのリクエストとリクエスト受付を繰り返し、空きが0になったらリクエストを取り下げる。後段ブロックである歪補正処理部8は、前段ブロックからのリクエスト受付(GRANT)と同時もしくはリクエスト受付(GRANT)の後に前段ブロックのイメージプロセス回路7からデータが流入し、内部メモリ部82へ書込みをする。複数段のイメージプロセス回路がパイプライン処理可能なように接続されている場合は、上記のようにして前段から後段へデータが転送され、各イメージプロセス回路のメモリ部にデータが書き込まれ、所定の画像処理が行われた後、後段からのリクエストに基づいて前段ブロックから後段へと画像処理を行いながら順次データが転送されていくことになる。
【0051】
図3は歪補正処理部8における座標変換の概念図を示している。図3(a)は元データである撮像画像データ、同図(b)は補正画像、同図(c)は(b)の補正画像の座標位置(X,Y)に対して(a)の元データの座標上に変換された座標位置Pでのデータの座標(X’,Y’)(この座標は元データを実際に構成する複数の画素の位置には必ずしも正確には一致しない座標位置にある)を示している。そのP点での座標位置(X’,Y’)はそのP点の周辺の画素16点の座標を使って算出されると共にP点での画像データはその周囲の前記16点の画素データを用いて補間演算される。補間演算部84にて点Pの位置のデータをその周囲の16点の画素値(輝度データ)から補間演算するべく処理が行われる。図2の補間位置生成部811で補間座標を生成するというのは、図3(b)の補正画像側でどこの画素位置(X,Y)を指し示すか、ということである。
【0052】
[式1]では、歪補正後の画素位置(X,Y)に対する歪補正前の画素位置(X’,Y’)を算出することができる。但し、歪補正前の画素位置(X’,Y’)は元画像データ上の画素位置に対応した整数値になるとは限らないことは前述した通りである。
【0053】
[式1]に従うと、図3(b)の座標(X,Y)が同図(a)のように座標(X’,Y’)に変換される。これにより、元データの中のどこの座標位置のデータを作成すれば、よいかを知ることができ、その位置(X’,Y’)のデータを後述する16点補間処理を行う補間式[式2]を用いて周囲16点の既知の画素値(図5の黒丸印の入力画像データ)から算出して得ることができる。
【0054】
【式1】
[式1]におけるZは、歪中心(Xd,Yd)から今注目している点(X,Y)までの距離である。[式1]によって、補正画像の点(X,Y)に対して歪んでいる元画像の方の座標(X’,Y’)が算出される。[式1]について補足説明すると、Mは光学系のデータを用いて理論的に補正した際、補正後に画像がはみ出したり、不足したりする現象を補正するための補正倍率である。Sx,Syは間引き取込みなど、縦横で空間的なサンプリング間隔が異なる現象の補正をするためのサンプリング比である。Xoff,Yoffは歪補正処理によって、歪補正処理後に、被写体位置が撮影時の位置とはずれてしまう現象の補正をする中心ずれの値である。
【0055】
本発明に係る[式1]では、高次項(具体的にはZ4、Z6、…)を考慮することで、より複雑な陣笠型の歪(図4参照)にも対応できるようにしている。また、中心が一致していても撮像素子の一部しかデータを取り込まない場合や、光軸中心と撮像素子中心がずれている場合など、歪中心(Xd,Yd)を考慮する必要がある。さらに、歪補正処理により被写体位置が撮影時の位置からずれる現象を補正するため、中心ずれ補正値(Xoff,Yoff)を考慮する必要がある。間引き取込みの場合や輝度データ(Y)と色データ(Cb,Cr)からなるYC画像を処理する場合は、X,Yで空間的なサンプリングが異なる。そこで係数としてサンプリング比(SX,Sy)を導入して、座標変換を補正するようにしている。
【0056】
次に、図25,図26を参照して画像データの書き込み及び読み出しの処理及び順序について説明する。
図25は、本実施の形態におけるフレームメモリからの画像データの読み出し順序を説明する図である。
【0057】
画像データは、通常は、ライン方向、つまり行方向にスイープさせて書き込まれていて、読み出し時は行方向に読み出されるようになっており、1ラインの画像データを全て読み出して、次に隣接するラインの画像データを全て読み出すといった動作を繰り返して行うのが普通である。
【0058】
これに対して、本発明に係る画像処理装置は、行方向にスイープさせて書き込まれた画像データを、列方向にある一定の長さを単位に、行方向の画像データを順番にイメージプロセス部7に入力し、以降、順次隣の列をイメージプロセス部7に入力して、画像の右端まで繰り返して得られる小領域(矩形状の画像データ)をブロックライン(BL)と呼ぶ。
【0059】
こうした画像データの読み出しを可能にするための第1データ順序変換部6と、第2データ順序変換部9との構成を、図26を参照して説明する。図26は、第1,第2データ順序変換部の構成を示すブロック図である。
【0060】
第1データ順序変換部6は、図26(a)に示すように、ブロック単位の画像データを記憶可能なメモリを複数、ここでは2つ備えており、この2つのメモリ6aとメモリ6bが書き込み側,読み出し側の各スイッチにて書き込み,読み出しが交互に切り換えられるようになっている。すなわち、フレームメモリ5は、書き込み側のスイッチにて、これらメモリ6aとメモリ6bとに切換可能に接続されているとともに、イメージプロセス部7も読み出し側のスイッチにてこれらのモリ6aとメモリ6bとに切換可能に接続されていて、フレームメモリ5がメモリ6aとメモリ6bとの一方に接続されているときには、該メモリ6aとメモリ6bとの他方がイメージプロセス部7に接続されるように切り換えられる。すなわち、メモリ6a,6bは、フレームメモリ5とイメージプロセス部7との両方に同時に接続されることがないようにスイッチングされ、交互に書き込み,読み出しが行われるようになっている。
【0061】
フレームメモリ5に記憶されているフレーム画像の一部は、ブロック単位でライン方向に読み出され、一方のメモリ、ここでは例えばメモリ6aに記憶される。
【0062】
これと並行して、メモリ6bからは、既にフレームメモリ5から読み出されて記憶されているブロック単位の画像データが、列方向(縦方向)に順に読み出されて、イメージプロセス部7へ出力される。
【0063】
フレームメモリ5からメモリ6aへの書き込みと、メモリ6bからイメージプロセス部7への読み出しが終了すると、書き込み側のスイッチおよび読み出し側のスイッチが切り換えられて、次に、フレームメモリ5からメモリ6bへ次のブロック単位の画像データの書き込みが開始されるとともに、メモリ6aからイメージプロセス部7へのブロック単位の画像データの読み出しが開始される。
【0064】
第2データ順序変換部9も、図26(b)に示すように、上記第1データ順序変換部6とほぼ同様に構成されていて、ほぼ同様に動作するようになっている。
【0065】
すなわち、第2データ順序変換部9は、メモリ9a,メモリ9bと、書き込み側スイッチ,読み出し側スイッチとを有して構成されている。
【0066】
そして、該第2データ順序変換部9の動作時には、歪補正処理部8からの書き込みがメモリ9aとメモリ9bとの一方に対して列方向(縦方向)に行われ、メモリ9aとメモリ9bとの他方からは行方向(横方向)に読み出しが行われて、JPEG処理部10へ出力されるようになっている。
図6は、図2における歪補正処理部8の詳細な構成を示している。
図6の各部と図2の各部との対応関係を説明する。図6における補間位置算出回路22が図2の補間位置生成部811に、セレクタ24が図2のセレクタ813に、歪補正係数補正回路21及び補間位置補正回路23が図2の歪補正座標変換部812に、それぞれ対応している。また、図6における2ポートSRAM26が図2の内部メモリ部82に対応し、書込みアドレス生成回路28,バッファ空き容量監視回路29,データ送信可否判定回路30,バッファ開放量算出回路31及び読出しアドレス生成回路25が図2のメモリ制御部83に、補間回路27が図2の補間演算部84に、それぞれ対応している。エラー検出回路32は、図2には図示していないがメモリ制御部83に接続して設けられている。エラー検出回路32は、歪補正処理において歪量が大きくなり後述するpreULB、postULBの設定値を越える歪が発生したときに、エラー(ERROR)としてCPU4に伝える機能を有するものである。
【0067】
補間位置算出回路22は、歪補正処理部8の後段回路からのリクエストに応じて後段回路へグラント(リクエスト受付)を返したときにそのグラントをトリガとして、1ユニットライン(以下、1ULという)分の補間位置(X1,Y1)を算出するものである。ここで、1ULとは、前述したブロックライン処理において、メモリ部への書き込み,読み出しの際に、列方向に一列に並んだ一定数分の画像データを書き込んだり,読み出したりする際の一単位である。つまり、1ULは、ブロックライン(BL)上の列方向に一列に並んだ一定画素数のデータを指している。
【0068】
補間位置補正回路23は、歪補正係数算出回路21からの歪補正係数Fを補間位置(X1,Y1)に乗算して、歪補正前の元データの座標位置(X’,Y’)を計算する。セレクタ24は、(X1,Y1)と(X’,Y’)を選択するもので、歪補正を行う場合は(X’,Y’)を選択して出力し、拡大・縮小処理(リサイズ)のみを行う場合は(X1,Y1)を選択して出力する。
【0069】
2ポートSRAM26は、歪補正処理部8内におけるデータを格納するバッファである。
【0070】
読出しアドレス生成回路25は、補間位置に対応する2ポートSRAM16内のアドレス(ADR)を生成したり、2ポートSRAM26からの出力を整列するための制御信号を出力したり、出力画像データに同期して書き込み制御信号WE_Nを出力したり、図7及び[式2]に示すD0が2ポートSRAM上のどこの位置かを知らせるデータ列制御信号を出力したりする。
【0071】
書き込みアドレス生成回路28は、書き込み制御信号WEに合わせて内部メモリである2ポートSRAM26のアドレス(ADDRESS)を生成したり、1UL分のデータ入力が完了したら、その内部カウンタ(BLC)をカウントアップする。
【0072】
データ送信可否判定回路30は、BLC値,本回路の動作状態,次のUL先頭座標,歪補正処理部8の後段回路からのリクエスト(REQ)状態とから、後段回路からのREQ信号に対してグラント(GRANT_N)を送信できる状態にあるかを判定し、グラント送信可能ならGRANT_N=1とする機能を有する。
【0073】
補間回路27は、補間位置に対応する画像データにつき、16点補間を行う。バッファ開放量算出回路31は、現在処理中のUL先頭座標と、次に処理予定のUL先頭座標の整数部の差をバッファ開放量(図17参照)として算出する。
【0074】
バッファ空き容量監視回路29は、内部バッファとしての2ポートSRAM26に格納されているデータ(UL)量を保持し、バッファに空きがあれば、歪補正処理部8の前段回路に対してリクエスト(REQ=1)を送信する。
【0075】
次に、図6の歪補正処理部8の回路動作を説明する。
まず、内部メモリ部(バッファ)である2ポートSRAM26に空きがある場合、バッファ空き容量監視回路29から前段回路に対してデータ要求としてのリクエスト(REQ)を送信すると、バッファ空き容量監視回路29は前段回路からリクエスト受付としてのグラント(GRANT)を受信し、この受信と同時に2ポートSRAM26に格納可能なUL数を記憶するカウンタ(回路29内にある)を1つ減らす。1回のリクエストとグラントで1ULを一動作単位としてデータ転送する。上記カウンタが0になったらリクエストを取り下げる。
【0076】
そして、前段回路から書込みアドレス生成回路28ヘデータが流入し、2ポートSRAM26への書込みが行われる。1UL入力毎に書込みアドレス生成回路18の内部カウンタ(BLC)がアップする。
【0077】
2ポートSRAM26は、補間回路27にて例えば16点補間を行えるように、図8の如く読出しと書込みが同時に行える2ポートSRAMが4×4の計16個で構成されている。
【0078】
ここで、図8を用いて、2ポートSRAM26を説明するが、メモリの数や各メモリの大きさは異なっていても構わない。例えば、図8では、ブロックラインの幅(ULの長さ)を96としているが、もっと長くしても短くしても構わない。回路規模と補正性能とのバランスで決めればよい。また、4×4(計16個)も、4点補間であれば2×2(計4個)で構わない。補間方式(何点で補間するか)に合わせて決めればよい。
【0079】
図8は、16個の2ポートSRAMからなるメモリ空間で、横方向は入力されるUL順であるが、縦方向は各2ポートSRAMごとに付したアドレスである。Nを整数とし、処理のある時点での状態を説明する。縦方向に並んだ4つの各2ポートSRAMであるNo.0,4,8,12に格納するデータは、4N,4N+4,4N+8,4N+12番目のULのデータであり、No.1,5,9,13に格納するデータは、4N+1,4N+5,4N+9,4N+13番目のULのデータであり、No.2,6,10,14に格納するデータは、4N+2,4N+6,4N+10,4N+14番目のULのデータであり、No.3,7,11,15に格納するデータは、4N+3,4N+7,4N+11,4N+15番目のULのデータである。
【0080】
横方向に並んだ4つの各2ポートSRAMであるNo.0,1,2,3及びNo.4,5,6,7及びNo.8,9,10,11及びNo.12,13,14,15の各組についても同様に格納されている。
【0081】
図9を使って、各2ポートSRAMにデータが書き込まれる様子を説明する。図9では、図9(a)に示すように、幅8ライン(画素)のブロックラインを想定しており、データは、UL単位に「1,2,…,i,m」、「5,6,…,j,n」、「9,10,…,k,o」、…という順序で入力される。図9(b)は同図(a) に示した書込み順番のデータが4×4の16個の2ポートSRAMNo.0〜No.15上のどこに書き込まれていくかを示している。例えばNo.0,No.4,No.8,No.12には、図9(a) の左側縦一列の1UL分の画像データ(順番1〜mで示されるデータ)が分散されて格納されていく。なお、図8に示される縦方向の2ポートSRAMNo.0,No.4,No.8,No.12の各縦ラインごとに付された表記0〜92,1〜93,2〜94,3〜95は、図9(a) で示される各ユニットライン(1〜m…、5〜n…、9〜o…、・・・・)の表記とは異なっている。これは、図9(a),(b)では、4×4の16個の画像データにつき書き込み順が分かるように1〜16,a〜p,A〜P,…と16個の塊ごとに符号を付してあるためである。図8の場合はその縦方向の2ポートSRAMNo.0,No.4,No.8,No.12の各縦ラインごとに付された表記は、縦方向の1つのULにおけるデータ順に相当する。2ポートSRAMNo.0,No.4,No.8,No.12のそれぞれには1つのUL画素データNo.0〜95が交互に分散して記載されている。従って、図8の縦方向に並んだ4つの各縦ラインには1つのユニットライン(UL)の画素順(0〜95)の何番目の画素であるかを示す表記が付されている。図8の2ポートSRAMのNo.0の縦方向にはULの4の倍数の画素(0,4,8…92)が格納してあり、2ポートSRAMのNo.4の縦方向にはULの(4の倍数)+1の画素(1,5,9…93)が格納してあり、2ポートSRAMのNo.8の縦方向にはULの(4の倍数)+2の画素(2,6,10…94)が格納してあり、2ポートSRAMのNo.12の縦方向にはULの(4の倍数)+3の画素(3,7,11…95)が格納してある。さらに、2ポートSRAMのNo.1,2,3及びNo.5,6,7及びNo.9,10,11及びNo.13,14,15の各組についても同様に格納してある。
【0082】
再び図8に戻って、1UL分のデータは縦方向に並ぶ4つの2ポートSRAMに1画素づつ順に格納されている。最初のULデータはNo.0,4,8,12(図8の4Nのライン)に書き込まれる。次のULデータはNo.1,5,9,13(図8の4N+1のライン)に書き込まれる。図8のバッファ形態では、歪補正処理によって補間位置がどのように移動しても、バッファ内の任意の座標周辺16点を1回のアクセスで同時に抽出することができる構成としてある。
【0083】
データ送信可否判定回路30が後段回路からリクエスト(REQ_N)を受信し、次のULデータが送れる状態にあればリクエスト受付(GRANT_N)を出力する。このリクエスト受付(GRANT_N)は自分自身へのトリガとなり、補間位置算出回路22が動作を開始し、1UL分動作したら次のUL先頭座標を算出して終了する。
【0084】
補間位置算出回路22が動作開始して補間位置(X1,Y1)を出力するのと同期するようにデータ送信可否判定回路30からは歪補正係数算出回路21へ動作トリガ(trig)を送る。歪補正係数算出回路21も補間位置算出回路22と同様、1UL分動作したら次のUL先頭座標を算出して終了する。
【0085】
読み出しアドレス生成回路25は、入力される補間座標から、2ポートSRAM26の16個夫々に読み出しアドレスを発行する。
【0086】
次に、読み出し及び補間の方法について説明する。
補間方法を図7に示す。図7は補間回路27における補間演算のイメージ図である。補正座標位置Pの座標(X’,Y’)は前出の[式1]で既に求めてある。この座標における画素値(輝度データ)を求めるのに、座標P(X’,Y’)の周辺16点の画素データD0〜D15から求める。その内、D0が16個のメモリのどのメモリから来ているかが分かれば、D1,D2…,D15はD0に対する位置関係から分かる。後述するように、D0は補間位置の座標によって求まる。
【0087】
図10は16個の2ポートSRAMからなるバッファからの読出し例を示している。今、補間位置(X’,Y’)がX’=10.…,Y’=50.…(…は小数点以下の数字)とすると、X’=10.…は(4×0+10)以上であるから、横方向には2ポートSRAMの4N+10番目のULより若干右側に補間位置が来る。Y’=50.…は(4×12+2)以上であり、4N+10番目のULで、50番目の画素が格納されているメモリ(No.10)が図7における画素D5を出力するので、D0を出力するメモリは、その左上にあるNo.5となる。
【0088】
図7のD0〜D15に対応する画素データは図10の○部であるので、それらが出力されるようにアドレスを生成する。
【0089】
No.0から出力される画像データがD0には対応しない。図10の例では、No.5からの出力がD0に対応する。このため、どのメモリからどのデータが出力されているかを識別するため、読出しアドレス生成回路25からデータ列制御信号を出力し、これによって、補間演算を行う補間回路27はD0が2ポートSRAM26のどこから出ているかを認識して16点補間を行う。
【0090】
画素データD0〜D15が分かれば、[式2]の補間式による補間処理を行うことによって、補正座標位置の画素データをDoutとして求めることができる。
【0091】
【式2】
最後のULデータ出力の後、バッファ開放量算出回路31は今処理し終わったUL先頭座標と次のUL先頭座標との差を計算し(図17参照)、必要なくなったデータの蓄積されているバッファを開放するため、バッファ開放量をバッファ空き容量監視回路29へ出力する。ただし、歪中心を跨ぐ時のバッファ開放量は、図16(b)に示すようにpostULB1,postULB2の値変化も考慮した量を開放することが好ましい。 図16(a)に示すpreULB、postULBとは、ULを形成する画素のうち、最初の画素の座標位置に対して、行方向に対して前側及び後側に所定幅の領域を設けたもので、これらをそれぞれpreULB、postULBと定義している。歪中心を跨いだ時はバッファ開放量を通常のUL先頭座標の差ではなく、参照値の変わるpostULB(ULB:Unit Line Bufferの略、ユニットラインバッファ)の変化量を参照してバッファ開放量を調節する(調整量は、postULB1−postULB2で、図16(b)参照)。
【0092】
(UL先頭座標の差)+(調整量)がマイナスになる場合は、マイナス値を記憶しておく。処理が進んでバッファ開放量がマイナス値を超えるまでバッファの開放を行わない。
【0093】
前述のバッファ開放量の算出と共に、バッファ開放量算出回路31は次のUL処理にあとどれだけ前段回路からデータが必要かをデータ送信可否判定回路30へ送信する。
【0094】
バッファ空き容量監視回路29は前述のバッファ開放量の算出によってバッファに空きができたら、前述の前段回路へのリクエストを行う。
【0095】
データ送信可否判定回路30は書込みアドレス生成回路28の内部カウンタ(BLC)とバッファ開放量算出回路31からの人力とpreULB値とに基づいて、次のULデータを送れるかどうかを判断する。データ送信可否判定回路30は、後段回路のリクエストに対してリクエスト受付(GRANT_N)を返す。
【0096】
エラー検出回路32は、読出しアドレス生成回路25に入力される座標がブロックライン(BL)の左端(図11参照)や右端を逸脱したり、ブロックライン(BL)の上下端(図12参照)を逸脱したり、歪量がpreULB、postULBの設定値を逸脱(図13参照)した場合にエラーを出力する。これらのエラーの出力は、座標を判別して出力することになる。図11及び図12の場合には、エラーを出力するが、処理は継続する。図13の場合も、エラーを出力するが、処理は継続する。図13のpreULB、postULBの場合については、エラーを出力するだけではなく、逸脱した量を記憶し、レジスタに設定してCPU4がデータとして取得できるようにしておく。
【0097】
このように、ブロックライン処理で、出力側の画像に対して入力側の画像を補間算出しているときに入力画像の範囲からはみ出すようなときがある。その場合、入力範囲にデータがない部分で補間データを生成することになり、エラー検出回路32から補間ができない旨のエラーを出力することになる。
【0098】
図14にあるように、歪の中心座標に対して、画像の歪み方は対照的になる。また、歪みは一般的に中心に近いほど小さく、離れるほど大きくなる。そこで、BLの両端にあるULの変形を考慮し、バッファを確保すれば、全てのULにおいて、補間処理でデータが不足することは通常はない。そこで、補間する最初の座標(図ではブロックラインBL内の画像データの一番上の×印にて示す先頭座標)に対して前方(図示右側)に所定の領域preULBを、後方(図示左側)に所定の領域postULBを設ける。
【0099】
サポート機能については、本願と同日に出願した特願2003‐202493号において、「歪補正範囲算出部」と称する部分に該当する。図27(a)において、注目領域がBLとなるが、歪補正の座標変換で同図(b)のように変形される。このとき、X’TL,Y’TL,XLmin,XLmaxからpreULB1/postULB1が決められる(図16(a)参照)。同様に、X’TR,Y’TR,XRmin,XRmaxからpreULB2/postULB2が決められる。
【0100】
さらに、UL処理において、歪の中心を通過すると、光学的歪の曲がり方が逆方向となる。すると、図14のように、歪中心の左右ではpreULB、postULBの値が異なる。この値を、左右どちらにも対応できるよう、図15のように右側で最も大きいpostULBを採用し、左側で最も大きいpreULBを採用すると、左側又は右側の一方側の処理のときに必要もないのにもう一方側のデータを大きく(すなわち、バッファを広く)確保しておかなければならず、バッファの無駄である。
【0101】
そこで、preULBとpostULBで予め同じ大きな値で両方決めておくのではなくて、preULBとpostULBを変数としてそれぞれに値を入れるようにする。歪の中心座標を過ぎたら、これらの値を変えてやって確保量を変えるようにする。すなわち、歪中心前後でpreULB、postULBを変化することにより、内部バッファの使い方に無駄をなくし、小さなバッファで比較的大きな歪補正を行える。
【0102】
pre,postULBをレジスタ85に設定するが、それらの値を生成するためには、歪の変形を考慮して画像データの入力範囲を算出可能とするサポート機能が必要となる。このサポート機能は、歪補正処理部8の歪補正処理機能に付加するなどして設ければよい。メモリ制御部83は、1UL処理中は他の処理によって前記領域preULB,postULBが上書きされないように制御する。前記領域preULB,postULBの設定は、CPU4からレジスタ85(図2参照)に設定しても構わないし、CPUで自動的に計算をして設定してもよい。
【0103】
歪補正処理において16点補間すると前に述べたが、図16(a)に示すように、歪補正によって補間位置は1UL処理の間にa(ただし、a>0)だけ動き得る。16点補間する関係上、入力画像範囲としてはpre側,post側とも上記間隔aに、補間に必要な画素分の間隔bL,bRを加えた範囲が必要となる。
【0104】
歪中心を越えると、pre,postULBの値を変えることで、バッファを必要最小限に絞る。また、前述の「歪補正算出部」で、補間分を考慮して結果を出力させてもよい。
【0105】
歪補正処理部8の持っている内部バッファ82は、図8の場合、最大で縦96画素の横に16ライン(画素)である。これを使って歪補正していくことになる。ブロックライン処理のデータは少なくとも1ULずつ図示右方向にスイープしていく。一気に数UL開放されることもあるので、必ずしも1ULずつスイープするわけでない。内部バッファ82は、はじめは空の状態からスタートするので、16ライン分入ってきて、歪補正処理を行う。これらのユニットラインを処理していくと、左側のラインに不要なデータ(1から数UL分のデータ)が生じることになる。なお、処理したら必ず不要になる訳ではなく、拡大率が大きい時は不要になるまで数ULかかることもある。不要なデータ分はバッファを開放(すなわち、上書き許可)していって新しいデータを入れていくことにする。スイープしていく画像は右側にずれていく。最大16ライン読み込めるサイズしかないので、要らなくなったデータ領域は開放して新しいデータを順次上書きしていくようにする。不要となったバッファ領域は全て一気に開放してしまう。その開放量は1ラインであるかもしれないし、5ラインであるかもしれない。例えば、はじめの3ライン分のデータがバッファに入っていたものを以降の処理に不要であるので開放してしまって次のデータを受け付けるようにして、次のデータが上書きされる。
【0106】
ところで、1UL処理が終わった後に開放できるバッファの量は、次のUL先頭座標が決まらなければ分からない(図17参照)。内部バッファは小さいので、使わなくなったデータが格納されている部分をできるだけ早くに開放する為、次のUL先頭座標を算出して開放量を取得し、バッファを開放することで内部バッファを有効に利用できるようにする。ところが、歪補正に対して後段の回路ブロックからリクエストが来てそれに対するグラントを返して1ULのデータを後段へ出力し、また次のリクエストが来てからグラントを返した後、座標を求めてというように動作させると、バッファの開放が遅れ、これに伴って、新しいデータの取り込みも遅れ、結果として、パイプライン動作に長い空きができてしまうことが起こり得る。そこで、図18に示すように先の歪補正処理(図示の座標1〜nの処理)を行っている段階で、後段の回路ブロックからリクエストに関係なく、座標nの処理が終わったら次の先頭座標n+1を演算して開放量を求め、バッファを早期に開放してしまう。これにより、前段回路ブロックから新たなデータ入力が比較的早く行なわれ、パイプラインの空きを詰めることができる。しかしながら、図18の場合であると、座標nの処理をした後、画素n+1を座標を計算してから処理を終了するので、図19のようにバッファ内に次のUL処理に必要なデータが揃っているのに、後段からのリクエストが連続するとパイプラインに空きが生じる。依然としてパイプラインの空きは存在するので、リクエストが連続した時は、装置全体の動作速度に悪影響を及ぼす恐れがある。
【0107】
そこで、図18の改善策として、図20のように、なるべく早くに次の座標が決まってバッファの開放量を求める方法がある。図18のように一番最後に次の先頭座標を求めるよりももっと早い段階で次のUL先頭座標を取得しておき、必要なデータが揃っていると判断されたら、次のUL処理を連続して行うことで処理の空きを小さくする。すなわち、1UL処理が終了する前にULのデータをレジスタ等に保持しておいて、次のULの先頭の座標位置を算出することで、予め次のUL処理の開放量を求めておく。図20では、先の歪補正処理(図示の座標1〜nの処理)の2画素目に次のULの先頭座標を求めておいてバッファ開放量を早い段階で取得する。これによって、バッファの開放を早くすることができ、図21に示すように図19に比べてパイプラインの空きをかなり少なくできる。しかしながら、回路的に複雑となり、制御も困難となる問題点がある。
【0108】
そこで、図20をさらに改善したのが、図22である。図22では、現在処理中のULが終わった時に開放する量(開放量1)は前のUL処理中に既に分かっている。座標nを算出した後、2つ先のUL先頭座標を計算し、次のUL処理が終わった時に開放できる量(開放量2)を予め求めておく。このようにすると、図20の場合のようにUL処理中に例外的な座標生成(座標2の生成)を行う必要がない。このように、次のULの先頭ではなくて次の次の2つ先のULの先頭座標を求めておけば、図20のような例外的な処理がなくなるので、回路的には簡単になる。
【0109】
【発明の効果】
以上述べたように本発明によれば、バスの転送量やメモリの容量を大きく増大させることなく、歪補正を実現することができる。すなわち、小さなバッファ容量で比較的大きな歪補正処理を行うことが可能となる。
【図面の簡単な説明】
【図1】本発明の一実施の形態の画像処理装置の全体構成を示すブロック図。
【図2】歪補正処理部の構成を示すブロック図。
【図3】歪補正処理部における座標変換の概念図。
【図4】陣笠型歪を示す図。
【図5】入力画像データを示す図。
【図6】歪補正処理部の詳細な構成を示すブロック図。
【図7】補間回路における補間演算のイメージ図。
【図8】歪補正処理部における内部メモリ部を説明する図。
【図9】図8の補足説明をする、書き込み順番を示す図。
【図10】図7の補正座標位置を算出するのに必要なD0を求めるための説明図。
【図11】エラー処理例を示す図。
【図12】他のエラー処理例を示す図。
【図13】他のエラー処理例を示す図。
【図14】歪補正処理に要するバッファ量について説明する図。
【図15】歪補正処理に要するバッファ量について説明する図。
【図16】歪補正処理に要するバッファ量について説明する図。
【図17】UL処理に伴う開放量の算出方法について説明する図。
【図18】UL処理に伴う開放量の算出方法について説明する図。
【図19】図18の処理に伴うパイプライン処理の空きについて説明する図。
【図20】UL処理に伴う開放量の算出方法について説明する図。
【図21】図20の処理に伴うパイプライン処理の空きについて説明する図。
【図22】UL処理に伴う開放量の算出方法について説明する図。
【図23】格子状の被写体、樽型歪を生じた撮影画像、糸巻き型歪を生じた撮影画像を示す図。
【図24】一般的なデジタルカメラの画像処理手順の概念、及び従来のデジタルカメラの画像処理装置におけるブロック構成を示す図。
【図25】本発明に係る実施の形態におけるフレームメモリからの画像データの読み出し順序を説明する図。
【図26】本発明に係る図1の第1,第2データ順序変換部の構成を示すブロック図。
【図27】歪補正範囲算出部における、歪補正処理を行う際の入力画像範囲を算出する動作を説明する図。
【符号の説明】
1…CCD
3…バス
4…CPU
5…フレームメモリ
6…第1データ順序変換部
7…イメージプロセス回路
6…第1データ順序変換部
8…歪補正処理部(歪補正手段)
9…第2データ順序変換部
10…JPEG処理部
11…メモリカード(記録媒体)
82…内部メモリ部(バッファ)
83…メモリ制御部
85…制御レジスタ[0001]
BACKGROUND OF THE INVENTION
The present invention mainly relates to an image processing apparatus and an image processing method used in an electronic imaging apparatus such as a digital camera, and more particularly to an image processing apparatus that realizes a distortion correction function without increasing a circuit scale or a data transfer amount. And an image processing method.
[0002]
[Prior art]
In general, distortion aberration appears in the optical system of a camera regardless of whether it is a digital camera or a silver salt camera. In addition, most cameras that are currently available are capable of optical zooming, and in this case, the state of distortion changes from the wide end to the tele end. There are many barrel distortions at the wide end, and there are many pincushion distortions at the tele end.
[0003]
The distortion is observed as barrel distortion or pincushion distortion when, for example, a grid-like subject is photographed.
[0004]
FIG. 23A shows a lattice-like subject, FIG. 23B shows a photographed image with barrel distortion, and FIG. 23C shows a photographed image with pincushion distortion.
[0005]
By the way, in a digital camera, after various image processing is performed on data of an image sensor such as a CCD, data compressed by a compression method such as JPEG is recorded on a recording medium such as a memory card.
[0006]
FIG. 24A shows a concept of an image processing procedure performed by a general digital camera. The imaging signal captured from the CCD is subjected to processing such as pixel defect processing and A / D conversion in a preprocess, and is stored in a frame memory such as an SDRAM. Next, the image data stored in the frame memory is read out, and various image processes are performed by the
[0007]
FIG. 24B shows a block diagram of an image processing apparatus of a conventional digital camera (for example, a conventional example in Japanese Patent Laid-Open No. 2000-31327).
[0008]
In FIG. 24B, a conventional image processing apparatus includes a
[0009]
On the other hand, a prior art for correcting distortion as part of this image processing has been disclosed. For example, there are JP-A-6-181530 and JP-A-10-224695.
[0010]
Japanese Patent Laid-Open No. 6-181530 discloses an image generated by an imaging zoom lens when the detection unit detects that the imaging position of the imaging zoom lens at the time of shooting is within a position where distortion is large. Is corrected by reading out imaging data of a solid-state imaging device based on geometric deformation.
[0011]
In Japanese Patent Laid-Open No. 10-224695, data taken by a solid-state imaging device that receives light passing through an optical system is stored in a random access video memory, and a random read timing generation circuit corrects aberrations caused by the optical system. And correcting the distortion aberration of the optical system by reading out the signals generated by the solid-state imaging device in a predetermined order based on the aberration correction data and generating a video signal. Yes.
[0012]
[Patent Document 1]
JP 2000-31327 A (
[0013]
[Patent Document 2]
Japanese Patent Laid-Open No. 6-181530 (first and second pages, FIG. 2)
[0014]
[Patent Document 3]
Japanese Patent Laid-Open No. 10-224695 (page 1-3, FIG. 1)
[0015]
[Problems to be solved by the invention]
However, in the conventional example of
[0016]
In
[0017]
In
[0018]
In view of the above problems, an object of the present invention is to provide an image processing apparatus and an image processing method capable of realizing distortion correction processing without greatly increasing the transfer amount of a bus or the capacity of a memory. .
[0019]
[Means for Solving the Problems]
The invention according to
[0020]
In this configuration, a part of the image data can be stored in the memory unit as an internal buffer, and interpolation calculation for distortion correction processing can be performed using the data.
[0021]
According to a second aspect of the present invention, in the image processing apparatus according to the first aspect, the memory control unit, when writing to the memory unit, includes image data (units) consisting of a certain number of pixels arranged in a line in the column direction. (Line: UL), and the image data stored in the memory unit so that an image after distortion correction processing is output in units of the UL when reading from the memory unit. It is characterized in that read control is performed on
[0022]
In this configuration, since writing to and reading from the memory unit is performed in units of UL, the buffer capacity of the memory unit may have a capacity of several UL, that is, a capacity of at least 1 UL depending on the amount of optical distortion. Distortion correction can be realized without greatly increasing the transfer amount and the memory capacity.
[0023]
According to a third aspect of the present invention, in the image processing apparatus according to the second aspect, the memory control unit has a predetermined width on the front side and the rear side in the row direction with respect to the coordinate position of the pixel processed first in the UL. The areas (preULB and postULB, respectively) are provided, and control is performed so that the area is not overwritten by another process during the UL process.
[0024]
With this configuration, it is possible to ensure that data in the preULB and postULB areas of the memory unit as a buffer necessary for processing is not overwritten.
[0025]
According to a fourth aspect of the present invention, in the image processing apparatus according to the second or third aspect, the memory control unit can be further opened to input data from a preceding stage of the distortion correcting means during the processing of the UL. A buffer release amount calculation circuit for calculating a buffer amount; and a data transmission availability determination circuit for determining whether or not data transmission is possible for a subsequent stage of the distortion correction unit. The buffer release amount calculation circuit includes: The postULB is input with the interpolation coordinates for the first pixel as the center, the preULB is input to the data transmission availability determination circuit, and the buffer release amount calculation circuit calculates the buffer release amount with reference to the value of the postULB, The data transmission permission / inhibition determination circuit refers to the value of the preULB and determines whether or not data transmission is possible.
[0026]
With this configuration, the memory unit as a buffer necessary for processing can be efficiently used with a small capacity.
[0027]
According to a fifth aspect of the present invention, in the image processing apparatus according to the third or fourth aspect, the preULB value and the postULB value can be set to different values on the front side and the rear side, respectively, with respect to the distortion center. .
[0028]
In this configuration, as shown in FIG. 14, if the values of preULB and postULB are different on the left and right sides of the distortion center, and these values are large as shown in FIG. Necessary buffers must be secured widely, which is a waste of buffers. By changing preULB and postULB before and after the distortion center, it is possible to eliminate wasteful use of the internal buffer and perform relatively large distortion correction with a small buffer capacity.
[0029]
According to a sixth aspect of the present invention, in the image processing apparatus according to any one of the first to fourth aspects, the image processing apparatus further includes a buffer free capacity monitoring circuit for detecting a buffer free area, and the buffer free capacity monitoring is performed. When an empty area in the buffer is detected by the circuit, data can be written to the empty area.
[0030]
With this configuration, it is possible to perform a pipeline operation that can be input during data output.
[0031]
According to a seventh aspect of the present invention, in the image processing apparatus according to the first aspect, the memory unit includes a plurality of memories capable of simultaneously performing a data read operation and a write operation, and the memory control unit further transfers the memory unit to the memory unit. A write address generation circuit that performs data write control, and a read address generation circuit that generates an address for simultaneously reading data necessary for interpolation calculation from the image data stored in the memory unit. The write control is characterized by writing simultaneously read data to different memories.
[0032]
According to this configuration, it is possible to simultaneously read out information on a plurality of pixels (for example, 16 pixels) around arbitrary coordinates as data necessary for the interpolation calculation from the image data in the buffer, so that the calculation process can be performed quickly. Yes.
[0033]
According to an eighth aspect of the present invention, in the image processing device according to any one of the third to fifth aspects, the image processing device further includes a coordinate whose distortion correction processing is performed with respect to an interpolation coordinate for the first image in the UL processing. And an error detection circuit for detecting and outputting an error when coordinates deviating from the preULB and postULB are generated in the column direction, or when the distortion-corrected coordinates become coordinates that are not input from the previous stage. And
[0034]
In this configuration, the error detection circuit detects and notifies the CPU when a parameter is erroneously input or the estimation of the distortion correction amount is too small. In particular, regarding preULB and postULB setting over (see FIG. 13), there is a case where accurate estimation cannot be performed in advance, so that the setting value can be easily corrected by notifying the CPU of the over amount.
[0035]
According to a ninth aspect of the present invention, in the image processing apparatus according to any one of the third to fifth aspects, when the error output is made, it is possible to reset the register and re-execute the image processing. And
[0036]
According to a tenth aspect of the present invention, in the image processing apparatus according to any one of the second to sixth aspects, the first interpolated coordinate when starting the next 1UL or further the next 1UL after the completion of the 1UL process is calculated. Then, the processing of 1 UL unit is terminated.
[0037]
In this configuration, the amount of the buffer that can be released after the end of 1UL processing is used unless the next UL head coordinate is determined (see FIG. 17). Since the internal buffer is small, in order to release as soon as possible the part storing the data that is no longer used, the next UL head coordinate is calculated to obtain the release amount (see FIG. 18), and the buffer is released. The internal buffer can be used effectively.
[0038]
According to an eleventh aspect of the present invention, in the image processing method for performing a distortion correction process on image data, when the distortion correction process is performed, the image data is stored in a memory unit in which data writing and reading are controlled. The image data read out from the memory unit is subjected to an interpolation calculation.
[0039]
In this method, a part of image data can be stored in a memory unit as an internal buffer, and interpolation can be performed for distortion correction processing using the data.
[0040]
A twelfth aspect of the present invention is the image processing apparatus according to any one of the third to fifth aspects, wherein the image processing apparatus further includes a distortion for calculating an input image range in which the distortion correction unit performs distortion correction processing. It has a correction range calculation part.
[0041]
According to a thirteenth aspect of the present invention, in the image processing apparatus according to the twelfth aspect, the distortion correction range calculation unit can perform coordinate conversion by applying a predetermined distortion correction formula, and the output image range after distortion correction Calculating at least one of a maximum value and a minimum value of conversion coordinates generated by coordinate conversion of pixels corresponding to each of the four sides, and conversion coordinates generated by coordinate conversion of pixels corresponding to the four vertices; The preULB and the postULB are calculated from an output result of the distortion correction range calculation unit.
[0042]
In these configurations, the above-described pre and postULB are set in the registers. However, in order to generate these values, a support function that enables calculation of the input range of image data in consideration of distortion deformation is required. Become. This support function is provided as a distortion correction range calculation unit for the distortion correction processing function of the distortion correction means.
[0043]
DETAILED DESCRIPTION OF THE INVENTION
Embodiments of the invention will be described with reference to the drawings.
FIG. 1 is a block diagram showing the overall configuration of an image processing apparatus according to an embodiment of the present invention. FIG. 2 is a block diagram showing the configuration of the distortion correction processing unit in FIG.
[0044]
In the image processing apparatus of FIG. 1, an image pickup signal from the
[0045]
The
[0046]
As shown in FIG. 2, the distortion
[0047]
As shown in FIG. 2, the interpolation coordinate generation unit 81 includes a coordinate generation unit 811 that generates an interpolation coordinate (X, Y), and a predetermined distortion correction formula [formula for the generated interpolation coordinate (X, Y). 1] A distortion correction coordinate conversion unit 812 that outputs coordinates (X ′, Y ′) before correction converted by applying (described later), and interpolation coordinates (X, Y) and distortion correction from the coordinate generation unit 811 The selector 813 can selectively output the converted coordinates (X ′, Y ′) from the coordinate conversion unit 812. The coordinate generation unit 811, the distortion correction coordinate conversion unit 812, the selector 813, and the memory control unit 83 in the distortion
[0048]
In the image processing apparatus according to the present invention configured as described above, the first data
[0049]
In the image process circuit unit configured by the first-stage
[0050]
When data transfer from the
[0051]
FIG. 3 shows a conceptual diagram of coordinate conversion in the distortion
[0052]
In [Expression 1], the pixel position (X ′, Y ′) before distortion correction with respect to the pixel position (X, Y) after distortion correction can be calculated. However, as described above, the pixel position (X ′, Y ′) before distortion correction is not always an integer value corresponding to the pixel position on the original image data.
[0053]
According to [Expression 1], the coordinates (X, Y) in FIG. 3B are converted into coordinates (X ′, Y ′) as shown in FIG. Thereby, it is possible to know where the coordinate position data in the original data should be created, and the interpolation equation [16-point interpolation processing described later] is performed on the data at the position (X ′, Y ′). It can be obtained by calculating from 16 known pixel values (input image data indicated by black circles in FIG. 5) using Equation 2].
[0054]
[Formula 1]
Z in [Formula 1] is the distance from the strain center (Xd, Yd) to the point (X, Y) of interest. [Expression 1] calculates the coordinates (X ′, Y ′) of the original image that is distorted with respect to the point (X, Y) of the corrected image. A supplementary explanation of [Formula 1] is that M is a correction magnification for correcting a phenomenon in which an image protrudes or becomes insufficient after correction when theoretically correcting using data of the optical system. Sx and Sy are sampling ratios for correcting a phenomenon in which spatial sampling intervals differ vertically and horizontally, such as thinning-in. Xoff and Yoff are center deviation values for correcting a phenomenon in which the subject position deviates from the shooting position after the distortion correction process by the distortion correction process.
[0055]
In [Expression 1] according to the present invention, higher-order terms (specifically, Z4, Z6,...) Are taken into consideration, so that more complex Jinkasa type distortion (see FIG. 4) can be dealt with. In addition, it is necessary to consider the distortion center (Xd, Yd), for example, when only a part of the image sensor is captured even if the centers coincide, or when the center of the optical axis and the center of the image sensor are shifted. Furthermore, in order to correct a phenomenon in which the subject position deviates from the position at the time of shooting by the distortion correction process, it is necessary to consider center deviation correction values (Xoff, Yoff). In the case of thinning-in or when processing a YC image composed of luminance data (Y) and color data (Cb, Cr), spatial sampling differs between X and Y. Therefore, the sampling ratio (SX, Sy) is introduced as a coefficient to correct the coordinate conversion.
[0056]
Next, the processing and order of image data writing and reading will be described with reference to FIGS.
FIG. 25 is a diagram for explaining the reading order of image data from the frame memory according to the present embodiment.
[0057]
The image data is normally written by sweeping in the line direction, that is, in the row direction, and is read out in the row direction at the time of reading. All the image data of one line is read and then adjacent. It is common to repeat the operation of reading all the image data of the line.
[0058]
On the other hand, the image processing apparatus according to the present invention is configured so that image data written by sweeping in the row direction is sequentially processed in the row direction image data in units of a certain length in the column direction. A small area (rectangular image data) obtained by sequentially inputting the next column to the
[0059]
The configuration of the first data
[0060]
As shown in FIG. 26 (a), the first data
[0061]
A part of the frame image stored in the
[0062]
In parallel with this, the block-unit image data that has already been read from the
[0063]
When writing from the
[0064]
As shown in FIG. 26B, the second data
[0065]
That is, the second data
[0066]
During the operation of the second data
FIG. 6 shows a detailed configuration of the distortion
A correspondence relationship between each unit in FIG. 6 and each unit in FIG. 2 will be described. The interpolation
[0067]
When the interpolation
[0068]
The interpolation
[0069]
The 2-
[0070]
The read
[0071]
The write
[0072]
The data transmission permission /
[0073]
The
[0074]
The buffer free
[0075]
Next, the circuit operation of the distortion
First, when the 2-
[0076]
Then, data flows from the preceding circuit to the write
[0077]
The 2-
[0078]
Here, the 2-
[0079]
FIG. 8 shows a memory space composed of 16 2-port SRAMs. The horizontal direction is the UL order input, but the vertical direction is an address assigned to each 2-port SRAM. Let N be an integer, and the state at a certain point in time will be described. No. 4 each of four 2-port SRAMs arranged in the vertical direction. The data stored in 0, 4, 8, and 12 are 4N, 4N + 4, 4N + 8, and 4N + 12th UL data. The data stored in 1, 5, 9, and 13 are the 4N + 1, 4N + 5, 4N + 9, and 4N + 13th UL data. The data stored in the second, sixth, tenth and fourteenth are 4N + 2, 4N + 6, 4N + 10, 4N + 14th UL data. The data stored in 3, 7, 11, and 15 are 4N + 3, 4N + 7, 4N + 11, 4N + 15th UL data.
[0080]
No. 4 each of four 2-port SRAMs arranged in the horizontal direction. 0, 1, 2, 3 and No. 4, 5, 6, 7 and no. 8, 9, 10, 11 and no. The respective sets of 12, 13, 14, and 15 are also stored in the same manner.
[0081]
The manner in which data is written to each 2-port SRAM will be described with reference to FIG. In FIG. 9, as shown in FIG. 9A, a block line having a width of 8 lines (pixels) is assumed, and data is “1, 2,..., I, m”, “5,” in UL units. 6,..., J, n ”,“ 9, 10,..., K, o ”,. FIG. 9B shows 16 2-port SRAM No. 4 in which the data in the write order shown in FIG. 0-No. 15 shows where the data will be written. For example, no. 0, No. 4, no. 8, no. 12, image data for 1 UL (data shown in
[0082]
Returning to FIG. 8 again, data for 1 UL is stored in order in one pixel at a time in four 2-port SRAMs arranged in the vertical direction. The first UL data is No. It is written in 0, 4, 8, 12 (
[0083]
The data transmission
[0084]
The data transmission
[0085]
The read
[0086]
Next, reading and interpolation methods will be described.
An interpolation method is shown in FIG. FIG. 7 is an image diagram of the interpolation calculation in the
[0087]
FIG. 10 shows an example of reading from a buffer composed of 16 2-port SRAMs. Now, the interpolation position (X ′, Y ′) is X ′ = 10. ..., Y '= 50. ... (... is a number after the decimal point), X '= 10. ... is equal to or greater than (4 × 0 + 10), so the interpolation position comes slightly to the right of the 4N + 10th UL of the 2-port SRAM in the horizontal direction. Y ′ = 50. ... is (4 × 12 + 2) or more, and the memory (No. 10) in which the 50th pixel is stored in the 4N + 10th UL outputs the pixel D5 in FIG. No. in the
[0088]
Since the pixel data corresponding to D0 to D15 in FIG. 7 are the circles in FIG. 10, addresses are generated so that they are output.
[0089]
No. The image data output from 0 does not correspond to D0. In the example of FIG. The output from 5 corresponds to D0. For this reason, in order to identify which data is output from which memory, a data string control signal is output from the read
[0090]
If the pixel data D0 to D15 are known, the pixel data at the corrected coordinate position can be obtained as Dout by performing an interpolation process using the interpolation equation [Expression 2].
[0091]
[Formula 2]
After the last UL data is output, the buffer release
[0092]
When (UL head coordinate difference) + (adjustment amount) is negative, a negative value is stored. The buffer is not released until the processing advances and the buffer release amount exceeds a negative value.
[0093]
Along with the above calculation of the buffer release amount, the buffer release
[0094]
The buffer free
[0095]
The data transmission
[0096]
In the
[0097]
As described above, in the block line processing, when the input side image is interpolated and calculated with respect to the output side image, there is a case where the image is projected from the range of the input image. In this case, interpolation data is generated in a portion where there is no data in the input range, and an error indicating that interpolation cannot be performed is output from the
[0098]
As shown in FIG. 14, the image distortion is contrasted with respect to the center coordinates of the distortion. Further, the distortion is generally smaller as it is closer to the center and larger as it is farther away. Therefore, if the buffer is secured in consideration of the deformation of the UL at both ends of the BL, there is usually no data shortage in the interpolation processing in all UL. Therefore, a predetermined area preULB is placed forward (right side in the figure) and rearward (left side in the figure) with respect to the first coordinate to be interpolated (the top coordinate indicated by the top X of the image data in the block line BL in the figure). Is provided with a predetermined area postULB.
[0099]
The support function corresponds to a part called “distortion correction range calculation unit” in Japanese Patent Application No. 2003-202493 filed on the same day as the present application. In FIG. 27A, the region of interest is BL, but is deformed as shown in FIG. At this time, preULB1 / postULB1 is determined from X′TL, Y′TL, XLmin, and XLmax (see FIG. 16A). Similarly, preULB2 / postULB2 is determined from X′TR, Y′TR, XRmin, and XRmax.
[0100]
Further, in the UL processing, when the strain passes through the center of the distortion, the bending direction of the optical distortion is reversed. Then, as shown in FIG. 14, the values of preULB and postULB are different on the left and right of the distortion center. If the largest postULB is adopted on the right side and the largest preULB is adopted on the left side as shown in FIG. On the other hand, the data on the other side must be kept large (that is, the buffer is wide), which is a waste of the buffer.
[0101]
Therefore, instead of pre-determining both preULB and postULB with the same large value in advance, preULB and postULB are respectively set as variables. After passing through the center coordinates of the distortion, change these values to change the amount secured. That is, by changing preULB and postULB before and after the distortion center, use of the internal buffer is eliminated, and relatively large distortion correction can be performed with a small buffer.
[0102]
Although pre and postULB are set in the
[0103]
Although it has been described above that 16-point interpolation is performed in the distortion correction process, as shown in FIG. 16A, the interpolation position can move by a (where a> 0) during the 1UL process by distortion correction. Because of the 16-point interpolation, the input image range needs to be a range obtained by adding intervals bL and bR for pixels necessary for the interpolation to the interval a on both the pre side and the post side.
[0104]
When the distortion center is exceeded, the buffer is narrowed to the minimum necessary by changing the values of pre and postULB. Further, the above-described “distortion correction calculation unit” may output the result in consideration of the interpolation.
[0105]
In the case of FIG. 8, the
[0106]
By the way, the amount of the buffer that can be released after the end of 1UL processing is not known unless the next UL head coordinate is determined (see FIG. 17). Since the internal buffer is small, in order to release the part where the data that is no longer used is released as soon as possible, the next UL head coordinate is calculated to obtain the release amount, and the internal buffer is made effective by releasing the buffer. Make it available. However, a request for distortion correction comes from a circuit block at the rear stage, a grant is returned, 1 UL data is output to the rear stage, and a grant is returned after the next request comes, and then the coordinates are obtained. If the operation is performed as described above, the release of the buffer is delayed, and accordingly, the fetching of new data is also delayed. As a result, a long space may be created in the pipeline operation. Therefore, as shown in FIG. 18, at the stage where the previous distortion correction processing (processing of the
[0107]
Therefore, as an improvement measure of FIG. 18, there is a method of obtaining the buffer opening amount by determining the next coordinates as soon as possible as shown in FIG. As shown in FIG. 18, the next UL head coordinate is acquired at a stage earlier than the last head coordinate obtained at the end, and if it is determined that the necessary data is available, the next UL processing is continued. By doing so, the processing space is reduced. That is, before the end of 1UL processing, the UL data is held in a register or the like, and the opening position of the next UL processing is obtained in advance by calculating the top coordinate position of the next UL. In FIG. 20, the leading coordinates of the next UL are obtained for the second pixel of the previous distortion correction processing (processing of the
[0108]
Therefore, FIG. 22 is a further improvement of FIG. In FIG. 22, the amount to be released when the currently processed UL is over (open amount 1) is already known during the previous UL processing. After calculating the coordinate n, the second UL head coordinate is calculated, and the amount that can be released when the next UL processing is completed (open amount 2) is obtained in advance. In this way, it is not necessary to perform exceptional coordinate generation (coordinate 2 generation) during UL processing as in the case of FIG. In this way, if the start coordinates of the next two next ULs are obtained instead of the start of the next UL, the exceptional processing as shown in FIG. 20 is eliminated, so that the circuit becomes simple. .
[0109]
【The invention's effect】
As described above, according to the present invention, distortion correction can be realized without greatly increasing the transfer amount of the bus or the capacity of the memory. That is, it is possible to perform a relatively large distortion correction process with a small buffer capacity.
[Brief description of the drawings]
FIG. 1 is a block diagram showing the overall configuration of an image processing apparatus according to an embodiment of the present invention.
FIG. 2 is a block diagram showing a configuration of a distortion correction processing unit.
FIG. 3 is a conceptual diagram of coordinate conversion in a distortion correction processing unit.
FIG. 4 is a diagram showing a Jinkasa type strain.
FIG. 5 is a diagram showing input image data.
FIG. 6 is a block diagram showing a detailed configuration of a distortion correction processing unit.
FIG. 7 is an image diagram of interpolation calculation in an interpolation circuit.
FIG. 8 is a diagram illustrating an internal memory unit in a distortion correction processing unit.
FIG. 9 is a diagram showing a writing order for supplementary explanation of FIG. 8;
10 is an explanatory diagram for obtaining D0 necessary for calculating the corrected coordinate position of FIG. 7;
FIG. 11 is a diagram showing an example of error processing.
FIG. 12 is a diagram showing another example of error processing.
FIG. 13 is a diagram showing another example of error processing.
FIG. 14 is a diagram for explaining a buffer amount required for distortion correction processing;
FIG. 15 is a diagram for explaining a buffer amount required for distortion correction processing;
FIG. 16 is a diagram for explaining a buffer amount required for distortion correction processing;
FIG. 17 is a diagram for explaining a method for calculating an opening amount associated with UL processing.
FIG. 18 is a diagram for explaining a method for calculating an opening amount associated with UL processing.
FIG. 19 is a diagram for explaining a vacancy in pipeline processing accompanying the processing in FIG. 18;
FIG. 20 is a diagram for explaining a method for calculating an opening amount associated with UL processing.
FIG. 21 is a diagram for explaining a vacancy in pipeline processing associated with the processing in FIG. 20;
FIG. 22 is a diagram for explaining a method for calculating an opening amount associated with UL processing.
FIG. 23 is a diagram showing a grid-like subject, a captured image with barrel distortion, and a captured image with pincushion distortion.
FIG. 24 is a diagram showing a concept of a general digital camera image processing procedure and a block configuration of a conventional digital camera image processing apparatus.
FIG. 25 is a view for explaining the reading order of image data from the frame memory according to the embodiment of the present invention.
26 is a block diagram showing the configuration of the first and second data order conversion units in FIG. 1 according to the present invention.
FIG. 27 is a diagram for explaining an operation for calculating an input image range when performing distortion correction processing in a distortion correction range calculation unit;
[Explanation of symbols]
1 ... CCD
3 ... Bus
4 ... CPU
5 ... Frame memory
6 ... 1st data order conversion part
7. Image process circuit
6 ... 1st data order conversion part
8: Distortion correction processing unit (distortion correction means)
9: Second data order conversion unit
10 ... JPEG processing unit
11 ... Memory card (recording medium)
82 ... Internal memory section (buffer)
83. Memory control unit
85: Control register
Claims (13)
前記歪補正手段は、
前記画像データの一部を格納するメモリ部と、
前記メモリ部に対するデータの書き込みおよび読み込みを制御するメモリ制御部と、
を有し、
前記メモリ部から読み出した画像データに対する補間演算を行うことを特徴とする画像処理装置。In an image processing apparatus having distortion correction means for performing distortion correction processing on image data,
The distortion correction means includes
A memory unit for storing a part of the image data;
A memory control unit for controlling writing and reading of data to and from the memory unit;
Have
An image processing apparatus that performs an interpolation operation on image data read from the memory unit.
前記メモリ部への書き込みの際は、列方向に一列に並んだ一定数分の画素からなる画像データ(ユニットライン:UL)を単位として書き込むように制御し、前記メモリ部からの読み出しの際は、歪補正処理後の画像が前記ULを単位として出力されるように、前記メモリ部に格納された画像データに対して読み出し制御することを特徴とする請求項1に記載の画像処理装置。The memory control unit
When writing to the memory unit, control is performed so that image data (unit line: UL) consisting of a fixed number of pixels arranged in a line in the column direction is written in units, and when reading from the memory unit, The image processing apparatus according to claim 1, wherein the image data stored in the memory unit is read and controlled so that an image after distortion correction processing is output in units of the UL.
前記ULの処理中に、前記歪補正手段の前段からのデータを入力するために開放可能なバッファ量を算出するバッファ開放量算出回路と、
前記歪補正手段の後段に対するデータ送信の可否を判定するデータ送信可否判定回路とを有し、
前記バッファ開放量算出回路には、前記ULの処理における最初の画素に対する補間座標を中心として前記postULBが入力され、データ送信可否判定回路には前記preULBが入力され、バッファ開放量算出回路は前記バッファ開放量を前記postULBの値を参照して算出し、データ送信可否判定回路は前記preULBの値を参照してデータ送信可否の判定を行うことを特徴とする請求項2又は3に記載の画像処理装置。The memory control unit further includes:
A buffer release amount calculation circuit for calculating a buffer amount that can be released to input data from the previous stage of the distortion correction means during the processing of the UL;
A data transmission availability determination circuit that determines whether data transmission is possible for the subsequent stage of the distortion correction means;
The postULB is input to the buffer opening amount calculation circuit centered on the interpolation coordinates for the first pixel in the UL processing, the preULB is input to the data transmission availability determination circuit, and the buffer opening amount calculation circuit is the buffer opening amount calculation circuit. 4. The image processing according to claim 2, wherein the release amount is calculated by referring to the value of the postULB, and the data transmission availability determination circuit determines whether data transmission is possible by referring to the value of the preULB. apparatus.
該バッファ空き容量監視回路によりバッファ内の空き領域が検出されると、該空き領域へのデータの書き込みを可能とすることを特徴とする請求項1〜4のいずれか1つに記載の画像処理装置。The image processing apparatus further includes a buffer free capacity monitoring circuit for detecting a buffer free area,
5. The image processing according to claim 1, wherein when a free area in the buffer is detected by the buffer free capacity monitoring circuit, data can be written to the free area. apparatus.
前記メモリ制御部は、さらに、
前記メモリ部へのデータ書込み制御を行う書込みアドレス生成回路と、
前記メモリ部に格納されている画像データから補間演算に必要なデータを同時に読み出すためのアドレスを生成する読出しアドレス生成回路と、
を有し、
前記データ書込み制御は、同時に読み出すデータをそれぞれ異なるメモリに書き込むものであることを特徴とする請求項1記載の画像処理装置。The memory unit includes a plurality of memories capable of simultaneously reading and writing data,
The memory control unit further includes:
A write address generation circuit for performing data write control to the memory unit;
A read address generation circuit for generating an address for simultaneously reading data necessary for the interpolation calculation from the image data stored in the memory unit;
Have
The image processing apparatus according to claim 1, wherein the data writing control is to write simultaneously read data in different memories.
前記歪補正処理を行うに際は、データの書き込みおよび読み込みが制御されるメモリ部に、前記画像データの一部を格納し、該メモリ部から読み出した画像データに対して補間演算を行うことを特徴とする画像処理方法。In an image processing method for performing distortion correction processing on image data,
When performing the distortion correction processing, a part of the image data is stored in a memory unit in which writing and reading of data are controlled, and an interpolation operation is performed on the image data read from the memory unit. A featured image processing method.
を特徴とする請求項3〜5のいずれか1つに記載の画像処理装置。The image processing apparatus further includes a distortion correction range calculation unit that calculates an input image range in which the distortion correction unit performs distortion correction processing;
The image processing apparatus according to claim 3, wherein:
周辺4辺の各辺に対応する画素を座標変換して生成した変換座標の最大値と最小値、および4頂点に対応する画素を座標変換して生成した変換座標、の少なくともいずれかを算出し、前記preULBおよびpostULBは、前記歪補正範囲算出部の出力結果から算出すること、を特徴とする請求項12記載の画像処理装置。The distortion correction range calculation unit is capable of coordinate conversion by applying a predetermined distortion correction formula, in the output image range after distortion correction,
Calculate at least one of the maximum and minimum values of converted coordinates generated by coordinate conversion of pixels corresponding to the four sides of the periphery, and converted coordinates generated by coordinate conversion of pixels corresponding to the four vertices. 13. The image processing apparatus according to claim 12, wherein the preULB and the postULB are calculated from an output result of the distortion correction range calculation unit.
Priority Applications (5)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2003202664A JP4334932B2 (en) | 2003-07-28 | 2003-07-28 | Image processing apparatus and image processing method |
EP12006314.4A EP2533192B1 (en) | 2003-07-28 | 2004-07-27 | Image processing apparatus, image processing method, and distortion correcting method |
PCT/JP2004/011010 WO2005010818A1 (en) | 2003-07-28 | 2004-07-27 | Image processing apparatus, image processing method, and distortion correcting method |
US10/566,408 US7813585B2 (en) | 2003-07-28 | 2004-07-27 | Image processing apparatus, image processing method, and distortion correcting method |
EP04771117.1A EP1650705B1 (en) | 2003-07-28 | 2004-07-27 | Image processing apparatus, image processing method, and distortion correcting method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2003202664A JP4334932B2 (en) | 2003-07-28 | 2003-07-28 | Image processing apparatus and image processing method |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2005045514A true JP2005045514A (en) | 2005-02-17 |
JP4334932B2 JP4334932B2 (en) | 2009-09-30 |
Family
ID=34262309
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2003202664A Expired - Fee Related JP4334932B2 (en) | 2003-07-28 | 2003-07-28 | Image processing apparatus and image processing method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP4334932B2 (en) |
Cited By (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2006267777A (en) * | 2005-03-25 | 2006-10-05 | Sony Corp | Information processing device and method, picture display system and program |
WO2008139577A1 (en) * | 2007-05-09 | 2008-11-20 | Fujitsu Microelectronics Limited | Image processor, imager, and image distortion correcting method |
JP2010054247A (en) * | 2008-08-26 | 2010-03-11 | Sharp Corp | Defect detecting apparatus, defect detecting method, defect detecting program and computer-readable recording medium with the program recorded thereon |
US20110122298A1 (en) * | 2009-11-26 | 2011-05-26 | Megachips Corporation | Image processing apparatus, and method of operating an image processing apparatus |
US8068149B2 (en) | 2007-08-28 | 2011-11-29 | Konica Minolta Opto, Inc. | Image processing device, image processing method, and image pickup apparatus |
JP2012033007A (en) * | 2010-07-30 | 2012-02-16 | Olympus Corp | Image processing device and image processing method |
JP2012238154A (en) * | 2011-05-11 | 2012-12-06 | Toshiba Corp | Image processing apparatus, image processing system and image processing method |
JP2014057369A (en) * | 2013-12-13 | 2014-03-27 | Canon Inc | Image processor and image processing method |
CN109817139A (en) * | 2017-11-21 | 2019-05-28 | 三星电子株式会社 | Display driver and electronic equipment |
JP2019114067A (en) * | 2017-12-25 | 2019-07-11 | カシオ計算機株式会社 | Image processing apparatus, image processing method, and program |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH08126009A (en) * | 1994-10-20 | 1996-05-17 | Olympus Optical Co Ltd | Image processing unit |
JPH09252391A (en) * | 1996-01-09 | 1997-09-22 | Fuji Photo Film Co Ltd | Image reader and image receiver |
JPH11250238A (en) * | 1998-02-27 | 1999-09-17 | Kyocera Corp | Digital image pickup device for operating distortion correction by block unit |
JP2001101396A (en) * | 1999-09-30 | 2001-04-13 | Toshiba Corp | Processor and method for correcting image distortion and medium with program performing image distortion correction processing stored therein |
JP2002268624A (en) * | 2001-03-12 | 2002-09-20 | Mega Chips Corp | Device and method for correcting image |
JP2002328881A (en) * | 2001-04-26 | 2002-11-15 | Sharp Corp | Image processor, image processing method and portable video equipment |
-
2003
- 2003-07-28 JP JP2003202664A patent/JP4334932B2/en not_active Expired - Fee Related
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH08126009A (en) * | 1994-10-20 | 1996-05-17 | Olympus Optical Co Ltd | Image processing unit |
JPH09252391A (en) * | 1996-01-09 | 1997-09-22 | Fuji Photo Film Co Ltd | Image reader and image receiver |
JPH11250238A (en) * | 1998-02-27 | 1999-09-17 | Kyocera Corp | Digital image pickup device for operating distortion correction by block unit |
JP2001101396A (en) * | 1999-09-30 | 2001-04-13 | Toshiba Corp | Processor and method for correcting image distortion and medium with program performing image distortion correction processing stored therein |
JP2002268624A (en) * | 2001-03-12 | 2002-09-20 | Mega Chips Corp | Device and method for correcting image |
JP2002328881A (en) * | 2001-04-26 | 2002-11-15 | Sharp Corp | Image processor, image processing method and portable video equipment |
Cited By (19)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2006267777A (en) * | 2005-03-25 | 2006-10-05 | Sony Corp | Information processing device and method, picture display system and program |
JP4670424B2 (en) * | 2005-03-25 | 2011-04-13 | ソニー株式会社 | Information processing apparatus and information processing method, image display system, and program |
WO2008139577A1 (en) * | 2007-05-09 | 2008-11-20 | Fujitsu Microelectronics Limited | Image processor, imager, and image distortion correcting method |
JPWO2008139577A1 (en) * | 2007-05-09 | 2010-07-29 | 富士通マイクロエレクトロニクス株式会社 | Image processing apparatus, imaging apparatus, and image distortion correction method |
JP4657367B2 (en) * | 2007-05-09 | 2011-03-23 | 富士通セミコンダクター株式会社 | Image processing apparatus, imaging apparatus, and image distortion correction method |
US8228396B2 (en) | 2007-05-09 | 2012-07-24 | Fujitsu Semiconductor Limited | Image processing apparatus, image capturing apparatus, and image distortion correction method |
US8068149B2 (en) | 2007-08-28 | 2011-11-29 | Konica Minolta Opto, Inc. | Image processing device, image processing method, and image pickup apparatus |
US8792017B2 (en) | 2007-08-28 | 2014-07-29 | Konica Minolta Opto, Inc. | Image processing device, image processing method, and image pickup apparatus |
JP4528850B2 (en) * | 2008-08-26 | 2010-08-25 | シャープ株式会社 | Defect detection apparatus, defect detection method, defect detection program, and computer-readable recording medium recording the program |
JP2010054247A (en) * | 2008-08-26 | 2010-03-11 | Sharp Corp | Defect detecting apparatus, defect detecting method, defect detecting program and computer-readable recording medium with the program recorded thereon |
US20110122298A1 (en) * | 2009-11-26 | 2011-05-26 | Megachips Corporation | Image processing apparatus, and method of operating an image processing apparatus |
US8723989B2 (en) * | 2009-11-26 | 2014-05-13 | Megachips Corporation | Image distortion processing apparatus, and method of operating an image distortion processing apparatus |
JP2012033007A (en) * | 2010-07-30 | 2012-02-16 | Olympus Corp | Image processing device and image processing method |
US8724923B2 (en) | 2010-07-30 | 2014-05-13 | Olympus Corporation | Image processing apparatus and image processing method for correcting distorted image data |
JP2012238154A (en) * | 2011-05-11 | 2012-12-06 | Toshiba Corp | Image processing apparatus, image processing system and image processing method |
JP2014057369A (en) * | 2013-12-13 | 2014-03-27 | Canon Inc | Image processor and image processing method |
CN109817139A (en) * | 2017-11-21 | 2019-05-28 | 三星电子株式会社 | Display driver and electronic equipment |
JP2019114067A (en) * | 2017-12-25 | 2019-07-11 | カシオ計算機株式会社 | Image processing apparatus, image processing method, and program |
JP7159555B2 (en) | 2017-12-25 | 2022-10-25 | カシオ計算機株式会社 | Image processing device, image processing method and program |
Also Published As
Publication number | Publication date |
---|---|
JP4334932B2 (en) | 2009-09-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP4772281B2 (en) | Image processing apparatus and image processing method | |
EP1650705B1 (en) | Image processing apparatus, image processing method, and distortion correcting method | |
JP4781229B2 (en) | Distortion correction apparatus, imaging apparatus, and control method for distortion correction apparatus | |
US7301565B2 (en) | Correction method, correction device and photographing device | |
JP3781634B2 (en) | Image processing apparatus, image processing method, and portable video device | |
WO2004109597A1 (en) | Image processing device | |
US20100321538A1 (en) | Image processing apparatus and imaging apparatus | |
JP5602532B2 (en) | Image processing apparatus and image processing method | |
JP2004362069A (en) | Image processor | |
JP4334932B2 (en) | Image processing apparatus and image processing method | |
JP2005045513A (en) | Image processor and distortion correction method | |
JP2006203437A (en) | Camera and its image processing method | |
JP2007079708A (en) | Image processor and processing method | |
JP4547321B2 (en) | Motion vector detection device and imaging device | |
JP4432786B2 (en) | Camera device and image processing method | |
JP4970378B2 (en) | Memory controller and image processing apparatus | |
JP2009003953A (en) | Image processor | |
JP4436626B2 (en) | Image processing device | |
JP6762775B2 (en) | Image processing equipment, imaging equipment, control methods and programs | |
JP2007156795A (en) | Image conversion apparatus | |
JPH11308560A (en) | Electronic camera | |
JP6440465B2 (en) | Image processing apparatus, image processing method, and program | |
JP7141295B2 (en) | Image processing device and its control method | |
JP2005011268A (en) | Image processor | |
JP3426484B2 (en) | Image data processing apparatus and image data processing method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20060404 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20090303 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20090507 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20090602 |
|
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20090624 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120703 Year of fee payment: 3 |
|
R151 | Written notification of patent or utility model registration |
Ref document number: 4334932 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R151 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120703 Year of fee payment: 3 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130703 Year of fee payment: 4 |
|
S531 | Written request for registration of change of domicile |
Free format text: JAPANESE INTERMEDIATE CODE: R313531 |
|
R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
LAPS | Cancellation because of no payment of annual fees |