TWI691938B - System and method of generating moving images, computer device, and readable storage medium - Google Patents
System and method of generating moving images, computer device, and readable storage medium Download PDFInfo
- Publication number
- TWI691938B TWI691938B TW107139083A TW107139083A TWI691938B TW I691938 B TWI691938 B TW I691938B TW 107139083 A TW107139083 A TW 107139083A TW 107139083 A TW107139083 A TW 107139083A TW I691938 B TWI691938 B TW I691938B
- Authority
- TW
- Taiwan
- Prior art keywords
- depth
- depth value
- value
- image
- bar graph
- Prior art date
Links
Images
Landscapes
- Image Generation (AREA)
Abstract
Description
本發明涉及影像處理技術領域,具體涉及一種動態影像生成方法及系統、電腦裝置、及可讀儲存介質。The invention relates to the technical field of image processing, and in particular to a method and system for generating dynamic images, a computer device, and a readable storage medium.
本部分旨在為申請專利範圍及具體實施方式中陳述的本發明實施例的實施方式提供背景或上下文。此處的描述不因為包括在本部分中就承認是現有技術。This section is intended to provide background or context for the implementation of the embodiments of the present invention set forth in the scope of patent application and specific implementation. The description here is not admitted to be prior art because it is included in this section.
當前有很多種方式可以獲得深度圖像。例如可利用深度攝影機進行拍攝、由模擬人類雙眼視覺之雙攝影機進行拍攝來獲得深度圖像、或者透過對靜態圖像建立空間模型、邊緣檢測、計算消失點等方式來獲取靜態圖像的深度圖像。然而,目前卻鮮少有利用深度圖像作進一步處理以擴增深度圖像作用的方案。There are currently many ways to obtain depth images. For example, you can use a depth camera to shoot, a dual camera that simulates human binocular vision to obtain a depth image, or a spatial model of a static image, edge detection, and calculation of the vanishing point to obtain the depth of the static image. image. However, at present, there are few solutions that use depth images for further processing to amplify the effect of depth images.
鑒於以上內容,有必要提出一種動態影像生成方法及系統、電腦裝置、及電腦可讀儲存介質,可以基於深度圖像生成動態影像。In view of the above, it is necessary to propose a method and system for generating dynamic images, a computer device, and a computer-readable storage medium, which can generate dynamic images based on depth images.
本發明的第一方面提供一種動態影像生成方法,所述方法包括:獲取一張靜態圖像,以及獲取所述靜態圖像的深度圖像;根據所述深度圖像的深度資訊將所述深度圖像的預設區域轉化成長條圖;根據所述長條圖計算得出一個平均深度值D,所述平均深度值D為所述預設區域中全部圖元點的深度值的平均值;根據所述平均深度值D從所述長條圖中確定一個第一深度值d1和一個第二深度值d2;根據所述第一深度值d1和第二深度值d2確定M個第三深度值d3,其中,所述M為大於1的整數,所述M個第三深度值d3為不同大小的深度值;根據所述M個第三深度值d3中的每個第三深度值d3對所述靜態圖像進行模糊處理,從而生成M張虛化圖像,並將所述M張虛化圖像分別與對應的第三深度值d3建立關聯;及按照所述M張虛化圖像中的每張虛化圖像所對應的第三深度值d3的大小來按序播放所述M張虛化圖像。A first aspect of the present invention provides a method for generating a dynamic image, the method includes: acquiring a static image, and acquiring a depth image of the static image; and converting the depth according to depth information of the depth image The preset area of the image is converted into a long bar graph; an average depth value D is calculated according to the bar graph, and the average depth value D is an average value of depth values of all primitive points in the preset area; Determining a first depth value d1 and a second depth value d2 from the bar graph according to the average depth value D; determining M third depth values according to the first depth value d1 and the second depth value d2 d3, where M is an integer greater than 1, and the M third depth values d3 are depth values of different sizes; according to each third depth value d3 in the M third depth values d3 Performing blur processing on the static image to generate M blurred images, and respectively associating the M blurred images with the corresponding third depth value d3; and according to the M blurred images The size of the third depth value d3 corresponding to each blurred image is used to play the M blurred images in sequence.
優選地,所述長條圖的橫軸表示深度值,縱軸表示圖元點的數量。Preferably, the horizontal axis of the bar graph represents a depth value, and the vertical axis represents the number of primitive points.
優選地,所述預設區域是指以所述深度圖像的中心為中心,具有預設大小和預設形狀的區域。Preferably, the preset area refers to an area having a preset size and a shape with the center of the depth image as the center.
優選地,所述根據所述長條圖計算得出一個平均深度值D包括:將所述長條圖所展示的每個深度值乘以對應的圖元點的數量獲得乘積;將所計算得出的所有乘積相加獲得一個總值;及將所述總值除以所述預設區域的圖元點的總數量計算得出所述平均深度值D。Preferably, the calculating an average depth value D according to the bar graph includes: multiplying each depth value displayed by the bar graph by the number of corresponding primitive points to obtain a product; and calculating the calculated Add all the products obtained to obtain a total value; and divide the total value by the total number of primitive points in the preset area to calculate the average depth value D.
優選地,所述根據所述平均深度值D從所述長條圖中確定一個第一深度值d1和一個第二深度值d2包括:(a1)確定所述長條圖中是否存在滿足第一條件的第一深度值d1,其中,所述第一條件包括:d1的大小在d min~D 之間,且d1對應的圖元點的數量大於或等於d min~D 之間的每一個深度值所對應的圖元點的數量,且d1對應的圖元點的數量大於預設值,其中d min為所述長條圖的橫軸座標的最小值;(b1)若在所述長條圖中存在滿足所述第一條件的第一深度值d1,確定所述第二深度值d2為d max,其中d max為所述長條圖的橫軸座標的最大值;(c1)若在所述長條圖中不存在滿足所述第一條件的第一深度值d1,則按照第二條件在所述長條圖中尋找所述第一深度值d1,所述第二條件包括:d1的大小在D~d max之間,且d1對應的圖元點的數量大於或等於D~d max之間的每一個深度值所對應的圖元點的數量;若所述第一深度值d1滿足所述第二條件,則確定所述第二深度值d2為d min。 Preferably, the determining a first depth value d1 and a second depth value d2 from the bar graph according to the average depth value D includes: (a1) determining whether there is a The first depth value d1 of the condition, where the first condition includes: the size of d1 is between d min ~D, and the number of primitive points corresponding to d1 is greater than or equal to each depth between d min ~D The number of primitive points corresponding to the value, and the number of primitive points corresponding to d1 is greater than the preset value, where d min is the minimum value of the horizontal axis coordinates of the bar graph; (b1) if it is in the bar There is a first depth value d1 that satisfies the first condition in the figure, and it is determined that the second depth value d2 is d max , where d max is the maximum value of the horizontal axis coordinate of the bar graph; (c1) If there is no first depth value d1 satisfying the first condition in the bar graph, the first depth value d1 is searched for in the bar graph according to the second condition, and the second condition includes: d1 Is between D~d max , and the number of primitive points corresponding to d1 is greater than or equal to the number of primitive points corresponding to each depth value between D~d max ; if the first depth value d1 If the second condition is satisfied, it is determined that the second depth value d2 is d min .
優選地,所述根據所述平均深度值D從所述長條圖中確定一個第一深度值d1和一個第二深度值d2包括:(a2)確定所述長條圖中是否存在滿足第三條件的第一深度值d1,其中,所述第三條件包括:d1的大小在D~d max之間,且d1對應的圖元點的數量大於或等於D~d max之間的每一個深度值所對應的圖元點的數量,且d1對應的圖元點的數量大於預設值,其中d max為所述長條圖的橫軸座標的最大值;(b2)若在所述長條圖中存在滿足所述第三條件的第一深度值d1,確定所述第二深度值d2為d min,其中d min為所述長條圖的橫軸座標的最小值;(c2)若在所述長條圖中不存在滿足所述第三條件的第一深度值d1,則按照第四條件在所述長條圖中尋找所述第一深度值d1,其中,所述第四條件包括:d1的大小在d min~D 之間,且d1對應的圖元點的數量大於或等於d min~D之間的每一個深度值所對應的圖元點的數量;若所述第一深度值d1滿足所述第四條件,則確定所述第二深度值d2為d max。 Preferably, the determining a first depth value d1 and a second depth value d2 from the bar graph according to the average depth value D includes: (a2) determining whether there is a third The first depth value d1 of the condition, wherein the third condition includes: the size of d1 is between D~d max , and the number of primitive points corresponding to d1 is greater than or equal to each depth between D~d max The number of primitive points corresponding to the value, and the number of primitive points corresponding to d1 is greater than the preset value, where d max is the maximum value of the horizontal axis coordinate of the bar graph; (b2) if it is in the bar There is a first depth value d1 satisfying the third condition in the figure, and it is determined that the second depth value d2 is d min , where d min is the minimum value of the horizontal axis coordinate of the bar graph; (c2) If there is no first depth value d1 satisfying the third condition in the bar graph, the first depth value d1 is searched for in the bar graph according to the fourth condition, where the fourth condition includes : The size of d1 is between d min ~D, and the number of primitive points corresponding to d1 is greater than or equal to the number of primitive points corresponding to each depth value between d min ~D; if the first depth If the value d1 satisfies the fourth condition, it is determined that the second depth value d2 is d max .
優選地,所述M個第三深度值d3組成一個等差數列,所述等差數列的公差等於所述第一深度值d1和第二深度值d2之間的差值的絕對值除以(M-1)所得的值,所述M個第三深度值d3中的最小深度值為d1和d2兩者中的較小者,所述M個第三深度值d3中的最大深度值為d1和d2兩者中的較大者。Preferably, the M third depth values d3 form an arithmetic sequence, and the tolerance of the arithmetic sequence is equal to the absolute value of the difference between the first depth value d1 and the second depth value d2 divided by ( M-1) The obtained value, the minimum depth value of the M third depth values d3 is the smaller of d1 and d2, and the maximum depth value of the M third depth values d3 is d1 And d2 whichever is greater.
優選地,根據所述M個第三深度值d3中的某個第三深度值d3對所述靜態圖像進行模糊處理時,所模糊處理的圖元點所對應的模糊程度正比於該模糊處理的圖元點所對應的深度值與所述某個第三深度值d3之間的差值。Preferably, when the still image is blurred according to a third depth value d3 of the M third depth values d3, the blur degree corresponding to the blurred primitive point is proportional to the blur processing The difference between the depth value corresponding to the pixel point of and the third depth value d3.
本發明第二方面提供一種電腦裝置,所述電腦裝置包括處理器,所述處理器用於在執行儲存器中儲存的電腦程式時實現所述的動態影像生成方法。本發明協力廠商面提供一種電腦可讀儲存介質,其上儲存有電腦程式,所述電腦程式被處理器執行時實現所述的動態影像生成方法。本發明第四方面提供一種動態影像生成系統,所述系統包括:獲取模組,用於獲取一張靜態圖像,以及獲取所述靜態圖像的深度圖像;及處理模組,用於根據所述深度圖像的深度資訊將所述深度圖像的預設區域轉化成長條圖;所述處理模組,還用於根據所述長條圖計算得出一個平均深度值D,所述平均深度值D為所述預設區域中全部圖元點的深度值的平均值;所述處理模組,還用於根據所述平均深度值D從所述長條圖中確定一個第一深度值d1和一個第二深度值d2;所述處理模組,還用於根據所述第一深度值d1和第二深度值d2確定M個第三深度值d3,其中,所述M為大於1的整數,所述M個第三深度值d3為不同大小的深度值;所述處理模組,還用於根據所述M個第三深度值d3中的每個第三深度值d3對所述靜態圖像進行模糊處理,從而生成M張虛化圖像,並將所述M張虛化圖像分別與對應的第三深度值d3建立關聯;及所述處理模組,還用於按照所述M張虛化圖像中的每張虛化圖像所對應的第三深度值d3的大小來按序播放所述M張虛化圖像。A second aspect of the present invention provides a computer device. The computer device includes a processor, and the processor is used to implement the dynamic image generation method when executing a computer program stored in a storage. The third party of the present invention provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the dynamic image generation method is realized. A fourth aspect of the present invention provides a dynamic image generation system. The system includes: an acquisition module for acquiring a static image and a depth image of the static image; and a processing module for The depth information of the depth image converts the preset area of the depth image into a bar graph; the processing module is further used to calculate an average depth value D according to the bar graph, the average The depth value D is the average value of the depth values of all the primitive points in the preset area; the processing module is further used to determine a first depth value from the bar graph according to the average depth value D d1 and a second depth value d2; the processing module is further configured to determine M third depth values d3 according to the first depth value d1 and the second depth value d2, where M is greater than 1. Integer, the M third depth values d3 are depth values of different sizes; the processing module is further used to compare the static value according to each third depth value d3 of the M third depth values d3 Blur the image to generate M blurred images, and associate the M blurred images with the corresponding third depth value d3; and the processing module is also used to The size of the third depth value d3 corresponding to each of the M blurred images is used to play the M blurred images in sequence.
本發明實施例中所述的動態影像生成方法及系統、電腦裝置、及電腦可讀儲存介質,可以基於深度圖像生成動態影像。The dynamic image generation method and system, computer device, and computer-readable storage medium described in the embodiments of the present invention can generate dynamic images based on depth images.
為了能夠更清楚地理解本發明的上述目的、特徵和優點,下面結合附圖和具體實施例對本發明進行詳細描述。需要說明的是,在不衝突的情況下,本發明的實施例及實施例中的特徵可以相互組合。In order to be able to understand the above objects, features and advantages of the present invention more clearly, the present invention will be described in detail below with reference to the drawings and specific embodiments. It should be noted that the embodiments of the present invention and the features in the embodiments can be combined with each other without conflict.
在下面的描述中闡述了很多具體細節以便於充分理解本發明,所描述的實施例僅僅是本發明一部分實施例,而不是全部的實施例。基於本發明中的實施例,本領域普通技術人員在沒有做出創造性勞動前提下所獲得的所有其他實施例,都屬於本發明保護的範圍。In the following description, many specific details are set forth in order to fully understand the present invention. The described embodiments are only a part of the embodiments of the present invention, but not all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by a person of ordinary skill in the art without making creative efforts fall within the protection scope of the present invention.
除非另有定義,本文所使用的所有的技術和科學術語與屬於本發明的技術領域的技術人員通常理解的含義相同。本文中在本發明的說明書中所使用的術語只是為了描述具體的實施例的目的,不是旨在於限制本發明。Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the technical field of the present invention. The terminology used in the description of the present invention herein is for the purpose of describing specific embodiments, and is not intended to limit the present invention.
圖1是本發明實施例提供的電腦裝置的示意圖。FIG. 1 is a schematic diagram of a computer device provided by an embodiment of the present invention.
在本發明較佳實施例中,電腦裝置3包括,但不限於,儲存器31、至少一個處理器32、顯示器34,及攝像裝置35。In a preferred embodiment of the present invention, the
本領域技術人員應該瞭解,圖1示出的電腦裝置的結構並不構成本發明實施例的限定,所述電腦裝置3還可以包括比圖示更多或更少的其他硬體或者軟體,或者不同的部件佈置。儘管未示出,所述電腦裝置3還可以包括給各個元件供電的電源(比如電池),優選的,電源可以透過電源管理裝置與所述至少一個處理器32邏輯相連,從而透過電源管理裝置實現管理充電、放電、以及功耗管理等功能。電源還可以包括一個或一個以上的直流或交流電源、再充電裝置、電源故障檢測電路、電源轉換器或者逆變器、電源狀態指示器等任意元件。所述電腦裝置3還可以包括其他元件,例如感測器、Wi-Fi模組等,在此不再贅述。Those skilled in the art should understand that the structure of the computer device shown in FIG. 1 does not constitute a limitation of the embodiment of the present invention, and the
應該瞭解,所述實施例僅為說明之用,在專利申請範圍上並不受此結構的限制。It should be understood that the described embodiments are for illustrative purposes only and are not limited by this structure in the scope of patent applications.
在一些實施例中,所述儲存器31用於儲存程式碼和各種資料,例如安裝在所述電腦裝置3中的動態影像生成系統5,並在電腦裝置3的運行過程中實現高速、自動地完成程式或資料的存取。所述儲存器31包括唯讀儲存器(Read-Only Memory,ROM)、隨機儲存器(Random Access Memory,RAM)、可程式設計唯讀儲存器(Programmable Read-Only Memory,PROM)、可擦除可程式設計唯讀儲存器(Erasable Programmable Read-Only Memory,EPROM)、一次可程式設計唯讀儲存器(One-time Programmable Read-Only Memory,OTPROM)、電子擦除式可複寫唯讀儲存器(Electrically-Erasable Programmable Read-Only Memory,EEPROM)、唯讀光碟(Compact Disc Read-Only Memory,CD-ROM)或其他光碟儲存器、磁碟儲存器、磁帶儲存器、或者能夠用於攜帶或儲存資料的電腦可讀的任何其他儲存介質。In some embodiments, the
在一些實施例中,所述至少一個處理器32可以由積體電路組成,例如可以由單個封裝的積體電路所組成,也可以是由多個相同功能或不同功能封裝的積體電路所組成,包括一個或者多個中央處理器(Central Processing unit,CPU)、微處理器、數文書處理晶片、圖形處理器及各種控制晶片的組合等。所述至少一個處理器32是所述電腦裝置3的控制核心(Control Unit),利用各種介面和線路連接整個電腦裝置3的各個部件,透過運行或執行儲存在所述儲存器31內的程式或者模組,以及調用儲存在所述儲存器31內的資料,以執行電腦裝置3的各種功能和處理資料,例如圖3所示的動態影像生成的功能。In some embodiments, the at least one
在一些實施例中,所述顯示器34可用於顯示由使用者輸入的資訊或提供給使用者的資訊以及電子設備1的各種圖形觀看者介面,這些圖形觀看者介面可以由圖形、文本、圖示、視頻和其任意組合來構成。所述顯示器34可包括顯示面板,例如液晶顯示(Liquid Crystal Display,LCD)面板或有機發光二極體(Organic Light-Emitting Diode,OLED)顯示面板。In some embodiments, the
在一些實施例中,攝像裝置35可以為深度攝影機或者是有模擬人類雙眼視覺之雙攝影機。所述電腦裝置3可以利用所述攝像裝置35拍攝深度圖像(depth image)。本實施例中,深度圖像也被稱為距離影像(range image),是指將從圖像採集器(例如拍攝裝置35)到場景中各點的距離(深度)作為圖元值的圖像。深度圖像的深度資訊往往採用一灰階範圍(例如0~255)來表示各圖元點的深度值,例如灰階值0表示最靠近圖像採集器,灰階值255表示最遠離圖像採集器。In some embodiments, the
在一些實施例中,所述動態影像生成系統5儲存於電腦裝置3的儲存器31中,並由所述至少一個處理器32所執行,以實現動態影像生成的功能。In some embodiments, the dynamic
所述動態影像生成系統5可以包括一個或多個程式形式的電腦指令,該一個或多個程式形式的電腦指令儲存於所述儲存器31中,並由所述至少一個處理器32執行。在一個實施例中,所述動態影像生成系統5可以集成於所述至少一個處理器32中。在其他實施例中,所述動態影像生成系統5也可以獨立於該處理器32之外。The dynamic
參閱圖2所示,所述動態影像生成系統5可以包括一個或多個模組,例如圖2所示的獲取模組51、以及處理模組52。關於各模組的功能將結合圖3詳述。Referring to FIG. 2, the dynamic
本說明書中所提及的“模組”是指以硬體或固件形式呈現的,或者是指利用程式語言例如JAVA、C語言編寫的電腦指令集。模組中的一個或多個電腦指令可嵌入固件中,如嵌入在一個可讀寫可程式設計儲存器中。本實施例中所描述的模組可被實現為軟體和/或硬體模組,並且可以被儲存在任何類型的非臨時性電腦可讀介質或其它存放裝置例如儲存器31中。The "module" mentioned in this specification refers to the form of hardware or firmware, or refers to the set of computer instructions written in programming languages such as JAVA and C. One or more computer instructions in the module can be embedded in the firmware, such as in a readable and writable programming memory. The modules described in this embodiment may be implemented as software and/or hardware modules, and may be stored in any type of non-transitory computer-readable medium or other storage device such as
圖3是本發明實施例提供的動態影像生成方法的流程圖。FIG. 3 is a flowchart of a method for generating a dynamic image provided by an embodiment of the present invention.
所述動態影像生成方法具體包括以下步驟,根據不同的需求,該流程圖中步驟的順序可以改變,某些步驟可以省略。The dynamic image generation method specifically includes the following steps. According to different requirements, the order of the steps in the flowchart may be changed, and some steps may be omitted.
步驟S11、獲取模組51獲取一張靜態圖像,以及獲取所述靜態圖像的深度圖像。Step S11: The
在一個實施例中,所述獲取模組51可以透過對所述靜態圖像建立空間模型、邊緣檢測、計算消失點等方式來獲取所述靜態圖像的深度圖像。所述獲取模組51也可自一伺服器或另一電腦裝置獲取所述深度圖像。In one embodiment, the
步驟S12、處理模組52根據所述深度圖像的深度資訊將所述深度圖像的預設區域轉化成長條圖(histogram)。其中,所述長條圖的橫軸表示深度值,縱軸表示圖元點的數量。所述長條圖的橫軸座標的最小值為d
min,所述長條圖的橫軸座標的最大值為d
max,例如d
min等於0且d
max等於255。在其他實施例中,d
min和d
max可改為其他數值。
Step S12: The processing
在一個實施例中,所述深度圖像的深度資訊是指每個圖元點的深度值。In one embodiment, the depth information of the depth image refers to the depth value of each primitive point.
在一個實施例中,所述預設區域是指以所述深度圖像的中心為中心,具有預設大小和預設形狀的區域。在一個實施例中,所述預設形狀可以為長方形、正方形,或者圓形等。舉例而言,以所述預設形狀為長方形為例,所述預設區域可以是指以所述深度圖像的中心為中心,具有預設長和預設寬的區域。In one embodiment, the preset area refers to an area with a preset size and a shape that is centered on the center of the depth image. In one embodiment, the preset shape may be a rectangle, a square, or a circle. For example, taking the preset shape as a rectangle as an example, the preset area may refer to an area with a preset length and a preset width centered on the center of the depth image.
例如,處理模組52根據所述深度圖像的深度資訊,將所述深度圖像的預設區域轉化成圖4所示的長條圖6。其中,所述長條圖6的橫軸表示深度值,縱軸表示圖元點的數量。For example, the
步驟S13、處理模組52根據所述長條圖計算得出一個平均深度值D。所述平均深度值D就是所述長條圖中(即所述預設區域中)全部圖元點的深度值的平均值。Step S13: The processing
具體地,所述處理模組52可以將所述長條圖所展示的每個深度值乘以對應的圖元點的數量獲得乘積,以及將所計算得出的所有乘積相加獲得一個總值,將所述總值除以所述預設區域的圖元點的總數量計算得出所述平均深度值D。Specifically, the
步驟S14、處理模組52根據所述平均深度值D從所述長條圖中確定一個第一深度值d1和一個第二深度值d2。Step S14: The processing
在第一實施例中:In the first embodiment:
所述根據所述平均深度值D從所述長條圖中確定一個第一深度值d1和一個第二深度值d2包括:The determining a first depth value d1 and a second depth value d2 from the bar graph according to the average depth value D includes:
(a1)確定所述長條圖中是否存在滿足第一條件的第一深度值d1。若在所述長條圖中存在滿足所述第一條件的第一深度值d1,執行步驟(b1)。若在所述長條圖中不存在滿足所述第一條件的第一深度值d1,執行步驟(c1)。 其中,所述第一條件包括: d1的大小在d min~D 之間,且d1對應的圖元點的數量大於或等於d min~D 之間的每一個深度值所對應的圖元點的數量,且d1對應的圖元點的數量大於一個預設值(例如180)。 (A1) Determine whether there is a first depth value d1 satisfying the first condition in the bar graph. If there is a first depth value d1 that satisfies the first condition in the bar graph, step (b1) is performed. If there is no first depth value d1 satisfying the first condition in the bar graph, step (c1) is executed. The first condition includes: the size of d1 is between d min ~D, and the number of primitive points corresponding to d1 is greater than or equal to that of the primitive points corresponding to each depth value between d min ~D Number, and the number of primitive points corresponding to d1 is greater than a preset value (for example, 180).
(b1)若在所述長條圖中存在滿足所述第一條件的第一深度值d1,所述處理模組52則確定所述第二深度值d2為d
max。
(B1) If there is a first depth value d1 satisfying the first condition in the bar graph, the
(c1)若在所述長條圖中不存在滿足所述第一條件的第一深度值d1,所述處理模組52則按照第二條件在所述長條圖中尋找所述第一深度值d1(即所述第一深度值d1需要滿足所述第二條件)。所述第二條件包括:d1的大小在D~d
max之間,且d1對應的圖元點的數量大於或等於D~d
max之間的每一個深度值所對應的圖元點的數量。在一個實施例中,若所述第一深度值d1為滿足所述第二條件的深度值,所述處理模組52則確定第二深度值d2為d
min。
(C1) If there is no first depth value d1 satisfying the first condition in the bar graph, the
在第二實施例中:In the second embodiment:
所述根據所述平均深度值D從所述長條圖中確定一個第一深度值d1和一個第二深度值d2包括:The determining a first depth value d1 and a second depth value d2 from the bar graph according to the average depth value D includes:
(a2)確定所述長條圖中是否存在滿足第三條件的第一深度值d1。若在所述長條圖中存在滿足所述第三條件的第一深度值d1,執行步驟(b2)。若在所述長條圖中不存在滿足所述第三條件的第一深度值d1,執行步驟(c2)。 其中,所述第三條件包括:d1的大小在D~d max之間,且d1對應的圖元點的數量大於或等於D~d max之間的每一個深度值所對應的圖元點的數量,且d1對應的圖元點的數量大於所述預設值(例如180)。 (A2) Determine whether there is a first depth value d1 satisfying the third condition in the bar graph. If there is a first depth value d1 that satisfies the third condition in the bar graph, step (b2) is performed. If there is no first depth value d1 satisfying the third condition in the bar graph, step (c2) is performed. Wherein, the third condition includes: the size of d1 is between D~d max , and the number of primitive points corresponding to d1 is greater than or equal to that of the primitive points corresponding to each depth value between D~d max Number, and the number of primitive points corresponding to d1 is greater than the preset value (for example, 180).
(b2)若在所述長條圖中存在滿足所述第三條件的第一深度值d1,所述處理模組52則確定所述第二深度值d2為d
min。
(B2) If there is a first depth value d1 satisfying the third condition in the bar graph, the
(c2)若在所述長條圖中不存在滿足所述第三條件的第一深度值d1,所述處理模組52則按照第四條件在所述長條圖中尋找所述第一深度值d1(即所述第一深度值d1需要滿足所述第四條件)。(C2) If there is no first depth value d1 satisfying the third condition in the bar graph, the
本實施例中,所述第四條件包括:d1的大小在d min~D 之間,且d1對應的圖元點的數量大於或等於d min~D之間的每一個深度值所對應的圖元點的數量。 In this embodiment, the fourth condition includes: the size of d1 is between d min ~D, and the number of primitive points corresponding to d1 is greater than or equal to the map corresponding to each depth value between d min ~D The number of meta points.
在一個實施例中,若所述第一深度值d1為滿足所述第四條件的深度值,所述處理模組52則確定第二深度值d2為d
max。
In one embodiment, if the first depth value d1 is a depth value that satisfies the fourth condition, the
步驟S15、處理模組52根據所述第一深度值d1、第二深度值d2確定M個第三深度值d3,其中,所述M個第三深度值d3為不同大小的深度值。Step S15. The
在一個實施例中,所述M的值為大於1的正整數。所述M的值可以是一個預設值,或者是由處理模組52根據使用者的輸入所設定。In one embodiment, the value of M is a positive integer greater than 1. The value of M may be a preset value, or set by the
在一個實施例中,所述M個第三深度值d3組成一個等差數列,所述等差數列的公差等於所述第一深度值d1和第二深度值d2之間的差值的絕對值除以(M-1)所得的值。在一個實施例中,所述M個第三深度值d3中的最小深度值為d1和d2兩者中的較小者,所述M個第三深度值d3中的最大深度值為d1和d2兩者中的較大者。In one embodiment, the M third depth values d3 form an arithmetic sequence, and the tolerance of the arithmetic sequence is equal to the absolute value of the difference between the first depth value d1 and the second depth value d2 The value divided by (M-1). In one embodiment, the minimum depth value of the M third depth values d3 is the smaller of d1 and d2, and the maximum depth value of the M third depth values d3 is d1 and d2 The larger of the two.
步驟S16、處理模組52 根據所述M個第三深度值d3中的每個第三深度值d3對所述靜態圖像進行模糊處理,從而生成M張虛化圖像(bokeh image),並將所述M張虛化圖像分別與對應的第三深度值d3建立關聯。Step S16. The
具體地,處理模組52 根據所述M個第三深度值d3中的某個第三深度值d3對所述靜態圖像進行模糊處理時,對深度值不等於所述某個第三深度值d3的圖元點進行模糊處理,以及對深度值等於所述某個第三深度值d3的圖元點不模糊處理,從而生成一張虛化圖像,並將所生成的虛化圖像與所述某個第三深度值d3建立關聯。依據此方法,根據所述M個第三深度值d3中的每個第三深度值d3分別對所述靜態圖像進行模糊處理,從而生M張虛化圖像,並將所生成的每張虛化圖像與對應的所述第三深度值d3建立關聯。Specifically, when the
在一個實施例中,所述處理模組52根據所述某個第三深度值d3對所述靜態圖像進行模糊處理時,所模糊處理的圖元點所對應的模糊程度正比於該模糊處理的圖元點所對應的深度值與所述某個第三深度值d3之間的差值。即,所述模糊處理的圖元點所對應的深度值與所述某個第三深度值d3之間的差值越大,該模糊處理的圖元點所對應的模糊程度越高。In one embodiment, when the
步驟S17、處理模組52按照所述M張虛化圖像中的每張虛化圖像所對應的第三深度值d3的大小來按序播放所述M張虛化圖像,由此實現動態影像的播放。Step S17: The processing
需要說明的是,本實施例中,所述作為分離部件說明的模組可以是或者也可以不是物理上分開的,作為模組顯示的部件可以是或者也可以不是物理單元,即可以位於一個地方,或者也可以分佈到多個網路單元上。可以根據實際的需要選擇其中的部分或者全部模組來實現本實施例方案的目的。It should be noted that, in this embodiment, the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical units, that is, they may be located in one place , Or can be distributed to multiple network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
對於本領域技術人員而言,顯然本發明不限於上述示範性實施例的細節,而且在不背離本發明的精神或基本特徵的情況下,能夠以其他的具體形式實現本發明。因此,無論從哪一點來看,均應將實施例看作是示範性的,而且是非限制性的,本發明的範圍由所附申請專利範圍而不是上述說明限定,因此旨在將落在申請專利範圍的等同要件的含義和範圍內的所有變化涵括在本發明內。不應將申請專利範圍中的任何附圖標記視為限制所涉及的申請專利範圍。此外,顯然“包括”一詞不排除其他單元或,單數不排除複數。裝置申請專利範圍中陳述的多個單元或裝置也可以由一個單元或裝置透過軟體或者硬體來實現。第一,第二等詞語用來表示名稱,而並不表示任何特定的順序。It will be apparent to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the spirit or basic characteristics of the present invention. Therefore, no matter from which point of view, the embodiments should be regarded as exemplary and non-limiting, the scope of the present invention is defined by the scope of the attached patent application rather than the above description, so it is intended to fall in the application All changes in the meaning and scope of equivalent requirements of the patent scope are included in the present invention. Any reference signs in the scope of patent application shall not be considered as limiting the scope of patent application involved. In addition, it is clear that the word "include" does not exclude other units or the singular does not exclude the plural. Multiple units or devices stated in the patent application scope of the device may also be implemented by one unit or device through software or hardware. The first and second words are used to indicate names, but do not indicate any particular order.
最後應說明的是,以上實施例僅用以說明本發明的技術方案而非限制,儘管參照較佳實施例對本發明進行了詳細說明,本領域的普通技術人員應當理解,可以對本發明的技術方案進行修改或等同替換,而不脫離本發明技術方案的精神和範圍。Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present invention can be Modifications or equivalent replacements are made without departing from the spirit and scope of the technical solutions of the present invention.
3:電腦裝置 31:儲存器 32:處理器 34:顯示器 35:攝像裝置 5:動態影像生成系統 51:獲取模組 52:處理模組 6:長條圖3: computer device 31: memory 32: processor 34: display 35: Camera 5: Dynamic image generation system 51: Get module 52: Processing module 6: Bar chart
圖1是本發明較佳實施例提供的電腦裝置的示意圖。 圖2是本發明較佳實施例提供的動態影像生成系統的功能模組圖。 圖3是本發明較佳實施例提供的動態影像生成方法的流程圖。 圖4舉例說明根據深度圖像的深度資訊生成長條圖。FIG. 1 is a schematic diagram of a computer device provided by a preferred embodiment of the present invention. 2 is a functional module diagram of a dynamic image generation system provided by a preferred embodiment of the present invention. FIG. 3 is a flowchart of a dynamic image generation method provided by a preferred embodiment of the present invention. FIG. 4 illustrates an example of generating a histogram based on depth information of a depth image.
無no
Claims (11)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW107139083A TWI691938B (en) | 2018-11-02 | 2018-11-02 | System and method of generating moving images, computer device, and readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW107139083A TWI691938B (en) | 2018-11-02 | 2018-11-02 | System and method of generating moving images, computer device, and readable storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
TWI691938B true TWI691938B (en) | 2020-04-21 |
TW202018661A TW202018661A (en) | 2020-05-16 |
Family
ID=71134592
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
TW107139083A TWI691938B (en) | 2018-11-02 | 2018-11-02 | System and method of generating moving images, computer device, and readable storage medium |
Country Status (1)
Country | Link |
---|---|
TW (1) | TWI691938B (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
TW201419215A (en) * | 2012-11-13 | 2014-05-16 | Inst Information Industry | Electronic device and method for determining depth of 3D object image in 3D environment image |
US9204034B2 (en) * | 2012-12-27 | 2015-12-01 | Canon Kabushiki Kaisha | Image processing apparatus and image processing method |
CN106796718A (en) * | 2014-09-05 | 2017-05-31 | 高通股份有限公司 | For the method and apparatus of efficient depth image conversion |
TW201828691A (en) * | 2017-01-25 | 2018-08-01 | 和碩聯合科技股份有限公司 | Video imaging method and electronic device using the same |
-
2018
- 2018-11-02 TW TW107139083A patent/TWI691938B/en active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
TW201419215A (en) * | 2012-11-13 | 2014-05-16 | Inst Information Industry | Electronic device and method for determining depth of 3D object image in 3D environment image |
US9204034B2 (en) * | 2012-12-27 | 2015-12-01 | Canon Kabushiki Kaisha | Image processing apparatus and image processing method |
CN106796718A (en) * | 2014-09-05 | 2017-05-31 | 高通股份有限公司 | For the method and apparatus of efficient depth image conversion |
TW201828691A (en) * | 2017-01-25 | 2018-08-01 | 和碩聯合科技股份有限公司 | Video imaging method and electronic device using the same |
Also Published As
Publication number | Publication date |
---|---|
TW202018661A (en) | 2020-05-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP6479142B2 (en) | Image identification and organization according to layout without user intervention | |
US10679426B2 (en) | Method and apparatus for processing display data | |
US8436857B2 (en) | System and method for applying level of detail schemes | |
US20160306505A1 (en) | Computer-implemented methods and systems for automatically creating and displaying instant presentations from selected visual content items | |
US20120113141A1 (en) | Techniques to visualize products using augmented reality | |
EP3826309A2 (en) | Method and apparatus for processing video | |
EP2972950B1 (en) | Segmentation of content delivery | |
TWI695295B (en) | Image processing method, device and electronic equipment based on augmented reality | |
US9412170B1 (en) | Image processing device and image depth processing method | |
CN108898082B (en) | Picture processing method, picture processing device and terminal equipment | |
US9554060B2 (en) | Zoom images with panoramic image capture | |
CN109819346A (en) | Video file processing method and processing device, computer system and readable storage medium storing program for executing | |
TW201541343A (en) | Method and device for displaying character string | |
US11683453B2 (en) | Overlaying metadata on video streams on demand for intelligent video analysis | |
JP2021170114A (en) | Postponement of state change of information that affects graphical user interface until inattention period | |
CN105488470A (en) | Method and apparatus for determining character attribute information | |
TWI691938B (en) | System and method of generating moving images, computer device, and readable storage medium | |
US10592194B2 (en) | Method and system for multiple display device projection | |
CN111145100B (en) | Dynamic image generation method and system, computer device and readable storage medium | |
CN112017304A (en) | Method, apparatus, electronic device, and medium for presenting augmented reality data | |
CN113051491B (en) | Map data processing method, apparatus, storage medium, and program product | |
WO2021208170A1 (en) | Method and apparatus for determining target algorithm in vr scene, and computing device | |
CN110119954B (en) | Method and device for generating tracking order of surgical tool | |
CN113438463A (en) | Method and device for simulating orthogonal camera image, storage medium and electronic equipment | |
US11062359B2 (en) | Dynamic media content for in-store screen experiences |