JP4334932B2 - Image processing apparatus and image processing method - Google Patents

Image processing apparatus and image processing method Download PDF

Info

Publication number
JP4334932B2
JP4334932B2 JP2003202664A JP2003202664A JP4334932B2 JP 4334932 B2 JP4334932 B2 JP 4334932B2 JP 2003202664 A JP2003202664 A JP 2003202664A JP 2003202664 A JP2003202664 A JP 2003202664A JP 4334932 B2 JP4334932 B2 JP 4334932B2
Authority
JP
Japan
Prior art keywords
unit
data
distortion correction
image
buffer
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.)
Expired - Fee Related
Application number
JP2003202664A
Other languages
Japanese (ja)
Other versions
JP2005045514A (en
Inventor
正樹 日暮
英明 古川
晃 上野
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Olympus Corp
Original Assignee
Olympus 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 Olympus Corp filed Critical Olympus Corp
Priority to JP2003202664A priority Critical patent/JP4334932B2/en
Priority to PCT/JP2004/011010 priority patent/WO2005010818A1/en
Priority to US10/566,408 priority patent/US7813585B2/en
Priority to EP04771117.1A priority patent/EP1650705B1/en
Priority to EP12006314.4A priority patent/EP2533192B1/en
Publication of JP2005045514A publication Critical patent/JP2005045514A/en
Application granted granted Critical
Publication of JP4334932B2 publication Critical patent/JP4334932B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

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】
この構成では、内部バッファとしてのメモリ部に画像データをブロック単位で格納して、そのデータを利用して歪補正処理のための補間演算を行うことができる。
また、メモリ部に対してULを単位として書き込み、読み出しを行うので、メモリ部のバッファ容量としては光学的歪量に応じて数UL分、すなわち少なくとも1UL分の容量があればよく、バスの転送量やメモリの容量を大きく増大させることなく、歪補正を実現できる。
【0023】
請求項の発明は、請求項の画像処理装置において、前記メモリ制御部は、前記ユニットラインの最初に処理される画素の座標位置を基準座標位置としてこの基準座標位置と行方向前側の座標位置との間がpreULBのであるメモリ領域を設け、行方向の後側の座標位置との間がpostULBのであるメモリ領域を設け、前記ユニットラインの処理中は他の処理によるデータによって前記両方のメモリ領域が上書きされないよう制御することを特徴とする。
【0024】
この構成により、処理に必要なバッファとしてのメモリ部の前記preULB、postULBの領域のデータが上書きされないよう確保できる。
【0025】
請求項の発明は、請求項又はの画像処理装置において、前記メモリ制御部は、さらに、前記ユニットラインの処理中に、前記歪補正手段の前段回路からのデータを入力するために開放可能なバッファ開放量を算出するバッファ開放量算出回路と、前記歪補正手段の後段回路に対するデータ送信の可否を判定するデータ送信可否判定回路とを有し、前記バッファ開放量算出回路は、現在処理中のユニットラインの最初の画素に対する座標と、次に処理予定のユニットラインの最初の画素に対する座標との差を前記バッファ開放量として算出するとともに、次のユニットラインの処理に必要な前段回路からのデータ量を前記データ送信可否判定回路に送信し、前記データ送信可否判定回路は、前記バッファ開放量算出回路から送信されたデータ量と、前記preULBの値とに基づいてデータ送信可否の判定を行うことを特徴とする。
【0026】
この構成により、処理に必要なバッファとしてのメモリ部を少ない容量で効率的に使用することができる。
【0027】
請求項の発明は、請求項又はの画像処理装置において、前記preULB値、postULB値は、それぞれ歪中心に対して前側と後側とで異なる値を設定可能であることを特徴とする。
【0028】
この構成では、図14のように、歪中心の左右ではpreULB、postULBの値が異なることに基づいて、これらの値を、どちらにも対応できるよう、図15のように大きく取ると、処理に必要なバッファを広く確保しておかなければならず、バッファの無駄である。歪中心前後でpreULB、postULBを変化することにより、内部バッファの使い方に無駄をなくし、小さなバッファ容量で比較的大きな歪補正を行うことが可能となる。
【0029】
請求項の発明は、請求項1〜のいずれか1つの画像処理装置において、前記画像処理装置は、さらに前記算出されたバッファ開放量によりバッファの空き領域を検出するバッファ空き容量監視回路を有し、該バッファ空き容量監視回路によりバッファ内の空き領域が検出されると、該空き領域へのデータの書き込みを可能とすることを特徴とする。
【0030】
この構成により、データ出力中に入力も可能なパイプライン的な動作を可能とする。
【0031】
請求項の発明は、請求項1の画像処理装置において、前記バッファメモリ部は、データのリード動作とライト動作が同時に可能な複数のバッファからなり、前記メモリ制御部は、さらに、前記バッファメモリ部へのデータ書込み制御を行う書込みアドレス生成回路と、前記バッファメモリ部に格納されている画像データから補間演算に必要なデータを同時に読み出すためのアドレスを生成する読出しアドレス生成回路と、を有し、前記データ書込み制御は、同時に読み出すデータをそれぞれ異なるバッファに書き込むものであることを特徴とする。
【0032】
この構成によれば、バッファ内にある画像データから、補間演算に必要なデータとして任意の座標の周辺の複数の画素(例えば、16画素)情報を同時に読み出すことが可能となり、演算処理を速やかに行える。
【0033】
請求項の発明は、請求項のいずれか1つの画像処理装置において、前記画像処理装置は、さらに、歪補正処理により得られた補間座標が前記ユニットラインの処理を行うためのブロックラインの画像データに対する補間座標に対し、列方向に前記preULB、postULBを逸脱する座標が生成された時、若しくは、歪補正処理により得られた補間座標が前段から入力されない座標となった時にエラー出力を行うエラー検出回路を有することを特徴とする。
【0034】
この構成では、パラメータの誤入力や、歪補正量の見積もりが過少だった時にエラー検出回路が検知してCPUに知らせる。特に、preULB、postULBの設定オーバー(図13参照)については、事前に正確な見積もりを行えない場合があるので、オーバーする量をCPUに通知することで設定値を修正しやすくする。
【0035】
請求項の発明は、請求項の画像処理装置において、前記エラー出力がなされたときは、前記ブロックラインの画像データの入力範囲を再設定して歪補正処理を再実行することが可能であることを特徴とする。
【0036】
請求項の発明は、請求項のいずれか1つの画像処理装置において、1つのユニットライン最後の画素に対する歪み補正処理終了後、次の1つのユニットラインまたはさらにその次の1つのユニットラインの最初に歪み補正処理を行う画素の補間座標を演算し前記補間座標に基づいてバッファ開放量を求めることを特徴とする。
【0037】
この構成では、1UL処理が終わった後に開放できるバッファの量は、次のUL先頭座標が決まらなければ分からない(図17参照)ことを利用する。内部バッファは小さいので、使わなくなったデータが格納されている部分をできるだけ早くに開放する為、次のUL先頭座標を算出して開放量を取得(図18参照)し、バッファを開放することで内部バッファを有効に利用することができる。
【0038】
請求項10の発明は、入力された画像データに対して歪補正処理を行う画像処理方法において、前記歪補正処理を行際は、データの書き込みおよび読み込みが制御されるバッファメモリ部に、前記入力された画像データをブロック単位で格納し、歪補正後の補正画像における画素の座標位置と、この座標位置に対応する、歪補正前の画像における画素の補間座標を生成し、前記生成された補間座標に基づいて、前記バッファメモリ部から読み出したブロック単位の画像データから該補間座標の画素データを生成する補間演算を行い、前記バッファメモリ部への書き込みの際は、列方向に一列に並んだ一定数分の画素からなる画像データであるユニットラインを単位として行方向に順次書き込むように制御し、前記バッファメモリ部からの読み出しの際は、歪補正処理後の画像データが前記ユニットラインを単位として行方向に順次出力されるように、前記バッファメモリ部に格納された画像データに対して読み出し制御を行うことを特徴とする。
【0039】
この方法では、内部バッファとしてのメモリ部に画像データをブロック単位で格納して、そのデータを利用して歪補正処理のための補間演算を行うことができる。
【0040】
請求項11の発明は、請求項のいずれか1つに記載の画像処理装置において、前記画像処理装置は、さらに、前記歪補正手段が歪補正処理を行うのに必要とする入力画像範囲を算出する歪補正範囲算出部を有し、前記入力画像範囲は、前記歪補正処理後の画像データにおける注目領域に対して歪み補正の座標変換がなされて得られる歪補正処理前の画像データの対応領域を包含する領域として得られることを特徴とする。
【0041】
請求項12の発明は、請求項11記載の画像処理装置において、前記歪補正範囲算出部は、前記歪補正処理後の画像データにおける注目領域に対して所定の歪補正式を適用することで座標変換可能であり、歪補正処理後の出力画像範囲における、周辺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】

Figure 0004334932
[式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】
Figure 0004334932
最後の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 object, 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 image process 1, the image process 2,. The image data after the image processing is further compressed by a compression method such as JPEG and recorded on a memory card or the like as a recording medium.
[0007]
FIG. 24B is 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 pre-processing circuit 102, a plurality of image processing circuits 106-1 to 106-n, a JPEG processing unit 107, a frame memory 105, and a recording medium as well as a CPU 104 on a bus 103. A memory card 108 is connected. Under the control of the CPU 104, the image pickup signal from the CCD 101 is subjected to pixel defect processing, A / D conversion, and the like in the preprocess circuit 102, and then temporarily stored in the frame memory 105 through the bus 103. Next, image data is read from the frame memory 105 and input to the image process circuit 106-1 through the bus 103 to perform predetermined image processing, and the image data is rewritten to the frame memory 105 through the bus 103 again. In the same manner, data is sequentially exchanged between the frame memory 105 and the image process circuits 106-2 to 106-n via the bus 103. Finally, the JPEG processing unit 107 performs JPEG compression processing, and the image The processed data is temporarily stored in the frame memory 105, and the processed data read from the frame memory 105 is recorded on the memory card 108 or the like. In the above image process and JPEG processing in each stage, image processing is performed in units of small areas (block lines).
[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 (page 3, FIG. 19)
[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 Patent Document 1, there are many data exchanges between the frame memory and each image process circuit, and the data transfer amount of the bus increases.
[0016]
In Patent Document 2, a large-capacity buffer memory is required to process one line. In addition, the image size that can be processed is limited by the capacity of the buffer memory.
[0017]
In Patent Document 3, a buffer memory is not required for processing by random access. However, generally, random access video memory such as SDRAM takes transfer time.
[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 of claim 1Connected to image processing means so that pipeline processing is possible.In an image processing apparatus having a distortion correction unit that performs distortion correction processing on image data, the distortion correction unit includes:A coordinate position of a pixel in the corrected image after distortion correction, and an interpolation coordinate generation unit that generates an interpolation coordinate of the pixel in the image before distortion correction corresponding to the coordinate position;The image dataIn blocksStorebufferA memory unit;bufferFor the memory partimageA memory control unit that controls writing and reading of data;Based on the generated interpolated coordinates,SaidbufferRead from memoryBlock-wiseimage dataGenerate pixel data of the interpolation coordinates fromPerform interpolation calculationAn interpolation calculation unit, and the memory control unit includes a predetermined number of pixels arranged in a line in a column direction when writing image data before distortion correction from the image processing unit to the buffer memory unit. Control is performed so that unit lines as image data are sequentially written in the row direction, and when reading from the buffer memory unit, the image data after distortion correction processing is sequentially output in the row direction in units of the unit lines. Next, read control is performed on the image data stored in the buffer memory unit.It is characterized by that.
[0020]
  In this configuration, image data is stored in the memory unit as an internal buffer.In blocksIt is possible to store and perform interpolation calculation for distortion correction processing using the data.
  In addition, since data is written to and read from the memory unit in units of UL, the buffer capacity of the memory unit may have a capacity of several UL, that is, at least 1 UL according to the amount of optical distortion. Distortion correction can be realized without greatly increasing the amount or memory capacity.
[0023]
  Claim2The invention of claim1In the image processing apparatus, the memory control unitUnit lineThe coordinate position of the first pixel to be processedBased onCoordinate positionAs,This reference coordinate position andRow directionofFront coordinate positionPreULB is betweenwidthMemory that isProvide an area,Row-wiseRear coordinate positionBetween and postULBwidthMemory that isProvide an area,Unit lineDuring processing, other processingData byBy the aboveBothControl is performed so that the memory area is not overwritten.
[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]
  Claim3The invention of claim1Or2In the image processing apparatus, the memory control unit further includes theUnit lineDuring the processing ofcircuitA buffer that can be opened to input data fromOpenA buffer opening amount calculating circuit for calculating the amount, and a subsequent stage of the distortion correcting meanscircuitA data transmission availability determination circuit for determining whether data transmission is possible,HaveAboveThe buffer opening amount calculation circuitThe difference between the coordinates for the first pixel of the unit line currently being processed and the coordinates for the first pixel of the next unit line to be processedThe buffer opening amountAsCalculationAt the same time, the amount of data from the previous circuit required for processing of the next unit line is transmitted to the data transmission availability determination circuit.AndAboveData transmission availability judgment circuit, The amount of data transmitted from the buffer opening amount calculation circuit,The value of the preULBAnd based onIt is characterized by determining 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]
  Claim4The invention of claim2Or3In the image processing apparatus, the preULBofValue, postULBofThe values are characterized in that different values can be set on the front side and the rear side with respect to the distortion center.
[0028]
In this configuration, as shown in FIG. 14, based on the fact that the values of preULB and postULB are different on the left and right of the distortion center, if these values are made 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]
  Claim5The invention of claim 1 to claim 13In any one of the image processing apparatuses, the image processing apparatus further includes:,SaidDepending on the calculated buffer release amountbufferInsideAnd a buffer free space monitoring circuit for detecting a free space in the buffer. When a free space in the buffer is detected by the buffer free space monitoring circuit, data can be written to the free space. .
[0030]
With this configuration, it is possible to perform a pipeline operation that can be input during data output.
[0031]
  Claim6The image processing apparatus according to claim 1, whereinbufferThe memory unit has a plurality of data read and write operations that can be performed simultaneously.bufferThe memory control unit further comprises thebufferA write address generation circuit for performing data write control to the memory unit;bufferA read address generation circuit for generating an address for simultaneously reading data necessary for the interpolation operation from the image data stored in the memory unit, and the data write control is different for the data read simultaneously.bufferIt is characterized by being written in.
[0032]
According to this configuration, it is possible to simultaneously read out information on a plurality of pixels (for example, 16 pixels) around an arbitrary coordinate as data necessary for the interpolation calculation from the image data in the buffer, and the calculation process can be quickly performed. Yes.
[0033]
  Claim7The invention of claim2~4In any one of the image processing apparatuses, the image processing apparatus further includes distortion correction processing.Interpolation obtained byThe coordinates areUnit lineProcessingBlock line image data to performWhen coordinates deviating from preULB and postULB are generated in the column direction with respect to the interpolation coordinates forInterpolation obtained by processingCoordinates from the previous stageIsEnteredGainError when there is no coordinateDo outputIt has an error detection circuit.
[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]
  Claim8The invention of claim7In the image processing apparatus, when the error output is made, Input range of image data of the block lineResetDistortion correctionThe process can be re-executed.
[0036]
  Claim9The invention of claim1~5In any one of the image processing apparatuses,1 unit lineofDistortion correction for the last pixelAfter processing, the next 1Unit lineOr even the next oneOne unit lineAt firstPixels that perform distortion correction processingInterpolation coordinatesIs calculated,The buffer opening amount is obtained based on the interpolation coordinates.It is characterized by that.
[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]
  Claim10The invention ofEnteredIn an image processing method for performing distortion correction processing on image data, the distortion correction processing is performed.UData writing and reading are controlledbufferIn the memory section,EnteredImage dataIn blocksStore andGenerate the coordinate position of the pixel in the corrected image after distortion correction, and the interpolation coordinate of the pixel in the image before distortion correction corresponding to this coordinate position, based on the generated interpolation coordinate,SaidbufferRead from memoryBlock-wiseimage dataGenerate pixel data of the interpolation coordinates fromPerform interpolation calculationThe bufferMemory partWhen writing to the buffer, control is performed so that unit lines, which are image data composed of a fixed number of pixels arranged in a line in the column direction, are sequentially written in the row direction as units.Memory partWhen reading from the buffer, the image data after distortion correction processing is sequentially output in the row direction with the unit line as a unit.Memory partRead control for image data stored inIt is characterized by that.
[0039]
  In this method, image data is stored in a memory unit as an internal buffer.In blocksIt is possible to store and perform interpolation calculation for distortion correction processing using the data.
[0040]
  Claim11The invention of claim2~4The image processing apparatus according to any one of the above, wherein the image processing apparatus further includes a distortion correction process performed by the distortion correction unit.Need forHas a distortion correction range calculator that calculates the input image range.The input image range is obtained as a region including a corresponding region of image data before distortion correction processing obtained by performing distortion correction coordinate transformation on a region of interest in the image data after distortion correction processing.It is characterized by that.
[0041]
  Claim12The invention of claim11In the image processing apparatus described above, the distortion correction range calculation unit includes:For a region of interest in the image data after the distortion correction processingApply the prescribed distortion correction formulaby doingCoordinate conversion is possible, distortion correctionprocessingLater in the output image rangeKick, Corresponding to each of the four sideseachPixelAgainstThe coordinate transformationTo goCorresponds to the maximum and minimum values and 4 vertices of the generated transformation coordinateseachPixelAgainstCoordinate transformationTo goAt least one of the generated conversion coordinates is calculated, and the preULB and the postULB are calculated by the distortion correction range calculation unit.CalculationresultOn the basis of theTo calculateTheFeatures.
[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 CCD 1 is subjected to pixel defect processing, A / D conversion, and the like by the preprocess circuit 2 under the control of the CPU 4 that controls each unit connected to the bus 3. The obtained image data is temporarily stored in the frame memory 5 via the bus 3. The frame memory 5 is configured by an SDRAM or the like and stores data before image processing and data after image processing. Next, the image data read from the frame memory 5 is input to the first data order conversion unit 6 via the bus 3. As will be described later with reference to FIG. 26 (a), the first data order conversion unit 6 includes a plurality of, in this case, two memories capable of storing data in block units. The first data order conversion unit 6 reads and stores data from the frame memory 5 in the row direction, and then sequentially reads the data in the column direction and outputs the data to the image process circuit 7.
[0045]
The image process circuit 7 performs predetermined image processing on the input data and transfers it to the distortion correction processing unit 8 as the distortion correction means at the next stage. The distortion correction processing unit 8 performs distortion correction processing on the input data and transfers it to the second data order conversion unit 9 at the next stage. As will be described later with reference to FIG. 26 (b), the second data order conversion unit 9 includes a plurality of, in this case, two memories capable of storing data in block units. The second data order conversion unit 9 reads and stores data in the column direction from the distortion correction processing unit 8, then sequentially reads the data in the row direction, and transfers the data to the JPEG processing unit 10. The JPEG processing unit 10 performs JPEG compression processing, temporarily stores the processing data in the frame memory 5, and records the processing data read from the frame memory 5 in the memory card 11 or the like.
[0046]
As shown in FIG. 2, the distortion correction processing unit 8 positions the corrected image after distortion correction (interpolation positions, X and Y) and the corresponding original image position before distortion correction (X ′, Y). ') And an internal memory unit as a buffer memory (hereinafter simply referred to as a buffer) for temporarily storing part of the image data from the circuit of the preceding block of the distortion correction processing unit 8 82, a memory control unit 83 for controlling writing and reading with respect to the internal memory unit 82, and image processing is performed according to the converted coordinates (X ′, Y ′) of the image position before distortion correction to correct distortion of the data. And an interpolation calculation unit 84.
[0047]
As shown in FIG. 2, the interpolation coordinate generation unit 81 includes a coordinate generation unit 811 that generates interpolation coordinates (X, Y), and a predetermined distortion correction equation [formula for the generated interpolation coordinates (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) from the coordinate generation unit 811 and distortion correction 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 correction processing unit 8 operate according to the set values for each block set in the control register 85 that stores control data. Further, the status of the processing result can be referred from the CPU.
[0048]
  In the image processing apparatus according to the present invention configured as described above, the first data order conversion unit 6 to the JPEG processing unit 10 are piped through an information transmission path different from the bus 3 without going through the bus 3. It is connected so that line processing is possible, and image data is transferred and processed in predetermined block units in a two-dimensional pixel array.. BaData transfer through the memory 3 is only transfer from the frame memory 5 to the first data order conversion unit 6, transfer from the JPEG processing unit 10 to the frame memory 5, and transfer from the frame memory 5 to the memory card 11. Therefore, compared with the conventional example (FIG. 24B) in which data is exchanged between the frame memory and each image process circuit, the amount of data transferred by the bus 3 can be greatly reduced. The load can be greatly reduced. Further, in the example shown in FIG. 1, only one image process circuit 7 for performing image processing is provided, but a plurality of image process circuits 7 may be provided. Furthermore, in the figure, the distortion correction processing unit 8 is provided at the subsequent stage of the image process circuit 7, but the configuration may be reversed.
[0049]
In the image process circuit unit configured by the first-stage image process circuit 7 and the distortion correction processing unit 8 which is the second-stage image process circuit, a pipeline register is not shown as a pipeline register before or inside each of the image process circuits 7 and 8. A small-capacity memory is arranged, and the image process circuits 7 and 8 are configured to perform pipeline processing operations via the small memory. These small-capacity memories are used to store peripheral data necessary for image processing when the image processing circuits 7 and 8 perform spatial image processing, and read out the image data in units of blocks and rearrange the data. It is provided because it is necessary to carry out processing and the like.
[0050]
When data transfer from the image process circuit 7 to the image process circuit 8 is free in the internal memory unit 82 of the distortion correction processing unit 8 which is a subsequent image process circuit, the image process circuit 7 in the previous stage is transferred from the distortion correction processing unit 8. In response to this, a request (REQ) is transmitted from the image process circuit 7 in the preceding stage, and at the same time, the free information in the internal memory unit 82 as a buffer is reduced by one. The distortion correction processing unit 8 in the subsequent block repeats this request and request reception, and when the space becomes 0, the request is withdrawn. The distortion correction processing unit 8, which is a subsequent block, receives data from the image process circuit 7 of the previous block simultaneously with the request reception (GRANT) from the previous block or after the request reception (GRANT), and writes the data to the internal memory unit 82. To do. When multiple stages of image process circuits are connected so that pipeline processing is possible, data is transferred from the previous stage to the subsequent stage as described above, and the data is written to the memory section of each image process circuit. After the image processing is performed, data is sequentially transferred while performing image processing from the preceding block to the subsequent stage based on a request from the subsequent stage.
[0051]
FIG. 3 shows a conceptual diagram of coordinate conversion in the distortion correction processing unit 8. FIG. 3A shows the original image data, FIG. 3B shows the corrected image, FIG. 3C shows the coordinate position (X, Y) of the corrected image in FIG. Data coordinates (X ′, Y ′) at the coordinate position P converted to the coordinates of the original data (the coordinates are not necessarily coincident with the positions of a plurality of pixels actually constituting the original data) ). The coordinate position (X ′, Y ′) at the P point is calculated using the coordinates of the 16 pixels around the P point, and the image data at the P point is the pixel data of the surrounding 16 points. Is used for interpolation calculation. The interpolation calculation unit 84 performs processing to interpolate the data at the position of the point P from the surrounding 16 pixel values (luminance data). The generation of the interpolation coordinates by the interpolation position generation unit 811 in FIG. 2 means which pixel position (X, Y) is indicated on the corrected image side in FIG.
[0052]
In [Formula 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 [Formula 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]
Figure 0004334932
Z in [Formula 1] is the distance from the strain center (Xd, Yd) to the point (X, Y) of interest. According to [Expression 1], the coordinates (X ′, Y ′) of the original image that is distorted with respect to the point (X, Y) of the corrected image are calculated. Supplementally explaining [Formula 1], 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 vertical and horizontal spatial sampling intervals are different, such as thinning-in. Xoff and Yoff are values of center deviation for correcting a phenomenon in which the subject position deviates from the position at the time of photographing 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 shooting position by the distortion correction process, it is necessary to consider the center deviation correction values (Xoff, Yoff). When sampling is performed or when processing a YC image consisting 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 image processing unit 7 and repeatedly to the right end of the image is referred to as a block line (BL).
[0059]
The configuration of the first data order conversion unit 6 and the second data order conversion unit 9 for enabling reading of such image data will be described with reference to FIG. FIG. 26 is a block diagram illustrating a configuration of the first and second data order conversion units.
[0060]
As shown in FIG. 26 (a), the first data order conversion unit 6 includes a plurality of memories that can store image data in units of blocks, two in this case, and the two memories 6a and 6b write data. Writing and reading can be switched alternately by the switches on the side and reading side. That is, the frame memory 5 is connected to the memory 6a and the memory 6b by a switch on the writing side so as to be switchable, and the image processing unit 7 also has the memory 6a and the memory 6b in the reading side switch. When the frame memory 5 is connected to one of the memory 6a and the memory 6b, the other of the memory 6a and the memory 6b is switched to be connected to the image processing unit 7. . That is, the memories 6a and 6b are switched so as not to be simultaneously connected to both the frame memory 5 and the image processing unit 7, and are alternately written and read.
[0061]
A part of the frame image stored in the frame memory 5 is read in the line direction in units of blocks and stored in one memory, for example, the memory 6a in this case.
[0062]
In parallel with this, the block-unit image data that has already been read from the frame memory 5 and stored in the memory 6b is sequentially read in the column direction (vertical direction) and output to the image processing unit 7. Is done.
[0063]
When writing from the frame memory 5 to the memory 6a and reading from the memory 6b to the image processing unit 7 are finished, the switch on the writing side and the switch on the reading side are switched, and then the frame memory 5 transfers to the memory 6b. The writing of the block unit image data is started, and the reading of the block unit image data from the memory 6a to the image processing unit 7 is started.
[0064]
As shown in FIG. 26B, the second data order conversion unit 9 is configured in substantially the same manner as the first data order conversion unit 6 and operates in substantially the same manner.
[0065]
That is, the second data order conversion unit 9 includes a memory 9a and a memory 9b, a write side switch, and a read side switch.
[0066]
During the operation of the second data order conversion unit 9, writing from the distortion correction processing unit 8 is performed in the column direction (vertical direction) with respect to one of the memory 9a and the memory 9b, and the memory 9a and the memory 9b Reading from the other is performed in the row direction (horizontal direction) and output to the JPEG processing unit 10.
FIG. 6 shows a detailed configuration of the distortion correction processing unit 8 in FIG.
A correspondence relationship between each unit in FIG. 6 and each unit in FIG. 2 will be described. The interpolation position calculation circuit 22 in FIG. 6 is the interpolation position generation unit 811 of FIG. 2, the selector 24 is the selector 813 of FIG. 2, and the distortion correction coefficient correction circuit 21 and the interpolation position correction circuit 23 are the distortion correction coordinate conversion unit of FIG. 812, respectively. Further, the 2-port SRAM 26 in FIG. 6 corresponds to the internal memory unit 82 in FIG. 2, and a write address generation circuit 28, a buffer free capacity monitoring circuit 29, a data transmission availability determination circuit 30, a buffer release amount calculation circuit 31, and a read address generation. The circuit 25 corresponds to the memory control unit 83 in FIG. 2, and the interpolation circuit 27 corresponds to the interpolation calculation unit 84 in FIG. Although not shown in FIG. 2, the error detection circuit 32 is provided connected to the memory control unit 83. The error detection circuit 32 has a function of notifying the CPU 4 as an error (ERROR) when a distortion amount increases in the distortion correction process and a distortion exceeding a preset value of preULB and postULB described later occurs.
[0067]
When the interpolation position calculation circuit 22 returns a grant (request acceptance) to the subsequent circuit in response to a request from the subsequent circuit of the distortion correction processing unit 8, the grant is used as a trigger for one unit line (hereinafter referred to as 1UL). The interpolation position (X1, Y1) is calculated. Here, 1UL is a unit when writing or reading a certain number of image data arranged in a line in the column direction when writing to or reading from the memory unit in the block line processing described above. is there. That is, 1UL indicates data of a certain number of pixels arranged in a line in the column direction on the block line (BL).
[0068]
The interpolation position correction circuit 23 multiplies the interpolation position (X1, Y1) by the distortion correction coefficient F from the distortion correction coefficient calculation circuit 21, and calculates the coordinate position (X ′, Y ′) of the original data before distortion correction. To do. The selector 24 selects (X1, Y1) and (X ′, Y ′). When performing distortion correction, the selector 24 selects (X ′, Y ′) and outputs it, and enlargement / reduction processing (resizing) When performing only, select (X1, Y1) and output.
[0069]
The 2-port SRAM 26 is a buffer that stores data in the distortion correction processing unit 8.
[0070]
The read address generation circuit 25 generates an address (ADR) in the 2-port SRAM 16 corresponding to the interpolation position, outputs a control signal for aligning outputs from the 2-port SRAM 26, or synchronizes with output image data. Then, the write control signal WE_N is output, or the data string control signal that indicates where D0 shown in FIG. 7 and [Equation 2] is on the 2-port SRAM is output.
[0071]
The write address generation circuit 28 generates an address (ADDRESS) of the 2-port SRAM 26 that is an internal memory in accordance with the write control signal WE, or counts up the internal counter (BLC) when data input for 1 UL is completed. .
[0072]
The data transmission permission / inhibition determination circuit 30 responds to the REQ signal from the subsequent circuit based on the BLC value, the operation state of this circuit, the next UL head coordinate, and the request (REQ) state from the subsequent circuit of the distortion correction processing unit 8. It is determined whether or not the grant (GRANT_N) can be transmitted. If grant transmission is possible, GRANT_N = 1.
[0073]
The interpolation circuit 27 performs 16-point interpolation for the image data corresponding to the interpolation position. The buffer release amount calculation circuit 31 calculates the difference between the integer part of the UL start coordinate currently being processed and the UL start coordinate to be processed next as the buffer release amount (see FIG. 17).
[0074]
The buffer free capacity monitoring circuit 29 holds the amount of data (UL) stored in the 2-port SRAM 26 as an internal buffer, and if there is free space in the buffer, a request (REQ) is sent to the preceding circuit of the distortion correction processing unit 8. = 1) is transmitted.
[0075]
Next, the circuit operation of the distortion correction processing unit 8 in FIG. 6 will be described.
First, when the 2-port SRAM 26 that is an internal memory unit (buffer) has a space, the buffer space monitoring circuit 29 sends a request (REQ) as a data request from the buffer space capacity monitoring circuit 29 to the preceding circuit. A grant (GRANT) as a request reception is received from the preceding circuit, and simultaneously with this reception, the counter (in the circuit 29) that stores the number of ULs that can be stored in the 2-port SRAM 26 is decreased by one. Data is transferred with 1 UL as one operation unit in one request and grant. When the counter reaches 0, the request is withdrawn.
[0076]
Then, data flows from the preceding circuit to the write address generation circuit 28, and writing to the 2-port SRAM 26 is performed. The internal counter (BLC) of the write address generation circuit 18 is incremented for every 1 UL input.
[0077]
The 2-port SRAM 26 is composed of a total of 16 2 × 4 SRAMs that can simultaneously read and write as shown in FIG. 8 so that the interpolation circuit 27 can perform 16-point interpolation, for example.
[0078]
Here, the 2-port SRAM 26 will be described with reference to FIG. 8, but the number of memories and the size of each memory may be different. For example, in FIG. 8, the block line width (UL length) is 96, but it may be longer or shorter. It may be determined by a balance between the circuit scale and the correction performance. Also, 4 × 4 (16 in total) may be 2 × 2 (4 in total) as long as 4-point interpolation is performed. It may be determined according to the interpolation method (how many points are to be interpolated).
[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. The data stored in Nos. 0, 4, 8, and 12 that are four 2-port SRAMs arranged in the vertical direction are the 4N, 4N + 4, 4N + 8, and 4N + 12th UL data. , 13 is the 4N + 1, 4N + 5, 4N + 9, 4N + 13th UL data, and the data stored in Nos. 2, 6, 10, 14 is the 4N + 2, 4N + 6, 4N + 10, 4N + 14th UL data. The data stored in Nos. 3, 7, 11, and 15 are 4N + 3, 4N + 7, 4N + 11, 4N + 15th UL data.
[0080]
No. 0, 1, 2, 3 and No. 4, 5, 6, 7 and No. 8, 9, 10, 11 and No. 12, 13, 14 which are four 2-port SRAMs arranged in the horizontal direction. , 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, a block line having a width of 8 lines (pixels) is assumed as shown in FIG. 9A, and data is “1, 2,..., I, m”, “5,” in UL units. 6,..., J, n ”,“ 9, 10,..., K, o ”,. FIG. 9B shows where the data in the write order shown in FIG. 9A is written on the 16 2 port SRAM No. 0 to No. 15 of 4 × 4. For example, in No. 0, No. 4, No. 8, No. 12, the image data for 1 UL (data shown in order 1 to m) in the left vertical column in FIG. 9A is distributed and stored. To go. Note that the notation 0 to 92, 1 to 93, 2 to 94, 3 attached to each vertical line of the vertical two-port SRAM No. 0, No. 4, No. 8, and No. 12 shown in FIG. ˜95 is different from the notation of each unit line (1˜m..., 5˜n..., 9˜o...) Shown in FIG. In FIGS. 9 (a) and 9 (b), 1 to 16, a to p, A to P,... And 16 blocks so that the writing order can be understood for 4 × 4 16 image data. This is because the reference numerals are attached. In the case of FIG. 8, the notation given to each vertical line of the 2-port SRAM No. 0, No. 4, No. 8, No. 12 in the vertical direction corresponds to the data order in one UL in the vertical direction. 2-port SRAM No. 0, No. 4, no. 8, no. Each of 12 includes one UL pixel data No. 0 to 95 distributed alternately. Accordingly, each of the four vertical lines arranged in the vertical direction in FIG. 8 is labeled with the number of pixels in the pixel order (0 to 95) of one unit line (UL). Pixels (0, 4, 8,... 92) that are multiples of UL are stored in the vertical direction of No. 0 of the 2-port SRAM in FIG. 8, and UL is stored in the vertical direction of No. 4 of the 2-port SRAM. (Multiple of 4) +1 pixels (1, 5, 9,... 93) are stored, and in the vertical direction of No. 8 of the 2-port SRAM, UL (multiple of 4) +2 pixels (2, 6 , 10... 94), and UL (multiple of 4) +3 pixels (3, 7, 11,... 95) are stored in the vertical direction of No. 12 of the 2-port SRAM. Further, No. 1, 2, 3 and No. 2 of 2-port SRAM. Each set of Nos. 5, 6, 7 and Nos. 9, 10, 11 and Nos. 13, 14, 15 is also stored in the same manner.
[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 (line 4N in FIG. 8). The next UL data is No. 1, 5, 9, and 13 (4N + 1 line in FIG. 8). The buffer form of FIG. 8 has a configuration in which 16 points around arbitrary coordinates in the buffer can be simultaneously extracted by one access regardless of how the interpolation position is moved by the distortion correction processing.
[0083]
The data transmission availability determination circuit 30 receives a request (REQ_N) from the subsequent circuit, and outputs a request acceptance (GRANT_N) if the next UL data can be sent. This request reception (GRANT_N) becomes a trigger for itself, and the interpolation position calculation circuit 22 starts its operation. When it operates for 1 UL, the next UL head coordinate is calculated and ends.
[0084]
The data transmission availability determination circuit 30 sends an operation trigger (trig) to the distortion correction coefficient calculation circuit 21 so that the interpolation position calculation circuit 22 starts operating and outputs the interpolation position (X1, Y1). Similarly to the interpolation position calculation circuit 22, the distortion correction coefficient calculation circuit 21 calculates the next UL head coordinates after the operation for one UL, and ends.
[0085]
The read address generation circuit 25 issues a read address to each of the 16 2-port SRAMs 26 from the input interpolation coordinates.
[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 interpolation circuit 27. The coordinates (X ′, Y ′) of the correction coordinate position P have already been obtained from the above [Equation 1]. The pixel values (luminance data) at these coordinates are obtained from the pixel data D0 to D15 at 16 points around the coordinates P (X ', Y'). If it is known from which of the 16 memories D0 comes, D1, D2,..., D15 can be known from the positional relationship with respect to D0. As will be described later, D0 is obtained from the coordinates of the interpolation position.
[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 upper left 5
[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 address generation circuit 25, whereby the interpolation circuit 27 for performing the interpolation operation has a D 0 from where in the 2-port SRAM 26. It recognizes whether it is coming out and performs 16-point interpolation.
[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 according to the interpolation formula of [Formula 2].
[0091]
[Formula 2]
Figure 0004334932
After the last UL data is output, the buffer release amount calculation circuit 31 calculates the difference between the UL start coordinate that has just been processed and the next UL start coordinate (see FIG. 17), and data that is no longer needed is accumulated. In order to release the buffer, the buffer release amount is output to the buffer free space monitoring circuit 29. However, it is preferable that the buffer release amount when straddling the strain center is opened in consideration of changes in values of postULB1 and postULB2, as shown in FIG. The preULB and postULB shown in FIG. 16A are obtained by providing areas of a predetermined width on the front side and the rear side in the row direction with respect to the coordinate position of the first pixel among the pixels forming the UL. These are defined as preULB and postULB, respectively. When straddling the distortion center, the buffer opening amount is not the difference between the normal UL start coordinates, but the buffer opening amount is referred to by the change amount of postULB (ULB: an abbreviation of Unit Line Buffer) where the reference value changes. (Adjustment amount is postULB1-postULB2, see FIG. 16 (b)).
[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 amount calculation circuit 31 transmits to the data transmission availability determination circuit 30 how much data is required from the previous stage circuit for the next UL processing.
[0094]
The buffer free capacity monitoring circuit 29 makes a request to the preceding circuit when the buffer is freed by the above calculation of the buffer opening amount.
[0095]
The data transmission availability determination circuit 30 determines whether or not the next UL data can be sent based on the internal counter (BLC) of the write address generation circuit 28, the human power from the buffer opening amount calculation circuit 31, and the preULB value. The data transmission availability determination circuit 30 returns a request acceptance (GRANT_N) in response to a request from the subsequent circuit.
[0096]
In the error detection circuit 32, the coordinates input to the read address generation circuit 25 deviate from the left end (see FIG. 11) or right end of the block line (BL), or the upper and lower ends (see FIG. 12) of the block line (BL). An error is output when the value deviates or the distortion amount deviates from the set values of preULB and postULB (see FIG. 13). The output of these errors is performed by determining the coordinates. In the case of FIGS. 11 and 12, an error is output, but the process continues. In the case of FIG. 13 as well, an error is output, but the process continues. In the case of preULB and postULB in FIG. 13, not only an error is output, but also the amount of deviation is stored and set in a register so that the CPU 4 can acquire it as data.
[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 input image range. 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 error detection circuit 32.
[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. 27 (a), the region of interest is BL, but is transformed as shown in FIG. 27 (b) by coordinate conversion for distortion correction. 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. 15 so that this value can be applied to both the left and right sides, there is no need for processing on one side of the left side or the right side. 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 register 85, 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. This support function may be provided by being added to the distortion correction processing function of the distortion correction processing unit 8. The memory control unit 83 performs control so that the areas preULB and postULB are not overwritten by another process during the 1UL process. The areas preULB and postULB may be set from the CPU 4 to the register 85 (see FIG. 2), or may be automatically calculated and set by the CPU.
[0103]
As described above, 16 points are interpolated in the distortion correction process, but as shown in FIG. 16A, the interpolation position can move by a (where a> 0) during the 1 UL process by the 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 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 internal buffer 82 included in the distortion correction processing unit 8 has 16 lines (pixels) in the horizontal direction of 96 pixels at the maximum. This will be used for distortion correction. The block line processing data is swept in the right direction in the figure by at least 1 UL. Since several UL may be released at once, it is not always necessary to sweep 1 UL at a time. Since the internal buffer 82 starts from an empty state at first, it enters 16 lines and performs distortion correction processing. When these unit lines are processed, unnecessary data (1 to several UL data) is generated on the left line. Note that the processing is not necessarily unnecessary, and when the enlargement ratio is large, it may take several UL until it is unnecessary. For unnecessary data, the buffer is released (that is, overwriting is permitted) and new data is inserted. The image you are sweeping shifts to the right. Since there is only a size that can read a maximum of 16 lines, the data area that is no longer needed is released and new data is overwritten sequentially. All unnecessary buffer areas are released at once. The opening amount may be 1 line or 5 lines. For example, since the first three lines of data stored in the buffer are unnecessary for the subsequent processing, the next data is overwritten by releasing it and accepting the next data.
[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 coordinates 1 to n shown in the figure) is being performed, regardless of the request from the subsequent circuit block, the processing of the next coordinate n is completed. The coordinate n + 1 is calculated to obtain the release amount, and the buffer is released early. As a result, new data is input from the preceding circuit block relatively quickly, and the pipeline space can be reduced. However, in the case of FIG. 18, after processing the coordinate n, the processing is terminated after calculating the coordinates of the pixel n + 1, so that the data necessary for the next UL processing is stored in the buffer as shown in FIG. Even if the requests are complete, if the requests from the subsequent stage continue, the pipeline becomes empty. Since there is still a pipeline vacancy, there is a possibility that the operation speed of the entire apparatus will be adversely affected when requests continue.
[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 coordinates 1 to n shown in the figure), and the buffer opening amount is acquired at an early stage. As a result, the buffer can be released quickly, and the pipeline space can be considerably reduced as compared with FIG. 19, as shown in FIG. However, there is a problem that the circuit becomes complicated and control becomes difficult.
[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. Thus, 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. .
[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.
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 lattice-shaped 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 (12)

画像処理手段とパイプライン処理可能なように接続され、画像処理後の画像データに対して歪補正処理を行う歪補正手段を有する画像処理装置において、
前記歪補正手段は、
歪補正後の補正画像における画素の座標位置と、この座標位置に対応する、歪補正前の画像における画素の補間座標を生成する補間座標生成部と、
前記画像データをブロック単位で格納するバッファメモリ部と、
前記バッファメモリ部に対する画像データの書き込みおよび読み込みを制御するメモリ制御部と、
前記生成された補間座標に基づいて、前記バッファメモリ部から読み出したブロック単位の画像データから該補間座標の画素データを生成する補間演算を行う補間演算部と、
を有し、
前記メモリ制御部は、
前記画像処理手段から歪補正前の画像データを前記バッファメモリ部へ書き込む際は、列方向に一列に並んだ一定数分の画素からなる画像データであるユニットラインを単位として行方向に順次書き込むように制御し、前記バッファメモリ部から読み出す際は、歪補正処理後の画像データが前記ユニットラインを単位として行方向に順次出力されるように、前記バッファメモリ部に格納された画像データに対して読み出し制御を行うことを特徴とする画像処理装置。
In an image processing apparatus having a distortion correction unit that is connected to an image processing unit so as to be pipeline- processed and that performs distortion correction processing on image data after image processing.
The distortion correction means includes
A coordinate position of a pixel in the corrected image after distortion correction, and an interpolation coordinate generation unit that generates an interpolation coordinate of the pixel in the image before distortion correction corresponding to the coordinate position;
A buffer memory unit for storing the image data in units of blocks ;
A memory control unit that controls writing and reading of image data to and from the buffer memory unit;
Based on the generated interpolation coordinates, an interpolation calculation unit that performs an interpolation calculation to generate pixel data of the interpolation coordinates from the block-unit image data read from the buffer memory unit ;
Have
The memory control unit
When the image data before distortion correction is written from the image processing means to the buffer memory unit, it is sequentially written in the row direction in units of unit lines, which are image data composed of a fixed number of pixels arranged in a line in the column direction. When the image data stored in the buffer memory unit is read out from the buffer memory unit, the image data after distortion correction processing is sequentially output in the row direction with the unit line as a unit. An image processing apparatus that performs read control .
前記メモリ制御部は、前記ユニットラインの最初に処理される画素の座標位置を基準座標位置として、この基準座標位置と行方向の前側の座標位置との間がpreULBの幅であるメモリ領域を設け、行方向の後側の座標位置との間がpostULBの幅であるメモリ領域を設け、
前記ユニットラインの処理中は他の処理によるデータによって前記両方のメモリ領域が上書きされないよう制御することを特徴とする請求項1に記載の画像処理装置。
The memory control unit provides a memory area having a preULB width between the reference coordinate position and the front coordinate position in the row direction, with the coordinate position of the pixel processed first in the unit line as a reference coordinate position. And a memory area having a width of postULB between the rear coordinate position in the row direction,
The image processing apparatus according to claim 1, wherein during the processing of the unit line, control is performed so that both the memory areas are not overwritten by data by other processing.
前記メモリ制御部は、さらに、
前記ユニットラインの処理中に、前記歪補正手段の前段回路からのデータを入力するために開放可能なバッファ開放量を算出するバッファ開放量算出回路と、
前記歪補正手段の後段回路に対するデータ送信の可否を判定するデータ送信可否判定回路と、を有し、
前記バッファ開放量算出回路は、現在処理中のユニットラインの最初の画素に対する座標と、次に処理予定のユニットラインの最初の画素に対する座標との差を前記バッファ開放量として算出するとともに、次のユニットラインの処理に必要な前段回路からのデータ量を前記データ送信可否判定回路に送信し、
前記データ送信可否判定回路は、前記バッファ開放量算出回路から送信されたデータ量と、前記preULBの値とに基づいてデータ送信可否の判定を行うことを特徴とする請求項1又は2に記載の画像処理装置。
The memory control unit further includes:
A buffer opening amount calculation circuit that calculates a buffer opening amount that can be opened to input data from a preceding circuit of the distortion correction unit during the processing of the unit line;
A data transmission availability determination circuit that determines whether data transmission is possible with respect to a subsequent circuit of the distortion correction unit;
The buffer opening amount calculation circuit calculates the difference between the coordinates for the first pixel of the unit line currently being processed and the coordinates for the first pixel of the unit line to be processed next as the buffer opening amount, and Send the data amount from the previous circuit required for processing the unit line to the data transmission availability determination circuit,
3. The data transmission availability determination circuit according to claim 1, wherein the data transmission availability determination circuit determines whether data transmission is possible based on a data amount transmitted from the buffer opening amount calculation circuit and a value of the preULB . Image processing device.
前記preULBの値、postULBの値は、それぞれ歪中心に対して前側と後側とで異なる値を設定可能であることを特徴とする請求項2又は3に記載の画像処理装置。The image processing apparatus according to claim 2, wherein 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 . 前記画像処理装置は、さらに、前記算出されたバッファ開放量によりバッファ内の空き領域を検出するバッファ空き容量監視回路を有し、
該バッファ空き容量監視回路によりバッファ内の空き領域が検出されると、該空き領域へのデータの書き込みを可能とすることを特徴とする請求項1〜3のいずれか1つに記載の画像処理装置。
The image processing apparatus further includes a buffer free capacity monitoring circuit that detects a free area in the buffer based on the calculated buffer opening amount,
4. 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 buffer memory unit includes a plurality of buffers 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 buffer 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 buffer memory unit;
Have
The image processing apparatus according to claim 1, wherein the data writing control is to write simultaneously read data to different buffers .
前記画像処理装置は、さらに、歪補正処理により得られた補間座標が前記ユニットラインの処理を行うためのブロックラインの画像データに対する補間座標に対し、列方向に前記preULB、postULBを逸脱する座標が生成された時、若しくは、歪補正処理により得られた補間座標が前段からは入力され得ない座標となった時にエラー出力を行うエラー検出回路を有することを特徴とする請求項2〜4のいずれか1つに記載の画像処理装置。 The image processing apparatus further includes coordinates that deviate from the preULB and the postULB in the column direction with respect to the interpolation coordinates for the image data of the block line for which the interpolation coordinates obtained by the distortion correction processing perform the unit line processing. 5. An error detection circuit that outputs an error when generated or when an interpolated coordinate obtained by distortion correction processing becomes a coordinate that cannot be input from the previous stage. the image processing apparatus according to one or. 前記エラー出力がなされたときは、前記ブロックラインの画像データの入力範囲を再設定して歪補正処理を再実行することが可能であることを特徴とする請求項7に記載の画像処理装置。The image processing apparatus according to claim 7, wherein when the error is output, the distortion correction processing can be re-executed by resetting an input range of the image data of the block line . 1つのユニットラインの最後の画素に対する歪み補正処理終了後、次の1つのユニットラインまたはさらにその次の1つのユニットラインの最初に歪み補正処理を行う画素の補間座標を演算し、前記補間座標に基づいてバッファ開放量を求めることを特徴とする請求項1〜5のいずれか1つに記載の画像処理装置。 After the distortion correction processing for the last pixel of one unit line is completed, the interpolation coordinates of the pixel for which distortion correction processing is performed at the beginning of the next one unit line or the next one unit line are calculated, and the interpolation coordinates are calculated. The image processing apparatus according to claim 1, wherein the buffer opening amount is obtained based on the image processing apparatus. 入力された画像データに対して歪補正処理を行う画像処理方法において、In an image processing method for performing distortion correction processing on input image data,
前記歪補正処理を行う際は、When performing the distortion correction process,
データの書き込みおよび読み込みが制御されるバッファメモリ部に、前記入力された画像データをブロック単位で格納し、The input image data is stored in block units in a buffer memory unit in which data writing and reading are controlled,
歪補正後の補正画像における画素の座標位置と、この座標位置に対応する、歪補正前の画像における画素の補間座標を生成し、Generate the coordinate position of the pixel in the corrected image after distortion correction and the interpolation coordinate of the pixel in the image before distortion correction corresponding to this coordinate position,
前記生成された補間座標に基づいて、前記バッファメモリ部から読み出したブロック単位の画像データから該補間座標の画素データを生成する補間演算を行い、Based on the generated interpolation coordinates, an interpolation calculation is performed to generate pixel data of the interpolation coordinates from the block-unit image data read from the buffer memory unit,
前記バッファメモリ部への書き込みの際は、列方向に一列に並んだ一定数分の画素からなる画像データであるユニットラインを単位として行方向に順次書き込むように制御し、前記バッファメモリ部からの読み出しの際は、歪補正処理後の画像データが前記ユニットラインを単位として行方向に順次出力されるように、前記バッファメモリ部に格納された画像データに対して読み出し制御を行うことを特徴とする画像処理方法。When writing to the buffer memory unit, control is performed so that unit lines, which are image data composed of a certain number of pixels arranged in a line in the column direction, are sequentially written in the row direction as units. When reading, the image data stored in the buffer memory unit is subjected to read control so that the image data after distortion correction processing is sequentially output in the row direction with the unit line as a unit. Image processing method.
前記画像処理装置は、さらに、前記歪補正手段が歪補正処理を行うのに必要とする入力画像範囲を算出する歪補正範囲算出部を有し、The image processing apparatus further includes a distortion correction range calculation unit that calculates an input image range necessary for the distortion correction unit to perform distortion correction processing,
前記入力画像範囲は、前記歪補正処理後の画像データにおける注目領域に対して歪み補正の座標変換がなされて得られる歪補正処理前の画像データの対応領域を包含する領域として得られることを特徴とする請求項2〜4のいずれか1つに記載の画像処理装置。The input image range is obtained as a region including a corresponding region of image data before distortion correction processing obtained by performing coordinate correction for distortion correction on a region of interest in the image data after distortion correction processing. The image processing apparatus according to any one of claims 2 to 4.
前記歪補正範囲算出部は、前記歪補正処理後の画像データにおける注目領域に対して所定の歪補正式を適用することで座標変換可能であり、歪補正処理後の出力画像範囲における
周辺4辺の各辺に対応する各画素に対して前記座標変換を行って生成した変換座標の最大値と最小値、および4頂点に対応する各画素に対して座標変換を行って生成した変換座標、の少なくともいずれかを算出し、
前記preULBおよびpostULBは、前記歪補正範囲算出部の算出結果に基づいて算出することを特徴とする請求項11記載の画像処理装置。
The distortion correction range calculation unit can perform coordinate conversion by applying a predetermined distortion correction formula to a region of interest in the image data after the distortion correction processing, and in the output image range after the distortion correction processing ,
The maximum and minimum values of the converted coordinates generated by performing the coordinate conversion on each pixel corresponding to each of the four surrounding sides, and the conversion generated by performing the coordinate conversion on each pixel corresponding to the four vertices Calculate at least one of the coordinates,
The image processing apparatus according to claim 11, wherein the preULB and the postULB are calculated based on a calculation result of the distortion correction range calculation unit .
JP2003202664A 2003-07-28 2003-07-28 Image processing apparatus and image processing method Expired - Fee Related JP4334932B2 (en)

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
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
EP12006314.4A EP2533192B1 (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 JP2005045514A (en) 2005-02-17
JP4334932B2 true 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)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4670424B2 (en) * 2005-03-25 2011-04-13 ソニー株式会社 Information processing apparatus and information processing method, image display system, and program
JP4657367B2 (en) * 2007-05-09 2011-03-23 富士通セミコンダクター株式会社 Image processing apparatus, imaging apparatus, and image distortion correction method
JP5135953B2 (en) 2007-08-28 2013-02-06 コニカミノルタアドバンストレイヤー株式会社 Image processing apparatus, image processing method, and imaging 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
JP5593060B2 (en) * 2009-11-26 2014-09-17 株式会社メガチップス Image processing apparatus and method of operating image processing apparatus
JP5602532B2 (en) * 2010-07-30 2014-10-08 オリンパス株式会社 Image processing apparatus and image processing method
JP5658612B2 (en) * 2011-05-11 2015-01-28 株式会社東芝 Image processing apparatus, image processing system, and image processing method
JP5769790B2 (en) * 2013-12-13 2015-08-26 キヤノン株式会社 Image processing apparatus and image processing method
KR102473840B1 (en) * 2017-11-21 2022-12-05 삼성전자주식회사 Display driver, mobile electronic device
JP7159555B2 (en) * 2017-12-25 2022-10-25 カシオ計算機株式会社 Image processing device, image processing method and program

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3686695B2 (en) * 1994-10-20 2005-08-24 オリンパス株式会社 Image processing device
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
JP4827213B2 (en) * 2001-03-12 2011-11-30 株式会社メガチップス Image correction apparatus and image correction method
JP3781634B2 (en) * 2001-04-26 2006-05-31 シャープ株式会社 Image processing apparatus, image processing method, and portable video device

Also Published As

Publication number Publication date
JP2005045514A (en) 2005-02-17

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
WO2004109597A1 (en) Image processing device
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
US20100321538A1 (en) Image processing apparatus and imaging apparatus
JP4334932B2 (en) Image processing apparatus and image processing method
JP5602532B2 (en) Image processing apparatus and image processing method
JP2004362069A (en) Image processor
JP2005045513A (en) Image processor and distortion correction method
CN109785265B (en) Distortion correction image processing method and image processing apparatus
JPH11275391A (en) Digital image pickup device for selecting distortion correction
JP2006203437A (en) Camera and its image processing method
JP2007079708A (en) Image processor and processing method
US6906748B1 (en) Electronic camera
WO2007108081A1 (en) Photography instrument, photography method and program, table making device and method of photography instrument, video processor and processing method
JP4436626B2 (en) Image processing device
JP6762775B2 (en) Image processing equipment, imaging equipment, control methods and programs
JPH11308560A (en) Electronic camera
JP5432657B2 (en) Imaging device, storage device, and control method
JP2007156795A (en) Image conversion apparatus
JP6440465B2 (en) Image processing apparatus, image processing method, and program
JP4279775B2 (en) Optical distortion correction apparatus, optical distortion correction method, and imaging apparatus
JP2005011268A (en) Image processor

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