JP4363153B2 - Imaging apparatus, image processing method thereof, and program - Google Patents

Imaging apparatus, image processing method thereof, and program Download PDF

Info

Publication number
JP4363153B2
JP4363153B2 JP2003354423A JP2003354423A JP4363153B2 JP 4363153 B2 JP4363153 B2 JP 4363153B2 JP 2003354423 A JP2003354423 A JP 2003354423A JP 2003354423 A JP2003354423 A JP 2003354423A JP 4363153 B2 JP4363153 B2 JP 4363153B2
Authority
JP
Japan
Prior art keywords
image
photographing
unit
conversion
parameter
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
JP2003354423A
Other languages
Japanese (ja)
Other versions
JP2005122327A (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.)
Casio Computer Co Ltd
Original Assignee
Casio Computer Co Ltd
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 Casio Computer Co Ltd filed Critical Casio Computer Co Ltd
Priority to JP2003354423A priority Critical patent/JP4363153B2/en
Publication of JP2005122327A publication Critical patent/JP2005122327A/en
Application granted granted Critical
Publication of JP4363153B2 publication Critical patent/JP4363153B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Image Analysis (AREA)
  • Image Processing (AREA)
  • Editing Of Facsimile Originals (AREA)
  • Facsimile Image Signal Circuits (AREA)
  • Studio Devices (AREA)

Description

本発明は、撮影装置、その画像処理方法及びプログラムに関するものである。   The present invention relates to a photographing apparatus, an image processing method thereof, and a program.

デジタルカメラの発達と蓄積型メモリの低価格化に伴い、デジタルカメラを単なる風景や人の撮影だけに用いるのではなく、紙面文書や名刺などの書類、また、会議での筆記された黒板等に表示されたものを撮影し、これらの画像をパーソナルコンピュータ等にデジタル的に保存し、管理をおこなう応用が考えられつつある。   With the development of digital cameras and the low price of storage-type memory, digital cameras are not only used for taking pictures of landscapes and people, but are also used for paper documents, business cards, and blackboards written at meetings. An application is being considered in which what is displayed is photographed, and these images are digitally stored in a personal computer or the like for management.

このように書類や黒板の撮影を行う場合、その撮影対象物を正面かつ垂直に撮影することが望ましい。しかし、机上におかれた書類の撮影を正面かつ垂直に撮影することは困難である。また、黒板を撮影する場合も、撮影者の位置によって、黒板を正面から撮影することが難しい場合もある。また、正面から撮影できたとしても、ライトの映り込みなどの理由で正面から撮影するのを避けた方が好ましい場合もある。このように書類などの対象物を斜め方向から撮影した場合、文字等が斜め、または台形に歪む。もちろん、これらの文字の判読は可能である。しかし、判読できたとしても、読むには非常に疲れやすいものである。またこれらの画像は歪みをもっているので、この画像を再利用することも難しい。   When photographing a document or a blackboard in this way, it is desirable to photograph the photographing object in front and vertically. However, it is difficult to shoot a document placed on the desk vertically and vertically. Also, when shooting a blackboard, it may be difficult to capture the blackboard from the front depending on the position of the photographer. Even if the image can be taken from the front, it may be preferable to avoid taking the image from the front for reasons such as reflection of light. Thus, when an object such as a document is photographed from an oblique direction, characters and the like are distorted obliquely or trapezoidally. Of course, these characters can be interpreted. However, even if it can be read, it is very tiring to read. Moreover, since these images have distortion, it is difficult to reuse these images.

このような不具合を解消するものとして、例えば、2つの視差のある画像を用いて画像の歪みを補正するようにしたものがある(例えば、特許文献1参照)。   As a solution to such a problem, for example, there is one in which image distortion is corrected using an image having two parallaxes (see, for example, Patent Document 1).

この画像処理部は、2枚以上の画像に対して視差がなくなるように画像変換を行って貼り合わせることによって合成した補正画像を作成する。そして、画像合成部が、作成された補正画像を画像メモリに記憶させる。
特開2001−134751号公報(第5頁、図1)
This image processing unit creates a corrected image that is synthesized by performing image conversion so that parallax is eliminated with respect to two or more images and combining them. Then, the image composition unit stores the created corrected image in the image memory.
JP 2001-134751 (5th page, FIG. 1)

しかし、かかる従来の装置では、もう一度、画像編集を行う場合、画像メモリに記憶した補正画像を編集すれば、画像は劣化する。また、補正前の元画像を再度、補正しようとすれば、元画像と補正画像とを画像メモリに記憶する必要があるし、元画像に対して同じような画像処理を繰り返す必要がある。   However, in such a conventional apparatus, when image editing is performed again, the image deteriorates if the corrected image stored in the image memory is edited. If the original image before correction is to be corrected again, it is necessary to store the original image and the corrected image in the image memory, and it is necessary to repeat similar image processing on the original image.

本発明は、このような従来の問題点に鑑みてなされたもので、容易に撮影対象物の画像を補正することが可能な撮影装置、その画像処理方法及びプログラムを提供することを目的とする。   The present invention has been made in view of such conventional problems, and an object of the present invention is to provide a photographing apparatus capable of easily correcting an image of a photographing target, an image processing method thereof, and a program. .

この目的を達成するため、本発明の第1の観点に係る撮影装置は、
撮影部により撮影対象物を撮影する撮影装置において、
前記撮影対象物を撮影する撮影部と、
前記撮影部で撮影することによって得られた前記撮影対象物の撮影画像の歪みを補正するように、前記撮影画像に対して画像処理を行う画像処理部と、を備え、
前記画像処理部は、
前記撮影対象物の画像から当該画像の輪郭を取得し、取得した前記輪郭から前記画像の形状を取得する形状取得部と、
前記形状取得部が取得した前記画像の形状と実際の撮影対象物の形状とを3次元の座標系を設定することで対応させて、前記撮影対象物の画像の頂点位置から、前記画像と実際の撮影対象物との関係を示す射影パラメータを求める射影パラメータ取得部と、
前記撮影部が有するレンズの焦点距離と前記撮影対象物の画像の頂点位置とに基づいて前記撮影対象物の縦横比を求める縦横比取得部と、
前記射影パラメータ取得部が求めた射影パラメータと前記縦横比取得部が求めた縦横比とを用いて、画像変換のための画像変換パラメータを求め、該画像変換パラメータを用いて、前記撮影対象物の画像の画像変換を行う画像変換部と、
前記画像変換部が前記撮影対象物の画像の画像変換に用いた画像変換パラメータを、記憶部の画像ファイルに格納する記憶制御部と、を備えたことを特徴とする。
In order to achieve this object, an imaging device according to the first aspect of the present invention provides:
In a photographing device that photographs a photographing object by a photographing unit,
A photographing unit for photographing the photographing object;
An image processing unit that performs image processing on the photographed image so as to correct distortion of the photographed image of the photographing object obtained by photographing with the photographing unit;
The image processing unit
A shape acquisition unit that acquires the contour of the image from the image of the shooting target, and acquires the shape of the image from the acquired contour;
The shape of the image acquired by the shape acquisition unit and the actual shape of the object to be photographed are associated with each other by setting a three-dimensional coordinate system. A projection parameter obtaining unit for obtaining a projection parameter indicating a relationship with the object to be imaged,
An aspect ratio acquisition unit for obtaining an aspect ratio of the photographing object based on a focal length of a lens included in the photographing unit and a vertex position of an image of the photographing object;
Using the projection parameter obtained by the projection parameter acquisition unit and the aspect ratio obtained by the aspect ratio acquisition unit, an image conversion parameter for image conversion is obtained, and the image conversion parameter is used to calculate the image of the subject to be imaged. An image conversion unit that performs image conversion of the image;
The image conversion unit includes a storage control unit that stores an image conversion parameter used for image conversion of the image of the photographing object in an image file of the storage unit.

前記記憶制御部は、前記記憶部の前記画像ファイルに、前記撮影部で撮影することによって得られた前記撮影対象物の画像データを格納し、当該画像ファイルに前記画像変換パラメータを格納してもよい。 The storage control unit may store the image data of the photographing object obtained by photographing with the photographing unit in the image file of the storage unit, and store the image conversion parameter in the image file. Good.

前記記憶制御部は、前記記憶部の前記画像ファイルに、前記画像変換部が画像変換した画像を格納してもよい。   The storage control unit may store the image converted by the image conversion unit in the image file of the storage unit.

前記記憶部は、外部記憶媒体によって構成されたものであってもよい。   The storage unit may be configured by an external storage medium.

前記形状取得部が取得した前記画像の形状から、前記撮影対象物の内容を表す実対象部を判別し、判別した実対象部の画像を切り出す画像切り出し部と、
前記画像切り出し部が切り出した実対象部の画像から、画像効果を補正するための画像効果補正用パラメータを取得する補正用パラメータ取得部と、
前記補正用パラメータ取得部が取得した画像効果補正用パラメータを用いて、前記撮影対象物の画像の画像効果処理を行う画像効果処理部と、を備え、
前記記憶制御部は、前記記憶部の画像ファイルに、前記画像効果処理部が前記撮影対象物の画像の画像効果処理に用いた画像効果補正用パラメータを格納してもよい。
From the shape of the image acquired by the shape acquisition unit, an actual target part representing the content of the photographing object is determined, and an image cutout unit that cuts out the image of the determined real target part;
A correction parameter acquisition unit for acquiring an image effect correction parameter for correcting an image effect from the image of the real target part cut out by the image cutout unit;
An image effect processing unit that performs image effect processing of the image of the object to be photographed using the image effect correction parameter acquired by the correction parameter acquisition unit;
The storage control unit may store an image effect correction parameter used by the image effect processing unit in the image effect processing of the image of the shooting target in the image file of the storage unit.

前記画像変換部は、前記記憶部の前記画像ファイルから、格納されている前記画像効果補正用パラメータを読み出し、読み出した画像効果補正用パラメータを用いて前記画像変換を行うようにしてもよい。   The image conversion unit may read the stored image effect correction parameter from the image file in the storage unit, and perform the image conversion using the read image effect correction parameter.

前記画像を表示する表示部を備えてもよい。   You may provide the display part which displays the said image.

本発明の第2の観点に係る撮影装置の画像処理方法は、
撮影部により撮影対象物を撮影することによって得られた前記撮影対象物の画像の歪みを補正するように、前記撮影対象物の画像に対して画像処理を行う撮影装置の画像処理方法であって、
前記撮影対象物の画像から当該画像の輪郭を取得し、取得した前記輪郭から前記画像の形状を取得するステップと、
取得した前記画像の形状と実際の撮影対象物の形状とを3次元の座標系を設定することで対応させて、前記撮影対象物の画像の頂点位置から、前記撮影対象物の画像と実際の撮影対象物との関係を示す射影パラメータを求めるステップと、
前記撮影部が有するレンズの焦点距離と前記撮影対象物の画像の頂点位置とに基づいて前記撮影対象物の縦横比を求めるステップと、
求めた射影パラメータと縦横比とを用いて、画像変換のための画像変換パラメータを求め、該画像変換パラメータを用いて、前記撮影対象物の画像の画像変換を行うステップと、
画像データを格納する画像ファイルに、前記画像変換に用いた画像変換パラメータを記憶するステップと、を備えたことを特徴とする。
An image processing method of the photographing apparatus according to the second aspect of the present invention is as follows.
An image processing method of a photographing apparatus that performs image processing on an image of the photographing target so as to correct distortion of the image of the photographing target obtained by photographing the photographing target by a photographing unit. ,
Acquiring a contour of the image from the image of the photographing object, and acquiring a shape of the image from the acquired contour;
The acquired shape of the image and the shape of the actual shooting target are associated with each other by setting a three-dimensional coordinate system, and from the vertex position of the image of the shooting target, the image of the shooting target and the actual shooting target Obtaining a projection parameter indicating a relationship with the object to be imaged;
Obtaining an aspect ratio of the photographing object based on a focal length of a lens included in the photographing unit and a vertex position of an image of the photographing object;
Using the obtained projection parameters and aspect ratio to determine image conversion parameters for image conversion, and using the image conversion parameters to perform image conversion of the image of the object to be photographed;
Storing image conversion parameters used for the image conversion in an image file storing image data.

本発明の第3の観点に係るプログラムは、
撮影部により撮影対象物を撮影する撮影装置が有するコンピュータに、
撮影対象物を撮影することによって得られた前記撮影対象物の画像から当該画像の輪郭を取得し、取得した前記輪郭から前記撮影対象物の画像の形状を取得する手順、
取得した前記画像の形状と実際の撮影対象物の形状とを3次元の座標系を設定することで対応させて、前記撮影対象物の画像の頂点位置から、前記撮影対象物の画像と実際の撮影対象物との関係を示す射影パラメータを求める手順、
前記撮影部が有するレンズの焦点距離と前記撮影対象物の画像の頂点位置とに基づいて前記撮影対象物の縦横比を求める手順、
求めた射影パラメータと縦横比とを用いて、画像変換のための画像変換パラメータを求め、該画像変換パラメータを用いて、前記撮影対象物の画像の歪みを補正するように前記画像に対して画像変換を行う手順、
画像データを格納する画像ファイルに、前記画像変換に用いた画像変換パラメータを記憶する手順、
を実行させるためのものである。
The program according to the third aspect of the present invention is:
In the computer of the photographing device that photographs the object to be photographed by the photographing unit,
A procedure for acquiring the contour of the image from the image of the shooting target obtained by shooting the shooting target, and acquiring the shape of the image of the shooting target from the acquired contour,
The acquired shape of the image and the shape of the actual shooting target are associated with each other by setting a three-dimensional coordinate system, and from the vertex position of the image of the shooting target, the image of the shooting target and the actual shooting target A procedure for obtaining a projection parameter indicating the relationship with the object to be photographed;
A procedure for obtaining an aspect ratio of the photographing object based on a focal length of a lens of the photographing unit and a vertex position of an image of the photographing object;
An image conversion parameter for image conversion is obtained using the obtained projection parameter and aspect ratio, and the image is imaged with respect to the image so as to correct the distortion of the image of the object to be photographed using the image conversion parameter. The steps to do the conversion,
A procedure for storing image conversion parameters used for the image conversion in an image file storing image data;
Is to execute.

本発明によれば、容易に撮影対象物の画像を補正することができる。   According to the present invention, it is possible to easily correct an image of a photographing object.

以下、本発明の実施の形態に係る撮影装置を図面を参照して説明する。
尚、実施形態では、撮影装置をデジタルカメラとして説明する。
Hereinafter, a photographing apparatus according to an embodiment of the present invention will be described with reference to the drawings.
In the embodiment, the photographing apparatus is described as a digital camera.

本実施形態に係るデジタルカメラ1の構成を図1に示す。
本実施形態に係るデジタルカメラ1は、撮影対象物として、白板2等の文字、図、写真等を撮影し、撮影によって得られた画像から、画像の歪みを検出して補正し、あたかも正面から撮影したような画像を生成するものである。デジタルカメラ1は、撮影レンズ部11と、液晶モニタ12と、シャッタボタン13と、を備える。
A configuration of a digital camera 1 according to the present embodiment is shown in FIG.
The digital camera 1 according to the present embodiment captures characters such as a white board 2, a figure, a photograph, and the like as an object to be photographed, detects and corrects image distortion from an image obtained by photographing, and is as if from the front. It generates an image as if it was taken. The digital camera 1 includes a photographic lens unit 11, a liquid crystal monitor 12, and a shutter button 13.

撮影レンズ部11は、光を集光するレンズ等を備え、白板2等の文字、図、写真等からの光を集光するものである。   The photographic lens unit 11 includes a lens that collects light and the like, and collects light from characters such as the white plate 2, drawings, and photographs.

液晶モニタ12は、撮影レンズ部11を介して内部に取り込まれた画像を映し出すためのものである。
シャッタボタン13は、撮影対象を撮影するときに押下するものである。
The liquid crystal monitor 12 is for projecting an image taken in through the photographing lens unit 11.
The shutter button 13 is pressed when shooting a shooting target.

このデジタルカメラ1は、図2に示すように、光学レンズ装置21と、イメージセンサ22と、メモリ23と、表示装置24と、画像処理装置25と、操作部26と、コンピュータインタフェース部27と、外部記憶IO装置28と、プログラムコード記憶装置29と、を備えて構成される。   As shown in FIG. 2, the digital camera 1 includes an optical lens device 21, an image sensor 22, a memory 23, a display device 24, an image processing device 25, an operation unit 26, a computer interface unit 27, An external storage IO device 28 and a program code storage device 29 are provided.

光学レンズ装置21は、撮影レンズ部11とその駆動部とを備えたものであり、イメージセンサ22上に、白板2の文字、図、写真等からの光を集光させて像を結像させる。   The optical lens device 21 includes a photographic lens unit 11 and a driving unit thereof, and forms an image on the image sensor 22 by condensing light from characters, drawings, photographs, and the like on the white plate 2. .

イメージセンサ22は、結像した画像を、デジタル化した画像データとして取り込むためのものであり、CCD等によって構成される。イメージセンサ22は、CPU30によって制御され、シャッタボタン13が押下されなければ、プレビュー用の解像度の低いデジタルの画像データを生成し、この画像データを秒30枚程度の間隔で、定期的にメモリ23に送出する。また、イメージセンサ22は、シャッタボタン13が押下されると、解像度の高い画像データを生成し、生成した画像データをメモリ23に送出する。   The image sensor 22 is for capturing a formed image as digitized image data, and is constituted by a CCD or the like. If the image sensor 22 is controlled by the CPU 30 and the shutter button 13 is not pressed, digital image data having a low preview resolution is generated, and the image data is periodically stored in the memory 23 at intervals of about 30 sheets per second. To send. Further, when the shutter button 13 is pressed, the image sensor 22 generates image data with high resolution and sends the generated image data to the memory 23.

メモリ23は、イメージセンサ22からの低解像度のプレビュー画像、高解像度の画像データ又は画像処理装置25が画像処理する元画像のデータ、処理後の画像データを一時記憶するものである。メモリ23は、一時記憶した画像データを表示装置24又は画像処理装置25に送り出す。   The memory 23 temporarily stores low-resolution preview images from the image sensor 22, high-resolution image data, original image data processed by the image processing device 25, and processed image data. The memory 23 sends the temporarily stored image data to the display device 24 or the image processing device 25.

表示装置24は、液晶モニタ12を備え、液晶モニタ12に画像を表示させるためのものである。表示装置24は、メモリ23が一時記憶した低解像度のプレビュー画像又は解像度の高い画像を液晶モニタ12に表示する。   The display device 24 includes the liquid crystal monitor 12 and displays the image on the liquid crystal monitor 12. The display device 24 displays a low-resolution preview image or a high-resolution image temporarily stored in the memory 23 on the liquid crystal monitor 12.

画像処理装置25は、メモリ23に一時記憶された画像データに対して、画像データの圧縮、画像の歪み補正、画像効果処理等の画像処理を行うためのものである。   The image processing device 25 is for performing image processing such as image data compression, image distortion correction, and image effect processing on the image data temporarily stored in the memory 23.

デジタルカメラ1が、図3(a)にそれぞれ示すように、白板2の文字等を、向かって左方向、右方向から撮影すると、液晶モニタ12には、図3(b),(c)に示すように、白板2と文字、図、写真等の画像が歪んで表示される。画像処理装置25は、この図3(b),(c)に示すような画像に対して画像処理を施すことにより、図3(d)に示すような、正面から撮影したような画像を生成する。   As shown in FIG. 3A, when the digital camera 1 shoots characters on the white plate 2 from the left direction and the right direction, the liquid crystal monitor 12 displays the characters shown in FIGS. 3B and 3C. As shown, the white plate 2 and images such as letters, diagrams, and photographs are distorted and displayed. The image processing device 25 performs image processing on the images as shown in FIGS. 3B and 3C to generate an image taken from the front as shown in FIG. 3D. To do.

画像処理装置25は、画像歪みを補正するため、歪んだ画像から四角形を切り取り、切り取った四角形に撮影画像を射影変換する。   In order to correct image distortion, the image processing device 25 cuts a square from the distorted image, and performs projective transformation of the captured image into the cut quadrangle.

さらに具体的には、画像処理装置25は、CPU30に制御されて、主に、以下の処理等を行う。
(1)撮影画像からのアフィンパラメータ抽出
(2)抽出したアフィンパラメータによる画像変換
(3)画像変換の調整処理
(4)輝度あるいは色差等に関する画像効果補正用パラメータの抽出及び画像効果処理
尚、これらの処理内容については、後述する。
More specifically, the image processing device 25 is controlled by the CPU 30 and mainly performs the following processing.
(1) Extraction of affine parameters from photographed image (2) Image conversion using extracted affine parameters (3) Adjustment processing of image conversion (4) Extraction of image effect correction parameters relating to luminance or color difference and image effect processing The processing contents of will be described later.

操作部26は、書画投影の機能を制御するためのスイッチ、キーを備えたものである。操作部26は、ユーザが、これらのキー、スイッチを押下すると、応答してこのときの操作情報をCPU30に送信する。   The operation unit 26 includes switches and keys for controlling the document projection function. When the user presses these keys and switches, the operation unit 26 responds and transmits the operation information at this time to the CPU 30.

操作部26は、図4に示すように、上縮小キー111と、下縮小キー112と、右縮小キー113と、左縮小キー114と、右回転キー115と、左回転キー116と、を備える。   As shown in FIG. 4, the operation unit 26 includes an upper reduction key 111, a lower reduction key 112, a right reduction key 113, a left reduction key 114, a right rotation key 115, and a left rotation key 116. .

上縮小キー111と、下縮小キー112と、右縮小キー113と、左縮小キー114とは、射影変換を行なうための射影変換キーである。上縮小キー111は、X軸を中心に画像の上部と下部とを比較し、上部が大きい場合に、上部を紙面に向かって下方向に回転させるときに押下するキーである。   The upper reduction key 111, the lower reduction key 112, the right reduction key 113, and the left reduction key 114 are projective conversion keys for performing projective conversion. The upper reduction key 111 is a key that is pressed when the upper part of the image is compared with the lower part around the X axis and the upper part is large and the upper part is rotated downward toward the paper surface.

下縮小キー112は、X軸を中心に画像の上部と下部を比較し、下部が大きい場合に、下部を紙面に向かって下方向に回転させるときに押下するキーである。   The lower reduction key 112 is a key that is pressed when the upper part and the lower part of the image are compared around the X axis, and the lower part is rotated downward toward the paper surface when the lower part is large.

右縮小キー113と左縮小キー114とは、Y軸側を中心に左右のひずみを調整するときに押下するキーであり、右縮小キー113は、右が大きいときに押下するキーであり、左縮小キー114は、左が大きいときに押下するキーである。   The right reduction key 113 and the left reduction key 114 are keys that are pressed when adjusting left and right distortion around the Y-axis side, and the right reduction key 113 is a key that is pressed when the right is large, and left The reduction key 114 is a key that is pressed when the left side is large.

右回転キー115と左回転キー116とは、画像の回転を調整するための回転補正キーである。右回転キー115は、画像を右に回転するときに押下するキーであり、左回転キー116は、画像を左に回転するときに押下するキーである。   The right rotation key 115 and the left rotation key 116 are rotation correction keys for adjusting the rotation of the image. The right rotation key 115 is a key that is pressed when the image is rotated to the right, and the left rotation key 116 is a key that is pressed when the image is rotated to the left.

また、操作部26は、この他に、撮影キー、再生キー、カーソルキー、コントロールキー等(図示せず)を備える。撮影キーは、撮影対象物を撮影するときの撮影モードを選択するためのキーである。再生キーは、撮影によって得られた撮影対象画像を再生するときの再生モードを選択するためのキーである。コントロールキーは、操作を確定させるYESキー、操作をキャンセルするためのNOキー、編集を行うための編集キー等の機能を有するキーである。   In addition, the operation unit 26 includes a photographing key, a reproduction key, a cursor key, a control key, and the like (not shown). The shooting key is a key for selecting a shooting mode when shooting a shooting object. The reproduction key is a key for selecting a reproduction mode for reproducing an image to be photographed obtained by photographing. The control key is a key having functions such as a YES key for confirming the operation, a NO key for canceling the operation, and an editing key for performing editing.

コンピュータインタフェース部27は、デジタルカメラ1がコンピュータ(図示せず)に接続されたときに、USBのストアレジクラスドライバとして動作するものである。これにより、コンピュータは、デジタルカメラ1に接続されると、メモリカード31をコンピュータの外部記憶装置として取り扱う。   The computer interface unit 27 operates as a USB store registration class driver when the digital camera 1 is connected to a computer (not shown). Thus, when the computer is connected to the digital camera 1, the computer handles the memory card 31 as an external storage device of the computer.

外部記憶IO装置28は、メモリカード31との間で、画像データ等の入出力を行うものである。メモリカード31は、外部記憶IO装置28から供給された画像データ等を記憶するものである。   The external storage IO device 28 inputs and outputs image data and the like with the memory card 31. The memory card 31 stores image data and the like supplied from the external storage IO device 28.

プログラムコード記憶装置29は、CPU30が実行するプログラムを記憶するためのものであり、ROM等によって構成される。   The program code storage device 29 is for storing a program executed by the CPU 30, and is configured by a ROM or the like.

CPU30は、プログラムコード記憶装置29に格納されているプログラムに従って、システム全体を制御するものである。尚、メモリ23は、CPU30の作業メモリとしても用いられる。   The CPU 30 controls the entire system according to a program stored in the program code storage device 29. The memory 23 is also used as a work memory for the CPU 30.

操作部26のスイッチ、キーが押下されることにより、操作部26から操作情報が送信されると、CPU30は、この操作情報に基づいて、イメージセンサ22、メモリ23、表示装置24,画像処理装置25等を制御する。   When operation information is transmitted from the operation unit 26 by pressing a switch or key of the operation unit 26, the CPU 30 performs image sensor 22, memory 23, display device 24, image processing device based on the operation information. 25 etc. are controlled.

具体的には、CPU30は、操作部26から、撮影キーが押下された旨の操作情報が送信されると、各部を撮影モードに設定する。CPU30は、撮影モードに設定した状態で、シャッタボタン13が押下されなければ、イメージセンサ22をプレビューモードに設定し、シャッタボタン13が押下されれば、解像度の高い撮影対象画像を読み込む高解像度モードに設定する。また、CPU30は、再生キーが押下された旨の操作情報が送信されると、各部を再生モードに設定する。   Specifically, when the operation information indicating that the photographing key is pressed is transmitted from the operation unit 26, the CPU 30 sets each unit to the photographing mode. The CPU 30 sets the image sensor 22 to the preview mode if the shutter button 13 is not pressed in the state set to the shooting mode, and reads the high-resolution shooting target image if the shutter button 13 is pressed. Set to. Further, when the operation information indicating that the reproduction key is pressed is transmitted, the CPU 30 sets each unit to the reproduction mode.

また、CPU30は、操作部26から、射影変換キー、回転補正キーが押下された旨の操作情報が送信されると、これらの操作情報を画像処理装置25に送信して、画像処理装置25を制御する。   Further, when the operation information indicating that the projection conversion key and the rotation correction key are pressed is transmitted from the operation unit 26, the CPU 30 transmits the operation information to the image processing device 25, and causes the image processing device 25 to operate. Control.

CPU30は、メモリ23に画像データを一時記憶する際、プレビュー画像、高解像度の画像データを異なる記憶領域に記録する。   When the image data is temporarily stored in the memory 23, the CPU 30 records the preview image and the high-resolution image data in different storage areas.

また、CPU30は、外部記憶IO装置28を介してメモリカード31に、プレビュー画像、高解像度の画像のデータを記録したり、メモリカード31から、記録された画像データを読み出したりする。CPU30は、このため、メモリカード31に、画像データを格納する画像ファイルを作成する。   Further, the CPU 30 records preview image and high-resolution image data on the memory card 31 via the external storage IO device 28, and reads the recorded image data from the memory card 31. For this reason, the CPU 30 creates an image file for storing image data in the memory card 31.

そして、CPU30は、例えば、JPEGフォーマットで圧縮した補正後の画像データを画像ファイルに分けて記録する。さらに、CPU30は、各画像ファイルに、画像ファイルのヘッダ情報記憶領域を作成し、画像データを記録する際、画像処理装置25が求めた射影パラメータ、画像効果処理補正用パラメータといった画像データに関するヘッダ情報を、このヘッダ情報記憶領域に記録する。このヘッダ情報については後述する。   Then, for example, the CPU 30 records the corrected image data compressed in the JPEG format into image files. Further, the CPU 30 creates a header information storage area of the image file for each image file and records the image data, such as the projection parameters and image effect processing correction parameters obtained by the image processing device 25 when the image data is recorded. Is recorded in this header information storage area. This header information will be described later.

次に本実施形態に係るデジタルカメラ1の動作を説明する。
ユーザがデジタルカメラ1の電源をオン(投入)すると、CPU30はプログラムコード記憶装置29に記憶されているプログラムのデータを取得する。ユーザが撮影ボタンを押下すると、操作部26は、この操作情報をCPU30に送信する。CPU30はこの操作情報を受信し、CPU30、画像処理装置25等は、図5に示すフローチャートに従って撮影処理を実行する。
Next, the operation of the digital camera 1 according to this embodiment will be described.
When the user turns on (turns on) the digital camera 1, the CPU 30 acquires program data stored in the program code storage device 29. When the user presses the shooting button, the operation unit 26 transmits this operation information to the CPU 30. The CPU 30 receives this operation information, and the CPU 30, the image processing device 25, etc. execute the photographing process according to the flowchart shown in FIG.

CPU30は、イメージセンサ22をプレビューモードに設定する(ステップS11)。
CPU30は、操作部26から送信された操作情報に基づいてシャッタボタン13が押下されたか否かを判定する(ステップS12)。
The CPU 30 sets the image sensor 22 to the preview mode (step S11).
The CPU 30 determines whether or not the shutter button 13 has been pressed based on the operation information transmitted from the operation unit 26 (step S12).

シャッタボタン13が押下されたと判定した場合(ステップS12においてYes)、CPU30は、イメージセンサ22に対して、プレビューモードから高解像度モードに切り替えてイメージセンサ22を制御する(ステップS13)。   If it is determined that the shutter button 13 has been pressed (Yes in step S12), the CPU 30 controls the image sensor 22 by switching the image sensor 22 from the preview mode to the high resolution mode (step S13).

CPU30は、イメージセンサ22が生成した高解像度の撮影対象画像のデータを、メモリ23上のプレビュー画像とは異なる記憶領域に記録する(ステップS14)。   The CPU 30 records the high-resolution photographic target image data generated by the image sensor 22 in a storage area different from the preview image on the memory 23 (step S14).

CPU30は画像データの読み込みが終了したか否かを判定する(ステップS15)。
読み込みが終了していないと判定した場合(ステップS15においてNo)、CPU30は、引き続き、画像データの読み込みを行うようにイメージセンサ22を制御する。
The CPU 30 determines whether the reading of the image data has been completed (step S15).
If it is determined that the reading has not been completed (No in step S15), the CPU 30 continues to control the image sensor 22 to read the image data.

画像データをすべて読み込んで画像転送も終了したと判定した場合(ステップS15においてYes)、CPU30は、この撮影画像(高解像度画像)から、低解像度のプレビュー画像を生成し、メモリ23のプレビュー画像用の記憶領域上に、プレビュー画像のデータを書き込む(ステップS16)。   If it is determined that all the image data has been read and the image transfer has been completed (Yes in step S15), the CPU 30 generates a low-resolution preview image from the captured image (high-resolution image), and uses the preview image for the preview image in the memory 23. The preview image data is written in the storage area (step S16).

CPU30は、圧縮データを作成するように画像処理装置25を制御し、画像処理装置25は、圧縮データを作成する(ステップS17)。
CPU30は、この圧縮データを、外部記憶IO装置28を介してメモリカード31に記録し、画像処理装置25が作成した圧縮データを保存する(ステップS18)。
The CPU 30 controls the image processing device 25 so as to create compressed data, and the image processing device 25 creates compressed data (step S17).
The CPU 30 records this compressed data on the memory card 31 via the external storage IO device 28, and stores the compressed data created by the image processing device 25 (step S18).

次に、画像処理装置25は、CPU30の制御の下、撮影画像から正面画像を作るための射影パラメータを抽出する(ステップS19)。   Next, the image processing device 25 extracts projection parameters for creating a front image from the captured image under the control of the CPU 30 (step S19).

CPU30、画像処理装置25は、射影パラメータを抽出できたか否かを判定する(ステップS20)。
抽出できたと判定した場合(ステップS20においてYes)、画像処理装置25は、抽出した射影パラメータに基づいて射影変換画像を作成する(ステップS21)。
The CPU 30 and the image processing device 25 determine whether or not the projection parameters have been extracted (step S20).
If it is determined that the extraction has been completed (Yes in step S20), the image processing device 25 creates a projected transformation image based on the extracted projection parameters (step S21).

操作部26の射影変換キー、回転補正キーが押下されると、操作部26は、この操作情報をCPU30に送信する。CPU30は、操作部26からの操作情報を画像処理装置25に送信し、画像処理装置25は、送信された操作情報に従って、画像変換の調整処理を行う(ステップS22)。   When the projection conversion key and the rotation correction key of the operation unit 26 are pressed, the operation unit 26 transmits this operation information to the CPU 30. The CPU 30 transmits operation information from the operation unit 26 to the image processing device 25, and the image processing device 25 performs image conversion adjustment processing in accordance with the transmitted operation information (step S22).

画像処理装置25は、画像効果補正用パラメータを抽出し(ステップS23)、画像効果処理を行う(ステップS24)。   The image processing device 25 extracts image effect correction parameters (step S23) and performs image effect processing (step S24).

画像処理装置25は、画像効果処理が行われた画像データに対して、圧縮処理を行い、圧縮データを作成する(ステップS25)。   The image processing device 25 performs compression processing on the image data that has been subjected to the image effect processing, and creates compressed data (step S25).

画像処理装置25は、作成した圧縮データをメモリカード31の画像ファイルに記録する(ステップS26)。また、CPU30は、射影変換に用いた射影パラメータ、画像効果処理に用いた画像効果補正用パラメータをメモリカード31の画像ファイルに記憶する。   The image processing device 25 records the created compressed data in the image file of the memory card 31 (step S26). Further, the CPU 30 stores the projection parameters used for the projective conversion and the image effect correction parameters used for the image effect processing in the image file of the memory card 31.

一方、射影パラメータを抽出することができなかったと判定した場合(ステップS20においてNo)、CPU30は、警告処理を行う(ステップS27)。   On the other hand, when it is determined that the projection parameters could not be extracted (No in step S20), the CPU 30 performs a warning process (step S27).

CPU30等は、このようにして撮影処理を終了させる。尚、ユーザがキーを操作しない限り、CPU30等は、この撮影処理を繰り返し実行する。   The CPU 30 and the like end the photographing process in this way. Note that the CPU 30 or the like repeatedly executes this photographing process unless the user operates the key.

次に、画像処理装置25が行う画像処理について説明する。
まず、画像処理装置25が画像処理に用いるアフィン変換についての基本的な考え方(実現方法)を説明する。
Next, image processing performed by the image processing device 25 will be described.
First, the basic concept (implementation method) of affine transformation used by the image processing apparatus 25 for image processing will be described.

画像の空間変換にアフィン変換が幅広く応用されている。本実施形態では、3次元のカメラパラメータを用いずに2次元アフィン変換を用いて射影変換を行う。これは、変換前の座標(u,v)の点が、移動、拡大縮小、回転などの変換によって、変換後の座標(x,y)が次の数1によって関係付けられることになる。射影変換もこのアフィン変換により行われることができる。

最終的な座標(x,y)は、次の数2によって算出される。

数2は、射影変換するための式であり、座標x、yは、z’の値に従い、0に向かって縮退する。即ち、z’に含まれるパラメータが射影に影響を及ぼすことになる。このパラメータはa13,a23,a33である。また、他のパラメータは、パラメータa33で正規化されることができるので、a33を1としてもよい。
Affine transformation is widely applied to image spatial transformation. In this embodiment, projective transformation is performed using two-dimensional affine transformation without using three-dimensional camera parameters. This is because the coordinates (u, v) before conversion are related to each other by the following equation (1) by conversion such as movement, enlargement / reduction, and rotation. Projective transformation can also be performed by this affine transformation.

The final coordinates (x, y) are calculated by the following formula 2.

Expression 2 is an expression for projective transformation, and the coordinates x and y are reduced toward 0 according to the value of z ′. That is, the parameter included in z ′ affects the projection. This parameter is a13, a23, a33. Since other parameters can be normalized by the parameter a33, a33 may be 1.

図6は、四角形の撮影画像の各頂点の座標を示したものである。デジタルカメラ1で撮影された四角形と実際の撮影対象物(白板2)との関係について、図7に基づいて説明する。   FIG. 6 shows the coordinates of each vertex of a rectangular captured image. The relationship between the quadrangle photographed with the digital camera 1 and the actual photographing object (white plate 2) will be described with reference to FIG.

この図7において、U−V−W座標系は、デジタルカメラ1で撮影して得られた画像の3次元座標系である。A(Au,Av,Aw))ベクトルとB(Bu,Bv,Bw)ベクトルとは、3次元座標系U−V−Wにおいて、撮影対象物をベクトルで表したものである。
また、S(Su,Sv,Sw)ベクトルは、3次元座標系U−V−Wの原点と撮影対象物との距離を示す。
In FIG. 7, the UVW coordinate system is a three-dimensional coordinate system of an image obtained by photographing with the digital camera 1. The A (Au, Av, Aw) vector and the B (Bu, Bv, Bw) vector represent the object to be imaged as vectors in the three-dimensional coordinate system UV-W.
The S (Su, Sv, Sw) vector indicates the distance between the origin of the three-dimensional coordinate system UV-W and the object to be imaged.

図7に示す投影スクリーンは、撮影対象物の画像の射影を行うためのものである。
投影スクリーン上の座標系をx,yとすると、この投影スクリーン上に投影される画像がデジタルカメラ1に撮影される画像と考えればよい。投影スクリーンは、W軸上から距離fだけ離れて垂直に位置するものとする。撮影対象物の任意の点P(u,v,w)と原点とを直線で結び、その直線と投影スクリーンと交差する点があるものとして、その交点のX−Y座標をp(x,y)とする。このとき、座標pは、射影変換より次の数3によって表される。

数3より、図7に示すように点P0,P1,P2,P3と投影スクリーンへの投影点p0,p1,p2,p3との関係から、次の数4に示す関係が求められる。

このとき、射影係数α、βは次の数5によって表される。
The projection screen shown in FIG. 7 is for projecting an image of the object to be photographed.
If the coordinate system on the projection screen is x, y, the image projected on the projection screen may be considered as the image photographed by the digital camera 1. It is assumed that the projection screen is positioned vertically at a distance f from the W axis. An arbitrary point P (u, v, w) of the object to be photographed is connected to the origin by a straight line, and there is a point that intersects the straight line and the projection screen, and the XY coordinate of the intersection is p (x, y ). At this time, the coordinate p is expressed by the following equation 3 by projective transformation.

From Equation 3, the relationship shown in the following Equation 4 is obtained from the relationship between the points P0, P1, P2, P3 and the projection points p0, p1, p2, p3 on the projection screen as shown in FIG.

At this time, the projection coefficients α and β are expressed by the following equation (5).

次に、射影変換について説明する。
撮影対象物上の任意の点Pは、S,A,Bベクトルを用いて、次の数6によって表される。

この数6に、数4の関係式を代入すると、座標xとyとは、次の数7によって表される。
Next, projective transformation will be described.
An arbitrary point P on the object to be imaged is expressed by the following equation 6 using S, A, and B vectors.

When the relational expression of Expression 4 is substituted into Expression 6, the coordinates x and y are expressed by the following Expression 7.

この関係を、アフィン変換の式に当てはめると、座標(x',y',z')は、次の数8によって表される。
When this relationship is applied to the affine transformation formula, the coordinates (x ′, y ′, z ′) are expressed by the following equation (8).

この数8にm,nを代入することにより、撮影画像の対応点(x,y)が求められる。対応点(x,y)は、整数値とは限らないので、画像補間法などを用いて画素の値を求めればよい。   By substituting m and n into Equation 8, the corresponding point (x, y) of the captured image is obtained. Since the corresponding point (x, y) is not necessarily an integer value, the pixel value may be obtained using an image interpolation method or the like.

上記m,nは、予め補正画像p(u,v)を出力する画像サイズ(0≦u<umax, 0≦v<vmax)を与えて、その画像サイズに合わせて画像を調整する方法が考えられる。この方法によれば、m,nは次の数9によって表される。

しかし、作成される補正画像の縦横比と撮影対象物の縦横比とは一致しない。ここで、補正画像p(u,v)とm、nの値との関係は、数3から、次の数10によって表される。
For m and n, an image size (0 ≦ u <umax, 0 ≦ v <vmax) for outputting the corrected image p (u, v) is given in advance, and a method of adjusting the image according to the image size is considered. It is done. According to this method, m and n are expressed by the following equation (9).

However, the aspect ratio of the corrected image to be created does not match the aspect ratio of the shooting target. Here, the relationship between the corrected image p (u, v) and the values of m and n is expressed by the following Equation 10 from Equation 3.

カメラパラメータであるレンズの焦点距離fが既知であれば、数10に従って、縦横比kを求めることができる。従って、補正画像p(u,v)の画像サイズを(0≦u<umax, 0≦v<vmax)であるとすると、次の数11に従ってm、nを求めることにより、撮影対象物と同じ縦横比kを得ることができる。

尚、カメラが固定焦点である場合、レンズの焦点距離fの値を、予め得ることができる。ズームレンズ等が存在する場合には、レンズの焦点距離fの値は、レンズのズーム倍率によって変化するので、そのズーム倍率とレンズの焦点距離fとの関係をを示すテーブルを予め作成して記憶し、ズーム倍率に基づいて焦点距離fを読み出し、数10,数11に従って、射影変換を行うことができる。
If the focal length f of the lens, which is a camera parameter, is known, the aspect ratio k can be obtained according to Equation 10. Therefore, if the image size of the corrected image p (u, v) is (0 ≦ u <umax, 0 ≦ v <vmax), m and n are obtained according to the following equation 11 to obtain the same as the object to be imaged. An aspect ratio k can be obtained.

If the camera has a fixed focus, the value of the focal length f of the lens can be obtained in advance. When a zoom lens or the like is present, the value of the focal length f of the lens changes depending on the zoom magnification of the lens. Therefore, a table indicating the relationship between the zoom magnification and the focal length f of the lens is created and stored in advance. Then, the focal length f can be read based on the zoom magnification, and projective transformation can be performed according to Equations 10 and 11.

画像処理装置25は、このようなアフィン変換を行うため、まず、撮影した撮影対象物の画像から射影パラメータを抽出する(図5のステップS19)。
画像処理装置25が実行する射影パラメータの抽出処理を図8に示すフローチャートに基づいて説明する。
In order to perform such affine transformation, the image processing device 25 first extracts projection parameters from the image of the photographed subject (step S19 in FIG. 5).
Projection parameter extraction processing executed by the image processing device 25 will be described with reference to the flowchart shown in FIG.

画像処理装置25は、撮影した撮影対象物の画像から、この撮影対象物の画像の四隅の座標点(四角形輪郭)を抽出する(ステップS31)。画像処理装置25は、図9に示すフローチャートに示す四角形の輪郭を抽出する。   The image processing device 25 extracts coordinate points (rectangular contours) at the four corners of the image of the photographed object from the photographed image of the photographed object (step S31). The image processing device 25 extracts a rectangular outline shown in the flowchart of FIG.

即ち、画像処理装置25は、画像処理の演算数を減らすため、入力画像から縮小輝度画像を生成する(ステップS41)。
画像処理装置25は、生成した縮小輝度画像から、撮影対象物のエッジ画像を生成する(ステップS42)。
That is, the image processing device 25 generates a reduced luminance image from the input image in order to reduce the number of operations for image processing (step S41).
The image processing device 25 generates an edge image of the shooting target from the generated reduced luminance image (step S42).

画像処理装置25は、撮影対象物のエッジ画像から、このエッジ画像に含まれる直線パラメータを検出する(ステップS43)。
画像処理装置25は、検出した直線パラメータから、撮影対象物の輪郭を形成する候補となる四角形を作成する(ステップS44)。
The image processing device 25 detects a straight line parameter included in the edge image from the edge image of the photographing object (step S43).
The image processing device 25 creates a quadrangle that is a candidate for forming the contour of the object to be photographed from the detected straight line parameters (step S44).

画像処理装置25は、このように候補となる四角形を生成し、生成した各四角形に優先順位を付す(図8のステップS32)。
画像処理装置25は、優先順位に従って四角形を選択し、選択した四角形を抽出できたか否かを判定する(ステップS33)。
The image processing device 25 generates the candidate rectangles in this way, and assigns priorities to the generated rectangles (step S32 in FIG. 8).
The image processing device 25 selects a rectangle according to the priority order, and determines whether or not the selected rectangle has been extracted (step S33).

四角形を抽出できなかったと判定した場合(ステップS33においてNo)、CPU30は、この射影パラメータ抽出処理を終了させる。   If it is determined that the quadrangle could not be extracted (No in step S33), the CPU 30 ends the projection parameter extraction process.

一方、四角形を抽出できたと判定した場合(ステップS33においてYes)、CPU30は、画像処理装置25から、抽出した四角形を取得して、表示装置24に送り、液晶モニタ12に、四角形のプレビュー画像を表示させる(ステップS34)。   On the other hand, if it is determined that the quadrangle has been extracted (Yes in step S33), the CPU 30 acquires the extracted quadrangle from the image processing device 25, sends it to the display device 24, and displays the quadrangle preview image on the liquid crystal monitor 12. It is displayed (step S34).

CPU30は、操作部26から送信された操作情報に基づいてYESキー、NOキーのいずれが押下されたか否かを判定する(ステップS35)。   The CPU 30 determines whether the YES key or the NO key has been pressed based on the operation information transmitted from the operation unit 26 (step S35).

NOキーが押下されたとCPU30が判定した場合(ステップS35においてNo)、画像処理装置25は、次の候補の四角形を指定する(ステップS36)。   If the CPU 30 determines that the NO key has been pressed (No in step S35), the image processing device 25 designates the next candidate rectangle (step S36).

一方、YESキーが押下されたと判定した場合(ステップS35においてYes)、CPU30は、抽出した四角形の頂点から、アフィンパラメータを算出する(ステップS37)。   On the other hand, if it is determined that the YES key has been pressed (Yes in step S35), the CPU 30 calculates affine parameters from the extracted quadrangular vertices (step S37).

次に、この射影パラメータの抽出処理を、さらに具体的に説明する。
画像処理装置25がステップS41において生成した縮小輝度画像の一例を図10(a)に示す。画像処理装置25は、このような縮小輝度画像から、Robertsフィルタと呼ばれるエッジ検出用のフィルタを用いて図10(b)に示すようなエッジ画像を生成する(ステップS42)。このRobertsフィルタとは、2つの4近傍画素の重み付けを行って2つのフィルタΔ1、Δ2を取得して平均化することによって、画像のエッジを検出するフィルタである。
Next, the projection parameter extraction process will be described more specifically.
An example of the reduced luminance image generated by the image processing device 25 in step S41 is shown in FIG. The image processing device 25 generates an edge image as shown in FIG. 10B from such a reduced luminance image using an edge detection filter called a Roberts filter (step S42). The Roberts filter is a filter that detects an edge of an image by weighting two 4-neighboring pixels, obtaining two filters Δ1 and Δ2, and averaging them.

図11(a)は、フィルタΔ1の係数を示し、図11(b)は、フィルタΔ2の係数を示す。この2つのフィルタΔ1,Δ2の係数を、ある着目した座標(x,y)の画素値f(x,y)に適用すると、変換後の画素値g(x,y)は、次の数12によって表される。
11A shows the coefficient of the filter Δ1, and FIG. 11B shows the coefficient of the filter Δ2. When the coefficients of the two filters Δ1 and Δ2 are applied to the pixel value f (x, y) of a certain coordinate (x, y), the converted pixel value g (x, y) Represented by

図10(b)に示すエッジ画像には、直線パラメータが含まれている。画像処理装置25は、このエッジ画像から、ラドン変換を行って直線パラメータを検出する(ステップS43の処理)。   The edge image shown in FIG. 10B includes straight line parameters. The image processing device 25 performs a Radon transform from this edge image to detect a straight line parameter (processing in step S43).

ラドン変換は、n次元のデータを、(n−1)次元の投影データに対応させる積分変換である。具体的には、図12(a),(b)に示すように、画像データをf(x,y)として、x−y座標系から角度θだけ回転したr−θ座標系を考える。θ方向の画像投影データp(r,θ)は、次の数13によって定義される。
The Radon transform is an integral transform that associates n-dimensional data with (n-1) -dimensional projection data. Specifically, as shown in FIGS. 12A and 12B, an r-θ coordinate system rotated by an angle θ from the xy coordinate system with image data f (x, y) is considered. Image projection data p (r, θ) in the θ direction is defined by the following equation (13).

この数13による変換がラドン変換と呼ばれるものである。
図12(a)に示すような画像データf(x,y)は、ラドン変換により、図12(b)に示すような画像投影データp(r,θ)に変換される。
This conversion by Equation 13 is called Radon conversion.
Image data f (x, y) as shown in FIG. 12A is converted into image projection data p (r, θ) as shown in FIG. 12B by Radon transformation.

このようなラドン変換によれば、図13(a)に示すようなx−y座標系の直線Lは、極座標系では、ρ=xcosα+ysinαで表される。この直線Lは、p(ρ,α)の点に全て投影されるので、p(r,θ)のピークを検出することで、直線の検出が可能になる。画像処理装置25は、この原理を用いて、エッジ画像から、ラドン変換によりデータp(r,θ)を生成する。   According to such a Radon transform, a straight line L in the xy coordinate system as shown in FIG. 13A is represented by ρ = x cos α + y sin α in the polar coordinate system. Since this straight line L is entirely projected on the point p (ρ, α), it is possible to detect the straight line by detecting the peak of p (r, θ). Using this principle, the image processing device 25 generates data p (r, θ) from the edge image by Radon transform.

次に、画像処理装置25は、生成したデータp(r,θ)から、そのピーク点を抽出する。このため、画像処理装置25は、図14に示すフローチャートに従って、このピーク点の抽出処理を実行する。   Next, the image processing device 25 extracts the peak point from the generated data p (r, θ). Therefore, the image processing device 25 executes this peak point extraction process according to the flowchart shown in FIG.

画像処理装置25は、P(r,θ)での最大値pmaxを探す(ステップS51)。
画像処理装置25は、閾値pth = pmax * k(kは0以上1までの定数値)を求める(ステップS52)。
The image processing device 25 searches for the maximum value pmax at P (r, θ) (step S51).
The image processing apparatus 25 obtains a threshold value pth = pmax * k (k is a constant value from 0 to 1) (step S52).

画像処理装置25は、pthを閾値にしてP(r,θ)から2値画像B(r,θ)を生成する(ステップS53)。
画像処理装置25は、B(r,θ)の画像ラベリングを行う。このとき得られたラベル数をN1とする(ステップS54)。
The image processing device 25 generates a binary image B (r, θ) from P (r, θ) using pth as a threshold (step S53).
The image processing device 25 performs image labeling of B (r, θ). The number of labels obtained at this time is set to N1 (step S54).

画像処理装置25は、各ラベル領域内でP(r,θ)が最大値のところのr,θを調べる。そして、画像処理装置25は、この値を、それぞれri,θi (i=1〜Nl)として取得する(ステップS55)。これが直線のパラメータとなる。   The image processing device 25 examines r and θ where P (r, θ) has the maximum value in each label area. The image processing device 25 acquires these values as ri, θi (i = 1 to Nl), respectively (step S55). This is a straight line parameter.

次に、画像処理装置25は、検出した直線パラメータを用いて四角形候補を生成する場合(図9のステップS44の処理)、図15(a)に示すように、4本の直線が四角形を形成すれば、例えば、対向する直線a1,a3は、対向する直線a1,a3以外の2本の直線a2,a4と、それぞれ、交点p1,p4,p2,p3を有することになる。この場合、CPU30は、四角形を抽出できたと判定する(図8のステップS33においてYes)。   Next, when the quadrilateral candidate is generated using the detected straight line parameter (the process of step S44 in FIG. 9), the image processing device 25 forms a quadrilateral with four straight lines as shown in FIG. In this case, for example, the opposing straight lines a1 and a3 have two straight lines a2 and a4 other than the opposing straight lines a1 and a3 and intersections p1, p4, p2, and p3, respectively. In this case, the CPU 30 determines that the quadrangle has been extracted (Yes in step S33 in FIG. 8).

一方、図15(b),(c)に示すように、4つの交点がなければ、CPU30は、四角形を抽出できなかったと判定する(ステップS33においてNo)。   On the other hand, as shown in FIGS. 15B and 15C, if there are no four intersections, the CPU 30 determines that the quadrangle could not be extracted (No in step S33).

次に、画像処理装置25は、抽出した四角形の候補の中から、撮影対象物の辺を表すものとして、最もふさわしい四角形を選択する。
この方法はいくつか考えられ、本実施の形態では、撮影された四角形のうち、最外郭の四角形を選ぶものとする。最外郭の四角形とは、図6に示すように候補となる四角形をX,Y軸の平行線で囲んで長方形を形成し、そのうち、面積が最も大きいものをいう。
Next, the image processing device 25 selects the most suitable rectangle as the one representing the side of the object to be photographed from the extracted rectangle candidates.
Several methods are conceivable, and in the present embodiment, the outermost quadrangle is selected from the photographed quadrilaterals. As shown in FIG. 6, the outermost quadrangle is a rectangle that is formed by surrounding a candidate quadrangle with parallel lines of the X and Y axes, and has the largest area.

長方形Riの4つの頂点の座標を、それぞれ、(x0,y0),(x1,y1),(x2,y2),(x3,y3)とすると、四角形の面積Siは、次の数14によって表される。
If the coordinates of the four vertices of the rectangle Ri are (x0, y0), (x1, y1), (x2, y2), and (x3, y3), the square area Si is expressed by the following equation (14). Is done.

画像処理装置25は、図16に示すフローチャートに従って、この四角形を選択する。
画像処理装置25は、候補数Nrの四角形のうちから、いずれかの四角形を選択する(ステップS61)。
画像処理装置25は、選択した四角形の面積Siを、数10に従って求める(ステップS62)。
The image processing device 25 selects this rectangle according to the flowchart shown in FIG.
The image processing device 25 selects one of the candidate number Nr of rectangles (step S61).
The image processing apparatus 25 calculates the area Si of the selected square according to Equation 10 (step S62).

画像処理装置25は、候補数Nrをデクリメントする(ステップS63)。
画像処理装置25は、候補数Nrが0になったか否かを判定する(ステップS64)。
候補数Nrが0にはなっていないと判定した場合(ステップS64においてNo)、画像処理装置25は、ステップS61〜S63の処理を、再度、実行する。
The image processing device 25 decrements the candidate number Nr (step S63).
The image processing device 25 determines whether the number of candidates Nr has become 0 (step S64).
When it is determined that the number of candidates Nr is not 0 (No in step S64), the image processing device 25 executes the processes in steps S61 to S63 again.

このような処理を繰り返し行うことによって、候補数Nrが0になったと判定した場合(ステップS64においてYes)、画像処理装置25は、求めた面積Siの大きい順に、候補となる四角形のデータを並べ替える(ステップS65)。   When it is determined that the number of candidates Nr has become 0 by repeating such processing (Yes in step S64), the image processing device 25 arranges the candidate quadrilateral data in descending order of the calculated area Si. Change (step S65).

そして、画像処理装置25は、一番目の四角形を最優先の四角形の輪郭とする。このように複数の四角形の候補があっても常に最大外郭の四角形が優先的に選択される。このように最大外郭の四角形を優先的に選択するのは、通常、意識的に撮影対象物が撮影画角内の最大になるように、ズーム調整や撮影位置の調整が行われ、最大外郭の四角形が撮影対象物の輪郭と考えられるからである。   Then, the image processing apparatus 25 sets the first quadrangle as the highest priority quadrilateral outline. Thus, even if there are a plurality of quadrangle candidates, the quadrilateral with the maximum outline is always preferentially selected. In this way, the preferential selection of the quadrangular shape of the maximum outline is usually performed by zoom adjustment and adjustment of the photographing position so that the object to be photographed becomes the maximum within the photographing angle of view. This is because the quadrangle is considered as the outline of the object to be imaged.

従って、概ね、撮影対象物の輪郭が自動的に抽出されることが期待される。また、誤って四角形が抽出されたとしても、ユーザは、一般には、最大外郭の四角形から順次、確認することになる。このため、撮影対象物の輪郭を示す直線が抽出されていれば、真の撮影対象物の四角形は、NOキーを順次押下することによって選択されることになる。   Therefore, it is generally expected that the outline of the object to be imaged is automatically extracted. In addition, even if a quadrangle is extracted by mistake, the user generally confirms sequentially from the quadrangle of the maximum outline. For this reason, if a straight line indicating the outline of the object to be imaged is extracted, the true rectangle of the object to be imaged is selected by sequentially pressing the NO key.

このようにして、選択された撮影対象物の四角形の4点の頂点の座標(x0,y0),(x1,y1),(x2,y2),(x3,y3)を用いて、数5,数8に従って、数8に示す行列内の各要素であるアフィンパラメータを求めることができる。   In this way, using the coordinates (x0, y0), (x1, y1), (x2, y2), (x3, y3) of the four points of the quadrangle of the selected photographing object, According to Equation 8, affine parameters that are each element in the matrix shown in Equation 8 can be obtained.

(1)撮影対象画像からのアフィンパラメータ抽出
このような考え方に基づいて、画像処理装置25は、四角形の頂点からアフィンパラメータを取得する。この処理を、図17に示すフローチャートに基づいて説明する。
(1) Extraction of Affine Parameter from Image to be Captured Based on such a concept, the image processing device 25 acquires an affine parameter from a rectangular vertex. This process will be described based on the flowchart shown in FIG.

画像処理装置25は、四角形の4点の頂点座標(x0,y0),(x1,y1),(x2,y2),(x3,y3)から、数5に従って、射影係数α、βを算出する(ステップS71)。   The image processing device 25 calculates projection coefficients α and β according to Equation 5 from the vertex coordinates (x0, y0), (x1, y1), (x2, y2), and (x3, y3) of the four points of the rectangle. (Step S71).

画像処理装置25は、数10に従って撮影対象物の縦横比kを算出する(ステップS72)。
画像処理装置25は、画像の中心点(uc,vc)を指定する(ステップS73)。
画像処理装置25は、最大画像サイズvmax/umaxと数10で表される縦横比kとを比較する(ステップS74)。
The image processing device 25 calculates the aspect ratio k of the object to be photographed according to Equation 10 (step S72).
The image processing device 25 designates the center point (uc, vc) of the image (step S73).
The image processing device 25 compares the maximum image size vmax / umax with the aspect ratio k expressed by Equation 10 (step S74).

vmax/umax≦kの場合(ステップS74においてNo)、縦横比kを変えないものとして、画像処理装置25は、U軸側(横)の最大画像サイズumaxの方が撮影対象物の画像サイズよりも大きいと判定する。そして、画像処理装置25は、V軸側の最大画像サイズと撮影対象物の画像サイズとが一致するように、数11の条件(1)に従って、m,nの値を求める(ステップS75)。   When vmax / umax ≦ k (No in step S74), the image processing apparatus 25 assumes that the maximum image size umax on the U-axis side (lateral) is larger than the image size of the object to be photographed, assuming that the aspect ratio k is not changed. Is also determined to be large. Then, the image processing device 25 obtains the values of m and n according to the condition (1) of Equation 11 so that the maximum image size on the V-axis side and the image size of the object to be photographed coincide (step S75).

vmax/umax>kの場合(ステップS74においてYes)、縦横比kを変えないものとして、画像処理装置25は、V軸側(縦)の最大画像サイズvmaxの方が撮影対象物の画像サイズよりも大きいと判定する。そして、画像処理装置25は、U軸側の最大画像サイズと撮影対象物の画像サイズとが一致するように、数11の条件(2)に従ってm,nの値を求める(ステップS76)。   When vmax / umax> k (Yes in step S74), assuming that the aspect ratio k is not changed, the image processing apparatus 25 determines that the maximum image size vmax on the V-axis side (vertical) is larger than the image size of the object to be photographed. Is also determined to be large. Then, the image processing device 25 obtains the values of m and n according to the condition (2) of Equation 11 so that the maximum image size on the U-axis side matches the image size of the object to be photographed (step S76).

画像処理装置25は、算出したm、nと四角形の4点の頂点座標(x0,y0),(x1,y1),(x2,y2),(x3,y3)から、数8に従って、アフィン変換行列Afを求める(ステップS77)。
画像処理装置25は、このアフィン変換行列Afの各要素をアフィンパラメータAとして、このアフィンパラメータAを取得する(ステップS78)。
The image processing device 25 calculates the affine transformation from the calculated vertex coordinates (x0, y0), (x1, y1), (x2, y2), (x3, y3) of the four points of the quadrangle according to Equation 8 A matrix Af is obtained (step S77).
The image processing apparatus 25 acquires the affine parameter A using each element of the affine transformation matrix Af as the affine parameter A (step S78).

尚、四角形が認識できないような場合(図8のステップS33においてNo)のように、画像撮影条件等が不適であり、射影パラメータが得られない場合がある。このような場合、図18(a)に示すような警告文を、液晶モニタ12に表示させ、撮影者に領域が検出できなかったことを適切に警告し、撮影者に、図18(b)に示すようなカメラ撮影設定モードにして撮影条件を変更させ、再度撮影を促すようにしたほうが好ましい。さらに再度、撮影条件を変えるように警告をした方が好ましい場合がある。   Note that, as in the case where the quadrangle cannot be recognized (No in step S33 in FIG. 8), the image capturing condition or the like is inappropriate, and the projection parameter may not be obtained. In such a case, a warning message as shown in FIG. 18A is displayed on the liquid crystal monitor 12 to appropriately warn the photographer that the area could not be detected, and to the photographer, FIG. It is preferable to change the shooting conditions to the camera shooting setting mode as shown in FIG. Furthermore, it may be preferable to warn again to change the shooting conditions.

CPU30は、このように適正な射影パラメータが得られなかった場合、図19に示すフローチャートに従って、警告処理を行う(図5のステップS27)。   When the proper projection parameter cannot be obtained as described above, the CPU 30 performs a warning process according to the flowchart shown in FIG. 19 (step S27 in FIG. 5).

CPU30は、表示装置24を制御して、図18(a)に示すような警告文を液晶モニタ12に表示させる(ステップS81)。   The CPU 30 controls the display device 24 to display a warning text as shown in FIG. 18A on the liquid crystal monitor 12 (step S81).

CPU30は、YESキー、NOキーのいずれが押下されたかを、操作部26から送信された操作情報に基づいて判定する(ステップS82)。   The CPU 30 determines which of the YES key and the NO key is pressed based on the operation information transmitted from the operation unit 26 (step S82).

NOキーが押下されたと判定した場合(ステップS82においてNo)、CPU30は、この警告処理を終了させる。   When it is determined that the NO key has been pressed (No in step S82), the CPU 30 ends the warning process.

一方、YESキーが押下されたと判定した場合(ステップS82においてYes)、CPU30は、撮影モードに切り替えて(ステップS83)、この警告処理を終了させる。   On the other hand, if it is determined that the YES key has been pressed (Yes in step S82), the CPU 30 switches to the shooting mode (step S83) and ends this warning process.

(2)抽出したアフィンパラメータによる画像変換
次に、得られたアフィンパラメータを用いて補正画像を作成する画像処理方法について説明する。
まず、アフィンパラメータを用いて射影変換や他のアフィン変換を行なう場合、図20に示すように、元の画像の点p(x,y)が、変換行列Apによる射影変換等によって変換(後)画像の点P(u,v)に対応するものとする。この場合、元の画像の点pに対応する変換画像の点Pを求めるよりは、変換画像の点P(u,v)に対応する元の画像の点p(x,y)を求めたほうが好ましい。
(2) Image Conversion Using Extracted Affine Parameters Next, an image processing method for creating a corrected image using the obtained affine parameters will be described.
First, when projective transformation or other affine transformation is performed using affine parameters, as shown in FIG. 20, the point p (x, y) of the original image is transformed by projective transformation using the transformation matrix Ap (after). Assume that it corresponds to the point P (u, v) of the image. In this case, it is better to obtain the point p (x, y) of the original image corresponding to the point P (u, v) of the converted image than to obtain the point P of the converted image corresponding to the point p of the original image. preferable.

尚、変換画像の点Pの座標を求める際、バイリニア法による補間方法を用いるものとする。バイリニア法による補間方法は、一方の画像(元の画像)の座標点と対応する他方の画像(変換画像)の座標点を探し出して、一方の画像の座標点の周辺4点の(画素)値から変換画像の点P(u,v)の(画素)値を求める方法である。この方法によれば、変換画像の点Pの画素値Pは、次の数15に従って算出される。
Note that when obtaining the coordinates of the point P of the converted image, an interpolation method based on the bilinear method is used. In the bilinear interpolation method, the coordinate point of the other image (transformed image) corresponding to the coordinate point of one image (original image) is searched, and the (pixel) values of four points around the coordinate point of the one image are found. Is a method for obtaining a (pixel) value of a point P (u, v) of the converted image. According to this method, the pixel value P of the point P of the converted image is calculated according to the following Expression 15.

変換画像の点P(u,v)に対応する元の画像の点p(x,y)を求めるため、画像処理装置25は、図21に示すフローチャートの処理を実行する。
画像処理装置25は、変換画像の画素位置uを0に初期化する(ステップS91)。
In order to obtain the point p (x, y) of the original image corresponding to the point P (u, v) of the converted image, the image processing device 25 executes the process of the flowchart shown in FIG.
The image processing device 25 initializes the pixel position u of the converted image to 0 (step S91).

画像処理装置25は、変換画像の画素位置vを0に初期化する(ステップS92)。
画像処理装置25は、数5及び数8で得られたアフィンパラメータAを用いて変換画像の画素位置(u,v)を代入し、数2に従って、元の画像の画素位置(x,y)を求める(ステップS93)。
The image processing device 25 initializes the pixel position v of the converted image to 0 (step S92).
The image processing device 25 substitutes the pixel position (u, v) of the converted image using the affine parameter A obtained by Equations 5 and 8, and according to Equation 2, the pixel position (x, y) of the original image Is obtained (step S93).

画像処理装置25は、求めた画素位置(x,y)から、数15に従って、バイリニア法により画素値P(u,v)を求める(ステップS94)。
画像処理装置25は、補正後画像の座標vを1つだけインクリメントする(ステップS95)。
The image processing device 25 obtains the pixel value P (u, v) from the obtained pixel position (x, y) according to the formula 15 by the bilinear method (step S94).
The image processing device 25 increments the corrected image coordinate v by one (step S95).

画像処理装置25は、補正後画像の座標vと座標vの最大値vmaxとを比較して、補正後画像の座標vが最大値vmax以上になったか否かを判定する(ステップS96)。   The image processing device 25 compares the coordinate v of the corrected image with the maximum value vmax of the coordinate v, and determines whether or not the coordinate v of the corrected image is greater than or equal to the maximum value vmax (step S96).

座標vが最大値vmax未満であると判定した場合(ステップS96においてNo)、画像処理装置25は、ステップS93〜S95を再度実行する。   When it is determined that the coordinate v is less than the maximum value vmax (No in step S96), the image processing device 25 executes steps S93 to S95 again.

ステップS93〜S95の処理を繰り返すことにより、座標vが最大値vmaxに達したと判定した場合(ステップS96においてYes)、画像処理装置25は、補正後画像の座標uを1つだけインクリメントする(ステップS97)。   When it is determined that the coordinate v has reached the maximum value vmax by repeating the processes in steps S93 to S95 (Yes in step S96), the image processing device 25 increments the coordinate u of the corrected image by one ( Step S97).

画像処理装置25は、座標uと座標uの最大値umaxとを比較し、座標uが最大値umax以上になったか否かを判定する(ステップS98)。
座標uが最大値umax未満であると判定した場合(ステップS98においてNo)、画像処理装置25は、再度、ステップS92〜S97の処理を実行する。
The image processing device 25 compares the coordinate u with the maximum value umax of the coordinate u, and determines whether or not the coordinate u is equal to or greater than the maximum value umax (step S98).
When it is determined that the coordinate u is less than the maximum value umax (No in step S98), the image processing device 25 executes the processes of steps S92 to S97 again.

ステップ92〜S97の処理を繰り返すことにより、座標uが最大値umaxに達したと判定した場合(ステップ98においてYes)、画像処理装置25は、この画像変換処理を終了させる。   When it is determined that the coordinate u has reached the maximum value umax by repeating the processes of steps 92 to S97 (Yes in step 98), the image processing apparatus 25 ends the image conversion process.

(3)画像変換の調整
次に、一度画像変換を行った画像に対して行われる調整(図5のステップS22)について説明する。
抽出された四角形の頂点の座標に若干の誤差等が含まれているような場合、図22(a)に示すように、得られたアフィンパラメータで射影した結果が好ましくない場合がある。このため、本実施形態のデジタルカメラ1は、一度画像変換した画像に対して調整を行い、図22(b)に示すような画像を得るために、ユーザによって射影変換の調整を行えるように構成されている。
(3) Image Conversion Adjustment Next, adjustment (step S22 in FIG. 5) performed on an image that has been once converted will be described.
In the case where some errors are included in the coordinates of the extracted quadrangular vertices, as shown in FIG. 22A, the result of projection with the obtained affine parameters may not be preferable. For this reason, the digital camera 1 of the present embodiment is configured so that the user can adjust the projective transformation in order to adjust the image once converted and obtain an image as shown in FIG. Has been.

ユーザが操作部26の射影変換キー、回転補正キーを操作すると、操作部26は、ユーザの操作に応答して、この操作情報をCPU30に送信する。CPU30は、この操作情報を判別し、判別結果に従って画像処理装置25を制御する。   When the user operates the projection conversion key and the rotation correction key of the operation unit 26, the operation unit 26 transmits this operation information to the CPU 30 in response to the user's operation. The CPU 30 determines this operation information and controls the image processing device 25 according to the determination result.

尚、図23に示すように、補正画像の補間画素Q(u',v')を求める際に、補間画素Q(u',v')に対して逆変換Aiを行って、補間画素Q(u',v')に対応する補正画像P(u,v)を求め、さらに補正画像P(u,v)に対して逆変換を行って、元の画像のp(x,y)を求め、画像p(x,y)に対して画素補間を行う。また、射影変換と拡大変換等、画像変換を2段変換する場合は、2つの変換を合成した変換行列を求めておいて、元の画像に対して変換を一度で行う。この方が、変換を2回行うより画像を高速に求めることができ、かつ、画像の劣化は少なくてすむ。   As shown in FIG. 23, when the interpolation pixel Q (u ′, v ′) of the corrected image is obtained, an inverse transformation Ai is performed on the interpolation pixel Q (u ′, v ′) to obtain the interpolation pixel Q. A corrected image P (u, v) corresponding to (u ′, v ′) is obtained, and further the inverse transformation is performed on the corrected image P (u, v) to obtain p (x, y) of the original image. Then, pixel interpolation is performed on the image p (x, y). Further, when performing two-stage image conversion such as projective conversion and enlargement conversion, a conversion matrix obtained by combining the two conversions is obtained, and the original image is converted at a time. In this case, an image can be obtained at a higher speed than when conversion is performed twice, and image deterioration can be reduced.

変換前の画像を、X軸,Y軸を中心に角度θだけ回転して得られた変換後の画像から、変換前の画像を取得する場合の回転逆変換行列Arは、次の数16によって表される。

変換前の画像を、X軸,Y軸を中心にしてSc倍拡大して得られた変換後の画像から、変換前の画像を取得する場合の拡大行列Ascは、次の数17によって表される。
The rotation inverse transformation matrix Ar for obtaining the image before conversion from the image after conversion obtained by rotating the image before conversion by the angle θ about the X axis and the Y axis is expressed by the following equation (16). expressed.

An enlargement matrix Asc in the case of obtaining an image before conversion from an image after conversion obtained by enlarging the image before conversion by Sc magnification around the X axis and the Y axis is expressed by the following Expression 17. The

尚、一度、画像を拡大すると、アフィンパラメータの調整や計算で丸め誤差の処理等が行われる場合がある。このため、画像を拡大する場合、その前に元の等倍のアフィンパラメータに復帰させるようにしておく必要がある。   Note that once an image is enlarged, a rounding error may be processed by adjusting or calculating an affine parameter. For this reason, before enlarging the image, it is necessary to restore the original affine parameters of the same magnification.

変換前の画像をX,Y方向に、それぞれ、Tx,Tyだけ移動させることによって得られた変換後の画像から、変換前の画像を取得する場合の移動行列Asは、次の数18によって表される。
The movement matrix As for obtaining the image before conversion from the image after conversion obtained by moving the image before conversion in the X and Y directions by Tx and Ty, respectively, is expressed by the following equation (18). Is done.

補正前の画像をX,Y方向に、それぞれ、α,βだけ傾斜することによって得られた変換後の画像から、変換前の画像を取得する場合の射影効果行列Apは、次の数19によって表される。

そして、2段の逆変換を実行する場合、その逆変換行列Aは、次の数20によって表される。
The projection effect matrix Ap in the case of acquiring the image before conversion from the image after conversion obtained by inclining the image before correction in the X and Y directions by α and β, respectively, is given by expressed.

When performing two-stage inverse transformation, the inverse transformation matrix A is expressed by the following equation (20).

尚、本実施形態では、射影効果パラメータα、βは0.1刻み、角度補正パラメータθは1度刻みに設定するものとする。但し、実際の補正の効果を確かめながら各パラメータの調整幅を決定することができる。   In this embodiment, the projection effect parameters α and β are set in increments of 0.1, and the angle correction parameter θ is set in increments of 1 degree. However, the adjustment range of each parameter can be determined while checking the actual correction effect.

このような考え方に基づいて実行される画像変換の調整処理を、図24に示すフローチャートに基づいて説明する。
CPU30は、画像の中心座標Xc,Ycを設定する(ステップS101)。
CPU30は、操作部26から送信された操作情報に基づいて射影補正キーが押下されたか否かを判定する(ステップ102)。
射影変換キーが押下されたと判定した場合(ステップS102においてYes)、CPU30は、射影変換キーとして、上縮小キー111、下縮小キー112、右縮小キー113、左縮小キー114のうちの押下されたキーの種別を判別する(ステップS103〜S106)。
Image conversion adjustment processing executed based on this concept will be described based on the flowchart shown in FIG.
The CPU 30 sets the center coordinates Xc and Yc of the image (step S101).
The CPU 30 determines whether or not the projection correction key is pressed based on the operation information transmitted from the operation unit 26 (step 102).
If it is determined that the projection conversion key has been pressed (Yes in step S102), the CPU 30 has pressed one of the upper reduction key 111, the lower reduction key 112, the right reduction key 113, and the left reduction key 114 as the projection conversion key. The key type is determined (steps S103 to S106).

押下された射影変換キーが上縮小キー111であると判別した場合、CPU30は、数19に示す射影効果行列Apに、α=0.1、β=0をそれぞれ代入して、逆変換行列Ai=Apを取得する(ステップS103)。   When determining that the pressed projective transformation key is the up-reduction key 111, the CPU 30 assigns α = 0.1 and β = 0 to the projective effect matrix Ap shown in Equation 19 to obtain an inverse transformation matrix Ai = Ap. Is acquired (step S103).

押下された射影変換キーが下縮小キー112であると判別した場合、CPU30は、数19に示す射影効果行列Apに、α=-0.1,β=0をそれぞれ代入して、逆変換行列Ai=Apを取得する(ステップS104)。   If it is determined that the pressed projective transformation key is the lower reduction key 112, the CPU 30 assigns α = −0.1 and β = 0 to the projective effect matrix Ap shown in Equation 19 to obtain an inverse transformation matrix Ai = Ap is acquired (step S104).

押下された射影変換キーが右縮小キー113であると判別した場合、CPU30は、数19に示す射影効果行列Apに、α=0,β=0.1をそれぞれ代入して、逆変換行列Ai=Apを取得する(ステップS105)。   If it is determined that the pressed projective transformation key is the right reduction key 113, the CPU 30 substitutes α = 0 and β = 0.1 for the projection effect matrix Ap shown in Equation 19 to obtain an inverse transformation matrix Ai = Ap. Is acquired (step S105).

押下された射影変換キーが左縮小キー114であると判別した場合、CPU30は、数19に示す射影効果行列Apに、α=0,β=-0.1をそれぞれ代入して、逆変換行列Ai=Apを取得する(ステップS106)。   When determining that the pressed projective transformation key is the left reduction key 114, the CPU 30 assigns α = 0 and β = −0.1 to the projective effect matrix Ap shown in Equation 19, respectively, and the inverse transformation matrix Ai = Ap is acquired (step S106).

射影変換キーは押下されなかったと判定した場合(ステップ102においてNo)、CPU30は、回転補正キーが押下されたか否かを判定する(ステップS107)。
回転補正キーが押下されたと判定した場合(ステップS107においてYes)、CPU30は、押下された回転補正キーの種別を判別する(ステップS108、S109)。
If it is determined that the projection conversion key has not been pressed (No in step 102), the CPU 30 determines whether or not the rotation correction key has been pressed (step S107).
If it is determined that the rotation correction key has been pressed (Yes in step S107), the CPU 30 determines the type of the rotation correction key that has been pressed (steps S108 and S109).

押下された回転補正キーが右回転キー115であると判別した場合、CPU30は、数16に示す回転逆変換行列Arに、θ=−1を代入して、逆変換行列Ai=Arを取得する(ステップ108)。   When determining that the pressed rotation correction key is the right rotation key 115, the CPU 30 substitutes θ = −1 into the rotation inverse transformation matrix Ar shown in Expression 16 to obtain the inverse transformation matrix Ai = Ar. (Step 108).

押下された回転補正キーが左回転キー116であると判別した場合、CPU30は、数16に示す回転逆変換行列Arに、θ=1を代入して、逆変換行列Ai=Arを取得する(ステップ109)。   If it is determined that the pressed rotation correction key is the left rotation key 116, the CPU 30 substitutes θ = 1 for the rotation inverse transformation matrix Ar shown in Equation 16 to obtain the inverse transformation matrix Ai = Ar ( Step 109).

また、射影変換キー又は回転補正キーが押下されたと判定して、逆変換行列Aiを設定した場合(ステップS103〜S106,S108,S109)、CPU30は、数20に従って、逆変換行列Aを求める(ステップS110)。   When it is determined that the projective transformation key or the rotation correction key has been pressed and the inverse transformation matrix Ai is set (steps S103 to S106, S108, S109), the CPU 30 obtains the inverse transformation matrix A according to Equation 20 ( Step S110).

CPU30は、求めた変換行列Aを画像処理装置25に供給し、逆変換行列Aに基づいて画像変換を行うように画像処理装置25を制御する。画像処理装置25は、供給された逆変換行列Aに基づいて、アフィン変換による画像変換を行い(ステップS111)、この画像変換の調整処理を終了させる。
一方、回転補正キーが押下されていないと判定した場合(ステップS107においてNo)、CPU30は、そのまま、この画像変換の調整処理を終了させる。
The CPU 30 supplies the obtained conversion matrix A to the image processing device 25, and controls the image processing device 25 to perform image conversion based on the inverse conversion matrix A. The image processing device 25 performs image conversion by affine transformation based on the supplied inverse transformation matrix A (step S111), and ends this image transformation adjustment processing.
On the other hand, if it is determined that the rotation correction key has not been pressed (No in step S107), the CPU 30 ends the image conversion adjustment process as it is.

このようにして得られたアフィンパラメータを用いて、前述した方法にて画像変換を行うことにより、補正画像に対して、さらに画像をマニュアル調整することもできる。   By performing image conversion by the above-described method using the affine parameters obtained in this manner, the image can be further manually adjusted with respect to the corrected image.

例えば、図22に示すような画像を調整する場合、画像が左方向に歪んでいるので、まず右回転キー115を押下すると、画像処理装置25は、画像を右回転させる。このまま、右回転キー115が押下されて、文字列が正しく表示されたときに右回転キー115の押下が停止すると、画像処理装置25は、画像の右回転を停止させる。   For example, when adjusting an image as shown in FIG. 22, since the image is distorted leftward, first, when the right rotation key 115 is pressed, the image processing device 25 rotates the image to the right. If the right rotation key 115 is pressed as it is and the character string is correctly displayed and the right rotation key 115 stops being pressed, the image processing device 25 stops the right rotation of the image.

次に画像の左側が右側に比較して大きいので左縮小キー114が押下されると、画像処理装置25は、画像の左右を調整する。このまま、左縮小キー114が押下されて左右のバランスが揃ったときに左縮小キー114の押下が停止すると、画像処理装置25は、左縮小処理を停止させる。   Next, since the left side of the image is larger than the right side, when the left reduction key 114 is pressed, the image processing device 25 adjusts the left and right sides of the image. If the left reduction key 114 is pressed and the left and right balances are aligned and the pressing of the left reduction key 114 stops, the image processing device 25 stops the left reduction process.

この方法は、元画像に対して一度だけの画像変換だけで、画像を得ることができるので、一度射影補正をおこなった画像に対して再度、回転、射影変換するより画質の良い画像を得ることができる。   In this method, an image can be obtained by performing only one image conversion on the original image, so that an image with better image quality than rotating and projecting the image once subjected to projection correction can be obtained. Can do.

(3)輝度あるいは色差等に関する画像効果補正用パラメータの抽出及び画像効果処理
次に、このように得られた画像から、画像効果補正用パラメータを抽出する処理と、このパラメータを用いて行う画像効果処理と、について説明する。画像効果処理は、より鮮明な画像を得るための処理である。
(3) Extraction of image effect correction parameters relating to luminance or color difference and image effect processing Next, processing for extracting image effect correction parameters from the image thus obtained, and image effects performed using these parameters Processing will be described. The image effect process is a process for obtaining a clearer image.

このようにして得られた画像は、結果として白板2や書類などを切り出した画像である。ヒストグラム補正などの画像効果を行なう場合、元の画像から補正パラメータを求めて補正を行うより、切り出す画像からパラメータを求めた方が、より有効なパラメータの取得が期待される。   The image thus obtained is an image obtained by cutting out the white board 2 or the document as a result. When performing image effects such as histogram correction, more effective parameters are expected to be obtained by obtaining parameters from the cut out image than by obtaining correction parameters from the original image and performing correction.

本実施形態では、補正画像データから輝度(Y)からヒストグラムを作成し、そのヒストグラムに応じて画像効果処理を行うものとする。   In the present embodiment, a histogram is created from luminance (Y) from the corrected image data, and image effect processing is performed according to the histogram.

尚、画像効果補正用パラメータは、輝度ヒストグラムの最大値、最小値、ピーク値といった画像効果処理に必要な変数である。   The image effect correction parameters are variables necessary for image effect processing such as the maximum value, minimum value, and peak value of the luminance histogram.

画像効果補正用パラメータを抽出するには、輝度のヒストグラムを生成する必要がある。まず、画像効果補正用パラメータの抽出に必要な処理について説明する。   In order to extract the image effect correction parameter, it is necessary to generate a luminance histogram. First, processing necessary for extracting image effect correction parameters will be described.

輝度ヒストグラムは、画像に存在する輝度値(Y)の分布を示すものであり、輝度値毎に画素の数を計数することにより生成される。図25に輝度ヒストグラムの一例を示す。図25において、横軸は、輝度値(Y)を示し、縦軸は、画素数を示す。画像効果を補正するには、画像効果補正用パラメータとして、最大値(Ymax)、最小値(Ymin)、ピーク値(Ypeak)を求める必要がある。   The luminance histogram indicates the distribution of luminance values (Y) existing in the image, and is generated by counting the number of pixels for each luminance value. FIG. 25 shows an example of a luminance histogram. In FIG. 25, the horizontal axis indicates the luminance value (Y), and the vertical axis indicates the number of pixels. In order to correct the image effect, it is necessary to obtain a maximum value (Ymax), a minimum value (Ymin), and a peak value (Ypeak) as image effect correction parameters.

最大値は、輝度値毎に画素の数を計数し、予め設定された所定数以上の計数値を有する輝度値のうちの最大輝度を示す値であり、最小値は、設定された所定数以上の計数値を有する輝度値のうちの最小輝度を示す値である。ピーク値は、計数値が最大となる輝度値である。ピーク値は、撮影対象物の背景色の輝度値を示すものと考えられる。   The maximum value counts the number of pixels for each luminance value, and is a value indicating the maximum luminance among luminance values having a predetermined number or more set in advance, and the minimum value is a predetermined number or more This is a value indicating the minimum luminance among the luminance values having the counted value. The peak value is a luminance value that maximizes the count value. The peak value is considered to indicate the luminance value of the background color of the photographing object.

尚、画像効果を補正して視認性に優れた画像を得るには、撮影対象物の背景色によって補正効果が異なってくるため、画像効果の補正方法を撮影対象物の背景色によって変える必要がある。このため、撮影対象物の背景色の判別が必要になってくる。撮影対象物の背景色は、輝度ヒストグラム、色差ヒストグラムの各ピーク値から判別される。   In order to obtain an image with excellent visibility by correcting the image effect, the correction effect differs depending on the background color of the object to be imaged. Therefore, it is necessary to change the image effect correction method depending on the background color of the object to be imaged. is there. For this reason, it is necessary to determine the background color of the object to be photographed. The background color of the object to be photographed is determined from the peak values of the luminance histogram and the color difference histogram.

ここで、撮影対象物の背景色を、3つに分類するものとする。第1は、ホワイトボード、ノート等のように背景色が白の場合である。第2は、黒板等のように背景色が黒の場合である。第3は、雑誌、パンフレットのように背景色が白又は黒以外の場合である。   Here, the background color of the photographing object is classified into three. The first is a case where the background color is white, such as a whiteboard or notebook. The second is a case where the background color is black, such as a blackboard. The third is a case where the background color is other than white or black, such as a magazine or a pamphlet.

具体的に、撮影対象物の背景色は、以下の判別式に従って判別される。
(2−a)白の判定条件
白判定条件は、次の数21によって表され、数21に示す条件を満足したときに、撮影対象物の背景色は白(W)と判定される。

(2−b)黒の判定条件
黒判定条件は、次の数22によって表され、数22に示す条件を満足したときに、撮影対象物の背景色は黒(b)と判定される。
Specifically, the background color of the shooting target is determined according to the following discriminant.
(2-a) White Determination Condition The white determination condition is expressed by the following Expression 21, and when the condition shown in Expression 21 is satisfied, the background color of the photographing target is determined to be white (W).

(2-b) Black Determination Condition The black determination condition is represented by the following Expression 22, and when the condition shown in Expression 22 is satisfied, the background color of the shooting target is determined to be black (b).

また、数21,22に示す条件を満足しなかった場合、撮影対象物の背景色はカラー(C)と判定される。尚、カラー閾値は、例えば、50及び128に、白判定閾値は、例えば、128に、黒判定閾値は、例えば、50に設定される。   If the conditions shown in Equations 21 and 22 are not satisfied, the background color of the object to be photographed is determined to be color (C). For example, the color threshold is set to 50 and 128, the white determination threshold is set to 128, and the black determination threshold is set to 50, for example.

このような考え方に基づいて、画像処理装置25は、図26に示すフローチャートに従って画像効果補正用パラメータの抽出処理を実行する。
画像処理装置25は、各輝度(Y)値を有する画素の数を計数して、図25に示すような輝度ヒストグラムを生成する(ステップS121)。
Based on such a concept, the image processing device 25 executes image effect correction parameter extraction processing according to the flowchart shown in FIG.
The image processing device 25 counts the number of pixels having each luminance (Y) value, and generates a luminance histogram as shown in FIG. 25 (step S121).

画像処理装置25は、生成した輝度ヒストグラムから、輝度の最大値(Ymax)、最小値(Ymin)、ピーク値(Ypeak)を取得する(ステップS122)。   The image processing device 25 acquires the maximum value (Ymax), the minimum value (Ymin), and the peak value (Ypeak) of the luminance from the generated luminance histogram (step S122).

画像処理装置25は、輝度ヒストグラムのピーク値(Ypeak)から、数21,22に示す判定条件式に従って撮影対象物の背景色を判別する(ステップS123)。
画像処理装置25は、画像効果補正用パラメータと撮影対象物の背景色のデータをメモリ23に記憶する(ステップS124)。
The image processing device 25 discriminates the background color of the object to be photographed from the peak value (Ypeak) of the luminance histogram according to the judgment condition formulas shown in Equations 21 and 22 (step S123).
The image processing device 25 stores the image effect correction parameter and the background color data of the shooting target in the memory 23 (step S124).

次に、画像処理装置25は、このように抽出した画像効果補正用パラメータを用いて画像効果処理(図5のステップS24)を行う。
前述のように、画像効果処理を効果的に行うには、背景色によって処理内容を替える必要がある。
Next, the image processing device 25 performs image effect processing (step S24 in FIG. 5) using the image effect correction parameters extracted in this way.
As described above, in order to effectively perform the image effect processing, it is necessary to change the processing contents depending on the background color.

ホワイトボード、ノート等のように、背景色が白である場合、図27(a)に示すような輝度変換を行う。黒板等のように、背景色が黒である場合、図27(b)に示すような輝度変換を行う。雑誌、パンフレット等のように、背景色が白または黒以外である場合、図27(c)に示すような変換を行う。尚、図27(a),(b),(c)において、横軸は、画素値の入力値を示し、縦軸は、画素値の出力値を示す。   When the background color is white, such as a whiteboard or notebook, luminance conversion as shown in FIG. When the background color is black, such as a blackboard, luminance conversion as shown in FIG. When the background color is other than white or black, such as a magazine or pamphlet, the conversion shown in FIG. 27C is performed. In FIGS. 27A, 27B, and 27C, the horizontal axis indicates the input value of the pixel value, and the vertical axis indicates the output value of the pixel value.

背景色が白である場合、図27(a)に示すように、ピーク値を境にして、輝度変換線の傾斜角度を変える。所定輝度値を、例えば、230として、入力された輝度のピーク値を輝度値230まで引き上げる。そして、最大値を、最大輝度まで持ち上げる。従って、輝度変換線は、図27(a)に示すように、2つの線分によって表される。   When the background color is white, as shown in FIG. 27A, the inclination angle of the luminance conversion line is changed with the peak value as a boundary. The predetermined luminance value is set to 230, for example, and the input luminance peak value is raised to the luminance value 230. Then, the maximum value is raised to the maximum brightness. Therefore, the luminance conversion line is represented by two line segments as shown in FIG.

背景色が黒である場合、図27(b)に示すように、ピーク値をある一定の輝度値(20)になるように輝度変換を行なう。この場合も、図27(b)に示すように、輝度変換線は2つの線分によって表される。   When the background color is black, luminance conversion is performed so that the peak value becomes a certain luminance value (20) as shown in FIG. Also in this case, as shown in FIG. 27B, the luminance conversion line is represented by two line segments.

背景色が白または黒以外の色である場合、図27(c)に示すように、通常の引き伸ばし処理と同様に、最小値以下と最大値以上をカットし、1つの線分として表されるように輝度変換線を設定する。   When the background color is a color other than white or black, as shown in FIG. 27C, the minimum value or less and the maximum value or more are cut and expressed as one line segment as in the normal enlargement process. The luminance conversion line is set as follows.

尚、このように背景の輝度(Y)と出力(Y’)との変換テーブルを予め設定してメモリカード31に記憶してもよい。作成した変換テーブルに従って、入力された各画素の値から、それぞれの出力値を求め、画像効果処理を施す。このように変換された画像は、明るい画素はより明るく、暗い画素はより暗くなるので、輝度分布が広がり、視認性がすぐれた画像になる。   It should be noted that a conversion table of background luminance (Y) and output (Y ′) may be set in advance and stored in the memory card 31 as described above. According to the created conversion table, each output value is obtained from the input pixel value, and image effect processing is performed. In the image thus converted, bright pixels are brighter and dark pixels are darker, so that the luminance distribution is widened and the image is excellent in visibility.

このような考え方に基づいて、画像処理装置25は、図28に示すフローチャートに従って、画像効果処理を実行する。
画像処理装置25は、保存した画像効果補正用パラメータをメモリ23から読み出す(ステップS131)。
Based on such a concept, the image processing device 25 executes image effect processing according to the flowchart shown in FIG.
The image processing device 25 reads the stored image effect correction parameters from the memory 23 (step S131).

画像処理装置25は、背景が白か否かを判定する(ステップS132)。
背景が白と判定した場合(ステップS132においてYes)、画像処理装置25は、背景をより白くして、視認性が良くなるように、図27(a)に示すような輝度変換を行って、輝度ヒストグラムの調整を行う(ステップS133)。
The image processing device 25 determines whether or not the background is white (step S132).
When the background is determined to be white (Yes in step S132), the image processing device 25 performs luminance conversion as illustrated in FIG. 27A so that the background is whiter and the visibility is improved. The brightness histogram is adjusted (step S133).

背景が白ではないと判定した場合(ステップS132においてNo)、画像処理装置25は、背景が黒か否かを判定する(ステップS134)。   If it is determined that the background is not white (No in step S132), the image processing apparatus 25 determines whether the background is black (step S134).

背景が黒であると判定した場合(ステップS134においてYes)、画像処理装置25は、背景が黒の場合、図27(b)に示すような輝度変換を行って、輝度ヒストグラムを調整する(ステップS135)。   When it is determined that the background is black (Yes in step S134), when the background is black, the image processing apparatus 25 performs luminance conversion as illustrated in FIG. 27B and adjusts the luminance histogram (step). S135).

背景が黒ではないと判定した場合(ステップS134においてNo)、画像処理装置25は、図27(c)に示すような輝度変換を行って、撮影対象物の背景色に応じたヒストグラム調整を行う(ステップS136)。   If it is determined that the background is not black (No in step S134), the image processing apparatus 25 performs luminance conversion as shown in FIG. 27C and performs histogram adjustment according to the background color of the shooting target. (Step S136).

本実施形態のデジタルカメラ1では、モードを撮影モードだけでなく再生モードに設定することもできる。
操作部26の再生キーが押下されると、操作部26は、この操作情報をCPU30に送信する。
In the digital camera 1 of the present embodiment, the mode can be set not only to the shooting mode but also to the playback mode.
When the playback key of the operation unit 26 is pressed, the operation unit 26 transmits this operation information to the CPU 30.

CPU30は、この操作情報に基づいて、モードが再生モードになったことを判別すると、図29に示すフローチャートに従って、再生処理を実行する。
CPU30は、メモリカード31内に記録されている画像ファイルの中から、ユーザの選択された一枚の画像を選択する(ステップS141)。
When the CPU 30 determines that the mode is the playback mode based on the operation information, the CPU 30 executes the playback process according to the flowchart shown in FIG.
The CPU 30 selects one image selected by the user from the image files recorded in the memory card 31 (step S141).

CPU30は、この選択した画像ファイルをメモリカード31から読み出し、メモリ23に書き込む(ステップS142)。
CPU30は、読み出した画像から縮小画像を作成する(ステップS143)。
The CPU 30 reads the selected image file from the memory card 31 and writes it in the memory 23 (step S142).
The CPU 30 creates a reduced image from the read image (step S143).

CPU30は、メモリ23上のプレビュー画像用の記憶領域に書き込む(ステップS144)。これにより撮影モード時と同じように、この縮小画像が表示装置24から表示される。ユーザはこの表示を見ることで、再生画像を確認することができる。   The CPU 30 writes in the preview image storage area on the memory 23 (step S144). Thus, the reduced image is displayed from the display device 24 as in the photographing mode. The user can confirm the reproduced image by viewing this display.

ユーザがこの表示を視認して、他の画像を見たい場合にNOキーを押下すると、操作部26はこの操作情報をCPU30に送信する。
CPU30は、この操作情報に従って、次の画像が指定されたか否かを判定する(ステップS145)。
If the user visually recognizes this display and presses the NO key to view another image, the operation unit 26 transmits this operation information to the CPU 30.
The CPU 30 determines whether or not the next image has been designated according to the operation information (step S145).

次の画像が指定されたと判定した場合(ステップS145においてYes)、CPU30は、次の画像を選択し(ステップS146)、再度ステップS142〜S144を実行する。   When it is determined that the next image has been designated (Yes in step S145), the CPU 30 selects the next image (step S146) and executes steps S142 to S144 again.

次の画像が指定されなかったと判定した場合(ステップS145においてNo)、CPU30は、この再生モードが終了したか否かを判定する(ステップS147)。
再生キーが押下されなければ、CPU30は、再度次の画像が指定されたか否かを判定する(ステップS145)。
If it is determined that the next image has not been designated (No in step S145), the CPU 30 determines whether or not the reproduction mode has ended (step S147).
If the reproduction key is not pressed, the CPU 30 determines again whether or not the next image has been designated (step S145).

一方、再生キーが押下されると、CPU30は、操作部26から、この操作情報を受信して再生モードが終了したと判定し(ステップS147においてYes)、再生処理を終了させる。   On the other hand, when the playback key is pressed, the CPU 30 receives this operation information from the operation unit 26 and determines that the playback mode has ended (Yes in step S147), and ends the playback process.

次に、パラメータのファイルヘッダへの書き込みについて説明する。
元画像と補正画像とを、共にJPEGフォーマットの画像として記録する際に、元画像のファイル名を画像ファイルのヘッダ(オプションデータ)領域に記録する。補正画像を再度修正したい場合に、修正画像ファイルを補正するのでは元の画像から作成することによって劣化の少ない画像を作成することができる。この画像編集は、デジタルカメラ1内で行われてもよい。しかし、画像編集は、コンピュータで行われることもできる。コンピュータで画像編集を行えば、さらに高度の画像補正を行えることが期待される。
Next, writing parameters to the file header will be described.
When both the original image and the corrected image are recorded as JPEG format images, the file name of the original image is recorded in the header (option data) area of the image file. When it is desired to correct the corrected image again, if the corrected image file is corrected, an image with little deterioration can be generated by generating the corrected image file from the original image. This image editing may be performed in the digital camera 1. However, image editing can also be performed on a computer. If image editing is performed on a computer, it is expected that more advanced image correction can be performed.

さらに、ヘッダに画像処理を行ったときのパラメータを記録することにより、コンピュータは、この元画像にこのパラメータを用いて、補正画像を再度、容易に作成することができる。このため、ユーザは即時、その前回の補正画像から手を加えやすくなる。   Further, by recording the parameters when image processing is performed in the header, the computer can easily create a corrected image again using the parameters for the original image. For this reason, it becomes easy for the user to make a change immediately from the previous corrected image.

ヘッダ情報は、図30に示すように、データの種類(データ名)と、それぞれのデータのバイト数と、その内容と、を含む。
CPU30は、このヘッダ情報を、ヘッダ情報記憶領域に順次、元画像データの画像ファイル名、補正画像の画像サイズ、アフィンパラメータ、ヒストグラムテーブルを作成するための入出力のデータセットを記憶する。
As shown in FIG. 30, the header information includes the type of data (data name), the number of bytes of each data, and the contents thereof.
The CPU 30 sequentially stores the header information in the header information storage area, the image file name of the original image data, the image size of the corrected image, the affine parameters, and an input / output data set for creating a histogram table.

入出力データセットは、入力データと出力データとの関係を示すデータのセットであり、入出力関係を示す直線の傾斜が変化する変化点毎に、入力データの小さい方から順に並べて、入力データと出力データとを組にしたものである。   The input / output data set is a set of data indicating the relationship between the input data and the output data, and is arranged in order from the smallest of the input data for each change point where the slope of the straight line indicating the input / output relationship changes. This is a set of output data.

変化点の入力データが、小さい方から、順に、x1,x2,…,xmとして、対応する出力データがy1,y2,...,ymとすると、データセットは、(x1,y1),(x2,y2),…,(xm,ym)のm個のデータセットで表される。この場合、入力データxは、xi<x<xi+1であれば、出力データyは次の数23によって表される。
If the input data at the change point is x1, x2, ..., xm in order from the smallest, and the corresponding output data is y1, y2, ..., ym, the data set is (x1, y1), ( x2, y2),..., (xm, ym). In this case, if the input data x is xi <x <xi + 1, the output data y is expressed by the following equation (23).

例えば、入力データと出力データとの関係が、図27(a)に示すような関係である場合、CPU30は、(0,0)、(最小値,0)、(ピーク値、一定輝度値(=230))、(最大値,255)、(255,255)の5つのデータセットをメモリカード31に記憶する。   For example, when the relationship between the input data and the output data is as shown in FIG. 27A, the CPU 30 determines (0, 0), (minimum value, 0), (peak value, constant luminance value ( = 230)), (maximum value, 255), and (255, 255) are stored in the memory card 31.

同様に、入出力データの関係が、図27(b)に示すような関係である場合、CPU30は、(0,0),(最小値,0),(ピーク値,一定輝度値(=20)),(最大値,255),(255,255)の5つのデータセットをメモリカード31に記憶する。   Similarly, when the relationship between the input and output data is as shown in FIG. 27B, the CPU 30 determines (0, 0), (minimum value, 0), (peak value, constant luminance value (= 20). )), (Maximum value, 255), and (255, 255) are stored in the memory card 31.

入出力データの関係が、図27(c)に示すような関係である場合、CPU30は、(0,0),(最小値,0),(最大値,255),(255,255)の4つのデータセットをメモリカード31に記憶する。   When the relationship between the input and output data is as shown in FIG. 27C, the CPU 30 determines (0, 0), (minimum value, 0), (maximum value, 255), (255, 255). Four data sets are stored in the memory card 31.

このような輝度値のデータセットを記録することにより、様々なヒストグラムを記述することができる。CPU30は、このようなデータを補正画像データの記録(図5のステップS26)と同時に、メモリカード31に記録する。   By recording such a brightness value data set, various histograms can be described. The CPU 30 records such data on the memory card 31 simultaneously with the recording of the corrected image data (step S26 in FIG. 5).

次に、補正画像の編集処理について説明する。
画像データを一度保存した後、この画像データを再度補正したい場合がある。この場合、前述のように、元の画像データを一括して補正した方が、画像劣化が少ないという点で、好ましい。
Next, correction image editing processing will be described.
In some cases, after image data is stored once, it is desired to correct the image data again. In this case, as described above, it is preferable to collectively correct the original image data in that image deterioration is small.

ユーザがコントロールキーを操作して画像の編集モードを指定すると、CPU30は、図31に示すフローチャートに従って、画像の編集処理を実行する。
CPU30は、操作部26から送信された操作情報に従って、補正画像を選択する(ステップS151)。
When the user operates the control key to designate an image editing mode, the CPU 30 executes an image editing process according to the flowchart shown in FIG.
The CPU 30 selects a corrected image according to the operation information transmitted from the operation unit 26 (step S151).

CPU30は、メモリカード31のヘッダ情報記憶領域からヘッダ情報を読み込む(ステップS152)。
CPU30は、元画像を読み込む(ステップS153)。
CPU30は、読み込んだ補正画像、ヘッダ情報、元画像を画像処理装置25に送り、再度、補正するように、画像処理装置25を制御する(ステップS154)。
The CPU 30 reads header information from the header information storage area of the memory card 31 (step S152).
The CPU 30 reads the original image (step S153).
The CPU 30 sends the read corrected image, header information, and original image to the image processing device 25, and controls the image processing device 25 to correct again (step S154).

画像処理装置25は、補正画像、ヘッダ情報、元画像を、CPU30から取得して、射影変換画像を作成し(ステップS155)、画像効果処理を行う(ステップS156)。画像処理装置25は、作成した射影変換画像のデータを表示装置24に送り、表示装置24は、この画像を液晶モニタ12に表示する。   The image processing device 25 acquires a corrected image, header information, and an original image from the CPU 30, creates a projective conversion image (step S155), and performs image effect processing (step S156). The image processing device 25 sends the data of the created projective transformation image to the display device 24, and the display device 24 displays this image on the liquid crystal monitor 12.

ユーザが射影変換キー、回転補正キーを操作すると、操作部26は、この操作情報をCPU30に送信する。CPU30は、この操作情報を取得して、画像処理装置25を射影手動補正処理を行うように制御する。   When the user operates the projection conversion key and the rotation correction key, the operation unit 26 transmits this operation information to the CPU 30. The CPU 30 acquires this operation information and controls the image processing apparatus 25 to perform the projection manual correction process.

画像処理装置25は、図24に示すフローチャートに従って射影手動補正処理を行う(ステップS157)。
画像処理装置25は、ヘッダ情報と共に射影手動補正処理された補正画像をメモリカード31に記録し(ステップS158)、この編集処理を終了させる。
The image processing device 25 performs a projection manual correction process according to the flowchart shown in FIG. 24 (step S157).
The image processing device 25 records the corrected image subjected to the projection manual correction process together with the header information on the memory card 31 (step S158), and ends the editing process.

以上説明したように、本実施形態によれば、画像処理装置25が、射影変換と画像効果処理を行った際に、補正した画像データをメモリカード31の画像ファイルに記録し、CPU30は、元の画像データ名と、求めた射影パラメータと、画像処理補正用パラメータと、をメモリカード31の画像ファイルに記憶するようにした。従って、再度、画像編集を行う際に、画像編集を容易に行って、画像を再度、補正することができる。   As described above, according to the present embodiment, when the image processing device 25 performs the projective transformation and the image effect processing, the corrected image data is recorded in the image file of the memory card 31, and the CPU 30 The image data name, the obtained projection parameter, and the image processing correction parameter are stored in the image file of the memory card 31. Therefore, when image editing is performed again, image editing can be easily performed and the image can be corrected again.

また、画像処理装置25は、撮影対象物(白板2)の画像から輪郭を取得して、撮影対象物の形状を取得し、撮影対象物の四角形の頂点位置から、射影パラメータを求めて撮影対象物の画像を射影変換するようにした。   Further, the image processing device 25 acquires a contour from the image of the shooting target (white plate 2), acquires the shape of the shooting target, obtains a projection parameter from the position of the quadrangle of the shooting target, and acquires a shooting parameter. Projective transformation of object images.

従って、撮影対象物が四角形であれば、自動的に画像の歪みを容易に補正することができる。また、その結果として、元の撮影対象物の画像に等しい判読性の高い画像を得ることができる。   Therefore, if the object to be photographed is a quadrangle, the image distortion can be automatically corrected easily. As a result, it is possible to obtain an image with high legibility that is equal to the image of the original object to be photographed.

また、撮影対象物が縦、横の比が不明な四角形であり、かつ、任意の撮影対象物を任意の視点・姿勢で撮影した場合でもデジタルカメラ1の焦点距離を用いることにより、画像の歪みを補正することができる。   Further, even when the object to be photographed is a quadrangle whose aspect ratio is unknown, and an arbitrary object to be photographed is photographed from an arbitrary viewpoint / posture, the focal length of the digital camera 1 is used to distort the image. Can be corrected.

また、射影パラメータを求めるのにプレビューなどに用いる解像度の低い縮小画像を用いるので、演算数は低減され、効率よく演算処理を行うことができ、画像処理を高速に行うことができる。   In addition, since a reduced image having a low resolution used for preview or the like is used to obtain the projection parameters, the number of operations can be reduced, the operation processing can be performed efficiently, and the image processing can be performed at high speed.

また、撮影された画像から、複数の四角形が抽出された場合に、最大外郭の四角形を優先的に選択し、NOキーやカーソルキー等によって、四角形が大きい方から順に選択されるように構成されているため、複数の撮影対象物の輪郭の候補があっても、速やかに撮影対象物の輪郭を取得することができ、結果として簡単な手法で判読性の高い画像を得ることができる。   In addition, when a plurality of rectangles are extracted from the captured image, the largest outline rectangle is preferentially selected, and the rectangle is selected in order from the larger one by the NO key, the cursor key, or the like. Therefore, even if there are a plurality of candidates for the contour of the object to be photographed, the contour of the object to be photographed can be quickly acquired, and as a result, a highly legible image can be obtained by a simple method.

また、歪み補正を行った画像から画像処理補正用パラメータを求めるようにしたので、より良好な画像効果補正を行うことができる。   In addition, since the image processing correction parameters are obtained from the distortion-corrected image, better image effect correction can be performed.

尚、本発明を実施するにあたっては、種々の形態が考えられ、上記実施形態に限られるものではない。
例えば、上記実施形態では、補正画像の作成に用いたパラメータを補正画像のファイルに保存した。しかし、元画像のファイルにこのパラメータを保存することもできる。元画像のファイルにパラメータを保存すれば、補正画像を保存しなくても、元画像から容易に補正画像を作成することができる。
In carrying out the present invention, various forms are conceivable and the present invention is not limited to the above embodiment.
For example, in the above embodiment, the parameters used to create the corrected image are stored in the corrected image file. However, this parameter can also be stored in the original image file. If the parameters are saved in the original image file, the corrected image can be easily created from the original image without saving the corrected image.

この場合のヘッダ情報は、図32に示すように、画像サイズと射影パラメータと画像効果補正用パラメータとのみで構成される。   As shown in FIG. 32, the header information in this case includes only the image size, projection parameters, and image effect correction parameters.

また、撮影処理を行う際、デジタルカメラ1は、変換後の画像を保存せずに、すぐに射影パラメータの抽出処理を行う。この処理内容を図33のフローチャートに示す。
画像処理装置25は、射影補正画像を作成し(ステップS161〜169)、画像変換の調整、画像効果補正用パラメータの抽出、画像効果処理を行う(ステップS170〜S171)。
Further, when performing the photographing process, the digital camera 1 immediately performs the projection parameter extraction process without storing the converted image. The contents of this processing are shown in the flowchart of FIG.
The image processing device 25 creates a projection corrected image (steps S161 to S169), performs image conversion adjustment, extraction of image effect correction parameters, and image effect processing (steps S170 to S171).

CPU30は、図32に示すヘッダ情報を作成する(ステップS172)。
画像処理装置25は、元画像データを圧縮し、CPU30は、作成したヘッダ情報を、圧縮した元画像データと共にメモリカード31に記録する(ステップS173,174)。
The CPU 30 creates header information shown in FIG. 32 (step S172).
The image processing device 25 compresses the original image data, and the CPU 30 records the created header information together with the compressed original image data in the memory card 31 (steps S173 and 174).

また、編集処理も図31に示す処理内容とは異なるものになる。即ち、編集処理は、補正画像ではなく、元画像に対して行われる。この処理内容を図34のフローチャートに示す。
CPU30は、元画像を選択し、元画像のファイルからヘッダ情報を読み出す(ステップS181,S182)。
Also, the editing process is different from the process shown in FIG. That is, the editing process is performed not on the corrected image but on the original image. This processing content is shown in the flowchart of FIG.
The CPU 30 selects the original image and reads header information from the original image file (steps S181 and S182).

画像処理装置25は、すぐに射影補正画像を作成し、画像効果処理を行う(ステップS183)。
CPU30と画像処理装置25とは、射影手動補正処理を行い、補正終了後、CPU30は、変更された射影補正パラメータに基づいてヘッダ情報を作成し、作成したヘッダ情報を元画像のファイルに再度記録する(ステップS184〜S187)。
The image processing device 25 immediately creates a projection corrected image and performs image effect processing (step S183).
The CPU 30 and the image processing device 25 perform a projection manual correction process. After the correction is completed, the CPU 30 creates header information based on the changed projection correction parameter, and records the created header information in the original image file again. (Steps S184 to S187).

また、上記実施形態では、画像補正をデジタルカメラ1で行うようにした。しかし、画像補正をコンピュータで行うことも可能である。この場合、コンピュータをコンピュータインタフェース部27に接続し、コンピュータが図31に示すフローチャートに従って画像の編集処理を実行する。コンピュータがこのような画像の編集処理を行えば、コンピュータは、マウス等を備え、デジタルカメラ1に比べて操作情報の入力も容易になるので、操作性が向上する。また、コンピュータの表示装置は、デジタルカメラ1の液晶モニタ12よりも大きいのが一般的であるので、画像を詳細に視認して、画像補正を精度良く行うことが可能になる。   In the above embodiment, the image correction is performed by the digital camera 1. However, image correction can also be performed by a computer. In this case, a computer is connected to the computer interface unit 27, and the computer executes image editing processing according to the flowchart shown in FIG. If the computer performs such image editing processing, the computer includes a mouse and the like, and it becomes easier to input operation information than the digital camera 1, so that the operability is improved. Further, since the display device of the computer is generally larger than the liquid crystal monitor 12 of the digital camera 1, the image can be visually confirmed in detail and image correction can be performed with high accuracy.

また、上記実施形態では、四角形を取得できない場合、警告を行うようにした。しかし、警告を行う代わりに、撮影した画像を表示して、コントロールキー等を用いて、ユーザに四角形の4点を指定させるように構成されることもできる。そして、この指定された4点を用いてアフィンパラメータを求めるようにすることもできる。   In the above embodiment, a warning is given when a quadrangle cannot be acquired. However, instead of issuing a warning, it is also possible to display the captured image and allow the user to designate four rectangular points using a control key or the like. Then, the affine parameters can be obtained using the designated four points.

尚、上記実施の形態では、プログラムが、それぞれメモリ等に予め記憶されているものとして説明した。しかし、コンピュータを、装置の全部又は一部として動作させ、あるいは、上述の処理を実行させるためのプログラムを、フレキシブルディスク、CD−ROM(Compact Disk Read-Only Memory)、DVD(Digital Versatile Disk)、MO(Magneto Optical disk)などのコンピュータ読み取り可能な記録媒体に格納して配布し、これを別のコンピュータにインストールし、上述の手段として動作させ、あるいは、上述の工程を実行させてもよい。   In the above-described embodiment, the program has been described as being stored in advance in a memory or the like. However, a program for causing a computer to operate as the whole or a part of the apparatus or to execute the above-described processing is a flexible disk, a CD-ROM (Compact Disk Read-Only Memory), a DVD (Digital Versatile Disk), The information may be stored in a computer-readable recording medium such as an MO (Magneto Optical disk) and distributed, installed in another computer, operated as the above-described means, or the above-described steps may be executed.

さらに、インターネット上のサーバ装置が有するディスク装置等にプログラムを格納しておき、例えば、搬送波に重畳させて、コンピュータにダウンロード等するものとしてもよい。   Furthermore, the program may be stored in a disk device or the like of a server device on the Internet, and may be downloaded onto a computer by being superimposed on a carrier wave, for example.

本発明の実施形態に係るデジタルカメラで白板を撮影するときの状態を示す説明図である。It is explanatory drawing which shows a state when image | photographing a white board with the digital camera which concerns on embodiment of this invention. 図1に示すデジタルカメラの構成を示すブロック図である。It is a block diagram which shows the structure of the digital camera shown in FIG. 図2に示す画像処理装置の機能を説明するための説明図である。It is explanatory drawing for demonstrating the function of the image processing apparatus shown in FIG. 図2に示す操作部が備える各キーを説明するための説明図である。It is explanatory drawing for demonstrating each key with which the operation part shown in FIG. 2 is provided. デジタルカメラが実行する撮影処理の内容を示すフローチャートである。It is a flowchart which shows the content of the imaging | photography process which a digital camera performs. 図2に示す画像処理装置の切り抜き対象の四角形を示す説明図である。It is explanatory drawing which shows the square of the clipping object of the image processing apparatus shown in FIG. 射影パラメータの抽出とアフィン変換の基本的な考え方を説明するための説明図である。It is explanatory drawing for demonstrating the basic concept of extraction of a projection parameter, and an affine transformation. 図2に示す画像処理装置が実行する射影パラメータ抽出処理の内容を示すフローチャートである。It is a flowchart which shows the content of the projection parameter extraction process which the image processing apparatus shown in FIG. 2 performs. 図2に示す画像処理装置が実行する四角形輪郭抽出処理の内容を示すフローチャートである。It is a flowchart which shows the content of the square outline extraction process which the image processing apparatus shown in FIG. 2 performs. 縮小輝度画像とエッジ画像を説明するための説明図である。It is explanatory drawing for demonstrating a reduced luminance image and an edge image. Robertsフィルタの機能を説明するための説明図である。It is explanatory drawing for demonstrating the function of a Roberts filter. ラドン変換の原理を説明するためのイメージ図である。It is an image figure for demonstrating the principle of radon conversion. X、Y座標系の直線をラドン変換して極座標系のデータを取得する動作を説明するための説明図である。It is explanatory drawing for demonstrating the operation | movement which acquires the data of a polar coordinate system by radon-transforming the straight line of a X, Y coordinate system. 図2に示す画像処理装置が実行する極座標系のデータからのピーク点検出処理の内容を示すフローチャートである。It is a flowchart which shows the content of the peak point detection process from the data of the polar coordinate system which the image processing apparatus shown in FIG. 2 performs. ピーク点を検出して抽出した直線から、四角形を検出する考え方を示す説明図である。It is explanatory drawing which shows the view which detects a square from the straight line which detected and extracted the peak point. 図2に示す画像処理装置が実行する検出した四角形の選択処理の内容を示すフローチャートである。It is a flowchart which shows the content of the selection process of the detected square which the image processing apparatus shown in FIG. 2 performs. 図2に示す画像処理装置が実行する四角形の頂点からアフィンパラメータを求める処理の内容を示すフローチャートである。It is a flowchart which shows the content of the process which calculates | requires an affine parameter from the square vertex performed by the image processing apparatus shown in FIG. 四角形を抽出できなかった場合の警告の内容を示す説明図である。It is explanatory drawing which shows the content of the warning when a square cannot be extracted. 図2に示すCPUが実行する警告処理の内容を示すフローチャートである。It is a flowchart which shows the content of the warning process which CPU shown in FIG. 2 performs. 射影変換後の画像から元の画像を得るための逆変換を説明するための説明図である。It is explanatory drawing for demonstrating the inverse transformation for obtaining the original image from the image after projective transformation. 図2に示す画像処理装置が実行するアフィン変換による画像変換処理の内容を示すフローチャートである。It is a flowchart which shows the content of the image conversion process by the affine transformation which the image processing apparatus shown in FIG. 2 performs. 射影変換によって画像の歪みを補正することができなかった例を示す説明図である。It is explanatory drawing which shows the example which was unable to correct | amend image distortion by projective transformation. 元の画像、射影変換画像、拡大した射影変換画像との対応関係を説明するための説明図である。It is explanatory drawing for demonstrating the correspondence with an original image, a projection conversion image, and the enlarged projection conversion image. 図2に示す画像処理装置が実行する補正調整と画像変換処理の内容を示すフローチャートである。3 is a flowchart showing details of correction adjustment and image conversion processing executed by the image processing apparatus shown in FIG. 2. 輝度ヒストグラムの一例を示す説明図である。It is explanatory drawing which shows an example of a brightness | luminance histogram. 図2に示す画像処理装置が実行する画像効果補正用パラメータの抽出処理の内容を示すフローチャートである。3 is a flowchart showing the contents of image effect correction parameter extraction processing executed by the image processing apparatus shown in FIG. 2. 画像効果処理を示す説明図であり、(a)は、背景色が白の場合の画像効果処理を示し、(b)は、背景が黒の場合の画像効果処理を示し、(c)は、背景が白又は黒以外の場合の画像効果処理を示す。It is explanatory drawing which shows an image effect process, (a) shows the image effect process in case a background color is white, (b) shows the image effect process in case a background is black, (c), The image effect processing when the background is other than white or black is shown. 図2に示す画像処理装置が実行する画像効果処理の内容を示すフローチャートである。It is a flowchart which shows the content of the image effect process which the image processing apparatus shown in FIG. 2 performs. 図2に示すCPU、画像処理装置が実行する再生処理の内容を示すフローチャートである。It is a flowchart which shows the content of the reproduction | regeneration processing which CPU and image processing apparatus which are shown in FIG. 2 perform. ヘッダ情報の内容を示す説明図である。It is explanatory drawing which shows the content of header information. 図2に示すCPU、画像処理装置が実行する補正画像の編集処理の内容を示すフローチャートである。3 is a flowchart showing the content of a correction image editing process executed by the CPU and image processing apparatus shown in FIG. 元画像のみを保存する場合のヘッダ情報の内容を示す説明図である。It is explanatory drawing which shows the content of the header information in the case of preserve | saving only an original image. 元画像のみを保存する場合に図2に示すCPU、画像処理装置が実行する撮影処理の内容を示すフローチャートである。FIG. 3 is a flowchart showing the contents of a photographing process executed by the CPU and image processing apparatus shown in FIG. 2 when only an original image is stored. 元画像のみを保存する場合に図2に示すCPU、画像処理装置が実行する補正画像の再編集処理の内容を示すフローチャートである。FIG. 3 is a flowchart showing details of a correction image re-editing process executed by the CPU and the image processing apparatus shown in FIG. 2 when only the original image is stored.

符号の説明Explanation of symbols

1・・・デジタルカメラ、2・・・白板、11・・・撮影レンズ部、12・・・液晶モニタ、13・・・シャッタボタン、21・・・光学レンズ装置、22・・・イメージセンサ、23・・・メモリ、24・・・表示装置、25・・・画像処理装置、30・・・CPU、31・・・メモリカード   DESCRIPTION OF SYMBOLS 1 ... Digital camera, 2 ... White board, 11 ... Shooting lens part, 12 ... Liquid crystal monitor, 13 ... Shutter button, 21 ... Optical lens apparatus, 22 ... Image sensor, 23 ... Memory, 24 ... Display device, 25 ... Image processing device, 30 ... CPU, 31 ... Memory card

Claims (9)

撮影部により撮影対象物を撮影する撮影装置において、
前記撮影対象物を撮影する撮影部と、
前記撮影部で撮影することによって得られた前記撮影対象物の撮影画像の歪みを補正するように、前記撮影画像に対して画像処理を行う画像処理部と、を備え、
前記画像処理部は、
前記撮影対象物の画像から当該画像の輪郭を取得し、取得した前記輪郭から前記画像の形状を取得する形状取得部と、
前記形状取得部が取得した前記画像の形状と実際の撮影対象物の形状とを3次元の座標系を設定することで対応させて、前記撮影対象物の画像の頂点位置から、前記画像と実際の撮影対象物との関係を示す射影パラメータを求める射影パラメータ取得部と、
前記撮影部が有するレンズの焦点距離と前記撮影対象物の画像の頂点位置とに基づいて前記撮影対象物の縦横比を求める縦横比取得部と、
前記射影パラメータ取得部が求めた射影パラメータと前記縦横比取得部が求めた縦横比とを用いて、画像変換のための画像変換パラメータを求め、該画像変換パラメータを用いて、前記撮影対象物の画像の画像変換を行う画像変換部と、
前記画像変換部が前記撮影対象物の画像の画像変換に用いた画像変換パラメータを、記憶部の画像ファイルに格納する記憶制御部と、を備えた、
ことを特徴とする撮影装置。
In a photographing device that photographs a photographing object by a photographing unit,
A photographing unit for photographing the photographing object;
An image processing unit that performs image processing on the photographed image so as to correct distortion of the photographed image of the photographing object obtained by photographing with the photographing unit;
The image processing unit
A shape acquisition unit that acquires the contour of the image from the image of the shooting target, and acquires the shape of the image from the acquired contour;
The shape of the image acquired by the shape acquisition unit and the actual shape of the object to be photographed are associated with each other by setting a three-dimensional coordinate system. A projection parameter obtaining unit for obtaining a projection parameter indicating a relationship with the object to be imaged,
An aspect ratio acquisition unit for obtaining an aspect ratio of the photographing object based on a focal length of a lens included in the photographing unit and a vertex position of an image of the photographing object;
Using the projection parameter obtained by the projection parameter acquisition unit and the aspect ratio obtained by the aspect ratio acquisition unit, an image conversion parameter for image conversion is obtained, and the image conversion parameter is used to calculate the image of the subject to be imaged. An image conversion unit that performs image conversion of the image;
A storage control unit that stores image conversion parameters used by the image conversion unit for image conversion of the image of the object to be captured in an image file of a storage unit;
An imaging apparatus characterized by that.
前記記憶制御部は、前記記憶部の前記画像ファイルに、前記撮影部で撮影することによって得られた前記撮影対象物の画像データを格納し、当該画像ファイルに前記画像変換パラメータを格納する、
ことを特徴とする請求項1に記載の撮影装置。
The storage control unit stores the image data of the photographing object obtained by photographing with the photographing unit in the image file of the storage unit, and stores the image conversion parameter in the image file.
The imaging apparatus according to claim 1, wherein:
前記記憶制御部は、前記記憶部の前記画像ファイルに、前記画像変換部が画像変換した画像を格納する、
ことを特徴とする請求項2に記載の撮影装置。
The storage control unit stores the image converted by the image conversion unit in the image file of the storage unit.
The imaging apparatus according to claim 2, wherein:
前記記憶部は、外部記憶媒体によって構成されたものである、
ことを特徴とする請求項1乃至3のいずれか1項に記載の撮影装置。
The storage unit is configured by an external storage medium.
The photographing apparatus according to any one of claims 1 to 3, wherein
前記形状取得部が取得した前記画像の形状から、前記撮影対象物の内容を表す実対象部を判別し、判別した実対象部の画像を切り出す画像切り出し部と、
前記画像切り出し部が切り出した実対象部の画像から、画像効果を補正するための画像効果補正用パラメータを取得する補正用パラメータ取得部と、
前記補正用パラメータ取得部が取得した画像効果補正用パラメータを用いて、前記撮影対象物の画像の画像効果処理を行う画像効果処理部と、を備え、
前記記憶制御部は、前記記憶部の画像ファイルに、前記画像効果処理部が前記撮影対象物の画像の画像効果処理に用いた画像効果補正用パラメータを格納する、
ことを特徴とする請求項1乃至4のいずれか1項に記載の撮影装置。
From the shape of the image acquired by the shape acquisition unit, an actual target part representing the content of the photographing object is determined, and an image cutout unit that cuts out the image of the determined real target part;
A correction parameter acquisition unit for acquiring an image effect correction parameter for correcting an image effect from the image of the real target part cut out by the image cutout unit;
An image effect processing unit that performs image effect processing of the image of the object to be photographed using the image effect correction parameter acquired by the correction parameter acquisition unit;
The storage control unit stores, in the image file of the storage unit, image effect correction parameters used by the image effect processing unit for image effect processing of the image of the shooting target.
The photographing apparatus according to claim 1, wherein the photographing apparatus is characterized in that:
前記画像変換部は、前記記憶部の前記画像ファイルから、格納されている前記画像効果補正用パラメータを読み出し、読み出した画像効果補正用パラメータを用いて前記画像変換を行う、
ことを特徴とする請求項5に記載の撮影装置。
The image conversion unit reads the stored image effect correction parameters from the image file in the storage unit, and performs the image conversion using the read image effect correction parameters.
The imaging device according to claim 5, wherein:
前記画像を表示する表示部を備えた、
ことを特徴とする請求項1乃至6のいずれか1項に記載の撮影装置。
A display unit for displaying the image;
The photographing apparatus according to any one of claims 1 to 6, wherein the photographing apparatus includes:
撮影部により撮影対象物を撮影することによって得られた前記撮影対象物の画像の歪みを補正するように、前記撮影対象物の画像に対して画像処理を行う撮影装置の画像処理方法であって、
前記撮影対象物の画像から当該画像の輪郭を取得し、取得した前記輪郭から前記画像の形状を取得するステップと、
取得した前記画像の形状と実際の撮影対象物の形状とを3次元の座標系を設定することで対応させて、前記撮影対象物の画像の頂点位置から、前記撮影対象物の画像と実際の撮影対象物との関係を示す射影パラメータを求めるステップと、
前記撮影部が有するレンズの焦点距離と前記撮影対象物の画像の頂点位置とに基づいて前記撮影対象物の縦横比を求めるステップと、
求めた射影パラメータと縦横比とを用いて、画像変換のための画像変換パラメータを求め、該画像変換パラメータを用いて、前記撮影対象物の画像の画像変換を行うステップと、
画像データを格納する画像ファイルに、前記画像変換に用いた画像変換パラメータを記憶するステップと、を備えた、
ことを特徴とする撮影装置の画像処理方法。
An image processing method of a photographing apparatus that performs image processing on an image of the photographing target so as to correct distortion of the image of the photographing target obtained by photographing the photographing target by a photographing unit. ,
Acquiring a contour of the image from the image of the photographing object, and acquiring a shape of the image from the acquired contour;
The acquired shape of the image and the shape of the actual shooting target are associated with each other by setting a three-dimensional coordinate system, and from the vertex position of the image of the shooting target, the image of the shooting target and the actual shooting target Obtaining a projection parameter indicating a relationship with the object to be imaged;
Obtaining an aspect ratio of the photographing object based on a focal length of a lens included in the photographing unit and a vertex position of an image of the photographing object;
Using the obtained projection parameters and aspect ratio to determine image conversion parameters for image conversion, and using the image conversion parameters to perform image conversion of the image of the object to be photographed;
Storing image conversion parameters used for the image conversion in an image file storing image data,
An image processing method for a photographing apparatus.
撮影部により撮影対象物を撮影する撮影装置が有するコンピュータに、
撮影対象物を撮影することによって得られた前記撮影対象物の画像から当該画像の輪郭を取得し、取得した前記輪郭から前記撮影対象物の画像の形状を取得する手順、
取得した前記画像の形状と実際の撮影対象物の形状とを3次元の座標系を設定することで対応させて、前記撮影対象物の画像の頂点位置から、前記撮影対象物の画像と実際の撮影対象物との関係を示す射影パラメータを求める手順、
前記撮影部が有するレンズの焦点距離と前記撮影対象物の画像の頂点位置とに基づいて前記撮影対象物の縦横比を求める手順、
求めた射影パラメータと縦横比とを用いて、画像変換のための画像変換パラメータを求め、該画像変換パラメータを用いて、前記撮影対象物の画像の歪みを補正するように前記画像に対して画像変換を行う手順、
画像データを格納する画像ファイルに、前記画像変換に用いた画像変換パラメータを記憶する手順、
を実行させるためのプログラム。
In the computer of the photographing device that photographs the object to be photographed by the photographing unit,
A procedure for acquiring the contour of the image from the image of the shooting target obtained by shooting the shooting target, and acquiring the shape of the image of the shooting target from the acquired contour,
The acquired shape of the image and the shape of the actual shooting target are associated with each other by setting a three-dimensional coordinate system, and from the vertex position of the image of the shooting target, the image of the shooting target and the actual shooting target A procedure for obtaining a projection parameter indicating the relationship with the object to be photographed;
A procedure for obtaining an aspect ratio of the photographing object based on a focal length of a lens of the photographing unit and a vertex position of an image of the photographing object;
An image conversion parameter for image conversion is obtained using the obtained projection parameter and aspect ratio, and the image is imaged with respect to the image so as to correct the distortion of the image of the object to be photographed using the image conversion parameter. The steps to do the conversion,
A procedure for storing image conversion parameters used for the image conversion in an image file storing image data;
A program for running
JP2003354423A 2003-10-14 2003-10-14 Imaging apparatus, image processing method thereof, and program Expired - Fee Related JP4363153B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003354423A JP4363153B2 (en) 2003-10-14 2003-10-14 Imaging apparatus, image processing method thereof, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003354423A JP4363153B2 (en) 2003-10-14 2003-10-14 Imaging apparatus, image processing method thereof, and program

Publications (2)

Publication Number Publication Date
JP2005122327A JP2005122327A (en) 2005-05-12
JP4363153B2 true JP4363153B2 (en) 2009-11-11

Family

ID=34612338

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003354423A Expired - Fee Related JP4363153B2 (en) 2003-10-14 2003-10-14 Imaging apparatus, image processing method thereof, and program

Country Status (1)

Country Link
JP (1) JP4363153B2 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4529837B2 (en) * 2005-08-04 2010-08-25 カシオ計算機株式会社 Imaging apparatus, image correction method, and program
JP4341629B2 (en) 2006-01-27 2009-10-07 カシオ計算機株式会社 Imaging apparatus, image processing method, and program
JP4772894B2 (en) * 2009-08-03 2011-09-14 シャープ株式会社 Image output device, portable terminal device, captured image processing system, image output method, program, and recording medium
JP5481470B2 (en) * 2011-12-19 2014-04-23 東芝テック株式会社 Electronic blackboard and computer program
JP2016134685A (en) * 2015-01-16 2016-07-25 オリンパス株式会社 Imaging apparatus and display method of imaging apparatus

Family Cites Families (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05101221A (en) * 1991-10-04 1993-04-23 Mitsubishi Heavy Ind Ltd Image distortion corrector
JPH07222052A (en) * 1994-02-08 1995-08-18 Nippon Telegr & Teleph Corp <Ntt> Method for separating paper material area from picked-up image and remote presentation method
JP3800661B2 (en) * 1996-04-23 2006-07-26 コニカミノルタフォトイメージング株式会社 Digital camera
JP3643203B2 (en) * 1997-01-27 2005-04-27 コニカミノルタフォトイメージング株式会社 Digital camera
JPH1196346A (en) * 1997-09-22 1999-04-09 Konica Corp Image processing method and image processor
JP2001238177A (en) * 1999-10-28 2001-08-31 Fuji Photo Film Co Ltd Image processing method and image processing apparatus
JP4524047B2 (en) * 2000-01-17 2010-08-11 富士フイルム株式会社 Image processing method and apparatus, camera, and photographing system
JP3497805B2 (en) * 2000-08-29 2004-02-16 オリンパス株式会社 Image projection display device
JP3753617B2 (en) * 2001-02-16 2006-03-08 コニカミノルタフォトイメージング株式会社 Digital photographing apparatus, image processing apparatus, and recording medium
JP2002344724A (en) * 2001-05-17 2002-11-29 Fuji Photo Film Co Ltd Imaging device, image processing apparatus, image processing method, and program
JP2003069889A (en) * 2001-08-24 2003-03-07 Fuji Photo Film Co Ltd Imaging apparatus and image output device
JP2003141520A (en) * 2001-10-31 2003-05-16 Fuji Xerox Co Ltd Image reading apparatus, image inspection apparatus, and program
JP2003168103A (en) * 2001-11-30 2003-06-13 Seiko Epson Corp Method and device for detecting line defect of picture, and method for correcting image data
JP4320990B2 (en) * 2001-11-30 2009-08-26 セイコーエプソン株式会社 Screen defect detection method and apparatus, and screen defect detection program
JP2003283916A (en) * 2002-03-20 2003-10-03 Seiko Epson Corp Digital camera

Also Published As

Publication number Publication date
JP2005122327A (en) 2005-05-12

Similar Documents

Publication Publication Date Title
JP4363151B2 (en) Imaging apparatus, image processing method thereof, and program
US7760962B2 (en) Image capture apparatus which synthesizes a plurality of images obtained by shooting a subject from different directions, to produce an image in which the influence of glare from a light is reduced
JP4341629B2 (en) Imaging apparatus, image processing method, and program
JP4556813B2 (en) Image processing apparatus and program
TWI268096B (en) Image processing apparatus for correcting distortion of image, image shooting apparatus for correcting distortion of shot image and recordable medium
KR100682651B1 (en) Image processing device, image projection apparatus, image processing method, and recording medium for storing the related program
KR100610569B1 (en) Photographing device, image processor, image-processing method of photographing device
EP1922693B1 (en) Image processing apparatus and image processing method
JP2006074512A (en) Photographing device, and image processing method, and program for photographing device
JP2002057879A (en) Apparatus and method for image processing, and computer readable recording medium
JP5541679B2 (en) Image processing apparatus and method, and program
JP2005275447A (en) Image processing device, image processing method and program
JP4363154B2 (en) Imaging apparatus, image processing method thereof, and program
JP4501701B2 (en) Image capturing apparatus, image processing method for image capturing apparatus, and program
JP4363153B2 (en) Imaging apparatus, image processing method thereof, and program
JP2005260657A (en) Photographing apparatus, image processing method and program therefor
JP2005269449A (en) Image processor, image processing method and program
JP4561302B2 (en) Image capturing apparatus, image processing method for image capturing apparatus, and program
JP4363152B2 (en) Captured image projection device, image processing method and program for captured image projection device
JP2005122319A (en) Photographing device, its image processing method, and program
JP4591343B2 (en) Image processing apparatus, imaging apparatus, image processing method, and program
JP2005217721A (en) Apparatus and method for generating still picture
JP7391502B2 (en) Image processing device, image processing method and program
JP2007148612A (en) Photographing device, image processing method and image processing program
JP2008084236A (en) Image processor, image processing method and program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20061011

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20080718

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20080729

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20080926

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20090421

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20090617

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

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

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

Free format text: PAYMENT UNTIL: 20120828

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

Ref document number: 4363153

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20120828

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20130828

Year of fee payment: 4

LAPS Cancellation because of no payment of annual fees