以下、添付図面を参照して実施形態を詳しく説明する。なお、以下の実施形態は特許請求の範囲に係る発明を限定するものでない。実施形態には複数の特徴が記載されているが、これらの複数の特徴の全てが発明に必須のものとは限らず、また、複数の特徴は任意に組み合わせられてもよい。さらに、添付図面においては、同一若しくは同様の構成に同一の参照番号を付し、重複した説明は省略する。
The following embodiments are described in detail with reference to the attached drawings. Note that the following embodiments do not limit the invention according to the claims. Although the embodiments describe multiple features, not all of these multiple features are necessarily essential to the invention, and multiple features may be combined in any manner. Furthermore, in the attached drawings, the same reference numbers are used for the same or similar configurations, and duplicate explanations are omitted.
<システム構成>
図1に、本実施形態の画像解析システムの構成例を示す。以下では、一例として、このシステムが特定人物追跡システムである場合について説明する。ただし、これに限られず、画像を解析して所定の情報出力を行う任意のシステムに、以下の議論を適用することができる。本システムは、撮像装置110a~110dと、ネットワーク120と、入出力装置130とを含んで構成される。なお、撮像装置110a~110dは、それぞれ、例えば撮像した画像を記録可能なデバイスを着脱可能なスロットを有し、そのスロットに着脱可能デバイス100a~100dが挿入されることにより、着脱可能デバイス100a~100dと接続される。なお、以下では、着脱可能デバイス100a~100dを「着脱可能デバイス100」と表記し、撮像装置110a~110dを「撮像装置110」と表記する。
<System Configuration>
FIG. 1 shows an example of the configuration of an image analysis system according to the present embodiment. In the following, as an example, a case where this system is a specific person tracking system will be described. However, the present system is not limited to this, and the following discussion can be applied to any system that analyzes images and outputs predetermined information. This system is configured to include imaging devices 110a to 110d, a network 120, and an input/output device 130. Note that the imaging devices 110a to 110d each have a slot into which a device capable of recording captured images can be attached and detached, and are connected to the removable devices 100a to 100d by inserting the removable devices 100a to 100d into the slot. Note that, in the following, the removable devices 100a to 100d are referred to as "detachable devices 100", and the imaging devices 110a to 110d are referred to as "imaging devices 110".
着脱可能デバイス100は、撮像装置110に対して着脱可能な演算デバイスである。着脱可能デバイス100は、一例として、SDカードに所定の処理回路を搭載したデバイスである。着脱可能デバイス100は、例えば、SDカードの態様によって、撮像装置110にその全体が挿入可能に構成され、これにより、撮像装置110から突出する部分がない状態で撮像装置110と接続可能に構成することができる。また、着脱可能デバイス100は、例えば、撮像装置110にその半分以上の部分が挿入可能に構成され、これにより、撮像装置110から突出する部分が少ない状態で撮像装置110と接続可能に構成されてもよい。これにより、着脱可能デバイス100が配線等の障害物と干渉することを防ぐことができ、デバイスの利用時の利便性を高めることができる。また、多くの既存のネットワークカメラなどの撮像装置110には、SDカードスロットが用意されているため、既存の撮像装置110に対して、着脱可能デバイス100により拡張機能を提供することができる。なお、着脱可能デバイス100は、SDカードの態様以外に、少なくともその撮像装置110で撮影された画像を記憶可能な記憶装置が装着される際に使用される任意のインタフェースで、撮像装置110に装着されるように構成されてもよい。例えば、着脱可能デバイス100は、USB(ユニバーサルシリアルバス)インタフェースを有し、撮像装置110のUSBソケットに装着されるように構成されてもよい。また、所定の処理回路は、例えば、所定の処理を実行するようにプログラムされたFPGA(フィールドプログラマブルゲートアレイ)によって実装されるが、それ以外の形式で実装されてもよい。
The removable device 100 is a computing device that is removable from the imaging device 110. As an example, the removable device 100 is a device in which a predetermined processing circuit is mounted on an SD card. The removable device 100 is configured to be able to be inserted into the imaging device 110 in its entirety, for example, in the form of an SD card, so that it can be connected to the imaging device 110 with no part protruding from the imaging device 110. The removable device 100 may also be configured to be able to be inserted into the imaging device 110 with more than half of it being inserted into the imaging device 110, so that it can be connected to the imaging device 110 with only a small part protruding from the imaging device 110. This makes it possible to prevent the removable device 100 from interfering with obstacles such as wiring, and to increase the convenience of using the device. In addition, since many existing imaging devices 110 such as network cameras are provided with an SD card slot, the removable device 100 can provide an extended function to the existing imaging device 110. Note that the removable device 100 may be configured to be attached to the imaging device 110 using any interface other than the SD card that is used when a storage device capable of storing at least images captured by the imaging device 110 is attached. For example, the removable device 100 may have a USB (Universal Serial Bus) interface and be configured to be attached to a USB socket of the imaging device 110. In addition, the specified processing circuit is implemented, for example, by an FPGA (Field Programmable Gate Array) programmed to execute a specified process, but may be implemented in other formats.
撮像装置110は、ネットワークカメラ等の撮像装置である。本実施形態では、撮像装置110は、映像を処理することのできる演算装置を内蔵するものとするが、これに限られない。例えば、撮像装置110に接続されたPC(パーソナルコンピュータ)等の外部コンピュータが存在してもよく、これらの組み合わせを、撮像装置110として扱ってもよい。また、本実施形態では、全ての撮像装置110に、着脱可能デバイス100が装着されているものとする。なお、図1では、4つの撮像装置110と、それぞれに装着された着脱可能デバイスとが示されているが、これらの装置の組み合わせの数は3つ以下であってもよいし、5つ以上であってもよい。撮像装置110に、画像解析処理機能を有する着脱可能デバイス100が装着されることにより、撮像装置110が画像解析処理機能を有しなくても、撮像装置110側で映像処理を実行することが可能となる。また、本実施形態のように撮像装置110に映像処理用の演算装置が配置された形態では、演算装置が配置された着脱可能デバイス100が撮像装置110に装着されることにより、撮像装置110側で実行可能な画像処理を多様化・高度化することができる。
The imaging device 110 is an imaging device such as a network camera. In this embodiment, the imaging device 110 is assumed to have a built-in arithmetic device capable of processing images, but is not limited to this. For example, an external computer such as a PC (personal computer) connected to the imaging device 110 may exist, and the combination of these may be treated as the imaging device 110. In addition, in this embodiment, it is assumed that the removable device 100 is attached to all of the imaging devices 110. Note that, in FIG. 1, four imaging devices 110 and removable devices attached to each of them are shown, but the number of combinations of these devices may be three or less, or five or more. By attaching the removable device 100 having an image analysis processing function to the imaging device 110, it becomes possible to perform image processing on the imaging device 110 side even if the imaging device 110 does not have an image analysis processing function. Furthermore, in a configuration in which a computing device for image processing is arranged in the imaging device 110 as in this embodiment, the removable device 100 in which the computing device is arranged is attached to the imaging device 110, thereby making it possible to diversify and advance the image processing that can be performed on the imaging device 110 side.
入出力装置130は、ユーザからの入力の受け付けや、ユーザへの情報の出力(例えば情報の表示)を行う装置である。本実施形態では、例えば入出力装置130は、PC等のコンピュータであり、そのコンピュータにインストールされたブラウザやネイティブアプリケーションが内蔵されたプロセッサによって実行されることで、情報の入出力が行われる。
The input/output device 130 is a device that receives input from a user and outputs information to the user (e.g., displays information). In this embodiment, the input/output device 130 is, for example, a computer such as a PC, and inputs and outputs information by executing a browser or native application installed on the computer by a built-in processor.
撮像装置110と入出力装置130は、ネットワーク120を介して通信可能に接続される。ネットワーク120は、例えばEthernet(登録商標)等の通信規格を満たす複数のルータ、スイッチ、ケーブル等を含んで構成される。本実施形態では、ネットワーク120は、撮像装置110と入出力装置130との間の通信を可能とする任意のネットワークであってよく、任意の規模や構成、準拠する通信規格によって構築されうる。例えば、ネットワーク120は、インターネットや有線LAN(Local Area Network)、無線LAN、WAN(Wide Area Network)等でありうる。また、ネットワーク120は、例えば、ONVIF(Open Network Video Interface Forum)規格に準拠した通信プロトコルでの通信が可能なように構成されうる。ただし、これに限られず、ネットワーク120は、例えば、独自の通信プロトコル等の他の通信プロトコルでの通信が可能なように構成されてもよい。
The imaging device 110 and the input/output device 130 are connected to each other via a network 120 so that they can communicate with each other. The network 120 includes a plurality of routers, switches, cables, etc. that meet a communication standard such as Ethernet (registered trademark). In this embodiment, the network 120 may be any network that enables communication between the imaging device 110 and the input/output device 130, and may be constructed with any scale, configuration, and communication standard that it complies with. For example, the network 120 may be the Internet, a wired LAN (Local Area Network), a wireless LAN, a WAN (Wide Area Network), etc. In addition, the network 120 may be configured to enable communication using a communication protocol that complies with the ONVIF (Open Network Video Interface Forum) standard. However, the present invention is not limited to this, and the network 120 may be configured to enable communication using other communication protocols such as a proprietary communication protocol.
<装置構成>
(撮像装置の構成)
続いて、撮像装置110の構成について説明する。図2は、撮像装置110のハードウェア構成例を示す図である。撮像装置110は、そのハードウェア構成として、例えば、撮像部201、画像処理部202、演算処理部203、配信部204、SD I/F部205を含む。なお、I/Fは、インタフェースの略語である。
<Device Configuration>
(Configuration of the imaging device)
Next, a description will be given of the configuration of the imaging device 110. Fig. 2 is a diagram showing an example of the hardware configuration of the imaging device 110. The imaging device 110 includes, as its hardware configuration, for example, an imaging unit 201, an image processing unit 202, an arithmetic processing unit 203, a distribution unit 204, and an SD I/F unit 205. Note that I/F is an abbreviation for interface.
撮像部201は、光を結像するためのレンズ部と、結像された光に応じたアナログ信号変換する撮像素子とを含んで構成される。レンズ部は、画角を調整するズーム機能や、光量の調整を行う絞り機能などを有する。撮像素子は、光をアナログ信号に変換する際の感度調整を行うゲイン機能を有する。これらの機能は、画像処理部202から通知された設定値に基づいて調整される。撮像部201によって取得されたアナログ信号は、アナログ-デジタル変換回路によってデジタル信号に変換され、画像信号として画像処理部202へ転送される。
The imaging unit 201 includes a lens unit for forming an image of light, and an imaging element that converts the formed light into an analog signal. The lens unit has a zoom function for adjusting the angle of view, and an aperture function for adjusting the amount of light. The imaging element has a gain function for adjusting the sensitivity when converting light into an analog signal. These functions are adjusted based on setting values notified by the image processing unit 202. The analog signal acquired by the imaging unit 201 is converted into a digital signal by an analog-digital conversion circuit, and transferred to the image processing unit 202 as an image signal.
画像処理部202は、画像処理エンジンと、その周辺デバイス等を含んで構成される。周辺デバイスは、例えば、RAM(Random Access Memory)や、各I/Fのドライバ等を含む。画像処理部202では、撮像部201から取得した画像信号に対して、例えば、現像処理、フィルタ処理、センサ補正、ノイズ除去等の、画像処理を施して画像データを生成する。また、画像処理部202は、レンズ部や撮像素子へ設定値を送信し、適切露出画像を取得できるように、露出調整を実行しうる。画像処理部202において生成された画像データは、演算処理部203へ転送される。
The image processing unit 202 is configured to include an image processing engine and its peripheral devices. The peripheral devices include, for example, a RAM (Random Access Memory) and drivers for each I/F. The image processing unit 202 performs image processing, such as development processing, filtering, sensor correction, and noise removal, on the image signal acquired from the imaging unit 201 to generate image data. The image processing unit 202 can also transmit setting values to the lens unit and the imaging element, and perform exposure adjustment so that an appropriately exposed image can be acquired. The image data generated in the image processing unit 202 is transferred to the calculation processing unit 203.
演算処理部203は、CPUやMPU等の1つ以上のプロセッサ、RAMやROM等のメモリ、各I/Fのドライバなどから構成される。なお、CPUはCentral Processing Unitの、MPUはMicro Processing Unitの、RAMはRandom Access Memoryの、ROMはRead Only Memoryの、頭字語である。演算処理部203では、一例において、上述のシステムにおいて実行されるべき処理の各部分を撮像装置110と着脱可能デバイス100とのいずれが実行するかの分担を決定し、その決定した分担に対応する処理を実行しうる。この処理内容や処理の分担の詳細に関しては後述する。画像処理部202から受け取った画像は、配信部204、又は、SD I/F部205へ転送される。また、処理結果や処理状態のデータも配信部204へ転送される。
The arithmetic processing unit 203 is composed of one or more processors such as a CPU or MPU, memories such as a RAM or ROM, drivers for each I/F, etc. Note that CPU is an acronym for Central Processing Unit, MPU is an acronym for Micro Processing Unit, RAM is an acronym for Random Access Memory, and ROM is an acronym for Read Only Memory. In one example, the arithmetic processing unit 203 determines whether each part of the processing to be executed in the above-mentioned system will be executed by the imaging device 110 or the removable device 100, and can execute the processing corresponding to the determined allocation. The details of this processing content and the allocation of processing will be described later. The image received from the image processing unit 202 is transferred to the distribution unit 204 or the SD I/F unit 205. In addition, data on the processing result and processing status is also transferred to the distribution unit 204.
配信部204は、ネットワーク配信エンジンと、例えば、RAMやETH PHYモジュールなどの周辺デバイス等を含んで構成される。ETH PHYモジュールは、Ethernetの物理(PHY)レイヤの処理を実行するモジュールである。配信部204は、演算処理部203から取得した画像データや処理結果や処理状態のデータを、ネットワーク120へ配信可能な形式に変換して、変換後のデータをネットワーク120へ出力する。SD I/F部205は、着脱可能デバイス100と接続するためのインタフェース部分で、例えば、電源と、着脱可能デバイス100を着脱するための、着脱ソケット等の装着機構を含んで構成される。ここでは、SD I/F部205が、SD Associationにより策定されたSD規格に従って構成されるものとする。演算処理部203から取得された画像の着脱可能デバイス100への転送や、着脱可能デバイス100からのデータの取得等の、着脱可能デバイス100と撮像装置110との間での通信は、SD I/F部205を通じて行われる。
The distribution unit 204 includes a network distribution engine and peripheral devices such as a RAM and an ETH PHY module. The ETH PHY module is a module that executes processing of the physical (PHY) layer of Ethernet. The distribution unit 204 converts the image data, processing results, and processing status data acquired from the arithmetic processing unit 203 into a format that can be distributed to the network 120, and outputs the converted data to the network 120. The SD I/F unit 205 is an interface part for connecting to the removable device 100, and includes, for example, a power source and an attachment mechanism such as a removable socket for attaching and detaching the removable device 100. Here, it is assumed that the SD I/F unit 205 is configured in accordance with the SD standard established by the SD Association. Communications between the removable device 100 and the imaging device 110, such as transferring images acquired from the calculation processing unit 203 to the removable device 100 and acquiring data from the removable device 100, are performed via the SD I/F unit 205.
図3に、撮像装置110の機能構成例を示す。撮像装置110は、その機能として、例えば、撮像制御部301、信号処理部302、記憶部303、制御部304、解析部305、デバイス通信部306、及び、ネットワーク通信部307を含む。
Figure 3 shows an example of the functional configuration of the imaging device 110. The imaging device 110 includes, as its functions, an imaging control unit 301, a signal processing unit 302, a storage unit 303, a control unit 304, an analysis unit 305, a device communication unit 306, and a network communication unit 307, for example.
撮像制御部301は、撮像部201を介して周囲の環境を撮影するようにする制御を実行する。信号処理部302は、撮像制御部301によって撮影された画像に対して所定の処理を施して、撮影画像のデータを生成する。以下では、この撮影画像のデータを単に「撮影画像」と呼ぶ。信号処理部302は、例えば、撮像制御部301によって撮影された画像を符号化する。信号処理部302は、静止画像に対して、例えば、JPEG(Joint Photographic Experts Group)等の符号化方式を用いて符号化を行う。また、信号処理部302は、動画像に対して、H.264/MPEG-4 AVC(以下では「H.264」と呼ぶ。)、HEVC(High Efficiency Video Coding)等の符号化方式を用いて符号化を行う。また、信号処理部302は、予め設定された複数の符号化方式の中から、例えば撮像装置110の不図示の操作部を介して、ユーザにより選択された符号化方式を用いて、画像を符号化してもよい。
The imaging control unit 301 executes control to capture the surrounding environment via the imaging unit 201. The signal processing unit 302 performs a predetermined process on the image captured by the imaging control unit 301 to generate captured image data. Hereinafter, this captured image data will simply be referred to as the "captured image". For example, the signal processing unit 302 encodes the image captured by the imaging control unit 301. For still images, the signal processing unit 302 encodes using an encoding method such as JPEG (Joint Photographic Experts Group). For moving images, the signal processing unit 302 encodes using an encoding method such as H.264/MPEG-4 AVC (hereinafter referred to as "H.264") and HEVC (High Efficiency Video Coding). Furthermore, the signal processing unit 302 may encode the image using an encoding method selected by the user from among a plurality of encoding methods set in advance, for example, via an operation unit (not shown) of the imaging device 110.
記憶部303は、解析部305において実行可能な解析処理のリスト(以下では「第1処理リスト」と呼ぶ。)と、解析処理の結果に対する後処理のリストとを記憶する。また、記憶部303は、後述する解析処理の結果を記憶する。なお、本実施形態では、実行される処理が解析処理であるが、任意の処理が実行されてもよく、記憶部303は、その実行される処理に関連する処理について、第1処理リストと後処理のリストとを記憶するようにしうる。制御部304は、信号処理部302、記憶部303、解析部305、デバイス通信部306、ネットワーク通信部307を、それぞれが所定の処理を実行するように、制御する。
The memory unit 303 stores a list of analysis processes that can be executed by the analysis unit 305 (hereinafter referred to as the "first processing list") and a list of post-processing for the results of the analysis processes. The memory unit 303 also stores the results of the analysis processes described below. Note that in this embodiment, the process executed is an analysis process, but any process may be executed, and the memory unit 303 may store a first processing list and a post-processing list for processes related to the process executed. The control unit 304 controls the signal processing unit 302, the memory unit 303, the analysis unit 305, the device communication unit 306, and the network communication unit 307 so that each executes a predetermined process.
解析部305は、撮影画像に対して、後述する解析前処理、解析処理、解析後処理の少なくともいずれかを選択的に実行する。解析前処理は、後述の解析処理を実行する前に、撮影画像に対して実行する処理である。本実施形態の解析前処理では、一例として、撮影画像を分割して分割画像を作成する処理が実行されるものとする。解析処理は、入力された画像を解析して得られる情報を出力する処理である。本実施形態の解析処理では、一例として、解析前処理によって得られた分割画像を入力として、人体検出処理、顔検出処理、車両検出処理の少なくともいずれかを実行し、解析処理結果を出力する処理が実行されるものとする。解析処理は、例えば非特許文献1の技術によって、画像に含まれるオブジェクトを検出できるように学習が行われた機械学習モデルを用いて、分割画像中のオブジェクトの位置を出力するように構成された処理でありうる。解析後処理は、解析処理が実行された後に実行される処理である。本実施形態の解析後処理では、一例として、各分割画像に対する解析処理結果に基づいて、各分割画像において検出されたオブジェクトの数を合計した値を処理結果として出力する処理が実行されるものとする。なお、解析処理は、パターンマッチングを行って画像中のオブジェクトを検出し、その位置を出力する処理であってもよい。
The analysis unit 305 selectively performs at least one of pre-analysis processing, analysis processing, and post-analysis processing, which will be described later, on the captured image. The pre-analysis processing is processing performed on the captured image before performing the analysis processing, which will be described later. In the pre-analysis processing of this embodiment, as an example, a process of dividing the captured image to create divided images is performed. The analysis processing is processing of outputting information obtained by analyzing an input image. In the analysis processing of this embodiment, as an example, a process of performing at least one of human body detection processing, face detection processing, and vehicle detection processing using the divided image obtained by the pre-analysis processing as input, and outputting the analysis processing result is performed. The analysis processing may be processing configured to output the position of an object in a divided image using a machine learning model that has been trained to detect an object included in an image, for example, by the technology of Non-Patent Document 1. The post-analysis processing is processing performed after the analysis processing is performed. In the post-analysis processing of this embodiment, as an example, a process of outputting the total number of objects detected in each divided image based on the analysis processing result for each divided image is performed. The analysis process may involve pattern matching to detect objects in an image and output their positions.
デバイス通信部306は、着脱可能デバイス100との通信を行う。デバイス通信部306は、入力されたデータを着脱可能デバイス100が処理可能な形式に変換し、その変換によって得られたデータを着脱可能デバイス100に送信する。また、デバイス通信部306は、着脱可能デバイス100からデータを受信し、受信したデータを撮像装置110が処理可能な形式に変換する。本実施形態では、デバイス通信部306は、変換処理として、小数を浮動小数点形式と固定小数点形式との間で変換する処理を実行するものとするが、これに限られず、他の処理がデバイス通信部306によって実行されてもよい。また、本実施形態では、デバイス通信部306は、着脱可能デバイス100に対してSD規格の範囲内で事前に定められたコマンドシーケンスを送信し、着脱可能デバイス100からの応答を受信することで、着脱可能デバイス100との通信を行うものとする。ネットワーク通信部307は、ネットワーク120を介して、入出力装置130との通信を行う。
The device communication unit 306 communicates with the removable device 100. The device communication unit 306 converts input data into a format that can be processed by the removable device 100, and transmits the data obtained by the conversion to the removable device 100. The device communication unit 306 also receives data from the removable device 100 and converts the received data into a format that can be processed by the imaging device 110. In this embodiment, the device communication unit 306 executes a process of converting decimals between a floating-point format and a fixed-point format as a conversion process, but this is not limited to this, and other processes may be executed by the device communication unit 306. In this embodiment, the device communication unit 306 communicates with the removable device 100 by transmitting a command sequence that is predetermined within the range of the SD standard to the removable device 100 and receiving a response from the removable device 100. The network communication unit 307 communicates with the input/output device 130 via the network 120.
(着脱可能デバイスの構成)
図4に、着脱可能デバイス100のハードウェア構成例を示す。着脱可能デバイス100は、一例として、I/F部401、FPGA402、SDコントローラ403、及び、記憶部404を含んで構成される。着脱可能デバイス100は、撮像装置110が有するSD I/F部205の着脱ソケットに挿抜できる形状で、すなわちSD規格に則った形状で成形されるものとする。
(Configuration of removable devices)
4 shows an example of the hardware configuration of the removable device 100. The removable device 100 includes, as an example, an I/F unit 401, an FPGA 402, an SD controller 403, and a storage unit 404. The removable device 100 is formed in a shape that can be inserted into and removed from a removable socket of the SD I/F unit 205 of the imaging device 110, that is, in a shape that complies with the SD standard.
I/F部401は、撮像装置110等の装置と着脱可能デバイス100とを接続するためのインタフェース部分である。I/F部401は、例えば、撮像装置110から電源の供給を受け、着脱可能デバイス100内で使用する電源を生成し分配する、電気的な接点端子等を含んで構成される。I/F部401は、撮像装置110のSD I/F部205と同様に、SD規格内で定義(準拠)されている項目に関しては、それに従うものとする。撮像装置110からの画像や設定データの受け取り、FPGA402から撮像装置110へのデータの送信は、I/F部401を介して実行される。
The I/F unit 401 is an interface section for connecting devices such as the imaging device 110 to the removable device 100. The I/F unit 401 is configured to include electrical contact terminals and the like that receive power from the imaging device 110 and generate and distribute power to be used within the removable device 100. As with the SD I/F unit 205 of the imaging device 110, the I/F unit 401 complies with items defined (compliant) within the SD standard. Receiving images and setting data from the imaging device 110 and transmitting data from the FPGA 402 to the imaging device 110 are performed via the I/F unit 401.
FPGA402は、入出力制御部410、処理切替部411、及び演算処理部412を含んで構成される。FPGA402は、内部の論理回路構造を繰り返し再構成できる半導体デバイスの一種である。FPGA402が実現する処理により、着脱可能デバイス100が装着された装置に、処理機能を追加(提供)することができる。また、FPGA402の再構成機能により、後から論理回路構造を変更することができるため、例えば技術の進歩の早い分野の装置に着脱可能デバイス100を装着することにより、その装置において適時に適切な処理を実行することが可能となる。なお、本実施形態では、FPGAが用いられる例について説明するが、後述する処理を実現可能である限りにおいて、例えば、汎用のASICや専用のLSIが用いられてもよい。FPGA402は、生成される論理回路構造の情報を含んだ設定データが専用のI/Fから書き込まれることにより、又は、その設定データがその専用のI/Fから読み出されることによって、起動される。本実施形態では、この設定データが記憶部404に保持されているものとする。FPGA402は、電源が投入されると、記憶部404から設定データを読み出し、論理回路を生成して起動する。ただし、これに限られず、例えば、着脱可能デバイス内に専用の回路を実装することにより、I/F部401を介して、撮像装置110がFPGA402に設定データを書き込んでもよい。
The FPGA 402 includes an input/output control unit 410, a processing switching unit 411, and an arithmetic processing unit 412. The FPGA 402 is a type of semiconductor device that can repeatedly reconfigure the internal logic circuit structure. The processing realized by the FPGA 402 can add (provide) a processing function to the device to which the removable device 100 is attached. In addition, the reconfiguration function of the FPGA 402 allows the logic circuit structure to be changed later, so that, for example, by attaching the removable device 100 to a device in a field where technology is rapidly advancing, it becomes possible to execute appropriate processing at the appropriate time in the device. In this embodiment, an example in which an FPGA is used will be described, but as long as the processing described later can be realized, for example, a general-purpose ASIC or a dedicated LSI may be used. The FPGA 402 is started by writing setting data including information on the logic circuit structure to be generated from a dedicated I/F, or by reading the setting data from the dedicated I/F. In this embodiment, it is assumed that this setting data is stored in the storage unit 404. When the FPGA 402 is powered on, it reads the setting data from the storage unit 404, generates a logic circuit, and starts it up. However, this is not limited to the above, and for example, the imaging device 110 may write the setting data to the FPGA 402 via the I/F unit 401 by implementing a dedicated circuit in a removable device.
入出力制御部410は、撮像装置110との間で画像を送受信するための回路、撮像装置110から受信したコマンドを解析する回路、解析した結果に基づいて制御を行う回路、等を含んで構成される。ここでのコマンドは、SD規格に定義されているものであり、入出力制御部410は、それらのうちのいくつかを検出することができる。機能の詳細に関しては後述する。入出力制御部410は、記憶処理の場合はSDコントローラ403へ画像を送信し、画像解析処理の場合は演算処理部412へ画像を送信するように制御を行う。また、入出力制御部410は、処理の切り替えの設定データを受け取った場合は、処理切替部411へ設定データを送信する。処理切替部411は、撮像装置110から受け取った設定データに基づいて、記憶部404から画像解析処理機能の情報を取得し、演算処理部412に書き込むための回路を含んで構成される。画像解析処理機能の情報は、例えば、演算処理部412内で処理される演算の順序や種類、演算の係数などを示す設定パラメータである。演算処理部412は、画像解析処理機能を実行するために必要な複数の演算回路を含んで構成される。演算処理部412は、処理切替部411から受け取った画像解析処理機能の情報に基づいて、各演算処理を実行して、その処理結果を撮像装置110へ送信し、及び/又は、その処理結果を記憶部404に記録する。このように、FPGA402は、事前に保持された複数の処理機能に対応する設定データに含まれる、実行対象の処理機能の設定データを抽出して、その抽出した設定データに基づいて演算処理部412によって実行される処理内容を書き換える。これにより、着脱可能デバイス100が、その複数の処理機能のうちの少なくともいずれかを選択的に実行することができる。また、新規に追加する処理の設定データを随時追加することにより、撮像装置110側で最新の処理を実行させることができる。なお、以下では、複数の処理機能のそれぞれに対応する複数の設定データを有していることを、複数の処理機能を有すると表現する。すなわち、着脱可能デバイス100のFPGA402が1つの処理機能を実行するように構成されている状態であっても、他の処理機能のための設定データにより演算処理部412の処理内容を変更することができる場合、複数の処理機能を有する、と表現する。
The input/output control unit 410 includes a circuit for transmitting and receiving images to and from the imaging device 110, a circuit for analyzing commands received from the imaging device 110, and a circuit for controlling based on the analysis results. The commands here are defined in the SD standard, and the input/output control unit 410 can detect some of them. Details of the functions will be described later. The input/output control unit 410 controls to transmit an image to the SD controller 403 in the case of storage processing, and to transmit an image to the arithmetic processing unit 412 in the case of image analysis processing. In addition, when the input/output control unit 410 receives setting data for switching processing, it transmits the setting data to the processing switching unit 411. The processing switching unit 411 includes a circuit for acquiring information on the image analysis processing function from the storage unit 404 based on the setting data received from the imaging device 110, and writing the information to the arithmetic processing unit 412. The information on the image analysis processing function is, for example, a setting parameter indicating the order and type of calculations to be processed in the arithmetic processing unit 412, coefficients of the calculations, and the like. The arithmetic processing unit 412 includes a plurality of arithmetic circuits required to execute the image analysis processing function. The arithmetic processing unit 412 executes each arithmetic processing based on the information of the image analysis processing function received from the processing switching unit 411, and transmits the processing result to the imaging device 110 and/or records the processing result in the storage unit 404. In this way, the FPGA 402 extracts the setting data of the processing function to be executed, which is included in the setting data corresponding to the multiple processing functions stored in advance, and rewrites the processing content executed by the arithmetic processing unit 412 based on the extracted setting data. This allows the removable device 100 to selectively execute at least one of the multiple processing functions. In addition, by adding setting data for a newly added process as needed, the imaging device 110 can execute the latest processing. In the following, having multiple setting data corresponding to each of the multiple processing functions is expressed as having multiple processing functions. In other words, even if the FPGA 402 of the removable device 100 is configured to execute one processing function, if the processing content of the arithmetic processing unit 412 can be changed by setting data for another processing function, it is expressed as having multiple processing functions.
SDコントローラ403は、SD規格に定義されているような公知のコントロールIC(集積回路)であり、SDプロトコルのスレーブ動作の制御と、記憶部404に対するデータの読み書きの制御とを実行する。記憶部404は、例えばNAND型フラッシュメモリによって構成され、例えば、撮像装置110から書き込まれた記憶データ、演算処理部412に書き込まれる画像解析処理機能の情報、FPGA402の設定データ等の各種情報を記憶する。
The SD controller 403 is a known control IC (integrated circuit) as defined in the SD standard, and controls the slave operation of the SD protocol and the reading and writing of data from and to the memory unit 404. The memory unit 404 is configured, for example, with a NAND type flash memory, and stores various information such as memory data written from the imaging device 110, information on the image analysis processing function written to the arithmetic processing unit 412, and setting data for the FPGA 402.
図5に、着脱可能デバイス100の機能構成例を示す。着脱可能デバイス100は、その機能構成として、例えば、解析部501、通信部502、及び記憶部503を含む。解析部501は、画像に対する解析処理を実行する。解析部501は、例えば、解析処理設定要求を入力された場合に、入力された解析処理を実行可能な状態にするための設定を実行する。また、解析部501は、画像が入力された場合、その入力された画像に対して、実行可能な状態に設定された解析処理を実行する。本実施形態では、実行可能な解析処理は、人体検出処理と顔検出処理であるものとするが、これらに限られない。例えば、事前に記憶された人物が画像に含まれるか否かを判定する処理(後述する顔認証処理)であってもよい。例えば、事前に記憶された人物の画像特徴量と、入力された画像から検出された人物の画像特徴量との一致度合いが算出され、一致度合いが閾値以上の場合に事前に記憶された人物であると判定される。また、プライバシー保護を目的として、入力された画像から検出された人物に対して、所定のマスク画像を重畳したり、モザイク処理を施したりする処理であってもよい。また、人物の特定の行動を機械学習によって学習した学習モデルを用いて、画像中の人物が特定の行動を行っているかを検出する処理であってもよい。さらには、画像中の領域がどのような領域なのかを判定する処理であってもよい。例えば、建物や道路、人物、空等を機械学習によって学習した学習モデルを用いて、画像中の領域がどのような領域なのかを判定する処理であってもよい。以上のように、実行可能な解析処理は、機械学習を用いた画像解析処理にも、機械学習を用いない画像解析処理にも応用可能である。また、上記の各解析処理は、着脱可能デバイス100が単独で行うのではなく、撮像装置110と協働して実行してもよい。通信部502は、I/F部401を介して、撮像装置110との通信を行う。記憶部503は、解析処理の設定内容や解析処理に要する時間等の情報を記憶する。解析処理に要する時間は、例えば、所定の処理が実行される際に要する実時間であり、その時間だけ待つことによりその解析処理が終了することが保証される時間でありうる。また、解析処理に要する時間は、その解析処理における処理のクロックサイクル数であってもよい。なお、この時間の情報は、解析処理ごとに個別に記憶されうる。また、解析処理に要する時間は、例えば、初期的に十分に大きい値に設定され、その後、実際に処理が実行された際に要した時間を統計値として収集し、その収集された値に基づいて、更新されてもよい。
5 shows an example of the functional configuration of the removable device 100. The removable device 100 includes, for example, an analysis unit 501, a communication unit 502, and a storage unit 503 as its functional configuration. The analysis unit 501 executes an analysis process on an image. For example, when an analysis process setting request is input, the analysis unit 501 executes settings to make the input analysis process executable. In addition, when an image is input, the analysis unit 501 executes an analysis process set to an executable state for the input image. In this embodiment, the executable analysis processes are assumed to be a human body detection process and a face detection process, but are not limited to these. For example, it may be a process of determining whether or not a person stored in advance is included in an image (a face recognition process to be described later). For example, the degree of match between the image feature amount of a person stored in advance and the image feature amount of a person detected from an input image is calculated, and if the degree of match is equal to or greater than a threshold, it is determined that the person is a person stored in advance. In addition, for the purpose of privacy protection, it may be a process of superimposing a predetermined mask image or performing mosaic processing on a person detected from an input image. The processing may also be a process of detecting whether a person in an image is performing a specific behavior using a learning model that has learned a specific behavior of the person through machine learning. Furthermore, the processing may be a process of determining what kind of area in an image is. For example, the processing may be a process of determining what kind of area in an image is using a learning model that has learned buildings, roads, people, the sky, etc. through machine learning. As described above, the executable analysis processing can be applied to image analysis processing using machine learning and image analysis processing without machine learning. In addition, each of the above analysis processing may be performed in cooperation with the imaging device 110, rather than being performed by the removable device 100 alone. The communication unit 502 communicates with the imaging device 110 via the I/F unit 401. The storage unit 503 stores information such as the setting contents of the analysis processing and the time required for the analysis processing. The time required for the analysis processing may be, for example, the actual time required when a specific processing is executed, and may be a time that guarantees that the analysis processing will be completed by waiting for that time. In addition, the time required for the analysis processing may be the number of clock cycles of the processing in the analysis processing. Note that this time information may be stored individually for each analysis processing. In addition, the time required for the analysis process may be initially set to a sufficiently large value, and then the time required when the process is actually performed may be collected as a statistical value, and the time may be updated based on the collected value.
<処理の流れ>
続いて、システム内で実行される処理の流れの例について説明する。なお、以下の各処理のうち撮像装置110が実行する処理は、例えば、演算処理部203内のプロセッサがメモリ等に記憶されたプログラムを実行することによって実現される。ただし、これは一例に過ぎず、後述の処理の一部又は全部が、専用のハードウェアによって実現されてもよい。また、着脱可能デバイス100や入出力装置130が実行する処理についても、各装置におけるプロセッサがメモリ等に記憶されたプログラムを実行することによって実現されてもよいし、処理の一部又は全部を、専用のハードウェアによって実現してもよい。
<Processing flow>
Next, an example of the flow of processing executed in the system will be described. Among the following processes, the processing executed by the imaging device 110 is realized, for example, by the processor in the arithmetic processing unit 203 executing a program stored in a memory or the like. However, this is only one example, and some or all of the processing described below may be realized by dedicated hardware. In addition, the processing executed by the removable device 100 and the input/output device 130 may also be realized by the processor in each device executing a program stored in a memory or the like, or some or all of the processing may be realized by dedicated hardware.
(全体の流れ)
図6に、システムで実行される画像解析処理の一連の流れを概略的に示す。本処理では、まず、ユーザによって、撮像装置110に着脱可能デバイス100が装着される(S601)。撮像装置110は、着脱可能デバイス100の初期化シーケンスを実行する(S602)。この初期化シーケンスでは、撮像装置110と着脱可能デバイス100との間で所定のコマンドが送受信されることにより、撮像装置110が、着脱可能デバイス100を使用可能な状態とされる。その後、撮像装置110は、着脱可能デバイス100が実行可能な処理を把握し、ローカルで実行可能な(撮像装置110単体で又は撮像装置110と着脱可能デバイス100の組み合わせで実行可能な)処理を把握する(S603)。なお、着脱可能デバイス100は、任意の処理を実行可能なように構成されうるが、撮像装置110側で実行されるべき処理と無関係な処理については考慮されなくてもよい。一例において、撮像装置110は、例えば入出力装置130から事前に取得した実行されうる処理のリストを保持しておいてもよい。この場合、撮像装置110は、着脱可能デバイス100が実行可能な処理を示す情報を着脱可能デバイス100から取得した際に、その処理がリストに含まれているか否かによって、実行されうる処理のみを把握することができる。続いて、撮像装置110は、実行する処理を決定し、必要に応じて着脱可能デバイス100の設定を実行する(S604)。すなわち、実行対象として決定された処理の少なくとも一部が着脱可能デバイス100によって実行される場合に、その処理のための着脱可能デバイス100の設定が実行される。この設定においては、例えば、実行対象の処理に対応する設定データを用いたFPGA402の再構成が行われうる。そして、撮像装置110または着脱可能デバイス100が、解析処理を実行する(S605)。その後、撮像装置110は、後処理を実行する(S606)。なお、S605とS606の処理は繰り返し実行される。図6の処理は、例えば、着脱可能デバイス100が装着された際に実行されるが、例えば着脱可能デバイス100が取り外された際にも、S603の処理が再度実行されるようにするなど、図6の処理の少なくとも一部が繰り返し実行されてもよい。
(Overall flow)
FIG. 6 shows a schematic flow of a series of image analysis processes executed by the system. In this process, first, the user attaches the removable device 100 to the imaging device 110 (S601). The imaging device 110 executes an initialization sequence for the removable device 100 (S602). In this initialization sequence, a predetermined command is transmitted and received between the imaging device 110 and the removable device 100, so that the imaging device 110 can use the removable device 100. After that, the imaging device 110 grasps the processes that can be executed by the removable device 100, and grasps the processes that can be executed locally (the processes that can be executed by the imaging device 110 alone or by a combination of the imaging device 110 and the removable device 100) (S603). Note that the removable device 100 can be configured to be able to execute any process, but processes unrelated to the processes to be executed on the imaging device 110 side may not be taken into consideration. In one example, the imaging device 110 may hold a list of processes that can be executed, which is obtained in advance from, for example, the input/output device 130. In this case, when the imaging device 110 obtains information indicating a process that the removable device 100 can execute from the removable device 100, the imaging device 110 can grasp only the processes that can be executed depending on whether the process is included in the list. Next, the imaging device 110 determines the process to be executed, and executes the setting of the removable device 100 as necessary (S604). That is, when at least a part of the process determined to be executed is executed by the removable device 100, the setting of the removable device 100 for the process is executed. In this setting, for example, the FPGA 402 may be reconfigured using the setting data corresponding to the process to be executed. Then, the imaging device 110 or the removable device 100 executes the analysis process (S605). After that, the imaging device 110 executes the post-processing (S606). Note that the processes of S605 and S606 are executed repeatedly. The processing of FIG. 6 is executed, for example, when the removable device 100 is attached, but at least a part of the processing of FIG. 6 may be executed repeatedly, for example, when the removable device 100 is removed, such that the processing of S603 is executed again.
(実行可能な処理を把握する処理)
図7に、撮像装置110が実行可能な処理を把握する処理の流れの例を示す。本処理は、図6のS603の処理に対応し、着脱可能デバイス100等のデバイスが撮像装置110に装着された又は抜去された場合や、撮像装置110の電源がオンとなった際に実行されうる。本処理では、撮像装置110は、着脱可能デバイス100で実行可能な処理を読み出し、撮像装置110自身が実行可能な解析処理と統合し、撮像装置110側で実行可能な解析処理を把握する。
(Process to determine executable processes)
Fig. 7 shows an example of the flow of a process for identifying processes executable by the imaging device 110. This process corresponds to the process of S603 in Fig. 6, and may be executed when a device such as the removable device 100 is attached to or removed from the imaging device 110, or when the imaging device 110 is powered on. In this process, the imaging device 110 reads out processes executable by the removable device 100, integrates them with analysis processes executable by the imaging device 110 itself, and identifies analysis processes executable by the imaging device 110.
まず、撮像装置110の制御部304は、記憶部303に記憶されている、撮像装置110自身の解析部305において実行可能な処理のリストである第1処理リストを読み出す(S701)。続いて、制御部304は、装着されたデバイスが、例えば従来の記憶機能のみを有するデバイスであるか、着脱可能デバイス100等の特定の処理機能を有する所定のデバイスであるかを判定する(S702)。例えば、制御部304は、デバイス通信部306を制御して、装着されたデバイスに対して、特定のアドレスへの読み出し要求(リードコマンド)を発行し、その特定のアドレスに格納されているフラグデータを読み出す。そして、制御部304は、読み出したフラグデータに基づいて、着脱可能デバイス100が特定の処理機能を有する所定のデバイスであるかを判定しうる。ただし、これは一例に過ぎず、他の方法によって、装着されたデバイスが所定のデバイスであるか否かが判定されてもよい。
First, the control unit 304 of the imaging device 110 reads out a first processing list, which is a list of processing that can be executed by the analysis unit 305 of the imaging device 110 itself, stored in the storage unit 303 (S701). Next, the control unit 304 determines whether the attached device is, for example, a device having only a conventional storage function, or a specific device having a specific processing function such as the removable device 100 (S702). For example, the control unit 304 controls the device communication unit 306 to issue a read request (read command) to the attached device to a specific address, and reads out flag data stored at the specific address. Then, the control unit 304 can determine whether the removable device 100 is a specific device having a specific processing function based on the read flag data. However, this is merely an example, and whether the attached device is a specific device may be determined by other methods.
装着されたデバイスが所定のデバイスである場合(S702でYES)、制御部304は、そのデバイス(着脱可能デバイス100)において実行可能な処理を把握するための処理を実行する。制御部304は、デバイス通信部306を制御して着脱可能デバイス100と通信し、着脱可能デバイス100において実行可能な処理のリスト(以下では「第2処理リスト」と呼ぶ。)を取得する(S703)。制御部304は、例えば、着脱可能デバイス100が所定のデバイスか否かを判定した場合と同様に、特定のアドレスに格納されているデータを読み出すことにより、第2処理リストを取得しうる。なお、例えば、第2処理リストは、着脱可能デバイスが所定のデバイスであるか否かの判定を行うフラグデータと同一のアドレスに格納されうる。この場合、撮像装置110は、そのアドレスにアクセスすることにより、フラグデータと第2処理リストとを同時に取得して、S702の処理とS703の処理とを同時に実行することができる。ただし、これに限られず、これらのデータは、別のアドレスに格納されてもよい。その後、制御部304は、記憶部303から読み出した撮像装置110自身が実行可能な処理の第1処理リストと、着脱デバイスから取得した第2処理リストとが統合された統合処理リストを作成し(S704)、処理を終了する。
If the attached device is a specified device (YES in S702), the control unit 304 executes a process to grasp the processes that can be executed in the device (removable device 100). The control unit 304 controls the device communication unit 306 to communicate with the removable device 100 and acquires a list of processes that can be executed in the removable device 100 (hereinafter referred to as the "second process list") (S703). The control unit 304 can acquire the second process list by reading data stored at a specific address, for example, in the same way as when determining whether the removable device 100 is a specified device. Note that, for example, the second process list can be stored at the same address as the flag data that determines whether the removable device is a specified device. In this case, the imaging device 110 can simultaneously acquire the flag data and the second process list by accessing the address, and simultaneously execute the process of S702 and the process of S703. However, this is not limited to this, and these data may be stored at different addresses. Thereafter, the control unit 304 creates an integrated process list that integrates the first process list of processes that can be executed by the imaging device 110 itself, which is read from the storage unit 303, and the second process list acquired from the removable device (S704), and ends the process.
この統合処理リストは、ネットワーク上のサーバ等の装置による処理が行われることなく、撮像装置110側でローカルに実行可能な処理を示すリストである。なお、本実施形態では、統合処理リストは、第1処理リストに含まれる処理と第2処理リストに含まれる処理との和集合によって得られるリストであり、第1処理リストと第2処理リストとの少なくともいずれかに含まれる処理がリスト化されたものである。ただし、これに限られず、例えば、第1処理リストに含まれる処理と第2処理リストに含まれる処理とを組み合わせることによって別の処理を実行可能となる場合などに、その実行可能となる別の処理が統合処理リストに加えられてもよい。
This integrated process list is a list that indicates processes that can be executed locally on the imaging device 110 side, without processing being performed by a device such as a server on the network. In this embodiment, the integrated process list is a list obtained by the union of the processes included in the first process list and the processes included in the second process list, and is a list of the processes included in at least one of the first process list and the second process list. However, this is not limited to this, and for example, when a process included in the first process list and a process included in the second process list become executable, the executable process may be added to the integrated process list.
装着されたデバイスが所定のデバイスでない場合(S702でNO)、制御部304は、装着されたデバイスによって実行可能な処理がないと判定する。このため、制御部304は、記憶部303から読み出した自装置において実行可能な処理の第1処理リストを、撮像装置110側でローカルに実行可能な処理を示す統合処理リストとして(S705)、処理を終了する。なお、デバイスが抜去された際に図7の処理が実行されると、所定のデバイスが当然に装着されていないため、第1処理リストが統合処理リストとして扱われることとなる。
If the attached device is not the specified device (NO in S702), the control unit 304 determines that there is no processing that can be executed by the attached device. Therefore, the control unit 304 sets the first processing list of processing that can be executed by the own device, read from the storage unit 303, as an integrated processing list indicating processing that can be executed locally on the imaging device 110 side (S705), and ends the processing. Note that if the processing in FIG. 7 is executed when the device is removed, the specified device is obviously not attached, so the first processing list will be treated as the integrated processing list.
これにより、特定の処理を実行可能な着脱可能デバイス100が撮像装置110に装着されているか否かに基づいて、撮像装置110側でローカルに実行可能な処理をリスト化することができる。また、この統合処理リストを後述のようにユーザに提示することにより、着脱可能デバイス100の装着によって撮像装置110側でローカルに実行可能となる処理を、ユーザが選択することができるようになる。
This makes it possible to list processes that can be executed locally on the imaging device 110, based on whether or not a removable device 100 capable of executing a particular process is attached to the imaging device 110. In addition, by presenting this integrated process list to the user as described below, the user can select processes that can be executed locally on the imaging device 110 by attaching the removable device 100.
(解析処理内容を決定する処理)
図8に、撮像装置110が解析処理内容を決定する処理の流れの例を示す。本処理では、撮像装置110側でローカルに実行可能な解析処理が入出力装置130を介してユーザに提示され、入出力装置130はユーザの選択を受け付ける。そして、撮像装置110は、入出力装置130を介して受け付けられたユーザ選択を示す情報に応じて、実行する解析処理を決定する。
(Processing for determining the content of analysis processing)
8 shows an example of a process flow in which the imaging device 110 determines the content of an analysis process. In this process, analysis processes that can be locally executed on the imaging device 110 side are presented to the user via the input/output device 130, and the input/output device 130 accepts the user's selection. Then, the imaging device 110 determines the analysis process to be executed according to information indicating the user selection accepted via the input/output device 130.
本処理では、まず、入出力装置130が、撮像装置110との通信を実行し、撮影画像と統合処理リストと後処理リストとの取得を要求する(S801)。入出力装置130は、一例として、ONVIF規格で規定された要求メッセージを撮像装置110へ送信することによって、撮像装置110へ情報の送信を要求する。ただし、これに限られず、他のメッセージ等によって情報の送信要求が行われてもよい。撮像装置110は、この要求に基づいて、撮像制御部301が周囲の環境を撮影し、制御部304が信号処理部302を制御して、撮像制御部301によって撮影された画像を処理して、撮影画像を取得する(S802)。なお、撮像装置110は、要求の有無によらず周囲の環境を撮影して、撮影画像を取得し続けていてもよい。撮像装置110は、撮影画像をローカルに保存していてもよいし、ネットワークサーバ等の他装置に撮影画像を転送して保存させてもよい。制御部304は、記憶部303に記憶されている後処理リストを読み出す。後処理リストは、本実施形態では表示処理及び保存処理を含むものとするが、これに限られない。制御部304は、ネットワーク通信部307を制御して、後処理リストと、図7の処理によって取得した統合処理リストと、S802で取得した撮影画像とを入出力装置130へ送信する(S803)。撮像装置110は、一例として、上述のONVIF規格で規定された要求メッセージに対する応答メッセージを入出力装置130へ送信することによって、入出力装置130へ情報を送信する。ただし、これに限られず、他のメッセージ等によって情報の送信が行われてもよい。なお、ここでは、実行する処理のみが考慮されてもよく、S801の入出力装置130による撮影画像の要求、S802における撮影画像の取得、及びS803の入出力装置130への撮影画像の送信は行われなくてもよい。
In this process, first, the input/output device 130 communicates with the imaging device 110 and requests the acquisition of the captured image, the integrated processing list, and the post-processing list (S801). As an example, the input/output device 130 requests the imaging device 110 to transmit information by transmitting a request message defined in the ONVIF standard to the imaging device 110. However, the present invention is not limited to this, and the request to transmit information may be made by other messages or the like. Based on this request, the imaging device 110 has the imaging control unit 301 capture the surrounding environment, and the control unit 304 controls the signal processing unit 302 to process the image captured by the imaging control unit 301 and acquire the captured image (S802). Note that the imaging device 110 may continue to capture the surrounding environment and acquire the captured image regardless of the presence or absence of a request. The imaging device 110 may store the captured image locally, or may transfer the captured image to another device such as a network server and store it. The control unit 304 reads out the post-processing list stored in the storage unit 303. In this embodiment, the post-processing list includes display processing and storage processing, but is not limited to this. The control unit 304 controls the network communication unit 307 to transmit the post-processing list, the integrated processing list acquired by the processing of FIG. 7, and the captured image acquired in S802 to the input/output device 130 (S803). As an example, the imaging device 110 transmits information to the input/output device 130 by transmitting a response message to the request message defined in the ONVIF standard to the input/output device 130. However, this is not limited to this, and information may be transmitted by other messages, etc. Note that only the processing to be executed may be considered here, and the request for the captured image by the input/output device 130 in S801, the acquisition of the captured image in S802, and the transmission of the captured image to the input/output device 130 in S803 may not be performed.
入出力装置130は、撮像装置110から撮影画像と統合処理リストと後処理リストを受信する。そして、入出力装置130は、画面表示等によって、統合処理リストと後処理リストをユーザに提示する(S804)。なお、入出力装置130は、このときに、併せて撮影画像を画面表示等によってユーザに提示してもよい。その後、ユーザは、表示された統合処理リストと後処理リストを確認し、実行すべき解析処理(以下では、「実行対象処理」と呼ぶ。)を統合処理リストの中から選択する(S805)。また、ユーザは、実行すべき後処理(以降、実行対象後処理)を選択する(S806)。入出力装置130は、実行対象処理と実行対象後処理の選択結果を示す情報を撮像装置110へ送信する(S807)。
The input/output device 130 receives the captured image, the integrated processing list, and the post-processing list from the imaging device 110. The input/output device 130 then presents the integrated processing list and the post-processing list to the user by displaying the screen or the like (S804). At this time, the input/output device 130 may also present the captured image to the user by displaying the screen or the like. The user then checks the displayed integrated processing list and post-processing list, and selects the analysis process to be executed (hereinafter referred to as the "process to be executed") from the integrated processing list (S805). The user also selects the post-process to be executed (hereinafter referred to as the post-process to be executed) (S806). The input/output device 130 transmits information indicating the selection result of the process to be executed and the post-process to be executed to the imaging device 110 (S807).
撮像装置110の制御部304は、ネットワーク通信部307を制御して、入出力装置130からユーザによって選択された実行対象処理を示す情報を受信すると、その実行対象処理が第2処理リストに含まれている処理であるか否かを判定する(S808)。そして、制御部304は、実行対象処理が第2処理リストに含まれない場合(S808でNO)には、撮像装置110内で処理を実行するため、着脱可能デバイス100への通知等を行うことなく図8の処理を終了する。一方、制御部304は、実行対象処理が第2処理リストに含まれる場合(S808でYES)、デバイス通信部306を制御して、実行対象処理の設定要求を着脱可能デバイス100に送信する(S809)。
When the control unit 304 of the imaging device 110 receives information indicating the process to be executed selected by the user from the input/output device 130 by controlling the network communication unit 307, it determines whether or not the process to be executed is included in the second process list (S808). If the process to be executed is not included in the second process list (NO in S808), the control unit 304 executes the process within the imaging device 110, and ends the process of FIG. 8 without notifying the removable device 100, etc. On the other hand, if the process to be executed is included in the second process list (YES in S808), the control unit 304 controls the device communication unit 306 to send a setting request for the process to be executed to the removable device 100 (S809).
着脱可能デバイス100の通信部502は、実行対象処理の設定要求を撮像装置110から受信する。通信部502は、撮像装置110から受信した実行対象処理の設定要求を、解析部501に出力する。解析部501は、通信部502から入力された実行対象処理の設定要求に基づいて、記憶部503から実行対象処理の設定を取得して、着脱可能デバイス100が実行対象処理を実行可能な状態となるようにするための設定を実行する(S810)。通信部502は、例えば設定処理が完了した後に、設定完了通知を撮像装置110へ送信する(S811)。なお、通信部502は、着脱可能デバイス100の設定が完了していないタイミングで撮像装置110がデータを書き込まないようにするための情報を通知すれば足り、設定が実際に完了する前に設定完了タイミングの情報等を撮像装置110に通知してもよい。撮像装置110の制御部304は、デバイス通信部306を制御して、着脱可能デバイス100から設定完了通知を受信する。
The communication unit 502 of the removable device 100 receives a setting request for the process to be executed from the imaging device 110. The communication unit 502 outputs the setting request for the process to be executed received from the imaging device 110 to the analysis unit 501. Based on the setting request for the process to be executed input from the communication unit 502, the analysis unit 501 acquires the setting of the process to be executed from the storage unit 503 and executes the setting so that the removable device 100 can execute the process to be executed (S810). For example, after the setting process is completed, the communication unit 502 transmits a setting completion notification to the imaging device 110 (S811). Note that the communication unit 502 only needs to notify the imaging device 110 of information to prevent the imaging device 110 from writing data at a timing when the setting of the removable device 100 is not completed, and may notify the imaging device 110 of information on the setting completion timing before the setting is actually completed. The control unit 304 of the imaging device 110 controls the device communication unit 306 to receive a setting completion notification from the removable device 100.
着脱可能デバイス100からの撮像装置110への設定完了の通知は、例えば、以下の3つ方法のうちのいずれかを用いて実行されうる。1つ目の通知方法では、通信部502が、撮像装置110からの1ブロック目のデータの書き込み処理時に、実行対象処理の設定が終了していない場合に、BUSY信号を出力するようにする。BUSY信号の出力は、例えば、SD規格で定められているDATAの信号ラインをLow状態にドライブしておくことにより行われる。この場合、撮像装置110は、BUSY信号を確認することにより、実行対象処理の設定が完了したか否かを判別することができる。2つ目の通知方法では、実行対象処理の設定完了までの時間を上述の特定のアドレスに事前に格納しておき、撮像装置110がその設定完了までの時間の情報を読み出すようにする。撮像装置110は、実行対象処理の設定完了までの時間が経過した後に、書き込みデータの出力(ライトコマンドの発行)を行う。これにより、撮像装置110は、実行対象処理の設定が完了した後に撮影画像のデータを送信することが可能となる。3つ目の通知方法では、解析部501が、実行対象処理の設定が完了した際に、着脱可能デバイス100の第2の特定のアドレスに設定完了のフラグを書き込む。撮像装置110は、この第2の特定のアドレスのデータを読み出すことにより、実行対象処理の設定が完了したか否かを判別することができる。なお、設定完了のフラグが書き込まれるアドレスの情報は、上述の特定のアドレスに格納されてもよいし、別のアドレスに格納されてもよい。
The notification of the completion of the setting from the removable device 100 to the imaging device 110 can be executed, for example, using one of the following three methods. In the first notification method, the communication unit 502 outputs a BUSY signal when the setting of the process to be executed is not completed during the write process of the first block of data from the imaging device 110. The output of the BUSY signal is performed, for example, by driving the DATA signal line defined in the SD standard to a low state. In this case, the imaging device 110 can determine whether the setting of the process to be executed is completed by checking the BUSY signal. In the second notification method, the time until the setting of the process to be executed is completed is stored in advance in the above-mentioned specific address, and the imaging device 110 reads out the information on the time until the setting is completed. The imaging device 110 outputs the write data (issues a write command) after the time until the setting of the process to be executed has elapsed. This makes it possible for the imaging device 110 to transmit the captured image data after the setting of the process to be executed is completed. In the third notification method, the analysis unit 501 writes a setting completion flag to a second specific address of the removable device 100 when the setting of the process to be executed is completed. The imaging device 110 can determine whether the setting of the process to be executed is completed by reading the data of this second specific address. Note that the address information to which the setting completion flag is written may be stored in the specific address described above, or may be stored in a different address.
(解析処理の実行制御)
図9に、撮像装置110が解析処理を実行する際の制御の流れの例を示す。本処理では、まず、撮像制御部301が周囲の環境を撮影する(S901)。制御部304は、信号処理部302を制御して、撮像制御部301によって撮影された画像の処理を行い、撮影画像を取得する。その後、制御部304は、解析部305を制御して、制御部304から入力された撮影画像に対して解析前処理を実行し、解析前処理結果の画像を取得する(S902)。そして、制御部304は、実行対象処理が第2処理リストに含まれるかを判定する(S903)。
(Control of analysis process execution)
9 shows an example of a flow of control when the imaging device 110 executes an analysis process. In this process, first, the imaging control unit 301 captures the surrounding environment (S901). The control unit 304 controls the signal processing unit 302 to process the image captured by the imaging control unit 301 and acquire the captured image. After that, the control unit 304 controls the analysis unit 305 to execute pre-analysis processing on the captured image input from the control unit 304 and acquire an image of the pre-analysis processing result (S902). Then, the control unit 304 determines whether the process to be executed is included in the second process list (S903).
制御部304は、実行対象処理が第2処理リストに含まれないと判定した場合(S903でNO)、解析部305を制御して、撮像装置110内で解析前処理結果の画像に対する実行対象処理を実行する(S904)。そして、制御部304は、解析部305を制御して、解析処理結果に対する解析後処理を実行し(S913)、処理を終了する。
When the control unit 304 determines that the process to be executed is not included in the second process list (NO in S903), it controls the analysis unit 305 to execute the process to be executed on the image resulting from the pre-analysis process within the imaging device 110 (S904). Then, the control unit 304 controls the analysis unit 305 to execute post-analysis process on the analysis process result (S913), and ends the process.
制御部304は、実行対象処理が第2処理リストに含まれている場合(S903でYES)、デバイス通信部306を制御して、着脱可能デバイス100に対して、実行対象処理の実行要求から処理の完了までの時間である解析処理時間を要求する(S905)。なお、以下では解析処理時間を「処理時間」と呼ぶ場合がある。そして、着脱可能デバイス100の通信部502は、処理時間の要求を受信したことに応じて、記憶部503から読み出した処理時間の情報を撮像装置110に送信する(S906)。なお、本実施形態では、例えば、S702において着脱可能デバイス100が所定のデバイスであるかを判定するために制御部304がアクセスしたアドレスに、処理時間の情報が記憶されうる。なお、記憶部503の別のアドレスに処理時間の情報が記憶されていてもよい。撮像装置110の制御部304は、例えば、処理時間の情報が記憶されているアドレスに対する読み出し要求(リードコマンド)を送出して、それに対するレスポンスとして、処理時間の情報を取得しうる。処理時間の情報は、処理ごとに記憶され、撮像装置110によって指定された実行対象処理に対応付けられた処理時間が撮像装置110に通知される。
If the target process is included in the second process list (YES in S903), the control unit 304 controls the device communication unit 306 to request the removable device 100 for an analysis process time, which is the time from the execution request of the target process to the completion of the process (S905). Note that the analysis process time may be referred to as the "processing time" below. Then, in response to receiving the request for the processing time, the communication unit 502 of the removable device 100 transmits the processing time information read from the storage unit 503 to the imaging device 110 (S906). Note that in this embodiment, for example, the processing time information may be stored in an address accessed by the control unit 304 in order to determine whether the removable device 100 is a specified device in S702. Note that the processing time information may be stored in another address of the storage unit 503. For example, the control unit 304 of the imaging device 110 may send a read request (read command) to the address where the processing time information is stored, and obtain the processing time information as a response thereto. Processing time information is stored for each process, and the processing time associated with the process to be executed specified by the imaging device 110 is notified to the imaging device 110.
また、例えば、処理時間は、動作周波数fと、(例えば位相同期回路(PLL)による)逓倍値kと解析処理が要求されてから終了するまでのクロックサイクル数Nとの積N/(f×k)として算出されてもよい。一例において、動作周波数fが5MHz、kが2、Nが10万とすると、105/(5×106×2)=10-2[秒]となり、処理時間が10ミリ秒と算出される。制御部304は、記憶部503に記憶された情報を読み出すことにより、又は、ハードウェアの演算処理部203から、例えばその性能を示す情報として、動作周波数の情報を取得しうる。なお、着脱可能デバイス100の演算処理部412の動作周波数の情報が、例えばS906において、又は、例えば、着脱可能デバイス100が撮像装置110に装着された際に、撮像装置110に通知されるようにしてもよい。また、制御部304は、記憶部503に記憶された情報を読み出すことにより、又は、例えば着脱可能デバイス100のハードウェアの位相同期回路から、例えばその性能を示す情報として、逓倍値を取得しうる。解析処理のクロックサイクル数は、例えば、解析処理と対応付けられて記憶部503に記憶され、制御部304は、記憶部503から、実行対象処理に対応するクロックサイクル数を取得しうる。このように、S906では、実行対象処理の処理時間を特定可能な任意の形式の情報が、着脱可能デバイス100から撮像装置110へ通知される。
Also, for example, the processing time may be calculated as the product N/(f×k) of the operating frequency f, the multiplication value k (for example, by a phase-locked loop (PLL)), and the number of clock cycles N from when the analysis process is requested to when it is completed. In one example, if the operating frequency f is 5 MHz, k is 2, and N is 100,000, the processing time is calculated as 10 5 /(5×10 6 ×2)=10 −2 [seconds], and 10 milliseconds. The control unit 304 may obtain information on the operating frequency by reading out information stored in the storage unit 503 or from the hardware arithmetic processing unit 203 as information indicating its performance, for example. Note that information on the operating frequency of the arithmetic processing unit 412 of the removable device 100 may be notified to the imaging device 110, for example, in S906, or, for example, when the removable device 100 is attached to the imaging device 110. Furthermore, the control unit 304 may obtain the multiplication value as information indicating the performance, for example, by reading out the information stored in the storage unit 503 or, for example, from a phase-locked loop circuit of the hardware of the removable device 100. The number of clock cycles of the analysis process may be stored in the storage unit 503 in association with the analysis process, for example, and the control unit 304 may obtain the number of clock cycles corresponding to the process to be executed from the storage unit 503. In this way, in S906, information in any format capable of identifying the processing time of the process to be executed is notified to the imaging device 110 from the removable device 100.
また、1つ以上の分割画像が着脱可能デバイス100に入力されて、その1つ以上の分割画像を一括して用いて所定の解析処理が実行される場合、分割画像ごとの処理時間を特定可能な情報が、着脱可能デバイス100から撮像装置110へ通知されてもよい。例えば、着脱可能デバイス100から撮像装置110へ、1つの分割画像についての処理時間としてTという値が通知されうる。この場合、撮像装置110は、分割画像の数dと、通知された処理時間Tとを乗算したdTを、全体の処理が完了するまでの時間として特定しうる。なお、一括して処理される1つ以上の分割画像は、撮影によって取得された画像の一部または全部でありうる。すなわち、撮影によって取得された画像の一部を構成する1つ以上の分割画像について一括して処理が行われてもよいし、取得された画像の全部を構成する複数の分割画像について一括して処理が行われてもよい。この場合、一括処理の対象となる分割画像の枚数が、上述の分割画像の数dとして特定される。また、例えば、分割画像ごとの処理の後に、処理の結果を統合する処理等が行われる場合、その統合等の処理の時間T0がさらに着脱可能デバイス100から撮像装置110へ通知されてもよい。この場合、撮像装置110は、例えば、全体の処理が完了するまでの時間をdT+T0と特定することができる。また、各分割画像についての処理や統合等の処理のそれぞれについてのクロックサイクル数の情報が通知されてもよい。なお、複数の処理が連続して実行される場合、例えば、その複数の処理のそれぞれが完了するまでの処理時間が特定可能な情報が撮像装置110に通知されてもよいし、その複数の処理の全体を完了するまでの処理時間が撮像装置110に通知されてもよい。いずれの場合であっても、撮像装置110は、着脱可能デバイス100によって実行される処理の全体が完了するまでの処理時間を特定可能な情報を取得する。そして、撮像装置110は、必要に応じて計算を実行し、処理時間を特定する。
In addition, when one or more divided images are input to the removable device 100 and a predetermined analysis process is performed using the one or more divided images collectively, information that can specify the processing time for each divided image may be notified from the removable device 100 to the imaging device 110. For example, the removable device 100 may notify the imaging device 110 of a value T as the processing time for one divided image. In this case, the imaging device 110 may specify dT, which is the multiplication of the number d of divided images and the notified processing time T, as the time until the entire processing is completed. Note that the one or more divided images that are processed collectively may be a part or all of the image obtained by shooting. In other words, the processing may be performed collectively on one or more divided images that constitute a part of the image obtained by shooting, or on multiple divided images that constitute the entire image obtained. In this case, the number of divided images to be processed collectively is specified as the number d of divided images described above. Also, for example, when a process such as integrating the results of the processes is performed after the process for each divided image, the removable device 100 may further notify the imaging device 110 of the time T0 for the process such as integration. In this case, the imaging device 110 may specify, for example, the time until the entire process is completed as dT+T0. Also, information on the number of clock cycles for each process such as the process for each divided image and the integration may be notified. Note that, when multiple processes are performed consecutively, for example, information that can specify the processing time until each of the multiple processes is completed may be notified to the imaging device 110, or the processing time until the entire process is completed may be notified to the imaging device 110. In either case, the imaging device 110 obtains information that can specify the processing time until the entire process performed by the removable device 100 is completed. Then, the imaging device 110 performs calculations as necessary to specify the processing time.
その後、制御部304は、デバイス通信部306を制御して、解析前処理結果を着脱可能デバイス100に送信する(S907)。例えば、制御部304は、解析前処理結果の書き込み要求(ライトコマンド)を発行することにより、着脱可能デバイス100へ解析前処理結果の画像を送信する。そして、制御部304は、デバイス通信部306を制御して、実行対象処理の要求を着脱可能デバイス100へ送信する(S908)。そして、撮像装置110において、制御部304は、着脱可能デバイス100から取得した情報に基づいて特定した処理時間の長さだけ、処理を停止して待機する(S909)。一方、着脱可能デバイス100において、通信部502が、S907において受信した解析前処理結果の画像を解析部501に出力し、解析部501は、その画像に対して、図8のS810において設定された実行対象処理を実行する(S910)。解析部501は、例えば、記憶部503において処理ごとに割り当てられたアドレスに、処理結果を記憶させる。
Then, the control unit 304 controls the device communication unit 306 to transmit the analysis preprocessing result to the removable device 100 (S907). For example, the control unit 304 transmits the image of the analysis preprocessing result to the removable device 100 by issuing a write request (write command) for the analysis preprocessing result. Then, the control unit 304 controls the device communication unit 306 to transmit a request for the processing to be executed to the removable device 100 (S908). Then, in the imaging device 110, the control unit 304 stops the processing and waits for the length of the processing time specified based on the information acquired from the removable device 100 (S909). Meanwhile, in the removable device 100, the communication unit 502 outputs the image of the analysis preprocessing result received in S907 to the analysis unit 501, and the analysis unit 501 executes the processing to be executed set in S810 of FIG. 8 for the image (S910). The analysis unit 501 stores the processing results, for example, in an address assigned to each process in the storage unit 503.
制御部304は、処理時間の経過後、処理を再開する。そして、制御部304は、デバイス通信部306を制御して、着脱可能デバイス100に解析処理結果を要求し(S911)、着脱可能デバイス100の通信部502は、その結果を示す情報を撮像装置110へ通知する(S912)。例えば、制御部304は、デバイス通信部306を制御して、解析処理結果が記憶されているアドレスに対して読み出し要求(リードコマンド)を発行して、そのアドレスに記憶されている処理結果の情報を取得する。その後、撮像装置110の制御部304は、デバイス通信部306を制御して、着脱可能デバイス100から解析処理結果を受信する。その後、制御部304は、解析部305を制御して、解析処理結果に対して解析後処理を実行する(S913)。
After the processing time has elapsed, the control unit 304 resumes the processing. Then, the control unit 304 controls the device communication unit 306 to request the analysis processing result from the removable device 100 (S911), and the communication unit 502 of the removable device 100 notifies the imaging device 110 of information indicating the result (S912). For example, the control unit 304 controls the device communication unit 306 to issue a read request (read command) to the address where the analysis processing result is stored, and obtains the information of the processing result stored at that address. Then, the control unit 304 of the imaging device 110 controls the device communication unit 306 to receive the analysis processing result from the removable device 100. Then, the control unit 304 controls the analysis unit 305 to execute post-analysis processing on the analysis processing result (S913).
(後処理の実行制御)
図10に、撮像装置110が後処理を実行する際の制御の流れの例を示す。本処理では、撮像装置110の制御部304が、実行対象の後処理に「表示」が含まれるか否かを判定する(S1001)。制御部304は、実行対象の後処理に表示が含まれると判定した場合(S1001でYES)、ネットワーク通信部307を制御して、解析処理の結果を入出力装置130へ送信する(S1002)。入出力装置130は、撮像装置110から解析処理の結果を受信すると、解析処理の結果を画面表示等によってユーザに提示する(S1003)。一方、制御部304が実行対象の後処理に表示が含まれないと判定した場合(S1001でNO)、S1002及びS1003の処理は実行されない。
(Post-processing execution control)
10 shows an example of a flow of control when the imaging device 110 executes post-processing. In this process, the control unit 304 of the imaging device 110 determines whether the post-processing to be executed includes "display" (S1001). When the control unit 304 determines that the post-processing to be executed includes display (YES in S1001), it controls the network communication unit 307 to transmit the result of the analysis process to the input/output device 130 (S1002). When the input/output device 130 receives the result of the analysis process from the imaging device 110, it presents the result of the analysis process to the user by displaying it on a screen or the like (S1003). On the other hand, when the control unit 304 determines that the post-processing to be executed does not include display (NO in S1001), the processes of S1002 and S1003 are not executed.
また、撮像装置110の制御部304は、実行対象の後処理に「保存」が含まれるか否かの判定を行う(S1004)。なお、S1004の判定は、S1001の前に実行されてもよいし、S1001と並行して実行されてもよい。制御部304は、実行対象の後処理に保存が含まれると判定した場合(S1004でYES)、記憶部303を制御して、解析処理の結果を記憶し、処理を終了する。一方、制御部304は、実行対象の後処理に保存が含まれないと判定した場合(S1004でNO)は、S1005の処理を実行せずに処理を終了する。
The control unit 304 of the imaging device 110 also determines whether the post-processing to be executed includes "save" (S1004). The determination of S1004 may be executed before S1001 or in parallel with S1001. If the control unit 304 determines that the post-processing to be executed includes save (YES in S1004), it controls the storage unit 303 to store the results of the analysis process and terminates the process. On the other hand, if the control unit 304 determines that the post-processing to be executed does not include save (NO in S1004), it terminates the process without executing the process of S1005.
このように、撮像装置110は、選択された後処理に応じて、解析処理の結果の入出力装置130への転送や記憶部303への格納を、ユーザによる特段の設定操作を受け付けることなく実行することができる。
In this way, the imaging device 110 can transfer the results of the analysis process to the input/output device 130 or store them in the memory unit 303 depending on the selected post-processing, without receiving any special setting operations from the user.
本実施形態では、上述のように、撮像装置110が、着脱可能デバイス100に解析処理の一部または全部を実行させる際に、それらの処理の実行要求をしてから処理が完了するまでの処理時間を(必要に応じて計算等を実行することにより)取得する。そして、撮像装置110は、その処理のための画像データ(前処理結果)を入力して処理の実行を要求してから、取得した処理時間が経過するまで待機し、その後に処理結果を読み出す。このようにすることで、着脱可能デバイス100が処理の終了後に自動的に処理結果を出力することができない構成において、撮像装置110が、適切なタイミングで処理結果を取得することができる。これにより、例えば処理の完了直後(又は処理完了後の十分に小さい時間の経過後)に処理結果の読み出し処理が行われるため、撮像装置110と着脱可能デバイス100が協働して実行する処理の高速化を図ることができる。また、撮像装置110が、処理が完了する前に処理結果の取得を試行することを防ぎ、不必要なメモリアクセスを防ぐことができる。
In this embodiment, as described above, when the imaging device 110 causes the removable device 100 to execute part or all of the analysis process, the imaging device 110 acquires the processing time from the request to execute the process to the completion of the process (by performing calculations, etc., as necessary). Then, the imaging device 110 inputs image data (preprocessing result) for the process, requests the execution of the process, waits until the acquired processing time has elapsed, and then reads out the processing result. In this way, in a configuration in which the removable device 100 cannot automatically output the processing result after the process is completed, the imaging device 110 can acquire the processing result at an appropriate timing. As a result, for example, the processing result is read out immediately after the process is completed (or after a sufficiently small time has elapsed after the process is completed), so that the imaging device 110 and the removable device 100 can cooperate to speed up the process executed. In addition, the imaging device 110 can be prevented from attempting to acquire the processing result before the process is completed, thereby preventing unnecessary memory access.
なお、本実施形態では、処理の要求から、処理が完了するまでの時間を処理時間としたが、例えば、分割画像に対する前処理結果などの処理対象データが入力されたタイミングを起点として、そこから処理完了までの経過時間を処理時間としてもよい。この場合、例えば、S908の処理の実行要求を送受信する処理は行われなくてもよく、処理対象のデータが入力されたことによって解析処理が自動で開始される。撮像装置110は、処理対象のデータを着脱可能デバイス100へ送信し、その送信の完了から、処理時間の間だけ待機して、その後、処理結果を読み出すようにしうる。これによれば、処理の実行指示の送受信が省略されることにより、コマンドの送受信回数を低減し、処理の効率を向上させることができる。なお、この形態では、処理対象のデータの書き込みコマンドが、処理の実行要求として用いられている、と言える。すなわち、処理対象の書き込みコマンドと別個に処理の実行要求コマンドが発行されてもよいし、処理対象の書き込みコマンドが処理の実行要求コマンドと兼用されてもよい。また、コマンドのタイミング以外に、着脱可能デバイス100において処理が実際に開始されるタイミングを起点として、そこから処理完了までの経過時間を処理時間としてもよい。このように、処理の開始に関連付けて任意に定められたタイミングから処理の完了までの経過時間を、処理時間としうる。
In this embodiment, the processing time is the time from the request for processing to the completion of processing, but for example, the processing time may be the time elapsed from the timing when the data to be processed, such as the result of preprocessing on the divided image, is input as the starting point until the processing is completed. In this case, for example, the process of transmitting and receiving the request for processing in S908 does not need to be performed, and the analysis process is automatically started by inputting the data to be processed. The imaging device 110 may transmit the data to be processed to the removable device 100, wait for the processing time from the completion of the transmission, and then read the processing result. According to this, the transmission and reception of the instruction to execute the process is omitted, so that the number of times the command is transmitted and received can be reduced and the efficiency of the process can be improved. In this embodiment, it can be said that the write command for the data to be processed is used as the request for execution of the process. In other words, a command to request execution of the process may be issued separately from the write command for the target to be processed, or the write command for the target to be processed may be used as the command to request execution of the process. In addition to the timing of the command, the processing time may be the time elapsed from the timing when the process is actually started in the removable device 100 until the processing is completed. In this way, the elapsed time from a timing arbitrarily determined in association with the start of processing to the completion of processing can be considered as processing time.
また、本実施形態では、撮像装置110が、着脱可能デバイス100に処理を開始させることを契機として、その処理に関する処理時間を取得するようにしたが、これに限られない。例えば、着脱可能デバイス100が撮像装置110に装着された際に、例えばS702で着脱可能デバイス100が所定のデバイスであるかの判定のために撮像装置110が読み出す情報に、この処理時間を特定可能な情報を含めてもよい。これによれば、着脱可能デバイス100が装着された際に1回だけ情報が読み出されればよくなるため、コマンドの送受信回数を低減し、処理の効率を向上させることができる。
In addition, in this embodiment, the imaging device 110 acquires the processing time related to the process when the removable device 100 starts the process, but this is not limited to this. For example, when the removable device 100 is attached to the imaging device 110, information that can identify this processing time may be included in the information that the imaging device 110 reads in S702 to determine whether the removable device 100 is a specified device. In this way, the information only needs to be read once when the removable device 100 is attached, thereby reducing the number of times commands are sent and received and improving processing efficiency.
また、上述の実施形態において、解析処理として画像解析処理を例に挙げて説明したが、本発明は音声解析処理にも適用可能である。例えば、悲鳴や、銃声、ガラス破壊音のような音声パターンを検知する処理に適応可能である。例えば、スペクトル解析等の種々の音声データの分析手法で音声の特徴量が抽出され、それを検出した音声パターンと比較される。そして、その一致度合いが算出されることで、特定の音声パターンを検出することができる。
In addition, in the above embodiment, image analysis processing has been used as an example of analysis processing, but the present invention can also be applied to audio analysis processing. For example, the present invention can be applied to processing that detects audio patterns such as screams, gunshots, and the sound of breaking glass. For example, audio features are extracted using various audio data analysis methods such as spectral analysis, and compared with the detected audio pattern. Then, the degree of match is calculated, making it possible to detect a specific audio pattern.
また、音声解析処理を行う場合は、音声データを所定の時間分の音声データに分割し、その所定の時間分の音声データを単位として音声解析処理を行う。また、この所定の時間は、検出対象の音声パターンに応じて、適宜、異なる。そのため、着脱可能デバイス100に、検知したい音声パターンに対応する時間分ごとの音声データが入力される。そして、着脱可能デバイス100は、その入力された音声データを解析する機能や、入力された音声データを保持する機能を有する。
When performing voice analysis processing, the voice data is divided into voice data of a predetermined time, and the voice analysis processing is performed using the voice data of the predetermined time as a unit. This predetermined time varies as appropriate depending on the voice pattern to be detected. Therefore, voice data for each time corresponding to the voice pattern to be detected is input to the removable device 100. The removable device 100 has a function to analyze the input voice data and a function to hold the input voice data.
また、上述の実施形態において、撮像装置110から入力されたデータを非一時的に格納可能な着脱可能デバイス100を例として説明した。しかし、一部の実施形態においては、撮像装置110から入力されたデータを非一時的に格納することができない着脱可能デバイス100であってもよい。つまり、着脱可能デバイス100は撮像装置110から入力されたデータに対して解析処理を行うのみで、そのデータを非一時的に記憶しなくてもよい。言い換えると、通常のSDカードのようにデータを保管する目的ではなく、解析処理のみを目的とした着脱可能デバイス100とすることも可能である。
In the above-described embodiment, the removable device 100 capable of non-temporarily storing data input from the imaging device 110 has been described as an example. However, in some embodiments, the removable device 100 may not be capable of non-temporarily storing data input from the imaging device 110. In other words, the removable device 100 may only perform analysis processing on the data input from the imaging device 110, and may not need to non-temporarily store the data. In other words, it is possible to make the removable device 100 intended only for analysis processing, rather than for the purpose of storing data like a normal SD card.
<変形例>
上述の実施形態では、撮像装置110が、着脱可能デバイス100における処理時間を事前に取得することができる場合に、着脱可能デバイス100に処理を実行させる際の効率を改善する手法について説明した。一方で、例えば電圧低下や撮像装置110が配置された環境などの要因などにより、着脱可能デバイス100における実際の処理時間が取得した処理時間よりも長くなる可能性がありうる。そして、実際の処理時間が長くなってしまった場合、撮像装置110は、実行対象処理が完了する前に、着脱可能デバイス100に対して処理結果の取得を試行してしまいうる。これに対し、本変形例では、実際の処理時間が取得した処理時間よりも長くなった場合に、実行対象処理が完了した後で処理結果の取得が行われるようにする。この手法について、以下、説明する。
<Modification>
In the above embodiment, a method for improving the efficiency of making the removable device 100 execute a process when the imaging device 110 can obtain the processing time in the removable device 100 in advance has been described. On the other hand, due to factors such as a voltage drop or the environment in which the imaging device 110 is placed, the actual processing time in the removable device 100 may be longer than the obtained processing time. If the actual processing time becomes longer, the imaging device 110 may attempt to obtain the processing result from the removable device 100 before the target process is completed. In contrast, in this modified example, if the actual processing time becomes longer than the obtained processing time, the processing result is obtained after the target process is completed. This method will be described below.
本実施形態に係る着脱可能デバイス100のハードウェア構成例を図11に示す。図11に示すように、本実施形態では、演算処理部412が、単一または複数の演算実行部1101と、単一または複数のRAM1102とを含む。また、着脱可能デバイス100の実行可能な各処理は、例えば、複数の部分処理の組み合わせによって構成されうる。ここで、例えば、複数の演算実行部1101の少なくとも一部がそれぞれ別個の部分処理を実行するような回路によって構成されうる。なお、一部の演算実行部1101が、共通の部分処理を、それぞれ異なるデータに対して並列して実行するように構成されてもよい。複数の演算実行部1101は、相互に接続されてもよいし、例えば、一時記録用のRAMへと接続されてもよい。それぞれの部分処理は、実行対象処理の中での処理順序(その部分処理が何番目の処理であるか)を示すインデクスと、実行する演算の種類を示すコマンドと、実行する演算の係数を示す重みとに関連付けられる。この場合、部分処理に関連付けられたインデクスとコマンドと重みは記憶部404に格納されて、RAM1102に展開される。演算実行部1101は、RAM1102にアクセスし、演算のコマンドを取得することによって、対応した部分処理を実行することができる。ただし、これに限られず、例えば、部分処理のインデクスが存在しなくてもよい。この場合、演算のコマンドや重みが、処理される順序に従って、RAM1102に展開されうる。
11 shows an example of the hardware configuration of the removable device 100 according to this embodiment. As shown in FIG. 11, in this embodiment, the arithmetic processing unit 412 includes a single or multiple arithmetic execution units 1101 and a single or multiple RAMs 1102. Each process executable by the removable device 100 may be configured, for example, by a combination of multiple partial processes. Here, for example, at least a portion of the multiple arithmetic execution units 1101 may be configured by a circuit that executes separate partial processes. Note that some of the arithmetic execution units 1101 may be configured to execute common partial processes in parallel on different data. The multiple arithmetic execution units 1101 may be connected to each other, or may be connected to a RAM for temporary recording, for example. Each partial process is associated with an index indicating the processing order (which process the partial process is) in the process to be executed, a command indicating the type of operation to be executed, and a weight indicating the coefficient of the operation to be executed. In this case, the index, command, and weight associated with the partial process are stored in the memory unit 404 and expanded in the RAM 1102. The calculation execution unit 1101 can execute the corresponding partial processing by accessing the RAM 1102 and acquiring the calculation command. However, this is not limited to this, and for example, the index of the partial processing does not have to exist. In this case, the calculation command and weights can be expanded in the RAM 1102 according to the order in which they are processed.
(撮像装置110と着脱可能デバイス100との間の通信)
ここで、撮像装置110と着脱可能デバイス100との通信について説明する。撮像装置110の演算処理部203と着脱可能デバイス100のSDコントローラ403は、撮像装置110のSD I/F部205のデバイス挿入用ソケットを介し、電源ライン、GNDライン、クロックライン、コマンドライン、データラインで接続される。なお、クロックライン、コマンドライン、及び、データラインは、FPGA402を経由する形で接続されるものとする。クロックラインでは、演算処理部203から出力される同期用のクロックが通信される。コマンドラインでは、演算処理部203からSDコントローラ403への動作要求用に発行するコマンド、コマンドに対するSDコントローラ403から演算処理部203へのレスポンスが通信される。データラインでは、演算処理部203からの書き込みデータ、着脱可能デバイス100からの読み出しデータが通信される。また、演算処理部203は、SD I/F部205のデバイス挿入用ソケットのデバイスディテクト信号のHighとLowを判別することにより、着脱可能デバイス100が挿入されているか否かを認識することができる。
(Communication between the imaging device 110 and the removable device 100)
Here, communication between the imaging device 110 and the removable device 100 will be described. The arithmetic processing unit 203 of the imaging device 110 and the SD controller 403 of the removable device 100 are connected by a power line, a GND line, a clock line, a command line, and a data line via a device insertion socket of the SD I/F unit 205 of the imaging device 110. The clock line, the command line, and the data line are connected via the FPGA 402. The clock line communicates a clock for synchronization output from the arithmetic processing unit 203. The command line communicates a command issued from the arithmetic processing unit 203 to request an operation from the SD controller 403, and a response to the command from the SD controller 403 to the arithmetic processing unit 203. The data line communicates write data from the arithmetic processing unit 203 and read data from the removable device 100. Furthermore, the arithmetic processing unit 203 can determine whether the removable device 100 is inserted by determining whether the device detect signal of the device insertion socket of the SD I/F unit 205 is High or Low.
演算処理部203は、SDコントローラ403に対して電源供給後にコマンドライン上でコマンドを発行する。そして、演算処理部203は、SDコントローラ403からのレスポンスと、SDカードとしてのデバイス情報を示す出力データを受信したことに応じて、データの通信用の電圧、通信速度(クロック周波数)等の設定を行う。
After supplying power to the SD controller 403, the arithmetic processing unit 203 issues a command on the command line. Then, in response to receiving a response from the SD controller 403 and output data indicating device information as an SD card, the arithmetic processing unit 203 sets the voltage for data communication, communication speed (clock frequency), and the like.
図12に、コマンドライン上で通信されるコマンドとレスポンスの構成例を示す。これらのコマンドとレスポンスはSD規格に従う構成を有する。演算処理部203からSDコントローラ403に対して発行されるコマンド1201は、コマンドナンバー部1204と、コマンド引数部1205と、誤り訂正用データ部1206とを含んで構成される。コマンドナンバー部1204には、コマンドの種別を示す値が記述される。例えば、コマンドナンバー部1204に値「23」が格納されている場合、そのコマンドがデータブロック数を指定するブロック数指定コマンドであることが示される。また、コマンドナンバー部1204に値「25」が格納されている場合、そのコマンドがマルチライトコマンドであることが示され、コマンドナンバー部1204に値「12」が格納されている場合、そのコマンドがデータ転送停止コマンドであることが示される。コマンド引数部1205では、コマンドの種別に応じて転送データブロック数、メモリの書き込み・読み出しアドレス等の情報が指定される。また、コマンドの最初のビットには、コマンドの開始位置を示すコマンドスタートビット1202が付加され、コマンドの最後のビットにはコマンドの終了を示すコマンドエンドビット1207が付加される。また、コマンドスタートビット1202の後ろに、撮像装置110から着脱可能デバイス100に対して出力された信号であることを示すディレクションビット1203も付加される。
Figure 12 shows an example of the configuration of commands and responses communicated on a command line. These commands and responses have a configuration that conforms to the SD standard. A command 1201 issued from the arithmetic processing unit 203 to the SD controller 403 includes a command number section 1204, a command argument section 1205, and an error correction data section 1206. A value indicating the type of command is written in the command number section 1204. For example, if the value "23" is stored in the command number section 1204, it is indicated that the command is a block number designation command that designates the number of data blocks. Also, if the value "25" is stored in the command number section 1204, it is indicated that the command is a multi-write command, and if the value "12" is stored in the command number section 1204, it is indicated that the command is a data transfer stop command. In the command argument section 1205, information such as the number of transfer data blocks and memory write/read addresses is specified according to the type of command. In addition, a command start bit 1202 indicating the start position of the command is added to the first bit of the command, and a command end bit 1207 indicating the end of the command is added to the last bit of the command. In addition, a direction bit 1203 indicating that the signal is output from the imaging device 110 to the removable device 100 is also added after the command start bit 1202.
演算処理部203からのコマンドに対してSDコントローラ403から返されるレスポンス1211は、どのコマンドに対するレスポンスかを示すレスポンスナンバー部1214と、レスポンス引数部1215と、誤り訂正用データ部1216とを含む。また、レスポンスの最初のビットにはレスポンスの開始位置を示すレスポンススタートビット1212が付加され、レスポンスの最後のビットにはレスポンスの終了位置を示すレスポンスエンドビット1217が付加される。また、レスポンススタートビット1212の後ろに着脱可能デバイス100から撮像装置110に対して出力された信号であることを示すディレクションビット1213も付加される。レスポンス引数部1215には、コマンド種別に応じてSDカードのステータス等の情報が格納される。
The response 1211 returned from the SD controller 403 in response to a command from the arithmetic processing unit 203 includes a response number section 1214 indicating which command the response is for, a response argument section 1215, and an error correction data section 1216. A response start bit 1212 indicating the start position of the response is added to the first bit of the response, and a response end bit 1217 indicating the end position of the response is added to the last bit of the response. A direction bit 1213 indicating that the signal is output from the removable device 100 to the imaging device 110 is also added after the response start bit 1212. The response argument section 1215 stores information such as the status of the SD card according to the command type.
次に、演算処理部203と着脱可能デバイス100とのデータの送受信の方法を説明する。SD I/F部205では、データの書き込み及び読み出し共にブロック単位でデータの転送が行われる。
Next, a method for transmitting and receiving data between the arithmetic processing unit 203 and the removable device 100 will be described. In the SD I/F unit 205, data is transferred in blocks for both writing and reading data.
演算処理部203が着脱可能デバイス100に対して複数ブロックのデータを転送する方法は以下の2つの方法がある。1つ目の方法では、転送データのブロック数指定コマンドによってブロック数が指定された後に、マルチライトコマンドにより、指定されたブロック数だけデータが転送される。ブロック数指定コマンドでは、コマンド引数部1205において書き込みデータのブロック数が指定され、マルチライトコマンドでは、コマンド引数部1205においてデータが書き込まれるべき記憶部404のアドレスが指定される。2つ目の方法では、ブロック数指定コマンドが発行されることなくマルチライトコマンドが発行されることにより、データ転送が開始され、データ転送が終わった時点で転送停止コマンドが発行されることによって処理が終了する。このとき、マルチライトコマンドのコマンド引数部1205において、データが書き込まれるべき記憶部404のアドレスのみが指定される。演算処理部203は2つの書き込み方法を任意に切り替えることが可能である。
There are two methods for the arithmetic processing unit 203 to transfer multiple blocks of data to the removable device 100. In the first method, the number of blocks is specified by a block number specification command for the transfer data, and then the specified number of blocks of data is transferred by the multi-write command. In the block number specification command, the number of blocks of the write data is specified in the command argument part 1205, and in the multi-write command, the address of the storage unit 404 to which the data should be written is specified in the command argument part 1205. In the second method, the data transfer is started by issuing a multi-write command without issuing a block number specification command, and the process ends when the data transfer is completed by issuing a transfer stop command. At this time, only the address of the storage unit 404 to which the data should be written is specified in the command argument part 1205 of the multi-write command. The arithmetic processing unit 203 can arbitrarily switch between the two writing methods.
なお、記憶処理が行われる場合、FPGA402は、演算処理部203から送られるコマンドとデータをそのままSDコントローラ403に入力し、SDコントローラ403は、受信したデータをコマンドで指定された記憶部404のアドレスに格納する。画像解析処理が行われる場合には、FPGA402は、演算処理部203から送られるデータに対して解析処理を実行し、その処理結果のデータと、記憶部404の所定のアドレスを指定する情報を、SDコントローラ403に出力する。SDコントローラ403は、指定された記憶部のアドレスに処理結果を格納する。
When storage processing is performed, the FPGA 402 inputs the command and data sent from the arithmetic processing unit 203 directly to the SD controller 403, and the SD controller 403 stores the received data at an address in the storage unit 404 specified by the command. When image analysis processing is performed, the FPGA 402 executes analysis processing on the data sent from the arithmetic processing unit 203, and outputs the data resulting from the processing and information specifying a specific address in the storage unit 404 to the SD controller 403. The SD controller 403 stores the processing result at the specified address in the storage unit.
演算処理部203は着脱可能デバイス100から複数ブロックのデータを読み出す方法は以下の2つの方法がある。1つ目の方法では、ブロック数指定コマンドでブロック数が指定されてからマルチリードコマンドが発行され、指定されたブロック数だけデータが読み出される。ブロック数指定コマンドでは、コマンド引数部1205において読み出しデータのブロック数が指定され、マルチリードコマンドのコマンド引数部1205においてデータの読み出し元のメモリのアドレスが指定される。2つ目の方法では、ブロック数指定コマンドが発行されることなくマルチリードコマンドが発行されることにより、データの読み出しが開始され、転送停止コマンドが発行されることによって処理が終了する。演算処理部203は2つの読み出し方法を任意に切り替えることが可能である。
The arithmetic processing unit 203 has two methods for reading multiple blocks of data from the removable device 100. In the first method, the number of blocks is specified by a block number specification command, and then a multi-read command is issued, and data is read out for the specified number of blocks. In the block number specification command, the number of blocks of read data is specified in the command argument section 1205, and the memory address from which the data is read is specified in the command argument section 1205 of the multi-read command. In the second method, data reading is started by issuing a multi-read command without issuing a block number specification command, and processing ends by issuing a transfer stop command. The arithmetic processing unit 203 can arbitrarily switch between the two read methods.
なお、書き込みデータ、読み出しデータが1ブロックの場合には、シングルライトコマンド、シングルリードコマンドが発行されることにより、ブロック数指定コマンド、転送停止コマンドが発行されることなく、データの書き込み、読み出しが実行されうる。シングルライトコマンド、シングルリードコマンドにおいても、上述の説明と同様に、コマンド引数部1205において、アクセス対象の記憶部404のアドレスが指定される。
When the write data or read data is one block, a single write command or single read command can be issued, allowing data to be written or read without issuing a block count specification command or a transfer stop command. In the single write command and single read command, the address of the storage unit 404 to be accessed is specified in the command argument section 1205, as in the above description.
演算処理部203は、着脱可能デバイス100に対して書き込みを行うことにより、記憶処理または画像解析処理の対象となるデータを着脱可能デバイス100へ送信することができる。また、演算処理部203は、着脱可能デバイス100に対して読み出しを行うことにより、記憶部404に記憶された画像データ、画像解析処理の処理結果、着脱可能デバイス100が保有する画像解析の処理機能の情報を取得することができる。
The arithmetic processing unit 203 can transmit data to be subjected to storage processing or image analysis processing to the removable device 100 by writing to the removable device 100. In addition, the arithmetic processing unit 203 can obtain image data stored in the storage unit 404, the results of image analysis processing, and information on the image analysis processing function possessed by the removable device 100 by reading from the removable device 100.
本変形例では、S911において撮像装置110が着脱可能デバイス100に処理結果を要求した場合に、その処理が完了していない場合にも、着脱可能デバイス100から撮像装置110へ効率的に処理結果が通知されるようにする。本処理では、着脱可能デバイス100は、処理結果の要求を受信した際に処理が完了していない場合、処理の状態を撮像装置110へ通知し、撮像装置110は、その処理の状態に応じて一定時間だけ待機した後に再度処理結果を要求するようにする。処理が未完了の際には着脱可能デバイス100の処理の状態を考慮して待ち時間が設定されるため、次に処理結果を要求した場合にその処理が完了していない状態となる確率を低下させながら、不必要に長時間の待機をすることを防ぐことができる。以下では、この処理の流れの例について、図13を用いて説明する。
In this modified example, when the imaging device 110 requests the removable device 100 for a processing result in S911, even if the processing is not complete, the removable device 100 efficiently notifies the imaging device 110 of the processing result. In this process, if the removable device 100 receives a request for the processing result and the processing is not complete, the removable device 100 notifies the imaging device 110 of the processing status, and the imaging device 110 waits for a certain period of time depending on the processing status before requesting the processing result again. When the processing is not complete, the waiting time is set taking into consideration the processing status of the removable device 100, so that it is possible to prevent unnecessarily long wait times while reducing the probability that the processing will be incomplete when the processing result is next requested. An example of the flow of this process is described below with reference to FIG. 13.
本処理では、まず、撮像装置110は、制御部304がデバイス通信部306を制御して、着脱可能デバイス100に処理結果を要求する(S1301)。着脱可能デバイス100は、通信部502を用いてこの処理結果を受信すると、解析部501において実行対象処理を完了したか否かを判定する(S1302)。着脱可能デバイス100は、解析部501が実行対象処理を完了したと判定した場合(S1302でYES)、通信部502を用いて、処理結果を撮像装置110へ通知し(S1303)、処理を終了する。一方、着脱可能デバイス100は、解析部501が実行対象処理を完了していないと判定した場合(S1302でNO)、通信部502を用いて解析部501による処理の実行状況を示す処理状態の情報を撮像装置110へ通知する(S1304)。撮像装置110は、着脱可能デバイス100から取得した処理状態の情報に基づいて、残処理時間を計算し、その残処理時間だけ待機する(S1305)。そして、撮像装置110は、その残処理時間の経過後に、再度、着脱可能デバイス100に処理結果を要求する(S1301)。この時点で、S1304で通知された処理状態から処理完了までに要すると想定される時間が経過している。このため、撮像装置110は、この処理結果の再要求により、十分に高い確率で、着脱可能デバイス100から処理結果を取得することができるようになる。
In this process, first, the control unit 304 of the imaging device 110 controls the device communication unit 306 to request the processing result from the removable device 100 (S1301). When the removable device 100 receives this processing result using the communication unit 502, it determines whether the analysis unit 501 has completed the processing to be executed (S1302). If the removable device 100 determines that the analysis unit 501 has completed the processing to be executed (YES in S1302), it notifies the imaging device 110 of the processing result using the communication unit 502 (S1303) and ends the process. On the other hand, if the removable device 100 determines that the analysis unit 501 has not completed the processing to be executed (NO in S1302), it notifies the imaging device 110 of the processing status information indicating the execution status of the processing by the analysis unit 501 using the communication unit 502 (S1304). The imaging device 110 calculates the remaining processing time based on the processing status information acquired from the removable device 100, and waits for the remaining processing time (S1305). Then, after the remaining processing time has elapsed, the imaging device 110 again requests the processing result from the removable device 100 (S1301). At this point, the time expected to be required from the processing status notified in S1304 to processing completion has elapsed. Therefore, by re-requesting the processing result, the imaging device 110 can acquire the processing result from the removable device 100 with a sufficiently high probability.
なお、処理状態の情報は、例えば、解析部501が実行中の部分処理のインデクスでありうる。ただし、これに限られず、処理状態の情報は、処理の進捗状況を特定可能な他の形式の情報であってもよい。例えば、部分処理に関連する情報が、RAM1102に展開されるため、処理状態の情報として、演算実行部1101がアクセスしているRAM1102のアドレスの値が用いられてもよい。また、例えば、処理状態の情報は、実行対象処理が完了したか否かを示す情報であってもよい。また、処理状態の情報は、例えば、残処理時間を示す値を含んでもよい。すなわち、着脱可能デバイス100が現在実行中の処理の残処理時間を特定可能に構成され、着脱可能デバイス100は、処理状態の情報として、その特定した残処理時間を撮像装置110へ通知するようにしてもよい。
The processing status information may be, for example, an index of the partial process being executed by the analysis unit 501. However, the processing status information is not limited to this, and may be information in another format capable of identifying the progress of the process. For example, since information related to the partial process is expanded in the RAM 1102, the address value of the RAM 1102 accessed by the calculation execution unit 1101 may be used as the processing status information. Also, for example, the processing status information may be information indicating whether the processing to be executed has been completed. Also, the processing status information may include, for example, a value indicating the remaining processing time. In other words, the removable device 100 may be configured to be able to identify the remaining processing time of the process currently being executed, and the removable device 100 may notify the imaging device 110 of the identified remaining processing time as the processing status information.
本変形例の着脱可能デバイス100による処理状態の通知は、処理結果の要求コマンドに対するレスポンスのデータ領域のうち、SD規格で予約領域とされている部分を用いて行われうる。ただしこれに限られず、例えば、処理結果の要求コマンドに対するデータライン上の応答において、処理結果を示す情報の前に処理状態の情報が含められてもよい。すなわち、処理結果の要求コマンドに対する応答として、処理が完了しているか否かによらず、処理状態の情報が送信されるようにしうる。この場合、着脱可能デバイス100から送信されるデータにおいて、処理結果が格納される領域が所定のサイズの領域としてあらかじめ用意される。そして、撮像装置110は、着脱可能デバイス100から受信したデータのうち、末尾から所定のサイズのデータを処理結果として扱い、それ以外のデータを処理状態として扱いうる。また、処理結果の要求コマンドに対するデータライン上の応答において、処理結果を示す情報の後に処理状態の情報が含められてもよい。なお、処理結果が格納される領域には、処理が完了していない場合にはすべてゼロなどの無効な値が含められうる。また、撮像装置110は、着脱可能デバイス100から受信したデータのうち、所定のパターンより前のデータを処理状態として扱い、所定のパターンより後のデータを処理結果として扱ってもよい。
The notification of the processing status by the removable device 100 of this modified example may be performed using a portion of the data area of the response to the request command for the processing result that is reserved in the SD standard. However, this is not limited to this, and for example, in the response on the data line to the request command for the processing result, information on the processing status may be included before the information indicating the processing result. In other words, the processing status information may be transmitted as a response to the request command for the processing result regardless of whether the processing is completed or not. In this case, in the data transmitted from the removable device 100, an area in which the processing result is stored is prepared in advance as an area of a predetermined size. Then, the imaging device 110 may treat the data of a predetermined size from the end of the data received from the removable device 100 as the processing result, and treat the other data as the processing status. In addition, in the response on the data line to the request command for the processing result, information on the processing status may be included after the information indicating the processing result. Note that the area in which the processing result is stored may contain invalid values such as all zeros if the processing is not completed. Furthermore, the imaging device 110 may treat, among the data received from the removable device 100, data before a specific pattern as the processing status, and treat data after the specific pattern as the processing result.
また、本変形例では、撮像装置110は、解析部501が実行中の部分処理のインデクスと全部分処理数と、処理の開始後に経過した経過時間とによって、残処理時間を計算しうる。例えば、部分処理がN個存在し、そのN個の部分処理に、実行順にそれぞれ0~N-1のインデクスが割り当てられているとする。すなわち、最初にインデクス0の部分処理が実行され、次にインデクス1の部分処理が実行され、その次にインデクス2の部分処理が実行され、・・・、最後にインデクスN-1の処理が実行される。このとき、処理状態の情報として、インデクスnが通知されたものとする。この場合、インデクスnの部分処理も実行中であり、インデクス0~n-1のn個の部分処理が完了した状態である。ここで経過時間をTとすると、経過時間Tに対してn個の部分処理が完了しているため、部分処理1つあたりに要する時間の期待値はT/nとなる。そして、全部分処理数がN個であるため、N×(T/n)が、全部分処理が終了するまでの時間であると推定される。そして、撮像装置110は、この全部分処理が終了するまでの時間から、処理開始後からの経過時間Tを減じた(N/n-1)×Tを残処理時間として算出しうる。ここで、着脱可能デバイス100は部分処理の全数を記憶しておき、撮像装置110は、着脱可能デバイス100からその部分処理の全数の情報を取得しうる。なお、残処理時間は、例えば着脱可能デバイス100において演算実行部1101がRAM1102にアクセスして上述のような計算を実行し、撮像装置110が着脱可能デバイス100からその計算の結果を取得するようにしてもよい。
In addition, in this modification, the imaging device 110 may calculate the remaining processing time based on the index of the partial process being executed by the analysis unit 501, the total number of partial processes, and the elapsed time since the start of the process. For example, assume that there are N partial processes, and that the N partial processes are assigned in order of execution with indexes 0 to N-1. That is, the partial process with index 0 is executed first, then the partial process with index 1 is executed, then the partial process with index 2 is executed, and finally the process with index N-1 is executed. At this time, assume that index n is notified as information on the processing state. In this case, the partial process with index n is also being executed, and the n partial processes with indexes 0 to n-1 are in a completed state. Here, if the elapsed time is T, since n partial processes have been completed for the elapsed time T, the expected value of the time required for each partial process is T/n. Since the total number of partial processes is N, it is estimated that N×(T/n) is the time until all partial processes are completed. Then, the imaging device 110 may calculate the remaining processing time as (N/n-1)×T by subtracting the elapsed time T from the start of processing from the time until all of the partial processes are completed. Here, the removable device 100 stores the total number of partial processes, and the imaging device 110 may acquire information on the total number of partial processes from the removable device 100. Note that the remaining processing time may be calculated by, for example, having the calculation execution unit 1101 in the removable device 100 access the RAM 1102 to execute the calculation as described above, and having the imaging device 110 acquire the result of the calculation from the removable device 100.
また、処理状態の情報が、演算実行部1101がアクセスしているRAM1102のアドレスの値である場合、残処理時間は、演算実行部1101がアクセスしているRAM1102のアドレス値に基づいて特定されうる。例えば、実行対象処理のデータが記憶されている記憶部404の範囲が事前に定められ、最初の部分処理の情報がその範囲内の一番先頭アドレスから一定範囲(例えばサイズSの範囲)に記憶されるものとする。そして、次の処理が、その最初の部分処理の情報が記憶されている範囲の直後の一定範囲(サイズSの範囲)に記憶され、その次の処理がその一定範囲の直後に記憶され、・・・最後の部分処理の情報がその範囲内の一番末尾の一定範囲に記憶される。このように、実行対象処理のデータのサイズは、そのデータが記憶されている記憶部404の範囲に対応しうる。このとき、例えば先頭アドレスがAであり、実行対象処理のデータのサイズがK×Sであり、処理状態の情報としてA+k×Sが指定されているものとする。この場合、全体の部分処理がK個存在し、k番目(インデクスがk-1)の部分処理までが完了していることが特定されうる。このため、残処理時間は、処理が開始した後の経過時間をTとすると、上述の場合と同様に、(K/k-1)×Tとなる。この計算は、アドレスに基づく計算((K×S)/(k×S)-1)×Tと等価である。なお、k×Sは、処理状態の情報として通知されるアドレスA+k×Sから、実行対象処理に関するデータが記憶される範囲の先頭アドレスAを減じた値として特定されうる。このように、現在実行中の部分処理に関連付けられた情報が記憶されている領域を指定するアドレスの情報に基づいて、残処理時間が算出されうる。
In addition, when the information on the processing state is the address value of the RAM 1102 accessed by the calculation execution unit 1101, the remaining processing time can be specified based on the address value of the RAM 1102 accessed by the calculation execution unit 1101. For example, the range of the storage unit 404 in which the data of the processing to be executed is stored is determined in advance, and the information on the first partial processing is stored in a certain range (for example, a range of size S) from the top address within that range. Then, the next processing is stored in a certain range (range of size S) immediately after the range in which the information on the first partial processing is stored, the next processing is stored immediately after that range, and ... the information on the last partial processing is stored in a certain range at the very end of that range. In this way, the size of the data of the processing to be executed can correspond to the range of the storage unit 404 in which the data is stored. At this time, for example, the top address is A, the size of the data of the processing to be executed is K x S, and A + k x S is specified as the information on the processing state. In this case, it can be specified that there are K total partial processings, and up to the kth partial processing (index is k-1) has been completed. Therefore, if the elapsed time after the start of processing is T, the remaining processing time is (K/k-1) x T, as in the above case. This calculation is equivalent to the address-based calculation ((K x S)/(k x S)-1) x T. Note that k x S can be specified as the value obtained by subtracting the top address A of the range in which data related to the processing to be executed is stored from the address A + k x S notified as processing status information. In this way, the remaining processing time can be calculated based on address information that specifies the area in which information associated with the currently executing partial processing is stored.
また、残処理時間は、例えば、処理状態によらず、経過時間Tと一定の係数との積として特定されてもよい。ここで、この係数は例えば1未満に事前設定される。なお、上述の残処理時間の計算方法のそれぞれにおいて、経過時間Tに代えて、S906において着脱可能デバイス100から撮像装置110へ通知された処理時間が用いられてもよい。
The remaining processing time may be determined, for example, as the product of the elapsed time T and a certain coefficient, regardless of the processing state. Here, this coefficient is preset to, for example, less than 1. Note that in each of the above-described methods for calculating the remaining processing time, the processing time notified to the imaging device 110 from the removable device 100 in S906 may be used instead of the elapsed time T.
本変形例では、上述のように、撮像装置110が着脱可能デバイス100に処理結果を要求した際に、着脱可能デバイス100は、処理が完了している場合には処理結果を、処理が完了していない場合には処理状態の情報を、撮像装置110へ通知する。そして、撮像装置110は、処理状態の情報によって処理が未完了であることが示されている場合に、残処理時間を特定して、その残処理時間だけ待機する。そして、撮像装置110は、残処理時間だけ待機した後に、処理結果の要求を再度実行する。これにより、着脱可能デバイス100が処理の終了後に自動的に(能動的に)処理結果を出力することができない構成において、撮像装置110が、適切なタイミングで処理結果を取得することができる。これにより、例えば処理の完了直後(又は処理完了後の十分に小さい時間の経過後)に処理結果の読み出し処理が行われるため、撮像装置110と着脱可能デバイス100が協働して実行する処理の高速化を図ることができる。
In this modified example, as described above, when the imaging device 110 requests the removable device 100 for a processing result, the removable device 100 notifies the imaging device 110 of the processing result if the processing is completed, or of the processing status information if the processing is not completed. Then, when the processing status information indicates that the processing is incomplete, the imaging device 110 identifies the remaining processing time and waits for the remaining processing time. Then, after waiting for the remaining processing time, the imaging device 110 executes the request for the processing result again. This allows the imaging device 110 to obtain the processing result at an appropriate timing in a configuration in which the removable device 100 cannot automatically (actively) output the processing result after the processing is completed. This allows the imaging device 110 to read the processing result immediately after the processing is completed (or after a sufficiently small time has elapsed after the processing is completed), for example, and therefore speeds up the processing executed by the imaging device 110 and the removable device 100 in cooperation with each other.
なお、本変形例では、実行対象処理が完了していない場合、撮像装置110が着脱可能デバイス100に解析処理結果を要求した際に、処理状態の情報を撮像装置110へ通知する例を示したが、これに限られない。例えば、撮像装置110は、着脱可能デバイス100に解析処理結果を要求する前に処理状態の情報を要求してもよい。着脱可能デバイス100は、処理状態の情報が要求された場合には、処理状態の情報を撮像装置110へ通知する。その後、実行対象処理が完了した状態であることを処理状態の情報が示す場合、撮像装置110は、着脱可能デバイス100に処理結果を要求し、着脱可能デバイス100は、撮像装置110に処理結果を通知する。また、実行対象処理が完了していない状態であることを処理状態の情報が示す場合、撮像装置110は、例えば上述のようにして算出された期間だけ待機する。そして、撮像装置110は、待機後に、着脱可能デバイス100に対して処理状態を再度要求し、着脱可能デバイス100は、撮像装置110に処理状態を再度通知しうる。
In this modified example, when the processing to be performed is not completed, the imaging device 110 is notified of the processing status information when the imaging device 110 requests the analysis processing result from the removable device 100, but this is not limited to the above. For example, the imaging device 110 may request the processing status information before requesting the analysis processing result from the removable device 100. When the processing status information is requested, the removable device 100 notifies the imaging device 110 of the processing status information. Thereafter, when the processing status information indicates that the processing to be performed is completed, the imaging device 110 requests the processing result from the removable device 100, and the removable device 100 notifies the imaging device 110 of the processing result. Also, when the processing status information indicates that the processing to be performed is not completed, the imaging device 110 waits for a period calculated as described above, for example. After waiting, the imaging device 110 can again request the processing status from the removable device 100, and the removable device 100 can again notify the imaging device 110 of the processing status.
なお、撮像装置110は、実行対象処理が完了したことを示す処理状態の情報を取得しない限りは、算出した時間だけ待機してから、処理結果を要求することを繰り返す。ただし、これに限られず、例えば、所定期間にわたって処理が進んでいない場合などには、撮像装置110は、エラーが発生したと判定してもよい。例えば、撮像装置110は、複数回連続して実行中の部分処理を示すインデクスに変化がない場合に、エラーが発生したと判定しうる。また、撮像装置110は、例えば、上述のようにして算出した待機時間の長さが所定時間長を超える場合には、エラーが発生したと判定してもよい。これにより、着脱可能デバイス100において、例えば処理がループするなど、処理が終わらない状態となっている場合に、撮像装置110がエラー状態に陥っていることを特定することが可能となる。
Note that the imaging device 110 waits for the calculated time and then repeatedly requests the processing result unless it acquires processing status information indicating that the processing to be executed has been completed. However, this is not limited to the above, and the imaging device 110 may determine that an error has occurred, for example, when processing has not progressed for a predetermined period of time. For example, the imaging device 110 may determine that an error has occurred when there is no change in the index indicating the partial processing being executed multiple times in succession. Also, the imaging device 110 may determine that an error has occurred, for example, when the length of the waiting time calculated as described above exceeds a predetermined length of time. This makes it possible to identify that the imaging device 110 has fallen into an error state when the removable device 100 is in a state where processing does not end, such as when the processing is looping.
<その他の実施形態>
本発明は、上述の実施形態の1以上の機能を実現するプログラムを、ネットワーク又は記憶媒体を介してシステム又は装置に供給し、そのシステム又は装置のコンピュータにおける1つ以上のプロセッサがプログラムを読出し実行する処理でも実現可能である。また、1以上の機能を実現する回路(例えば、ASIC)によっても実現可能である。
<Other embodiments>
The present invention can also be realized by a process in which a program for implementing one or more of the functions of the above-described embodiments is supplied to a system or device via a network or a storage medium, and one or more processors in a computer of the system or device read and execute the program. The present invention can also be realized by a circuit (e.g., ASIC) that implements one or more of the functions.
発明は上記実施形態に制限されるものではなく、発明の精神及び範囲から離脱することなく、様々な変更及び変形が可能である。従って、発明の範囲を公にするために請求項を添付する。
The invention is not limited to the above-described embodiment, and various modifications and variations are possible without departing from the spirit and scope of the invention. Therefore, the following claims are appended to disclose the scope of the invention.