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

JP4150171B2 - Image generating apparatus and method - Google Patents

Image generating apparatus and method Download PDF

Info

Publication number
JP4150171B2
JP4150171B2 JP2001147181A JP2001147181A JP4150171B2 JP 4150171 B2 JP4150171 B2 JP 4150171B2 JP 2001147181 A JP2001147181 A JP 2001147181A JP 2001147181 A JP2001147181 A JP 2001147181A JP 4150171 B2 JP4150171 B2 JP 4150171B2
Authority
JP
Japan
Prior art keywords
horizontal
vertical
pixels
output
interpolation
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
JP2001147181A
Other languages
Japanese (ja)
Other versions
JP2002344731A (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.)
Fujifilm Corp
Original Assignee
Fujifilm 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 Fujifilm Corp filed Critical Fujifilm Corp
Priority to JP2001147181A priority Critical patent/JP4150171B2/en
Publication of JP2002344731A publication Critical patent/JP2002344731A/en
Application granted granted Critical
Publication of JP4150171B2 publication Critical patent/JP4150171B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/40Scaling of whole images or parts thereof, e.g. expanding or contracting
    • G06T3/4007Scaling of whole images or parts thereof, e.g. expanding or contracting based on interpolation, e.g. bilinear interpolation

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Image Processing (AREA)
  • Editing Of Facsimile Originals (AREA)
  • Controls And Circuits For Display Device (AREA)

Description

【0001】
【技術分野】
この発明は、与えられる入力画像データによって表される入力画像を拡大して出力エリア(プリント用紙のエリア、表示画面のエリア等)上に表現される出力画像を生成する画像生成装置および方法に関する。
【0002】
【発明の背景】
画像をプリントしたり、表示するときには、入力した画像をリサイズしてプリント・エリア、表示エリアなどの出力エリアにあうように出力画像を生成する。入力画像の大きさおよびアスペクトは一定ではなく、出力画像の大きさおよびアスペクトも一定ではない。入力画像のアスペクトと出力画像のアスペクトとが同じでないと、出力するプリント用紙内に出力画像全体が収まる出力画像をプリント用紙に内接してプリントすると、プリント用紙に余白ができてしまう。逆に出力画像内にプリント用紙全体が収まるようにプリント用紙に外接してプリントすると、プリント用紙からはみ出た出力画像の部分が切り取られてしまう(図9参照)。
【0003】
外接プリントをする場合、出力画像がプリント用紙すべてにぴったりとプリントするように、入力画像をリサイズしても実際にはプリント用紙に余白ができることがある。このようなことは、プリント用紙にプリントする場合に限らす、表示装置の表示画面に表示する場合にも同じである。
【0004】
【発明の開示】
この発明は、外接プリント、外接表示等する場合に余白が生じるのを未然に防止することを目的とする。
【0005】
第1の発明による画像生成装置は、与えられる入力画像データによって表される入力画像を拡大して出力エリア上に表現される出力画像を生成する画像生成装置において、画素補間により上記入力画像の水平方向の画素数を上記出力エリアの水平方向の長さに相当する画素数以上にする一の水平補間率であって、かつあらかじめ定められた使用可能な適正水平補間率のうち、最小水平補間率を算出する水平補間率算出手段、画素補間により上記入力画像の垂直方向の画素数を上記出力エリアの垂直方向の長さに相当する画素数以上にする一の垂直補間率であって、あらかじめ定められた使用可能な適正垂直補間率のうち、最小垂直補間率を算出する垂直補間率算出手段、および上記水平補間率算出手段により算出された最小水平補間率と上記垂直補間率算出手段により算出された垂直補間率とのうち大きい方の補間率を用いて、上記入力画像データを補間して上記出力画像を表す出力画像データを出力する第1の補間手段を備えていることを特徴とする。
【0006】
第1の発明は、上記画像生成装置に適した方法も提供している。すなわち、この方法は、与えられる入力画像データによって表される入力画像を拡大して出力エリアに表現される出力画像を生成する画像生成装置において、画素補間により上記入力画像の水平方向の画素数を上記出力エリアの水平方向の長さに相当する画素数以上にする一の水平補間率であって、かつあらかじめ定められた使用可能な適正水平補間率のうち、最小水平補間率を算出し、画素補間により上記入力画像の垂直方向の画素数を上記出力エリアの垂直方向の長さに相当する画素数以上にする一の垂直補間率であって、あらかじめ定められた使用可能な適正垂直補間率のうち、最小垂直補間率を算出し、算出された最小水平補間率と垂直補間率とのうち大きい方の補間率を用いて、上記入力画像データを補間して上記出力画像を表す出力画像データを出力するものである。
【0007】
第1の発明によると、画素補間により入力画像の水平方向の画素数を出力画像の水平方向の画素数以上にする一の水平補間率であってあらかじめ定められた使用可能な適正水平補間率(一の水平補間率であってもディジタル化の制限から使用できない補間率がある)のうち、最小水平補間率が算出される。同様に、画素補間により入力画像の垂直方向の画素数を出力画像の垂直方向の画素数以上にする一の垂直補間率であって、あらかじめ定められた使用可能な適正垂直補間率のうち最小垂直補間率がそれぞれ算出される。
【0008】
算出された最小水平補間率と最小垂直補間率とが比較され、大きい方の補間率を用いて入力画像データが補間処理され、出力画像データが生成される。
【0009】
最小水平補間率と最小垂直補間率とのうち、大きい方の補間率を用いて入力画像データが補間されるので、生成された出力画像データによって表される出力画像は、プリント用紙のプリント・エリア、表示画面の表示エリア等の出力エリア以上の大きさとなる。出力画像がプリントされる用紙、表示画面等の出力エリア水平方向または垂直方向に余白ができてしまうことを未然に防止できる。
【0010】
上記一の水平補間率と、上記一の垂直補間率とを比較する比較手段、上記比較手段における上記一の水平補間率と上記一の垂直補間率との差が所定値未満かどうかを判定する判定手段、上記判定手段により所定値未満と判定されたことにより、水平補間率算出処理、垂直補間率算出処理および補間処理を行うように、上記水平補間率算出手段、上記垂直補間率算出手段および上記第1の補間手段を制御する制御手段、ならびに上記判定手段により所定値以上と判定されたことにより、上記比較手段の比較結果に応じて、上記最小水平補間率または上記最小垂直補間率のいずれかの補間率を用いて、上記入力画像データを補間して上記出力画像を表す出力画像データを出力する第2の補間手段をさらに備えてもよい。
【0011】
上記判定手段により所定値以上と判定された場合には、上記比較手段の比較結果に応じて、上記最小水平補間率または上記最小垂直補間率のいずれかの補間率を用いて、上記入力画像データを補間して上記出力画像を表す出力画像データが生成される。上記最小水平補間率または上記最小垂直補間率のいずれか一方を算出すれば、上記出力画像データを生成できるようになる。
【0012】
最小水平補間率および最小垂直補間率の両方の補間率を算出する計算量は比較的負担が大きいが、最小水平補間率または最小垂直補間率のいずれか一方を算出すれば済むので、計算量の負担を抑えることができる。
【0013】
第2の発明は、与えられる入力画像データによって表される入力画像を拡大して出力エリア上に表現される出力画像を生成する画像生成装置において、画素補間により上記入力画像の水平方向の水平入力画素数を上記出力エリアの水平方向の長さに相当する水平出力画素数以上にする一の水平補間率と、上記入力画像の垂直方向の垂直入力画素数を上記出力エリアの垂直方向の長さに相当する垂直出力画素数以上にする一の垂直補間率とを比較する比較手段、上記比較手段における比較結果に応じて、上記一の垂直補間率または上記一の水平補間率であって、かつあらかじめ定められている使用可能な第1の適正垂直補間率または第1の適正水平補間率のいずれかの補間率を用いて上記水平入力画素または上記垂直入力画素を補間して得られる画素数が上記水平出力画素数または上記垂直出力画素数以上となるかどうかを判定する第1の判定手段、上記第1の判定手段により上記水平出力画素数または上記垂直出力画素数以上となると判定されたことにより、上記第1の適正垂直補間率のうちの第1の最小垂直補間率または上記第1の適正水平補間率のうちの第1の最小水平補間率を用いて上記入力画像データを補間する第1の補間手段、および上記第1の判定手段により上記水平出力画素数未満と判定されたことにより、上記一の水平補間率であって、かつあらかじめ定められている使用可能な第2の適正水平補間率のうちの第2の最小水平補間率を用いて上記入力画像データを補間し、または上記第1の判定手段により上記垂直出力画素数未満と判定されたことにより、上記一の垂直補間率であって、あらかじめ定められている使用可能な第2の垂直補間率のうちの第2の垂直補間率を用いて上記入力画像データを補間する第2の補間手段を備えていることを特徴とする。
【0014】
第2の発明は、上記画像生成装置に適した方法も提供している。すなわち、この方法は、与えられる入力画像データによって表される入力画像を拡大して出力エリア上に表現される出力画像を生成する画像生成装置において、画素補間により上記入力画像の水平方向の水平入力画素数を上記出力画像の水平方向の長さに相当する水平出力画素数以上にする一の水平補間率と、上記入力画像の垂直方向の垂直入力画素数を上記出力エリアの垂直方向の長さに相当する垂直方向画素数以上にする一の垂直補間率とを比較し、比較結果に応じて、上記一の垂直補間率または上記一の水平補間率であって、かつあらかじめ定められている使用可能な第1の適正垂直補間率または第1の適正水平補間率のいずれかの補間率を用いて上記水平入力画素または上記垂直入力画素を補間して得られる画素数が上記水平出力画素数または上記垂直出力画素数以上となるかどうかを判定し、上記水平出力画素数または上記垂直出力画素数以上となると判定されたことにより、上記第1の適正垂直補間率のうちの最小垂直補間率または上記第1の適正水平補間率のうちの最小水平補間率を用いて上記入力画像データを補間し、上記水平出力画素数未満と判定されたことにより、上記一の水平補間率であって、かつあらかじめ定められている使用可能な第2の適正水平補間率のうちの第2の最小水平補間率を用いて上記入力画像データを補間し、または上記垂直出力画素数未満と判定されたことにより、上記一の垂直補間率であって、あらかじめ定められている使用可能な第2の垂直補間率のうちの第2の最小垂直補間率を用いて上記入力画像データを補間することを特徴とする。
【0015】
第2の発明によると、上記一の水平補間率と上記一の垂直補間率とが比較される。比較結果に応じて、上記第1の適正垂直補間率または上記第1の適正水平補間率のいずれかの補間率を用いて上記水平入力画素または上記垂直入力画素を補間して得られる画素数が上記水平出力画素数または上記垂直出力画素数以上となるかどうかが判定される。
【0016】
上記水平出力画素数または上記垂直出力画素数以上となる場合には、上記第1の最小垂直補間率または上記第1の最小補間率を用いて上記入力画像データが補間される。上記水平出力画素数または上記垂直出力画素数未満となる場合には、上記第2の最小水平補間率または上記第2の最小垂直補間率を用いて入力画像データが補間される。
【0017】
このように、上記第1の最小垂直補間率もしくは上記第1の最小補間率または上記第2の最小水平補間率もしくは上記第2の最小垂直補間率を用いて入力画像データが補間される。補間により生成された出力画像データによって表される出力画像は、プリント用紙のプリント・エリア、表示画面の表示エリア等の出力エリア以上の大きさとなる。出力画像がプリントされる用紙、表示画面等の出力エリアの水平方向または垂直方向に余白ができてしまうことを未然に防止できる。
【0018】
上記一の水平補間率と上記一の垂直補間率との差が所定値以上かどうかを判定する第2の判定手段、上記第2の判定手段により所定値以上と判定されたことにより、上記比較手段における比較結果に応じて、上記第1の最小水平補間率を用いて上記入力画像データを補間して上記出力画像を表す上記出力画像データを出力し、または上記第2の最小垂直補間率を用いて上記入力画像データを補間して上記出力画像データを出力する第3の補間手段、および上記第2の判定手段により所定値未満と判定されたことにより、比較処理、判定処理および補間処理を行うように、上記比較手段、上記第1の判定手段および上記第1の補間手段または上記第2の補間手段を制御する制御手段をさらに備えてもよい。
【0019】
この場合も、必ずしも最小水平補間率および最小垂直補間率の両方の補間率を算出する必要がないので、計算量の負担が比較的少なくて済む。
【0020】
【実施例の説明】
図1は、この発明の実施例を示すもので、画像再生(生成)装置の電気的構成を示すブロック図である。この画像再生装置は、メモリ・カード1に記録されている画像データによって表される入力画像をプリントするときに、プリント用紙に余白ができないように入力画像を構成する画素を補間するものである。また同様に、入力画像を表示装置9の表示画面に表示するときにも、表示画面に余白ができないように入力画像を構成する画素を補間するものである。
【0021】
メモリ・カード1に記録されている画像データがカード・インターフェイス2を介してコンピュータ3に入力する。コンピュータ3において、入力画像が補間され、入力画像の大きさおよびアスペクトが調整される。コンピュータ3における補間処理について詳しくは後述する。またガンマ補正など画像データについての所定の信号処理がコンピュータ3において行われる。コンピュータ3から出力される画像データが、出力画像を表す出力画像データとしてメモリ7に一時的に記憶される。
【0022】
プリンタ4におけるプリント用紙の排出等を行う駆動回路5は、コンピュータ3によって制御される。プリンタ4においてプリントする場合には、メモリ7に一時的に記憶されている出力画像データがプリンタ・ヘッド6に与えられる。プリンタ・ヘッド7により、出力画像データによって表される出力画像がプリント用紙にプリントされる。
【0023】
表示装置9の表示画面に出力画像を表示する場合には、メモリ7から読み出された出力画像データはビデオ回路8に与えられる。ビデオ回路8において、出力画像データからビデオ信号に変換される。変換されたビデオ信号が表示装置9に与えられることにより、出力画像が表示装置9の表示画面上に表示される。
【0024】
プリント用紙のアスペクトまたは大きさと、表示装置9の表示画面のアスペクトおよび大きさとが一致していないときには(通常は、一致していないであろう)、プリントに適した補間処理と表示に適した補間処理とがコンピュータ3においてそれぞれ行われることとなろう。
【0025】
図2は、いわゆるバイリニア方式による画素補間処理を示している。図2においては、便宜的に水平方向の画素のみを表しているが、垂直方向にも同様に補間処理が行われるのはいうまでもない。
【0026】
バイリニア方式による画素補間処理は、入力画像を構成する入力画素の間隔を、分数で表される補間率(倍率)で掛け、得られた値を出力画素の位置とするものである。
【0027】
補間率を1024/768(=4/3)とし、5つの入力画素(もちろん、実際にはもっと多数の画素が存在する)Pi11からPi15がそれぞれ2048の間隔で配置されているものとする。また、入力画素Pi11からPi15を画素補間することにより得られた出力画素をPo11からPo16とする。また、先頭の入力画素Pi11から先頭の出力画素Po11の位置ずれ量AをA=256とする。
【0028】
上述のように、バイリニア方式による画素補間処理は、出力画素を挟む2つの入力画素からの距離の比率を掛けて得られた値を出力画素の位置とするものである。たとえば、出力画素Po11の位置は次のように算出される。入力画素の間隔2048であると、第1の出力画素Po11から第1の入力画素Pi11までの距離の入力画素の間隔に対する比率は、256/2048となる。また、出力画素Po11から第2の入力画素Pi12までの距離の入力画素の間隔に対する比率は、1792(=1536+256)/2048となる。したがって、出力画素Po11の位置は、式1から求められる。
【0029】
Po11=(1792×Pi11+256×Pi12)/2048・・・式1
【0030】
同様にして、出力画素Po12からPo16の位置は、式2から式6により算出されることは容易に理解されよう。
【0031】
Po12=(256×Pi11+1792×Pi12)/2048・・・式2
Po13=(768×Pi12+1280×Pi13)/2048・・・式3
Po14=(1280×Pi13+768×Pi13)/2048・・・式4
Po15=(1792×Pi14+256×Pi15)/2048・・・式5
Po16=(256×Pi14+1792×Pi15)/2048・・・式6
【0032】
また、入力画素数をPin、出力画素数をPonとすると、式7により出力画素数を算出することができる。ただし、Boは、補間率の分母であり、この場合768となる。
【0033】

Figure 0004150171
【0034】
入力画素数が5個の場合であって、補間率が1024/768であると、出力画素数は6個となる。
【0035】
式7は、画素間隔を考慮して、画素の与える長さから画素数を算出することを示している。すなわち、入力画素Pi11〜Pi15が作る長さは、4×2048である。この4×2048の長さの中に1536の間隔をもつ出力画素が何個入るかを算出している。出力画素の位置ずれ量A=256としたので、4×2048−256の長さから1536の間隔を持つ出力画素が何個入るかを算出することとなる。図2に示す場合、5個となるが、最後の画素も出力できるので、出力画素の間隔数よりも1個多くなり、6個となる。
【0036】
このようなバイリニア方式による画素補間処理を用いて、従来のリサイズ処理は次のようにして行っている。入力画像のアスペクト(水平方向画素数/垂直方向画素数とする)と出力エリアのアスペクトとを比較する。入力画像のアスペクトよりも出力エリアのアスペクトの方が大きい場合には、入力画像の水平画素数から出力画像の水平画素数以上の画素数を得られる補間率のうち最小の補間率を用いて入力画像をリサイズする。逆に入力画像のアスペクトよりも出力エリアのアスペクトの方が小さい場合には、入力画像の垂直画素数から出力エリアの垂直画素数以上の画素数を得られる補間率のうち最小の補間率を用いて入力画像をリサイズする。
【0037】
図3に示すように入力画像の水平方向の画素数をHin=384画素、入力画像の垂直方向の画素数をVin=259画素、図4に示すように出力エリアの水平方向の画素数をHout=608画素、出力エリアの垂直方向の画素数をVout=410画素とする。この場合、入力画像のアスペクトAsin=Hin/Vin=384/259=1.4826、出力エリアのアスペクトAsout=Hout/Vout=608/410=1.4829であるから、出力エリアのアスペクトの方が入力画像のアスペクトよりも大きい。したがって、入力画像の水平画素数から出力エリアの水平画素数以上の画素数を得られる補間率のうち最小の補間率を用いて入力画像をリサイズして、出力画像を得る。
【0038】
式7を参照して、最大のBo(最小の補間率)は、646となる。このBoを用いて出力画像の水平方向の画素数を算出すると、(384−1)×1024/646−1=608となる。出力画像の垂直方向の画素数を算出すると、(259−1)×1024/646−1=409となる。出力画像の垂直方向の画素数によって表される長さでは出力エリアの垂直方向の長さよりも短くなってしまう。このためにプリントしたときには、垂直方向に余白ができてしまう。
【0039】
この実施例においては、次に示すようにして補間率が決定され、余白が生じないように出力画像の表示が行われる。
【0040】
図5は、表示処理手順を示すフローチャートである。
【0041】
まず、入力画像の水平方向画素数Hinおよび垂直方向画素数Vinが入力画像データの付随データからそれぞれ取得される(または算出される)(ステップ11)。
【0042】
つづいて、入力画像の水平方向画素数Hinに補間率を乗じることにより出力エリアの水平方向画素数Hout以上となる補間率のうち、使用可能な(上述したBoが整数となるような)第1の最小補間率m1が算出される(ステップ12)。また、入力画像の垂直方向画素数Vinに補間率を乗じることにより出力エリアの垂直方向画素数Vout以上となる補間率のうち、使用可能な第2の最小補間率m2も算出される(ステップ13)。
【0043】
算出された第1の最小補間率m1と第2の最小補間率m2とが比較され、大きい方の補間率が入力画像から出力画像を生成するのに用いられる補間率として設定される(ステップ14)。大きい方の補間率を用いているため、出力画像は、出力エリアを包含することとなる。表示画面上(出力エリア)に余白ができるのを未然に防止できる。
【0044】
設定補間率を用いて入力画像データが補間され、出力画像を表す出力画像データが生成される。生成された出力画像データは、上述したようにメモリ7に一時的に格納される(ステップ15)。出力画像データがメモリ7から読み出され、上述したように、ビデオ回路8を介して表示装置9に与えられることにより、表示装置9の表示画面一杯にわたって余白ができることなく、出力画像が表示されることとなる(ステップ16)。
【0045】
上述したように、入力画像の水平方向の画素数Hin=384画素、入力画像の垂直方向の画素数Vin=259画素、出力エリアの水平方向の画素数Hout=608画素、出力エリアの垂直方向の画素数Vout=410画素とすると、式7から第1の最小補間率m1=1024/645、第2の最小補間率m2=1024/646となる。第2の最小補間率m2よりも第1の最小補間率m1の方が大きいので、第1の最小補間率m1=1024/645が設定補間率とされる。
【0046】
出力画像の水平方向の画素数は、{(384−1)×1024/645)+1=609、垂直方向の画素数は、{(259−1)×1024/645)+1=410となる。水平方向および垂直方向とも出力エリアの長さ以上の長さを与える画素数となる。余白ができてしまうのを未然に防止できるようになる。
【0047】
図6は、他の処理手順を示すフローチャートである。
【0048】
上述したのと同様に、入力画像の水平方向の画素数Hinと垂直方向の画素数Vinとが取得される(ステップ21)。また、垂直方向における入力画像と出力エリアとの垂直方向拡大率Vout/Vinと、水平方向における入力画像と出力エリアとの水平方向拡大率Hout/Hinとがそれぞれ算出される(ステップ22)。
【0049】
垂直方向拡大率Vout/Vinが水平方向拡大率Hout/Hinよりも大きければ(ステップ23でYES)、入力画像の水平方向画素数Hinに補間率を乗じることにより出力エリアの水平方向画素数Hout以上となる補間率のうち、使用可能な(上述したBoが整数となるような)第1の最小補間率m11が算出される(ステップ24)。
【0050】
算出された第1の最小補間率m11を用いて入力垂直画素数Vinを補間した場合の垂直画素数が算出される(ステップ25)。補間された垂直画素数が出力エリアの垂直画素数Vout以上であれば(ステップ26でYES)、第1の最小補間率m11を用いて入力画像データを補間して得られる出力画像は水平方向および垂直方向のいずれとも出力エリア以上となり、余白ができない。このために、第1の最小補間率m11が設定補間率とされる(ステップ28)。
【0051】
補間された垂直画素数が出力エリアの垂直画素数Vout未満であれば(ステップ26でNO)、第1の最小補補間率m11を用いて入力画像データを補間すると、補間された出力画像データによって表される出力画像は垂直方向において出力エリア未満となる。このために、入力画像の垂直方向画素数Hinに補間率を乗じることにより出力エリアの垂直方向画素数Vout以上となる補間率のうち、使用可能な第2の最小補間率m12が算出される(ステップ27)。第2の最小補間率m12を用いて入力画像データを補間して得られる出力画像は水平方向および垂直方向のいずれとも出力エリア以上となり、余白ができない。第2の最小補間率m12が設定補間率とされる(ステップ35)。
【0052】
垂直方向拡大率Vout/Vinが水平方向拡大率Hout/Hinよりも小さければ(ステップ23でNO)、入力画像の垂直方向画素数Vinに補間率を乗じることにより出力エリアの垂直方向画素数Vout以上となる補間率のうち、使用可能な第2の最小補間率m12が算出される(ステップ31)。
【0053】
算出された第2の最小補間率m12を用いて入力水平画素数Hinを補間した場合の水平画素数が算出される(ステップ32)。補間された水平画素数が出力エリアの水平画素数Hout以上であれば(ステップ33でYES)、第2の最小補間率m12を用いて入力画像データを補間して得られる出力画像は水平方向および垂直方向のいずれとも出力エリア以上となり、余白ができない。このために、第2の最小補間率m12が設定補間率とされる(ステップ35)。
【0054】
補間された水平画素数が出力エリアの水平画素数Hout未満であれば(ステップ33でNO)、第2の最小補補間率m12を用いて入力画像データを補間すると、補間された出力画像データによって表される出力画像は水平方向において出力エリア未満となる。このために、入力画像の水平方向画素数Hinに補間率を乗じることにより出力エリアの水平方向画素数Hout以上となる補間率のうち、使用可能な第1の最小補間率m11が算出される(ステップ34)。第1の最小補間率m11を用いて入力画像データを補間して得られる出力画像は水平方向および垂直方向のいずれとも出力エリア以上となり、余白ができない。第1の最小補間率m11が設定補間率とされる(ステップ28)。
【0055】
このようにして得られた設定補間率を用いて入力画像データが補間され、出力画像データが生成される。生成された出力画像データがメモリ7に格納される(ステップ29)。メモリ7から出力画像データが読み出され、ビデオ回路8を介して表示装置9に与えられることにより、表示装置9の表示画面上に出力画像が表示される(ステップ30)。
【0056】
上述したように、入力画像の水平方向の画素数Hin=384画素、入力画像の垂直方向の画素数Vin=259画素、出力エリアの水平方向の画素数Hout=608画素、出力エリアの垂直方向の画素数Vout=410画素とすると、垂直方向の拡大率Vout/Vin=1.5830,水平方向の拡大率Hout/Hin=1.5833となる。水平方向の拡大率のほうが垂直方向の拡大率よりも大きいので、入力画像の水平方向の画素数から出力画像の水平方向以上の画素数以上の画素数が得られる補間率m11は、m11=1024/646となる。
【0057】
この補間率m11を用いて出力画像の垂直方向の画素数を算出すると、式7から409画素となる。出力エリアの垂直方向の画素数未満となってしまうので、入力画像の垂直方向の画素数Vinから出力エリアの垂直方向の画素数Vout以上となる補間率のうち、最小の補間率が算出される。この場合には、補間率1024/645となり、設定補間率とされる。
【0058】
図8は、さらに他の処理手順を示すフローチャートである。
【0059】
上述したのと同様に、入力画像の水平方向の画素数Hinと垂直方向の画素数Vinとが取得される(ステップ41)。また、垂直方向における入力画像と出力エリアとの垂直方向拡大率Vout/Vinと、水平方向における入力画像と出力エリアとの水平方向拡大率Hout/Hinとがそれぞれ算出される(ステップ42)。
【0060】
つづいて、垂直方向拡大率Vout/Vinと水平方向拡大率Hout/Hinとの差分の絶対値が算出される(ステップ43)。差分の絶対値が所定値(たとえば0.05)より大きいと、垂直方向拡大率Vout/Vinが水平方向拡大率Hout/Hinよりも大きいかどうかが判定される(ステップ44)。
【0061】
垂直方向拡大率Vout/Vinが水平方向拡大率Hout/Hinよりも大きければ(ステップ44でYES)、入力画像の水平方向画素数Hinに補間率を乗じることにより出力エリアの水平方向画素数Hout以上となる補間率のうち、使用可能な第1の最小補間率m11が算出され、設定補間率とされる(ステップ45)。垂直方向拡大率Vout/Vinが水平方向拡大率Hout/Hinよりも小さければ(ステップ44でNO)、入力画像の垂直方向画素数Vinに補間率を乗じることにより出力エリアの垂直方向画素数Vout以上となる補間率のうち、使用可能な第2の最小補間率m12が算出され、設定補間率とされる(ステップ46)。
【0062】
設定補間率を用いて入力画像が補間され、出力画像データが生成される。生成された出力画像データがメモリ7に格納される(ステップ47)。出力画像が表示装置に表示される(ステップ48)。
【0063】
垂直方向拡大率Vout/Vinと水平方向拡大率Hout/Hinとの差分の絶対値が所定値(0.05)より小さいと(ステップ43でNO)、図6ステップ23の処理に移行する。その後、上述したように、図6ステップ23以降の処理が実施される。
【0064】
上述したように、入力画像の水平方向の画素数Hin=384画素、入力画像の垂直方向の画素数Vin=259画素、出力エリアの水平方向の画素数Hout=608画素、出力エリアの垂直方向の画素数Vout=410画素とすると、垂直方向拡大率Vout/Vinは、1.5830,水平方向拡大率Hout/Hinは、1.5833となる。差分の絶対値は、所定値(0.05)以下の0.0003であるから、図6を参照して説明したように、設定補間率は、1024/645となる。
【0065】
上述した実施例においては、垂直方向拡大率Vout/Vinと水平方向拡大率Hout/Hinとの差分の絶対値が所定値(0.05)より小さいと(ステップ43でNO)、図6ステップ23の処理に移行しているが、図5ステップ12の処理に移行するようにしてもよい。その後、図5ステップ12以降の処理が実施される。差分の絶対値は、0.0003であるから、図5を参照して説明したように、設定補間率は、1024/645となる。
【0066】
図6から図8に示す処理にしたがって設定補間率が決定されると、必ずしも2つの最小補間率を算出しなくともよいので、コンピュータ3における計算量の負担が軽くなる。また、上述した実施例は出力エリアが表示画面の場合だが、プリント用紙の場合も同様に適用できるのはいうまでもない。
【図面の簡単な説明】
【図1】画像再生装置の電気的構成を示すブロック図である。
【図2】バイリニア方式により画素が補間される様子を示している。
【図3】入力画像の水平方向の画素数、垂直方向の画素数を示している。
【図4】出力エリアの水平方向の画素数、垂直方向の画素数を示している。
【図5】出力画像生成処理手順を示すフローチャートである。
【図6】出力画像生成処理手順を示すフローチャートである。
【図7】出力画像生成処理手順を示すフローチャートである。
【図8】出力画像生成処理手順を示すフローチャートである。
【図9】入力画像と出力エリアとの関係を示している。
【符号の説明】
1 メモリ・カード
3 コンピュータ
4 プリンタ
7 メモリ
9 表示装置
Pi11〜Pi15 入力画素
Po11〜Po16 出力画素[0001]
【Technical field】
The present invention relates to an image generation apparatus and method for generating an output image expressed on an output area (print paper area, display screen area, etc.) by enlarging an input image represented by given input image data.
[0002]
BACKGROUND OF THE INVENTION
When printing or displaying an image, the input image is resized and an output image is generated so as to match an output area such as a print area or a display area. The size and aspect of the input image are not constant, and the size and aspect of the output image are not constant. If the aspect of the input image and the aspect of the output image are not the same, if the output image in which the entire output image fits within the print paper to be output is printed inscribed on the print paper, a margin will be formed on the print paper. Conversely, when printing is performed circumscribing the print sheet so that the entire print sheet fits within the output image, the portion of the output image that protrudes from the print sheet is cut off (see FIG. 9).
[0003]
In the case of circumscribed printing, a margin may actually be formed on the print paper even if the input image is resized so that the output image is printed exactly on all the print paper. This is the same when displaying on a display screen of a display device, not only when printing on printing paper.
[0004]
DISCLOSURE OF THE INVENTION
An object of the present invention is to prevent a margin from being generated in the case of circumscribed printing, circumscribed display, or the like.
[0005]
An image generation apparatus according to a first aspect of the present invention is an image generation apparatus that generates an output image expressed on an output area by enlarging an input image represented by given input image data. The horizontal interpolation rate is one horizontal interpolation rate that makes the number of pixels in the direction equal to or greater than the number of pixels corresponding to the horizontal length of the output area, and the minimum horizontal interpolation rate out of the predetermined appropriate horizontal interpolation rates that can be used A horizontal interpolation rate calculating means for calculating a vertical interpolation rate that makes the number of pixels in the vertical direction of the input image equal to or greater than the number of pixels corresponding to the vertical length of the output area by pixel interpolation, Among the appropriate vertical interpolation rates that can be used, the vertical interpolation rate calculating means for calculating the minimum vertical interpolation rate, the minimum horizontal interpolation rate calculated by the horizontal interpolation rate calculating means, and the above First interpolation means for interpolating the input image data and outputting output image data representing the output image by using the larger one of the vertical interpolation ratios calculated by the direct interpolation rate calculating means is provided. It is characterized by.
[0006]
The first invention also provides a method suitable for the image generating apparatus. That is, this method enlarges the input image represented by the given input image data and generates an output image represented in the output area, and the number of pixels in the horizontal direction of the input image is determined by pixel interpolation. One horizontal interpolation rate that is equal to or greater than the number of pixels corresponding to the horizontal length of the output area, and a minimum horizontal interpolation rate is calculated from the predetermined appropriate horizontal interpolation rates that can be used. A vertical interpolation rate that makes the number of pixels in the vertical direction of the input image equal to or greater than the number of pixels corresponding to the vertical length of the output area by interpolation, and has a predetermined appropriate vertical interpolation rate that can be used. Among them, the minimum vertical interpolation rate is calculated, and the input image data is interpolated using the larger one of the calculated minimum horizontal interpolation rate and vertical interpolation rate to represent the output image. And it outputs a force image data.
[0007]
According to the first aspect of the present invention, the horizontal interpolation rate is one horizontal interpolation rate that makes the number of pixels in the horizontal direction of the input image equal to or greater than the number of pixels in the horizontal direction of the output image by pixel interpolation. The minimum horizontal interpolation rate is calculated out of some interpolation rates that cannot be used due to the limitation of digitization even with one horizontal interpolation rate. Similarly, a vertical interpolation rate that makes the number of pixels in the vertical direction of the input image equal to or greater than the number of pixels in the vertical direction of the output image by pixel interpolation, and is the minimum appropriate vertical interpolation rate that can be used in advance. Each interpolation rate is calculated.
[0008]
The calculated minimum horizontal interpolation rate and minimum vertical interpolation rate are compared, input image data is interpolated using the larger interpolation rate, and output image data is generated.
[0009]
Since the input image data is interpolated using the larger one of the minimum horizontal interpolation rate and the minimum vertical interpolation rate, the output image represented by the generated output image data is the print area of the print paper. The size is larger than the output area such as the display area of the display screen. It is possible to prevent a margin from being generated in the horizontal direction or the vertical direction of an output area such as a sheet on which an output image is printed and a display screen.
[0010]
Comparing means for comparing the one horizontal interpolation rate with the one vertical interpolation rate, and determining whether a difference between the one horizontal interpolation rate and the one vertical interpolation rate in the comparing means is less than a predetermined value. The horizontal interpolation rate calculation unit, the vertical interpolation rate calculation unit, and the horizontal interpolation rate calculation processing, the vertical interpolation rate calculation processing, and the interpolation processing performed by the determination unit and the determination unit that are determined to be less than the predetermined value, Either the minimum horizontal interpolation rate or the minimum vertical interpolation rate is determined by the control means for controlling the first interpolation means, and by the determination means being determined to be greater than or equal to a predetermined value, depending on the comparison result of the comparison means. Second interpolation means for interpolating the input image data and outputting output image data representing the output image using the interpolation rate may be further provided.
[0011]
When the determination means determines that the input image data is equal to or greater than a predetermined value, the input image data is calculated using either the minimum horizontal interpolation ratio or the minimum vertical interpolation ratio according to the comparison result of the comparison means. Are interpolated to generate output image data representing the output image. By calculating either the minimum horizontal interpolation rate or the minimum vertical interpolation rate, the output image data can be generated.
[0012]
The amount of calculation for calculating both the minimum horizontal interpolation rate and the minimum vertical interpolation rate is relatively heavy, but it is sufficient to calculate either the minimum horizontal interpolation rate or the minimum vertical interpolation rate. The burden can be reduced.
[0013]
According to a second aspect of the present invention, there is provided an image generation apparatus for generating an output image expressed on an output area by enlarging an input image represented by given input image data. One horizontal interpolation rate that makes the number of pixels equal to or greater than the number of horizontal output pixels corresponding to the horizontal length of the output area, and the vertical input pixel number of the input image in the vertical direction of the output area Comparing means for comparing one vertical interpolation rate equal to or more than the number of vertical output pixels corresponding to the above, depending on the comparison result in the comparing means, the one vertical interpolation rate or the one horizontal interpolation rate, and It is obtained by interpolating the horizontal input pixel or the vertical input pixel using either a predetermined first appropriate vertical interpolation rate or first appropriate horizontal interpolation rate that can be used. First determination means for determining whether the number of pixels is equal to or greater than the number of horizontal output pixels or the number of vertical output pixels, and the first determination means determines that the number of horizontal output pixels or the number of vertical output pixels is equal to or greater than As a result, the input image data is converted using the first minimum vertical interpolation rate of the first appropriate vertical interpolation rates or the first minimum horizontal interpolation rate of the first appropriate horizontal interpolation rates. Since the first interpolation means for interpolating and the first determination means determine that the number of pixels is less than the horizontal output pixel number, the second horizontal interpolation rate and a predetermined second usable can be used. The input image data is interpolated using the second minimum horizontal interpolation rate of the appropriate horizontal interpolation rate, or the number of vertical output pixels is determined to be less than the number of vertical output pixels by the first determination unit. A second interpolation means for interpolating the input image data by using a second vertical interpolation rate out of predetermined second usable vertical interpolation rates, which is a vertical interpolation rate; It is characterized by.
[0014]
The second invention also provides a method suitable for the image generating apparatus. That is, in this method, in an image generation apparatus that generates an output image expressed on an output area by enlarging an input image represented by given input image data, horizontal input of the input image is performed by pixel interpolation. One horizontal interpolation ratio that makes the number of pixels equal to or greater than the number of horizontal output pixels corresponding to the horizontal length of the output image, and the vertical input pixel number of the input image in the vertical direction of the output area Is compared with one vertical interpolation rate equal to or more than the number of vertical pixels corresponding to the above, and according to the comparison result, the one vertical interpolation rate or the one horizontal interpolation rate, and a predetermined use The number of pixels obtained by interpolating the horizontal input pixel or the vertical input pixel using an interpolation rate of either the first appropriate vertical interpolation rate or the first appropriate horizontal interpolation rate is the horizontal output image. Or the number of vertical output pixels is greater than or equal to the number of horizontal output pixels or the number of vertical output pixels. When the input image data is interpolated using the minimum horizontal interpolation rate of the first appropriate horizontal interpolation rate or the first horizontal interpolation rate is determined to be less than the number of horizontal output pixels, the one horizontal interpolation rate is In addition, the input image data is interpolated using a second minimum horizontal interpolation rate out of second predetermined appropriate appropriate horizontal interpolation rates, or determined to be less than the number of vertical output pixels. The input image data is interpolated using the second minimum vertical interpolation rate of the second vertical interpolation rates that can be used in advance, which is the one vertical interpolation rate. To.
[0015]
According to the second invention, the one horizontal interpolation rate and the one vertical interpolation rate are compared. Depending on the comparison result, the number of pixels obtained by interpolating the horizontal input pixel or the vertical input pixel using an interpolation rate of either the first appropriate vertical interpolation rate or the first appropriate horizontal interpolation rate is It is determined whether or not the horizontal output pixel number or the vertical output pixel number is exceeded.
[0016]
When the number of horizontal output pixels or the number of vertical output pixels is greater than or equal to, the input image data is interpolated using the first minimum vertical interpolation rate or the first minimum interpolation rate. When the number of horizontal output pixels is less than the number of vertical output pixels, the input image data is interpolated using the second minimum horizontal interpolation rate or the second minimum vertical interpolation rate.
[0017]
In this way, the input image data is interpolated using the first minimum vertical interpolation rate, the first minimum interpolation rate, the second minimum horizontal interpolation rate, or the second minimum vertical interpolation rate. The output image represented by the output image data generated by the interpolation is larger than the output area such as the print area of the print paper and the display area of the display screen. It is possible to prevent a margin from being generated in the horizontal direction or the vertical direction of an output area such as a sheet on which an output image is printed or a display screen.
[0018]
The second determination means for determining whether or not the difference between the one horizontal interpolation rate and the one vertical interpolation rate is equal to or greater than a predetermined value. The second determination means determines that the difference is equal to or greater than a predetermined value. Depending on the comparison result in the means, the input image data is interpolated using the first minimum horizontal interpolation rate to output the output image data representing the output image, or the second minimum vertical interpolation rate is set. A third interpolation unit that interpolates the input image data and outputs the output image data, and the second determination unit determines that the input image data is less than a predetermined value, thereby performing comparison processing, determination processing, and interpolation processing. As described above, the control unit may further include a control unit that controls the comparison unit, the first determination unit, and the first interpolation unit or the second interpolation unit.
[0019]
Also in this case, since it is not always necessary to calculate both the minimum horizontal interpolation rate and the minimum vertical interpolation rate, the burden of calculation amount is relatively small.
[0020]
[Explanation of Examples]
FIG. 1 shows an embodiment of the present invention and is a block diagram showing an electrical configuration of an image reproducing (generating) apparatus. This image reproducing apparatus interpolates pixels constituting an input image so that no margin is formed on a print sheet when an input image represented by image data recorded on the memory card 1 is printed. Similarly, when the input image is displayed on the display screen of the display device 9, the pixels constituting the input image are interpolated so that there is no blank space on the display screen.
[0021]
Image data recorded in the memory card 1 is input to the computer 3 via the card interface 2. In the computer 3, the input image is interpolated, and the size and aspect of the input image are adjusted. Details of the interpolation processing in the computer 3 will be described later. Further, predetermined signal processing for image data such as gamma correction is performed in the computer 3. Image data output from the computer 3 is temporarily stored in the memory 7 as output image data representing an output image.
[0022]
A drive circuit 5 that discharges print paper in the printer 4 is controlled by a computer 3. When printing is performed by the printer 4, output image data temporarily stored in the memory 7 is given to the printer head 6. The printer head 7 prints the output image represented by the output image data on the print paper.
[0023]
When an output image is displayed on the display screen of the display device 9, the output image data read from the memory 7 is given to the video circuit 8. In the video circuit 8, the output image data is converted into a video signal. The converted video signal is applied to the display device 9, whereby an output image is displayed on the display screen of the display device 9.
[0024]
When the aspect or size of the printing paper does not match the aspect and size of the display screen of the display device 9 (usually, it will not match), interpolation processing suitable for printing and interpolation suitable for display Processing will be performed in the computer 3 respectively.
[0025]
FIG. 2 shows pixel interpolation processing by a so-called bilinear method. In FIG. 2, only the pixels in the horizontal direction are shown for convenience, but it goes without saying that the interpolation processing is similarly performed in the vertical direction.
[0026]
In the pixel interpolation processing by the bilinear method, the interval between input pixels constituting an input image is multiplied by an interpolation rate (magnification) expressed as a fraction, and the obtained value is used as the position of the output pixel.
[0027]
It is assumed that the interpolation rate is 1024/768 (= 4/3), and five input pixels (of course there are actually more pixels) Pi11 to Pi15 are arranged at intervals of 2048, respectively. Further, the output pixels obtained by performing the pixel interpolation on the input pixels Pi11 to Pi15 are assumed to be Po11 to Po16. Further, the positional deviation amount A from the leading input pixel Pi11 to the leading output pixel Po11 is set to A = 256.
[0028]
As described above, the pixel interpolation processing by the bilinear method uses the value obtained by multiplying the ratio of the distance from two input pixels sandwiching the output pixel as the position of the output pixel. For example, the position of the output pixel Po11 is calculated as follows. When the input pixel interval is 2048, the ratio of the distance from the first output pixel Po11 to the first input pixel Pi11 to the input pixel interval is 256/2048. The ratio of the distance from the output pixel Po11 to the second input pixel Pi12 with respect to the input pixel interval is 1792 (= 1536 + 256) / 2048. Therefore, the position of the output pixel Po11 is obtained from Equation 1.
[0029]
Po11 = (1792 × Pi11 + 256 × Pi12) / 2048 Formula 1
[0030]
Similarly, it will be easily understood that the positions of the output pixels Po12 to Po16 are calculated by the equations 2 to 6.
[0031]
Po12 = (256 × Pi11 + 1799 × Pi12) / 2048 Equation 2
Po13 = (768 × Pi12 + 1280 × Pi13) / 2048 Equation 3
Po14 = (1280 × Pi13 + 768 × Pi13) / 2048 Formula 4
Po15 = (1792 × Pi14 + 256 × Pi15) / 2048 Formula 5
Po16 = (256 × P14 + 1792 × Pi15) / 2048 Equation 6
[0032]
Further, when the number of input pixels is Pin and the number of output pixels is Pon, the number of output pixels can be calculated by Expression 7. However, Bo is a denominator of the interpolation rate, and is 768 in this case.
[0033]
Figure 0004150171
[0034]
If the number of input pixels is five and the interpolation rate is 1024/768, the number of output pixels is six.
[0035]
Expression 7 indicates that the number of pixels is calculated from the length given by the pixel in consideration of the pixel interval. That is, the length created by the input pixels Pi11 to Pi15 is 4 × 2048. The number of output pixels having an interval of 1536 in the length of 4 × 2048 is calculated. Since the output pixel positional deviation amount A = 256, the number of output pixels having an interval of 1536 from the length of 4 × 2048−256 is calculated. In the case shown in FIG. 2, the number is 5, but since the last pixel can also be output, the number is one more than the number of intervals between the output pixels, which is 6.
[0036]
The conventional resizing process is performed as follows using such a bilinear pixel interpolation process. The aspect of the input image (the number of pixels in the horizontal direction / the number of pixels in the vertical direction) is compared with the aspect of the output area. If the aspect ratio of the output area is larger than the aspect ratio of the input image, input using the minimum interpolation ratio among the interpolation ratios that can obtain the number of horizontal pixels of the output image from the number of horizontal pixels of the input image. Resize the image. Conversely, if the aspect ratio of the output area is smaller than the aspect ratio of the input image, use the minimum interpolation ratio that can obtain the number of pixels equal to or greater than the number of vertical pixels in the output area from the number of vertical pixels in the input image. To resize the input image.
[0037]
As shown in FIG. 3, the number of pixels in the horizontal direction of the input image is Hin = 384 pixels, the number of pixels in the vertical direction of the input image is Vin = 259 pixels, and the number of pixels in the horizontal direction of the output area is shown in FIG. = 608 pixels, and the number of pixels in the vertical direction of the output area is Vout = 410 pixels. In this case, the aspect Asin = Hin / Vin = 384/259 = 1.4826 of the input image and the aspect Asout of the output area Asout = Hout / Vout = 608/410 = 1.4829, the aspect of the output area is more than the aspect of the input image. Is also big. Therefore, the input image is resized using the minimum interpolation rate among the interpolation rates that can obtain the number of pixels equal to or greater than the number of horizontal pixels of the output area from the number of horizontal pixels of the input image, and an output image is obtained.
[0038]
Referring to Equation 7, the maximum Bo (minimum interpolation rate) is 646. If the number of pixels in the horizontal direction of the output image is calculated using Bo, (384-1) × 1024 / 646-1 = 608. When the number of pixels in the vertical direction of the output image is calculated, (259-1) × 1024 / 646-1 = 409. The length represented by the number of pixels in the vertical direction of the output image is shorter than the length of the output area in the vertical direction. For this reason, when printing is performed, a margin is formed in the vertical direction.
[0039]
In this embodiment, the interpolation rate is determined as follows, and the output image is displayed so that no blank space is generated.
[0040]
FIG. 5 is a flowchart showing a display processing procedure.
[0041]
First, the horizontal pixel number Hin and the vertical pixel number Vin of the input image are respectively acquired (or calculated) from the accompanying data of the input image data (step 11).
[0042]
Next, among the interpolation rates that are equal to or greater than the horizontal pixel number Hout of the output area by multiplying the horizontal pixel number Hin of the input image by the interpolation rate, the first usable one (such that Bo described above becomes an integer) is used. Is calculated (step 12). Also, the second minimum interpolation rate m2 that can be used is calculated from among the interpolation rates that are equal to or greater than the vertical direction pixel number Vout of the output area by multiplying the vertical pixel number Vin of the input image by the interpolation rate (step 13). ).
[0043]
The calculated first minimum interpolation rate m1 and second minimum interpolation rate m2 are compared, and the larger one is set as the interpolation rate used to generate the output image from the input image (step 14). ). Since the larger interpolation rate is used, the output image includes the output area. It is possible to prevent a blank space from appearing on the display screen (output area).
[0044]
The input image data is interpolated using the set interpolation rate, and output image data representing the output image is generated. The generated output image data is temporarily stored in the memory 7 as described above (step 15). As described above, the output image data is read from the memory 7 and applied to the display device 9 via the video circuit 8, so that the output image is displayed without a blank space over the display screen of the display device 9. (Step 16).
[0045]
As described above, the number of horizontal pixels Hin = 384 pixels of the input image, the number of vertical pixels Vin = 259 pixels of the input image, the number of horizontal pixels Hout = 608 pixels of the output area, and the vertical direction of the output area Assuming that the number of pixels is Vout = 410 pixels, the first minimum interpolation rate m1 = 1024/645 and the second minimum interpolation rate m2 = 1024/646 are obtained from Equation 7. Since the first minimum interpolation rate m1 is larger than the second minimum interpolation rate m2, the first minimum interpolation rate m1 = 1024/645 is set as the set interpolation rate.
[0046]
The number of pixels in the horizontal direction of the output image is {(384-1) × 1024/645) + 1 = 609, and the number of pixels in the vertical direction is {(259-1) × 1024/645) + 1 = 410. In both the horizontal direction and the vertical direction, the number of pixels gives a length longer than the length of the output area. It becomes possible to prevent the margin from being formed.
[0047]
FIG. 6 is a flowchart showing another processing procedure.
[0048]
As described above, the horizontal pixel number Hin and the vertical pixel number Vin of the input image are acquired (step 21). Also, the vertical magnification Vout / Vin between the input image and the output area in the vertical direction and the horizontal magnification Hout / Hin between the input image and the output area in the horizontal direction are respectively calculated (step 22).
[0049]
If the vertical enlargement rate Vout / Vin is larger than the horizontal enlargement rate Hout / Hin (YES in step 23), the horizontal pixel count Hint of the output area is equal to or greater than the horizontal pixel count Hint of the output area by multiplying the horizontal pixel count Hin of the input image by the interpolation rate. The first minimum interpolation rate m11 that can be used (such that Bo described above becomes an integer) is calculated (step 24).
[0050]
The number of vertical pixels when the input vertical pixel number Vin is interpolated using the calculated first minimum interpolation rate m11 is calculated (step 25). If the number of interpolated vertical pixels is equal to or greater than the number of vertical pixels Vout in the output area (YES in step 26), the output image obtained by interpolating the input image data using the first minimum interpolation rate m11 is horizontal and Both vertical areas are larger than the output area, and there is no margin. For this purpose, the first minimum interpolation rate m11 is set as the set interpolation rate (step 28).
[0051]
If the number of interpolated vertical pixels is less than the number of vertical pixels Vout in the output area (NO in step 26), when the input image data is interpolated using the first minimum interpolation rate m11, the interpolated output image data The output image represented is less than the output area in the vertical direction. For this purpose, the second minimum interpolation rate m12 that can be used is calculated among the interpolation rates that are equal to or greater than the number Vout of vertical pixels in the output area by multiplying the number of vertical pixels Hin in the input image by the interpolation rate ( Step 27). The output image obtained by interpolating the input image data using the second minimum interpolation rate m12 is equal to or larger than the output area in both the horizontal direction and the vertical direction, and there is no blank space. The second minimum interpolation rate m12 is set as the set interpolation rate (step 35).
[0052]
If the vertical enlargement rate Vout / Vin is smaller than the horizontal enlargement rate Hout / Hin (NO in step 23), the vertical pixel number Vout of the output area is equal to or greater by multiplying the vertical pixel number Vin of the input image by the interpolation rate. The second minimum interpolation rate m12 that can be used is calculated (step 31).
[0053]
The number of horizontal pixels when the input horizontal pixel number Hin is interpolated using the calculated second minimum interpolation rate m12 is calculated (step 32). If the number of interpolated horizontal pixels is equal to or greater than the horizontal pixel number Hout of the output area (YES in step 33), the output image obtained by interpolating the input image data using the second minimum interpolation rate m12 is the horizontal direction and Both vertical areas are larger than the output area, and there is no margin. For this purpose, the second minimum interpolation rate m12 is set as the set interpolation rate (step 35).
[0054]
If the number of interpolated horizontal pixels is less than the number of horizontal pixels Hout in the output area (NO in step 33), when the input image data is interpolated using the second minimum complementary interpolation rate m12, the interpolated output image data The output image represented is less than the output area in the horizontal direction. For this purpose, the first minimum interpolation rate m11 that can be used is calculated among the interpolation rates that are equal to or greater than the horizontal pixel number Hout of the output area by multiplying the horizontal pixel number Hin of the input image by the interpolation rate ( Step 34). The output image obtained by interpolating the input image data using the first minimum interpolation rate m11 is equal to or larger than the output area in both the horizontal direction and the vertical direction, and there is no blank space. The first minimum interpolation rate m11 is set as the set interpolation rate (step 28).
[0055]
The input image data is interpolated using the set interpolation rate obtained in this way, and output image data is generated. The generated output image data is stored in the memory 7 (step 29). The output image data is read from the memory 7 and given to the display device 9 via the video circuit 8, whereby the output image is displayed on the display screen of the display device 9 (step 30).
[0056]
As described above, the number of horizontal pixels Hin = 384 pixels of the input image, the number of vertical pixels Vin = 259 pixels of the input image, the number of horizontal pixels Hout = 608 pixels of the output area, and the vertical direction of the output area If the number of pixels is Vout = 410 pixels, the vertical enlargement ratio Vout / Vin = 1.5830 and the horizontal enlargement ratio Hout / Hin = 1.5833. Since the enlargement ratio in the horizontal direction is larger than the enlargement ratio in the vertical direction, the interpolation ratio m11 at which the number of pixels equal to or greater than the number of pixels in the horizontal direction of the output image is obtained from the number of pixels in the horizontal direction of the input image is m11 = 1024. / 646.
[0057]
When the number of pixels in the vertical direction of the output image is calculated using this interpolation rate m11, 409 pixels are obtained from Equation 7. Since the number of pixels in the vertical direction of the output area is less than the number of pixels in the vertical direction of the input image, the minimum interpolation rate is calculated from the interpolation rate that is greater than or equal to the number of pixels in the vertical direction of the output area Vout. . In this case, the interpolation rate is 1024/645, which is the set interpolation rate.
[0058]
FIG. 8 is a flowchart showing still another processing procedure.
[0059]
As described above, the horizontal pixel number Hin and the vertical pixel number Vin of the input image are acquired (step 41). Also, the vertical enlargement ratio Vout / Vin between the input image and the output area in the vertical direction and the horizontal enlargement ratio Hout / Hin between the input image and the output area in the horizontal direction are respectively calculated (step 42).
[0060]
Subsequently, the absolute value of the difference between the vertical direction enlargement ratio Vout / Vin and the horizontal direction enlargement ratio Hout / Hin is calculated (step 43). If the absolute value of the difference is larger than a predetermined value (for example, 0.05), it is determined whether or not the vertical magnification rate Vout / Vin is larger than the horizontal magnification rate Hout / Hin (step 44).
[0061]
If the vertical enlargement rate Vout / Vin is larger than the horizontal enlargement rate Hout / Hin (YES in step 44), the horizontal pixel count Hin of the output area is greater than or equal to the horizontal pixel count Hout of the output area by multiplying the horizontal pixel count Hin of the input image by the interpolation rate. The first minimum interpolation rate m11 that can be used among the interpolation rates is calculated and set as the set interpolation rate (step 45). If the vertical magnification rate Vout / Vin is smaller than the horizontal magnification rate Hout / Hin (NO in step 44), the vertical pixel number Vout of the output area is greater than or equal to the output area by multiplying the vertical pixel number Vin of the input image by the interpolation rate. The second minimum interpolation rate m12 that can be used among the interpolation rates is calculated and set as the set interpolation rate (step 46).
[0062]
The input image is interpolated using the set interpolation rate, and output image data is generated. The generated output image data is stored in the memory 7 (step 47). The output image is displayed on the display device (step 48).
[0063]
If the absolute value of the difference between the vertical direction enlargement ratio Vout / Vin and the horizontal direction enlargement ratio Hout / Hin is smaller than a predetermined value (0.05) (NO in step 43), the process proceeds to step 23 in FIG. Thereafter, as described above, the processing after step 23 in FIG. 6 is performed.
[0064]
As described above, the number of horizontal pixels Hin = 384 pixels of the input image, the number of vertical pixels Vin = 259 pixels of the input image, the number of horizontal pixels Hout = 608 pixels of the output area, and the vertical direction of the output area Assuming that the number of pixels Vout = 410 pixels, the vertical direction expansion rate Vout / Vin is 1.5830, and the horizontal direction expansion rate Hout / Hin is 1.5833. Since the absolute value of the difference is 0.0003 which is equal to or less than a predetermined value (0.05), the set interpolation rate is 1024/645 as described with reference to FIG.
[0065]
In the above-described embodiment, if the absolute value of the difference between the vertical direction enlargement ratio Vout / Vin and the horizontal direction enlargement ratio Hout / Hin is smaller than a predetermined value (0.05) (NO in step 43), the process of step 23 in FIG. However, the process may be shifted to step 12 in FIG. Thereafter, the processing from step 12 onward in FIG. 5 is performed. Since the absolute value of the difference is 0.0003, as described with reference to FIG. 5, the set interpolation rate is 1024/645.
[0066]
When the set interpolation rate is determined according to the processing shown in FIGS. 6 to 8, it is not always necessary to calculate the two minimum interpolation rates, so the burden of calculation amount in the computer 3 is reduced. In the above-described embodiment, although the output area is a display screen, it is needless to say that the present invention can be similarly applied to a print sheet.
[Brief description of the drawings]
FIG. 1 is a block diagram showing an electrical configuration of an image reproduction apparatus.
FIG. 2 shows how pixels are interpolated by a bilinear method.
FIG. 3 shows the number of pixels in the horizontal direction and the number of pixels in the vertical direction of the input image.
FIG. 4 shows the number of pixels in the horizontal direction and the number of pixels in the vertical direction of the output area.
FIG. 5 is a flowchart illustrating an output image generation processing procedure.
FIG. 6 is a flowchart illustrating an output image generation processing procedure.
FIG. 7 is a flowchart illustrating an output image generation processing procedure.
FIG. 8 is a flowchart illustrating an output image generation processing procedure.
FIG. 9 shows a relationship between an input image and an output area.
[Explanation of symbols]
1 Memory card
3 Computer
4 Printer
7 memory
9 Display device
Pi11 to Pi15 input pixels
Po11 to Po16 output pixels

Claims (3)

与えられる入力画像データによって表される入力画像を拡大して出力エリア上に表現される出力画像を生成する画像生成装置において,
画素補間により上記入力画像の水平方向の画素数である入力水平画素数を上記出力エリアの水平方向の長さに相当する画素数である出力水平画素数以上にする一の水平補間率であって,かつあらかじめ定められた使用可能な適正水平補間率のうち,最小水平補間率を算出する水平補間率算出手段,
画素補間により上記入力画像の垂直方向の画素数である入力垂直画素数を上記出力エリアの垂直方向の長さに相当する画素数である出力垂直画素数以上にする一の垂直補間率であって,あらかじめ定められた使用可能な適正垂直補間率のうち,最小垂直補間率を算出する垂直補間率算出手段,および
(上記出力垂直画素数/上記入力垂直画素数)である垂直方向拡大率が(上記出力水平画素数/上記入力水平画素数)である水平方向拡大率よりも大きく,かつ上記水平補間率算出手段により算出された最小水平補間率を用いて上記入力画像データを補間したときに得られる垂直方向画素数が上記出力垂直画素数以上の場合,または上記垂直方向拡大率が上記水平方向拡大率以下であり,かつ上記垂直補間算出手段により算出された垂直方向補間率を用いて上記入力画像データを補間したときに得られる水平方向画素数が上記出力水平画素数未満の場合に上記最小水平補間率を用いて上記入力画像データを補間して上記出力画像を表す出力画像データを出力し,上記垂直方向拡大率が上記水平方向拡大率よりも大きく,かつ上記水平補間率算出手段により算出された最小水平補間率を用いて上記入力画像データを補間したときに得られる垂直方向画素数が上記出力垂直画素数未満の場合,または上記垂直方向拡大率が上記水平方向拡大率以下であり,かつ上記垂直補間算出手段により算出された垂直方向補間率を用いて上記入力画像データを補間したときに得られる水平方向画素数が上記出力水平画素数以上の場合に上記最小垂直補間率を用いて上記入力画像データを補間して上記出力画像を表す出力画像データを出力する補間手段,
を備えた画像生成装置。
In an image generation apparatus for generating an output image expressed on an output area by enlarging an input image represented by given input image data,
A horizontal interpolation rate that makes the number of input horizontal pixels, which is the number of pixels in the horizontal direction of the input image, more than the number of output horizontal pixels, which is the number of pixels corresponding to the horizontal length of the output area, by pixel interpolation. , And a horizontal interpolation rate calculating means for calculating a minimum horizontal interpolation rate out of predetermined appropriate usable horizontal interpolation rates,
A vertical interpolation rate that makes the number of input vertical pixels, which is the number of pixels in the vertical direction of the input image, equal to or greater than the number of output vertical pixels, which is the number of pixels corresponding to the length of the output area in the vertical direction, by pixel interpolation. A vertical interpolation rate calculating means for calculating a minimum vertical interpolation rate out of predetermined appropriate vertical interpolation rates, and
The vertical direction enlargement ratio (the number of output vertical pixels / the number of input vertical pixels) is larger than the horizontal direction enlargement ratio (the number of output horizontal pixels / the number of input horizontal pixels), and the horizontal interpolation ratio calculation means When the number of vertical pixels obtained by interpolating the input image data using the minimum horizontal interpolation rate calculated by the above is greater than or equal to the number of output vertical pixels, or the vertical magnification is less than or equal to the horizontal magnification And the minimum horizontal interpolation rate is set when the number of horizontal pixels obtained when the input image data is interpolated using the vertical direction interpolation rate calculated by the vertical interpolation calculation means is less than the number of output horizontal pixels. And interpolating the input image data to output the output image data representing the output image, the vertical enlargement ratio is greater than the horizontal enlargement ratio, and the horizontal interpolation ratio calculation. When the number of vertical pixels obtained when the input image data is interpolated using the minimum horizontal interpolation rate calculated by the means is less than the number of output vertical pixels, or the vertical magnification rate is equal to or less than the horizontal magnification rate And the minimum vertical interpolation rate when the number of horizontal pixels obtained when the input image data is interpolated using the vertical direction interpolation rate calculated by the vertical interpolation calculating means is equal to or greater than the number of output horizontal pixels. Interpolating means for interpolating the input image data using and outputting output image data representing the output image,
An image generation apparatus comprising:
上記補間手段は,上記垂直方向拡大率と上記水平方向拡大率との差が所定値未満である場合には,上記垂直方向拡大率が上記水平方向拡大率よりも大きいときには上記水平補間率算出手段によって算出された最小水平補間率を用いて上記入力画像データを補間して上記出力画像データを出力し,上記垂直方向拡大率が上記水平方向拡大率以下のときには上記垂直補間率算出手段によって算出された最小垂直補間率を用いて上記入力画像データを補間して上記出力画像データを出力するものである,
請求項1に記載の画像生成装置。
When the difference between the vertical enlargement factor and the horizontal enlargement factor is less than a predetermined value, the interpolation means calculates the horizontal interpolation rate calculation means when the vertical enlargement factor is greater than the horizontal enlargement factor. The output image data is output by interpolating the input image data using the minimum horizontal interpolation rate calculated by the above. When the vertical enlargement rate is equal to or less than the horizontal enlargement rate, the vertical interpolation rate calculating means calculates the output image data. The input image data is interpolated using the minimum vertical interpolation rate and the output image data is output.
The image generation apparatus according to claim 1.
与えられる入力画像データによって表される入力画像を拡大して出力エリア上に表現される出力画像を生成する画像生成方法において,
水平補間率算出手段が,画素補間により上記入力画像の水平方向の画素数である入力水平画素数を上記出力エリアの水平方向の長さに相当する画素数である出力水平画素数以上にする一の水平補間率であって,かつあらかじめ定められた仕様可能な適正水平補間率のうち,最小水平補間率を算出し,
垂直補間率算出手段が,画素補間により上記入力画像の垂直方向の画素数である入力垂直画素数を上記出力エリアの垂直方向の長さに相当する画素数である出力垂直画素数以上にする一の垂直補間率であって,あらかじめ定められた使用可能な適正垂直補間率のうち,最小垂直補間率を算出し,および
補間手段が,(上記出力垂直画素数/上記入力垂直画素数)である垂直方向拡大率が(上記出力水平画素数/上記入力水平画素数)である水平方向拡大率よりも大きく,かつ上記水平補間率算出手段により算出された最小水平補間率を用いて上記入力画像データを補間したときに得られる垂直方向画素数が上記出力垂直画素数以上の場合,または上記垂直方向拡大率が上記水平方向拡大率以下であり,かつ上記垂直補間算出手段により算出された垂直方向補間率を用いて上記入力画像データを補間したときに得られる水平方向画素数が上記出力水平画素数未満の場合に上記最小水平補間率を用いて上記入力画像データを補 間して上記出力画像を表す出力画像データを出力し,上記垂直方向拡大率が上記水平方向拡大率よりも大きく,かつ上記水平補間率算出手段により算出された最小水平補間率を用いて上記入力画像データを補間したときに得られる垂直方向画素数が上記出力垂直画素数未満の場合,または上記垂直方向拡大率が上記水平方向拡大率以下であり,かつ上記垂直補間算出手段により算出された垂直方向補間率を用いて上記入力画像データを補間したときに得られる水平方向画素数が上記出力水平画素数以上の場合に上記最小垂直補間率を用いて上記入力画像データを補間して上記出力画像を表す出力画像データを出力する,
画像生成方法。
In an image generation method for generating an output image expressed on an output area by enlarging an input image represented by given input image data,
The horizontal interpolation rate calculating means sets the number of input horizontal pixels, which is the number of pixels in the horizontal direction of the input image, by pixel interpolation to be equal to or greater than the number of output horizontal pixels, which is the number of pixels corresponding to the horizontal length of the output area. The minimum horizontal interpolation rate is calculated from the appropriate horizontal interpolation rates that can be specified in advance.
The vertical interpolation rate calculating means sets the number of input vertical pixels, which is the number of pixels in the vertical direction of the input image, by pixel interpolation to be equal to or greater than the number of output vertical pixels, which is the number of pixels corresponding to the vertical length of the output area. Of the appropriate vertical interpolation rates that can be used in advance and calculate the minimum vertical interpolation rate, and
The interpolation means has a vertical enlargement ratio which is (the number of output vertical pixels / the number of input vertical pixels) larger than a horizontal enlargement ratio which is (the number of output horizontal pixels / the number of input horizontal pixels) and the horizontal When the number of vertical pixels obtained by interpolating the input image data using the minimum horizontal interpolation rate calculated by the interpolation rate calculation means is greater than or equal to the number of output vertical pixels, or the vertical enlargement rate is the horizontal direction When the number of horizontal pixels obtained when the input image data is interpolated using the vertical direction interpolation rate calculated by the vertical interpolation calculating means is less than the enlargement rate and less than the number of output horizontal pixels, the minimum and interpolate the input image data and outputs the output image data representing the output image using the horizontal interpolation factor, the vertical enlargement ratio is greater than the horizontal magnification ratio, and the When the number of vertical pixels obtained by interpolating the input image data using the minimum horizontal interpolation rate calculated by the flat interpolation rate calculation means is less than the number of output vertical pixels, or the vertical enlargement rate is the horizontal When the number of horizontal pixels obtained when the input image data is interpolated using the vertical direction interpolation rate calculated by the vertical interpolation calculating means is equal to or less than the direction horizontal enlargement rate and is equal to or greater than the number of output horizontal pixels. Output image data representing the output image by interpolating the input image data using a minimum vertical interpolation rate;
Image generation method.
JP2001147181A 2001-05-17 2001-05-17 Image generating apparatus and method Expired - Fee Related JP4150171B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2001147181A JP4150171B2 (en) 2001-05-17 2001-05-17 Image generating apparatus and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2001147181A JP4150171B2 (en) 2001-05-17 2001-05-17 Image generating apparatus and method

Publications (2)

Publication Number Publication Date
JP2002344731A JP2002344731A (en) 2002-11-29
JP4150171B2 true JP4150171B2 (en) 2008-09-17

Family

ID=18992703

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2001147181A Expired - Fee Related JP4150171B2 (en) 2001-05-17 2001-05-17 Image generating apparatus and method

Country Status (1)

Country Link
JP (1) JP4150171B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7773158B2 (en) 2005-10-12 2010-08-10 Panasonic Corporation Visual processing device, display device, and integrated circuit

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7773158B2 (en) 2005-10-12 2010-08-10 Panasonic Corporation Visual processing device, display device, and integrated circuit
US7880814B2 (en) 2005-10-12 2011-02-01 Panasonic Corporation Visual processing device, display device, and integrated circuit
US8368814B2 (en) 2005-10-12 2013-02-05 Panasonic Corporation Visual processing device, display device, and integrated circuit for adjusting the contrast of an image

Also Published As

Publication number Publication date
JP2002344731A (en) 2002-11-29

Similar Documents

Publication Publication Date Title
JP4880172B2 (en) Image processing method and image processing apparatus
JP5644461B2 (en) Image processing apparatus and program
JP3206060B2 (en) Image editing device
JP2001175218A (en) Image display device
JP2002215122A (en) Multi-vision projector device and multi-vision using the same
JP2009075646A (en) Video display system and parameter generation method for the system
JPH11143872A (en) Reduced image creation device
JP4150171B2 (en) Image generating apparatus and method
JPH11234506A (en) Printer and method for printing synthesis image
JP2004054898A (en) Print data generation device, print data generation method, and program therefor
JP2002158922A (en) Image display control device and method therefor
JP2000209433A (en) Image forming device
JP3711735B2 (en) Document image processing apparatus and recording medium
JPH05282421A (en) Image reader
JPH11275348A (en) Image correction processing device
JP2979928B2 (en) Score recognition result display system
JP2006139697A (en) Image processing apparatus and image processing method
JP2004184738A (en) Image scaling device, image scaling method, program, and recording medium
JPH0946510A (en) Image forming device
JP2000081867A (en) Video output device and control method for video output
JP3530765B2 (en) Image processing method, image processing apparatus, and storage medium
JPH1020847A (en) Image processing apparatus and method
JP4273419B2 (en) Image data conversion processing method and program and apparatus
JP3809868B2 (en) Image conversion processing unit and image display apparatus having the same
JP2000082136A (en) Picture data processing device, method therefor and served medium

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20060123

A711 Notification of change in applicant

Free format text: JAPANESE INTERMEDIATE CODE: A712

Effective date: 20061207

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20080310

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20080430

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20080603

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: 20080624

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: 20080627

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110704

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees