200913685 九、發明說明: 【發明所屬之技術領域】 本發明涉及攝像領域,尤其涉及一種攝像裝置及其影 像自動正立方法。 【先前技術】 在現今資訊時代中,各種攝像裝置,如數位相機、數 位攝像機、具有攝像功能之手機等越來越受到廣大消費者 之親睞,攝像裝置之功能亦越來越多。 傳統之攝像裝置在進行拍攝時,一般通過手持或三腳 架來固定攝像裝置,由於在拍攝過程中可能出現抖動或三 腳架放置不平等原因導致攝像裝置與被攝物之間發生歪 斜,導致被攝物在攝像裝置上之成像發生傾斜。如此,對 該被攝物之影像直接進行存儲,則明顯不利於以後進行觀 看。 【發明内容】 有鑒於此,有必要提供一種可將拍攝時發生傾斜之被 攝物影像自動正立之攝像裝置及一種影像自動正立方法。 一種攝像裝置,其包括一感測器、一影像感測器、一 影像處理單元及一記憶體。所述感測器、影像感測器及記 憶體分別與所述影像處理單元電連接。所述影像感測器用 於獲取被攝物之影像。所述感測器用於感測所述攝像裝置 獲取被攝物之影像時之傾斜度。所述影像處理單元根據所 述傾斜度將被攝物影像矯正為正立之被攝物之影像。所述 記憶體用於存儲所述矯正之被攝物之影像。 6 200913685 一種攝像裝置之影像自動正立方法,其包括以下步 驟:獲取一被攝物之影像,並感測攝像裝置獲取該被攝物 之影像時之傾斜度資訊;根據所述攝像裝置之傾斜度資 訊,矯正所述被攝物之影像,得到一具有正立之被攝物影 像之圖片;及存儲所述具有正立之被攝物影像之圖片。 所述攝像裝置通過在拍攝被攝物影像之同時獲得此時 其傾斜度資訊,然後通過該傾斜度資訊對產生傾斜之被攝 物影像進行矯正,以得到一正立之被攝物影像,然後再進 行存儲,從而便於以後進行觀看。 【實施方式】 下面將結合附圖,對本發明作進一步之詳細說明。 請參閱圖1,為本發明實施例提供之一種攝像裝置100 之功能模組圖。該攝像裝置100包括一感測器10、一影像 感測器20、一影像處理單元30、一記憶體40及一顯示器 50。所述感測器10、影像感測器20、記憶體40及一顯示 器50分別與所述影.像處理單元30電連接。所述攝像裝置 100具體可為數位相機、數位攝像機、具有攝像功能之手 機等。 攝像裝置100在理想拍攝狀態時,一般其中轴線與水 平面垂直,以拍攝得到正立之影像圖片。然而,在實際拍 攝中,所述攝像裝置100往往會有所傾斜,即其中轴線往 往與水平面之法線具有一定之夾角,導致攝像裝置1〇〇得 到之被攝物之影像往往係傾斜之影像。 所述影像感測器20用於獲取被攝物之影像,將來自被 7 200913685 攝物之光訊號轉換為對應該被攝物影像之電訊號。當攝像 裝置100拍攝時出現傾斜時,影像感測器20上被攝物之影 像也會出現傾斜’得到如圖3所示之第一圖片101。—般 清况下’攝像褒置1〇〇之傾斜角度與影像感測器2〇上被攝 物之影像傾斜角度及方向相同。本實施例中,所述被攝物 為〜棵樹’由於攝像裝置1〇〇在拍攝時出現傾斜,所述樹 在第—圖片1〇1中出現傾斜。 士所述感測器10用於感測所述攝像裝置1〇〇在拍攝影像 蚪之彳員斜度,即攝像裝置1〇〇之中軸線與水平面之法線之 間之爽角’並輪出一反應攝像裝置100傾斜度之訊號。由 ;良平面之法線與重力加速度之方向相同,通過感測攝像 f置100之中軸線與重力加速度之間之夾角即可知道攝像 =置100之中轴線與水平面之法線之間之夾角,從而得到 像裝置100在拍攝影像時之傾斜度。感測攝像裝置 線與重力加速度之間之夾角可方便實現,如可採用 h螺儀或多軸感應元件。 所述影像處理單元3〇用於將影像感測器2〇獲取之傾 斜之被攝物影像矯正為正立之被攝物之影像。請參閱圖2 =圖4’具體地’所述影像處理單元3〇根據感測器i 1攝像裝置1GG之傾斜度訊號,得到在對被攝物進: 2 ’攝像W之傾斜角度,進而得到被攝物影像在 圖片101上之傾斜角度。通過將第一圖片⑽旋轉— Ϊ攝像裝i動之傾斜角度大小相同方向相反之角 又’传到-歪斜之第二圖片搬,所述被攝物影像在該第 8 200913685 二圖片102中成正立。然所述第二圖片102並不係一正立 之矩形,優選地,將所述第二圖片102進行剪裁得到一正 立之第三圖片103。由於攝像裝置100在實際進行拍攝時, 往往有會有所傾斜,而較小之傾斜實際並不會影響所形成 圖片之觀看效果,因此,優選地,所述影像處理單元30中 設定有一域值,當檢測到攝像裝置100拍攝時之傾斜度大 於所述域值時,則進行被攝物影像矯正,否則則不進行矯 正0 所述記憶體40用於存儲經過所述影像處理單元30處 理後之圖片,如所述第三圖片103。 所述顯示器50可在攝像裝置100拍攝過程中用於預覽 被攝物影像,還可在非拍攝過程中用於觀看記憶體40中存 儲之圖片。 另外,本發明實施例還提供一種所述攝像裝置100之 影像自動正立方法。其包括以下步驟,請進一步參閱圖5。 步驟S11 :獲取一被攝物之影像,得到一具有被攝物 之影像之一原始圖片,並感測攝像裝置1〇〇獲取該被攝物 之影像時之傾斜度。所述攝像裝置1〇〇之傾斜度具體可體 現在攝像裝置100之中軸線與水平面之法線之間之夾角大 小。所述攝像裝置100之傾斜度可採用一固定於攝像裝置 100上之感測器10來感測,所述感測器10具體可為一陀 螺儀。 步驟S13 :根據所述攝像裝置1⑻之傾斜度資訊,矯 正所述被攝物之影像,得到一具有正立之被攝物影像之圖 9 200913685 片。在步驟S13,可進一步包括一判斷步驟,判斷攝像裝 置拍攝時之傾斜度是否大於一設定之域值,若大於則進行 被攝物影像矯正,否則則不進行矯正。 步驟S15:存儲所述具有正立之被攝物影像之圖片。 所述攝像裝置通過在拍攝被攝物影像之同時獲得此時 其傾斜度資訊,然後通過該傾斜度資訊對產生傾斜之被攝 物影像進行矯正,以得到一正立之被攝物影像,然後再進 行存儲,從而便於以後進行觀看。 綜上所述,本發明符合發明專利要件,爰依法提出專 利申請。惟,以上所述者僅為本發明之較佳實施方式,本 發明之範圍並不以上述實施方式為限,舉凡熟悉本案技藝 之人士援依本發明之精神所作之等效修飾或變化,皆應涵 蓋於以下申請專利範圍内。 【圖式簡單說明】 圖1係本發明實施例提供之一種攝像裝置之功能模組圖。 圖2係圖1中之攝像裝置發生歪斜時獲取之具有被攝物影 像之圖片。 圖3係圖2中之圖片旋轉一角度所得到之圖片。 圖4係圖3中之圖片剪裁後所得到之圖片。 圖5係本發明實施例提供之一種攝像裝置之攝像裝置之影 像自動正立方法之流程圖。 【主要元件符號說明】 攝像裝置 1〇〇 感測器 10 影像感測器 20 影像處理單元 30 200913685 記憶體 40 顯示器 50 第一圖片 101 第二圖片 102 第三圖片 103 11BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to the field of imaging, and more particularly to an image pickup apparatus and an image automatic erect method thereof. [Prior Art] In today's information age, various camera devices, such as digital cameras, digital cameras, and mobile phones with camera functions, are increasingly favored by consumers, and the functions of camera devices are increasing. When a conventional camera device is used for shooting, the camera device is generally fixed by a hand or a tripod. The camera may be tilted due to the possibility of jitter or uneven placement of the tripod during shooting, causing the subject to be in the subject. The imaging on the camera is tilted. Thus, directly storing the image of the subject is obviously not conducive to viewing in the future. SUMMARY OF THE INVENTION In view of the above, it is necessary to provide an image pickup apparatus capable of automatically erecting an image of an object which is tilted at the time of shooting, and an image automatic erect method. A camera device includes a sensor, an image sensor, an image processing unit, and a memory. The sensor, the image sensor, and the memory are electrically connected to the image processing unit, respectively. The image sensor is used to acquire an image of a subject. The sensor is configured to sense an inclination of the image capturing device to acquire an image of a subject. The image processing unit corrects the subject image to an image of the subject that is erected according to the tilt. The memory is used to store an image of the corrected subject. 6 200913685 An image auto-aligning method for a camera device, comprising the steps of: acquiring an image of a subject, and sensing tilt information when the camera device acquires an image of the subject; according to the tilt of the camera device Degree information, correcting the image of the subject to obtain a picture with an erect object image; and storing the picture with the erect object image. The camera device obtains the tilt information at the same time as the image of the subject, and then corrects the image of the tilted object by the tilt information to obtain an erect object image, and then Store it again for later viewing. [Embodiment] Hereinafter, the present invention will be further described in detail with reference to the accompanying drawings. FIG. 1 is a functional block diagram of a camera device 100 according to an embodiment of the present invention. The camera device 100 includes a sensor 10, an image sensor 20, an image processing unit 30, a memory 40, and a display 50. The sensor 10, the image sensor 20, the memory 40, and a display 50 are electrically connected to the image processing unit 30, respectively. The camera device 100 may specifically be a digital camera, a digital camera, a mobile phone having an imaging function, or the like. When the image pickup apparatus 100 is in an ideal photographing state, the axis is generally perpendicular to the horizontal plane to capture an erect image. However, in actual shooting, the camera device 100 tends to be inclined, that is, the axis thereof often has a certain angle with the normal of the horizontal plane, and the image of the object obtained by the camera device 1 tends to be inclined. image. The image sensor 20 is configured to acquire an image of the object and convert the optical signal from the object of the 200913685 into an electrical signal corresponding to the image of the object. When the tilt occurs when the image pickup apparatus 100 is photographed, the image of the subject on the image sensor 20 is also tilted to obtain the first picture 101 as shown in FIG. In general, the tilt angle of the camera is set to be the same as the tilt angle and direction of the image on the image sensor 2 . In the present embodiment, the subject is a tree. Since the camera 1 is tilted at the time of shooting, the tree appears tilted in the first picture 1〇1. The sensor 10 is configured to sense the slope of the camera of the camera device 1 , that is, the refresh angle between the axis of the camera device 1 and the normal of the horizontal plane. A signal reflecting the inclination of the imaging device 100 is emitted. The normal line of the good plane is the same as the direction of the gravitational acceleration. By the angle between the central axis of the sensing image f and the gravitational acceleration, it can be known that the image is between the central axis of the 100 and the normal of the horizontal plane. The angle is obtained to obtain the inclination of the image capturing device 100 when the image is captured. The angle between the sensing camera line and the gravitational acceleration can be easily realized, such as an h-spin or a multi-axis sensing element. The image processing unit 3 is configured to correct the image of the object captured by the image sensor 2 to an image of the object that is erect. Please refer to FIG. 2 = FIG. 4 'specifically' the image processing unit 3 得到 according to the inclination signal of the imaging device 1 GG of the sensor i 1 , and obtain the inclination angle of the image of the object 2: The tilt angle of the subject image on the picture 101. By rotating the first picture (10), the angle of the tilting angle of the camera is the same as the angle of the opposite direction, and the image is transmitted to the second picture. The subject image is positive in the 8th 200913685 2 picture 102. Standing. However, the second picture 102 is not an erect rectangle. Preferably, the second picture 102 is clipped to obtain an erect third picture 103. Since the imaging device 100 is often tilted when actually shooting, the smaller tilt does not affect the viewing effect of the formed picture. Therefore, preferably, the image processing unit 30 sets a field value. When it is detected that the inclination of the imaging apparatus 100 is greater than the threshold value, the subject image is corrected, otherwise the correction is not performed. The memory 40 is used for storage after being processed by the image processing unit 30. A picture, such as the third picture 103. The display 50 can be used to preview a subject image during shooting of the image pickup apparatus 100, and can also be used to view a picture stored in the memory 40 during non-shooting. In addition, an embodiment of the present invention further provides an image auto-aligning method of the image capturing apparatus 100. It includes the following steps, please refer to Figure 5. Step S11: Acquire an image of a subject to obtain an original picture having an image of the subject, and sense the inclination of the image capturing device 1 to acquire the image of the subject. The inclination of the image pickup device 1 specifically reflects the angle between the axis of the image pickup device 100 and the normal to the horizontal plane. The tilt of the camera device 100 can be sensed by a sensor 10 fixed to the camera device 100. The sensor 10 can be a gyroscope. Step S13: Correcting the image of the subject according to the tilt information of the image capturing apparatus 1 (8) to obtain a picture 9 200913685 having an image of the object being erected. In step S13, a determining step may be further included to determine whether the tilt of the camera is greater than a set value, and if it is greater than, the subject image is corrected, otherwise the correction is not performed. Step S15: storing the picture having the erect object image. The camera device obtains the tilt information at the same time as the image of the subject, and then corrects the image of the tilted object by the tilt information to obtain an erect object image, and then Store it again for later viewing. In summary, the present invention complies with the requirements of the invention patent and submits a patent application according to law. However, the above description is only the preferred embodiment of the present invention, and the scope of the present invention is not limited to the above-described embodiments, and equivalent modifications or variations made by those skilled in the art in light of the spirit of the present invention are It should be covered by the following patent application. BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 is a functional block diagram of an image pickup apparatus according to an embodiment of the present invention. Fig. 2 is a picture of the image having the subject acquired when the image pickup apparatus of Fig. 1 is skewed. Figure 3 is a picture obtained by rotating the picture of Figure 2 at an angle. Figure 4 is a picture obtained after the picture in Figure 3 is cropped. FIG. 5 is a flow chart of a method for automatically erecting an image of an image pickup apparatus of an image pickup apparatus according to an embodiment of the present invention. [Description of main component symbols] Camera unit 1〇〇 Sensor 10 Image sensor 20 Image processing unit 30 200913685 Memory 40 Display 50 First picture 101 Second picture 102 Third picture 103 11