[go: up one dir, main page]

CN111563174A - Image processing method, image processing apparatus, electronic device, and storage medium - Google Patents

Image processing method, image processing apparatus, electronic device, and storage medium Download PDF

Info

Publication number
CN111563174A
CN111563174A CN202010402713.6A CN202010402713A CN111563174A CN 111563174 A CN111563174 A CN 111563174A CN 202010402713 A CN202010402713 A CN 202010402713A CN 111563174 A CN111563174 A CN 111563174A
Authority
CN
China
Prior art keywords
image
processing
processed
image processing
layer
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010402713.6A
Other languages
Chinese (zh)
Inventor
樊俊良
徐尤龙
袁乐
颜铭佳
贾雪
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Sensetime Technology Co Ltd
Original Assignee
Shenzhen Sensetime Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Sensetime Technology Co Ltd filed Critical Shenzhen Sensetime Technology Co Ltd
Priority to CN202010402713.6A priority Critical patent/CN111563174A/en
Publication of CN111563174A publication Critical patent/CN111563174A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/51Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/53Querying
    • G06F16/538Presentation of query results
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/58Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
    • G06F16/583Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/58Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
    • G06F16/5866Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using information manually generated, e.g. tags, keywords, comments, manually generated location and time information
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/172Classification, e.g. identification
    • GPHYSICS
    • G07CHECKING-DEVICES
    • G07CTIME OR ATTENDANCE REGISTERS; REGISTERING OR INDICATING THE WORKING OF MACHINES; GENERATING RANDOM NUMBERS; VOTING OR LOTTERY APPARATUS; ARRANGEMENTS, SYSTEMS OR APPARATUS FOR CHECKING NOT PROVIDED FOR ELSEWHERE
    • G07C9/00Individual registration on entry or exit
    • G07C9/30Individual registration on entry or exit not involving the use of a pass
    • G07C9/32Individual registration on entry or exit not involving the use of a pass in combination with an identity check
    • G07C9/37Individual registration on entry or exit not involving the use of a pass in combination with an identity check using biometric data, e.g. fingerprints, iris scans or voice recognition
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/179Human faces, e.g. facial parts, sketches or expressions metadata assisted face recognition

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Library & Information Science (AREA)
  • Human Computer Interaction (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Computation (AREA)
  • Evolutionary Biology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Oral & Maxillofacial Surgery (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Multimedia (AREA)
  • Artificial Intelligence (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Software Systems (AREA)
  • Image Processing (AREA)

Abstract

本申请公开了一种图像处理方法、图像处理装置、电子设备及存储介质。所述图像处理方法通过图像处理框架实现,所述图像处理框架包括视图接入层、视图处理层、存储层、任务下发层;所述视图接入层,用于获取至少一张第一待处理图像;所述任务下发层,用于获取至少一个待执行图像处理任务;所述视图处理层,用于对所述至少一张第一待处理图像进行处理,得到至少一个第一处理结果;所述存储层,用于存储所述至少一个第一处理结果;所述任务下发层,用于依据所述至少一个待执行图像处理任务,对存储于所述存储层中的所述至少一个第一处理结果进行处理,得到第二处理结果。

Figure 202010402713

The present application discloses an image processing method, an image processing apparatus, an electronic device and a storage medium. The image processing method is implemented by an image processing framework, and the image processing framework includes a view access layer, a view processing layer, a storage layer, and a task delivery layer; the view access layer is used to obtain at least one first to-be-received layer. processing an image; the task delivery layer is used to acquire at least one image processing task to be executed; the view processing layer is used to process the at least one first image to be processed to obtain at least one first processing result ; the storage layer is used to store the at least one first processing result; the task delivery layer is used to store the at least one image processing task stored in the storage layer according to the at least one image processing task to be executed. A first processing result is processed to obtain a second processing result.

Figure 202010402713

Description

图像处理方法、图像处理装置、电子设备及存储介质Image processing method, image processing device, electronic device, and storage medium

技术领域technical field

本申请涉及计算机技术领域,尤其涉及一种图像处理方法、图像处理装置、电子设备及存储介质。The present application relates to the field of computer technology, and in particular, to an image processing method, an image processing apparatus, an electronic device, and a storage medium.

背景技术Background technique

随着计算机视觉技术的快速发展,各种具备不同功能的计算机视觉模型应运而生,例如,人脸识别模型可用于进行人脸识别,物体检测模型可用于检测物体,动作监测模型可用于监测是否发生特定动作。With the rapid development of computer vision technology, various computer vision models with different functions have emerged. For example, face recognition models can be used for face recognition, object detection models can be used to detect objects, and motion monitoring models can be used to monitor whether A specific action occurs.

为将计算机视觉模型用于执行图像处理任务,可通过编写用于实现计算机视觉模型的软件,通过设备运行该软件可实现执行图像处理任务。为进一步提高开发效率,可基于软件框架实现上述软件开发,但基于传统软件框架进行开发的开发效率低,导致图像处理效率低。In order to use the computer vision model to perform image processing tasks, software for implementing the computer vision model can be written, and the image processing tasks can be performed by running the software through a device. In order to further improve the development efficiency, the above software development can be implemented based on a software framework, but the development efficiency based on the traditional software framework is low, resulting in low image processing efficiency.

发明内容SUMMARY OF THE INVENTION

本申请提供一种图像处理方法、图像处理装置、电子设备及存储介质。The present application provides an image processing method, an image processing apparatus, an electronic device and a storage medium.

第一方面,提供了一种图像处理方法,所述图像处理方法通过图像处理框架实现,所述图像处理框架包括视图接入层、视图处理层、存储层、任务下发层;A first aspect provides an image processing method, the image processing method is implemented by an image processing framework, and the image processing framework includes a view access layer, a view processing layer, a storage layer, and a task delivery layer;

所述视图接入层,用于获取至少一张第一待处理图像;the view access layer, used to acquire at least one first image to be processed;

所述任务下发层,用于获取至少一个待执行图像处理任务;The task delivery layer is used to acquire at least one image processing task to be executed;

所述视图处理层,用于对所述至少一张第一待处理图像进行处理,得到至少一个第一处理结果;the view processing layer, configured to process the at least one first image to be processed to obtain at least one first processing result;

所述存储层,用于存储所述至少一个第一处理结果;the storage layer, configured to store the at least one first processing result;

所述任务下发层,用于依据所述至少一个待执行图像处理任务,对存储于所述存储层中的所述至少一个第一处理结果进行处理,得到第二处理结果。The task delivery layer is configured to process the at least one first processing result stored in the storage layer according to the at least one image processing task to be executed to obtain a second processing result.

由于业务逻辑通过待执行图像处理任务确定,而在该方面中,待执行图像处理任务通过任务下发层获取得到,业务逻辑和视图处理层中的计算机视觉模型是相互独立的。这样,在基于图像处理框架开发得到图像处理软件后,通过向图像处理软件的任务下发层输入不同的待执行图像处理任务,和/或,通过更新(此处的更新包括一下至少一种操作:替换、删减、增加)软件中的计算机视觉模型,可使更新后的软件用于实现不同的图像处理功能,从而提高软件的通用性,开发人员的开发效率,以及图像处理的效率。Since the business logic is determined by the image processing task to be executed, and in this aspect, the image processing task to be executed is obtained through the task delivery layer, the business logic and the computer vision model in the view processing layer are independent of each other. In this way, after the image processing software is developed based on the image processing framework, different to-be-executed image processing tasks are input to the task delivery layer of the image processing software, and/or, by updating (the updating here includes at least one of the following operations) : replace, delete, add) the computer vision model in the software, so that the updated software can be used to realize different image processing functions, thereby improving the versatility of the software, the development efficiency of developers, and the efficiency of image processing.

结合本申请任一实施方式,所述至少一个第一处理结果包括图像数据和非图像数据;所述存储层包括图像数据存储模块和非图像数据存储模块;With reference to any embodiment of the present application, the at least one first processing result includes image data and non-image data; the storage layer includes an image data storage module and a non-image data storage module;

所述存储层还用于:The storage layer is also used to:

将所述图像数据存储于所述图像数据存储模块,将所述非图像数据存储于所述非图像数据存储模块;storing the image data in the image data storage module, and storing the non-image data in the non-image data storage module;

通过将所述非图像数据作为所述图像数据的索引款目,在所述图像数据和所述非图像数据之间建立索引。An index is established between the image data and the non-image data by using the non-image data as an index entry for the image data.

在该种实施方式中,通过将至少一个第一处理结果中的图像数据和非图像数据分开存储,有利于对至少一个第一处理结果的管理。通过在非图像数据与图像数据之间建立索引,可依据非图像数据查找图像数据,进而提高从至少一个第一处理结果中检索图像数据的效率。In this embodiment, the image data and the non-image data in the at least one first processing result are stored separately, which facilitates the management of the at least one first processing result. By establishing an index between the non-image data and the image data, the image data can be searched according to the non-image data, thereby improving the efficiency of retrieving the image data from the at least one first processing result.

结合本申请任一实施方式,其特征在于,所述视图处理层包括图片处理模块和视频处理模块;所述视图处理层还用于:With reference to any embodiment of the present application, it is characterized in that the view processing layer includes a picture processing module and a video processing module; the view processing layer is further used for:

在所述第一待处理图像的数量大于或等于2,且接收到执行图片处理指令和执行视频处理指令的情况下,依据所述执行图片处理指令,从至少两张所述第一待处理图像中选取至少一张第二待处理图像;In the case where the number of the first images to be processed is greater than or equal to 2, and an instruction to perform image processing and an instruction to perform video processing are received, according to the instruction to perform image processing, from at least two of the first images to be processed Select at least one second image to be processed from the

使用所述图片处理模块对所述至少一张第二待处理图像进行处理,得到至少一个第三处理结果;using the image processing module to process the at least one second image to be processed to obtain at least one third processing result;

依据所述执行视频处理指令,从所述至少两张所述第一待处理图像中选取至少两张第三待处理图像;Selecting at least two third images to be processed from the at least two first images to be processed according to the executing video processing instruction;

使用所述视频处理模块对所述至少两张第三待处理图像进行处理,得到至少一个第四处理结果;Using the video processing module to process the at least two third images to be processed to obtain at least one fourth processing result;

依据所述至少一个第三处理结果和所述至少一个第四处理结果,得到所述至少一个第一处理结果。The at least one first processing result is obtained according to the at least one third processing result and the at least one fourth processing result.

在该种实施方式中,图片处理模块与视频处理模块为相互独立的两个模块,基于图像处理框架开发得到的软件,既可用于执行图片处理任务,又可用于执行视频处理任务,还可用于同时执行图片处理任务和视频处理任务。In this embodiment, the picture processing module and the video processing module are two independent modules, and the software developed based on the image processing framework can be used to perform both picture processing tasks, video processing tasks, and Perform image processing tasks and video processing tasks at the same time.

结合本申请任一实施方式,所述使用所述图片处理模块对所述至少一张第二待处理图像进行处理,得到至少一个第三处理结果,包括:With reference to any embodiment of the present application, the use of the image processing module to process the at least one second image to be processed to obtain at least one third processing result includes:

使用所述图片处理模块对第四待处理图像进行对象检测处理,得到第一对象在所述第四待处理图像中的位置;所述第四待处理图像属于所述至少一张第二待处理图像;所述第一对象属于所述第四待处理图像;Using the image processing module to perform object detection processing on the fourth image to be processed, to obtain the position of the first object in the fourth image to be processed; the fourth image to be processed belongs to the at least one second image to be processed an image; the first object belongs to the fourth image to be processed;

依据所述位置,确定包含所述第一对象的像素区域;determining a pixel area including the first object according to the position;

从所述第四待处理图像中截取所述像素区域,得到对象图像;Intercept the pixel area from the fourth to-be-processed image to obtain an object image;

使用所述图片处理模块对所述对象图像进行属性提取处理,得到所述第一对象的属性。Use the image processing module to perform attribute extraction processing on the object image to obtain the attribute of the first object.

在该种实施方式中,由于对象图像包含的数据量大于第四待处理图像包含的数据量,对对象图像进行属性提取处理带来的数据处理量小于对第四待处理图像进行属性提取处理带来的数据处理量,从而通过对对象图像进行属性提取处理得到第一对象的属性,可减小数据处理量、提高处理速度。In this embodiment, since the amount of data contained in the object image is greater than the amount of data contained in the fourth image to be processed, the amount of data processing brought by the attribute extraction processing on the object image is smaller than that brought by the attribute extraction processing on the fourth image to be processed. Therefore, the attribute of the first object can be obtained by performing attribute extraction processing on the object image, which can reduce the data processing amount and improve the processing speed.

结合本申请任一实施方式,所述图像数据包括所述至少一张第一待处理图像和所述对象图像,所述非图像数据包括所述第一对象的属性。With reference to any embodiment of the present application, the image data includes the at least one first image to be processed and the object image, and the non-image data includes attributes of the first object.

结合本申请任一实施方式,所述视图接入层还用于:Combined with any embodiment of the present application, the view access layer is further used for:

获取至少一张第五待处理图像;Acquire at least one fifth image to be processed;

在所述至少一张第五待处理图像的通信协议与所述图像处理框架所使用的通信协议不同的情况下,将所述至少一张第五待处理图像的通信协议转换成所述图像处理框架所使用的通信协议,得到所述至少一张第一待处理图像。If the communication protocol of the at least one fifth image to be processed is different from the communication protocol used by the image processing framework, converting the communication protocol of the at least one fifth image to be processed into the image processing The communication protocol used by the framework to obtain the at least one first image to be processed.

在该种实施方式中,在从成像设备获取到的图像的通信协议与图像处理框架所使用的通信协议不同的情况下,通过将获取到的图像的通信协议转换成图像处理框架所使用的通信协议,使基于图像处理框架开发的软件可对从任意成像设备获取到的图像进行处理。In this embodiment, in the case where the communication protocol of the image acquired from the imaging device is different from the communication protocol used by the image processing framework, by converting the communication protocol of the acquired image to the communication protocol used by the image processing framework The protocol enables software developed based on the image processing framework to process images obtained from any imaging device.

结合本申请任一实施方式,所述图像处理框架还包括信息索引层;In combination with any embodiment of the present application, the image processing framework further includes an information index layer;

所述信息索引层,用于获取检索信息;The information index layer is used to obtain retrieval information;

使用所述检索信息检索所述至少一个第一处理结果,得到第五处理结果。The at least one first processing result is retrieved using the retrieval information to obtain a fifth processing result.

第二方面,提供了另一种图像处理方法,所述方法包括:In a second aspect, another image processing method is provided, the method comprising:

获取至少一张第一待处理图像和至少一个待执行图像处理任务;Acquiring at least one first image to be processed and at least one image processing task to be performed;

对所述至少一张第一待处理图像进行图片处理和/或视频处理,得到至少一个第一处理结果;Perform picture processing and/or video processing on the at least one first image to be processed to obtain at least one first processing result;

存储所述至少一个第一处理结果;storing the at least one first processing result;

依据所述至少一个待执行图像处理任务,对存储于所述存储层中的所述至少一个第一处理结果进行处理,得到第二处理结果。According to the at least one image processing task to be executed, the at least one first processing result stored in the storage layer is processed to obtain a second processing result.

结合本申请任一实施方式,所述图像处理方法通过图像处理框架实现,所述图像处理框架的构建过程包括:In combination with any embodiment of the present application, the image processing method is implemented by an image processing framework, and the construction process of the image processing framework includes:

获取所述至少一个待执行图像处理任务和待处理框架;所述待处理框架包括视图处理层、存储层、任务下发层;Obtain the at least one image processing task to be executed and a frame to be processed; the frame to be processed includes a view processing layer, a storage layer, and a task delivery layer;

在通过所述任务下发层获取到所述至少一个待执行图像处理任务的情况下,获取与所述至少一个待执行图像处理任务匹配的图片处理模块和/或视频处理模块;所述图片处理模块用于实现图片处理;所述视频处理模块用于实现视频处理;In the case where the at least one image processing task to be executed is obtained through the task delivery layer, obtain a picture processing module and/or a video processing module matching the at least one image processing task to be executed; the picture processing The module is used to realize image processing; the video processing module is used to realize video processing;

将所述图片处理模块和/或所述视频处理模块添加至待处理图像处理框架的视图处理层,得到所述图像处理框架。The picture processing module and/or the video processing module are added to the view processing layer of the to-be-processed image processing frame to obtain the image processing frame.

第三方面,提供了一种图像处理装置,所述图像处理装置包括:In a third aspect, an image processing apparatus is provided, and the image processing apparatus includes:

视图接入单元,用于获取至少一张第一待处理图像;a view access unit, configured to acquire at least one first image to be processed;

任务下发单元,用于获取至少一个待执行图像处理任务;a task issuing unit, used for acquiring at least one image processing task to be executed;

视图处理单元,用于对所述至少一张第一待处理图像进行处理,得到至少一个第一处理结果;a view processing unit, configured to process the at least one first image to be processed to obtain at least one first processing result;

存储单元,用于存储所述至少一个第一处理结果;a storage unit for storing the at least one first processing result;

任务下发单元,用于依据所述至少一个待执行图像处理任务,对存储于所述存储层中的所述至少一个第一处理结果进行处理,得到第二处理结果。A task issuing unit, configured to process the at least one first processing result stored in the storage layer according to the at least one image processing task to be executed to obtain a second processing result.

结合本申请任一实施方式,所述至少一个第一处理结果包括图像数据和非图像数据;所述存储单元包括图像数据存储子单元和非图像数据存储子单元;With reference to any embodiment of the present application, the at least one first processing result includes image data and non-image data; the storage unit includes an image data storage subunit and a non-image data storage subunit;

所述存储单元,用于:The storage unit is used for:

将所述图像数据存储于所述图像数据存储子单元,将所述非图像数据存储于所述非图像数据存储子单元;storing the image data in the image data storage subunit, and storing the non-image data in the non-image data storage subunit;

通过将所述非图像数据作为所述图像数据的索引款目,在所述图像数据和所述非图像数据之间建立索引。An index is established between the image data and the non-image data by using the non-image data as an index entry for the image data.

结合本申请任一实施方式,所述视图处理单元包括图片处理子单元和视频处理子单元;所述视图处理单元用于:With reference to any embodiment of the present application, the view processing unit includes a picture processing subunit and a video processing subunit; the view processing unit is used for:

在所述第一待处理图像的数量大于或等于2,且接收到执行图片处理指令和执行视频处理指令的情况下,依据所述执行图片处理指令,从至少两张所述第一待处理图像中选取至少一张第二待处理图像;In the case where the number of the first images to be processed is greater than or equal to 2, and an instruction to perform image processing and an instruction to perform video processing are received, according to the instruction to perform image processing, from at least two of the first images to be processed Select at least one second image to be processed from the

使用所述图片处理子单元对所述至少一张第二待处理图像进行处理,得到至少一个第三处理结果;Using the picture processing subunit to process the at least one second image to be processed to obtain at least one third processing result;

依据所述执行视频处理指令,从所述至少两张所述第一待处理图像中选取至少两张第三待处理图像;Selecting at least two third images to be processed from the at least two first images to be processed according to the executing video processing instruction;

使用所述视频处理子单元对所述至少两张第三待处理图像进行处理,得到至少一个第四处理结果;using the video processing subunit to process the at least two third images to be processed to obtain at least one fourth processing result;

依据所述至少一个第三处理结果和所述至少一个第四处理结果,得到所述至少一个第一处理结果。The at least one first processing result is obtained according to the at least one third processing result and the at least one fourth processing result.

结合本申请任一实施方式,所述视图处理单元用于:With reference to any embodiment of the present application, the view processing unit is used for:

使用所述图片处理子单元对第四待处理图像进行对象检测处理,得到第一对象在所述第四待处理图像中的位置;所述第四待处理图像属于所述至少一张第二待处理图像;所述第一对象属于所述第四待处理图像;Using the image processing subunit to perform object detection processing on the fourth image to be processed to obtain the position of the first object in the fourth image to be processed; the fourth image to be processed belongs to the at least one second image to be processed processing an image; the first object belongs to the fourth image to be processed;

依据所述位置,确定包含所述第一对象的像素区域;determining a pixel area including the first object according to the position;

从所述第四待处理图像中截取所述像素区域,得到对象图像;Intercept the pixel area from the fourth to-be-processed image to obtain an object image;

使用所述图片处理子单元对所述对象图像进行属性提取处理,得到所述第一对象的属性。Using the image processing subunit to perform attribute extraction processing on the object image to obtain the attribute of the first object.

结合本申请任一实施方式,所述图像数据包括所述至少一张第一待处理图像和所述对象图像,所述非图像数据包括所述第一对象的属性。With reference to any embodiment of the present application, the image data includes the at least one first image to be processed and the object image, and the non-image data includes attributes of the first object.

结合本申请任一实施方式,所述视图接入单元用于:With reference to any embodiment of the present application, the view access unit is used for:

获取至少一张第五待处理图像;Acquire at least one fifth image to be processed;

在所述至少一张第五待处理图像的通信协议与所述图像处理框架所使用的通信协议不同的情况下,将所述至少一张第五待处理图像的通信协议转换成所述图像处理框架所使用的通信协议,得到所述至少一张第一待处理图像。If the communication protocol of the at least one fifth image to be processed is different from the communication protocol used by the image processing framework, converting the communication protocol of the at least one fifth image to be processed into the image processing The communication protocol used by the framework to obtain the at least one first image to be processed.

结合本申请任一实施方式,所述图像处理装置还包括:信息索引单元;With reference to any embodiment of the present application, the image processing apparatus further includes: an information indexing unit;

所述信息索引单元,用于获取检索信息,以及使用所述检索信息检索所述至少一个第一处理结果,得到第五处理结果。The information indexing unit is configured to acquire retrieval information, and use the retrieval information to retrieve the at least one first processing result to obtain a fifth processing result.

第四方面,提供了另一种图像处理装置,所述图像处理装置包括:In a fourth aspect, another image processing apparatus is provided, and the image processing apparatus includes:

获取单元,用于获取至少一张第一待处理图像和至少一个待执行图像处理任务;an acquisition unit, configured to acquire at least one first image to be processed and at least one image processing task to be performed;

第一处理单元,用于对所述至少一张第一待处理图像进行图片处理和/或视频处理,得到至少一个第一处理结果;a first processing unit, configured to perform picture processing and/or video processing on the at least one first image to be processed to obtain at least one first processing result;

存储单元,用于存储所述至少一个第一处理结果;a storage unit for storing the at least one first processing result;

第二处理单元,用于依据所述至少一个待执行图像处理任务,对存储于所述存储层中的所述至少一个第一处理结果进行处理,得到第二处理结果。The second processing unit is configured to process the at least one first processing result stored in the storage layer according to the at least one image processing task to be executed to obtain a second processing result.

结合本申请任一实施方式,所述图像处理装置所执行的方法通过图像处理框架实现,所述获取单元,还用于获取所述至少一个待执行图像处理任务和待处理框架;所述待处理框架包括视图处理层、存储层、任务下发层;With reference to any embodiment of the present application, the method executed by the image processing apparatus is implemented by an image processing framework, and the acquiring unit is further configured to acquire the at least one image processing task to be executed and the frame to be processed; the to-be-processed The framework includes a view processing layer, a storage layer, and a task delivery layer;

所述获取单元,还用于在通过所述任务下发层获取到所述至少一个待执行图像处理任务的情况下,获取与所述至少一个待执行图像处理任务匹配的图片处理模块和/或视频处理模块;所述图片处理模块用于实现图片处理;所述视频处理模块用于实现视频处理;The acquiring unit is further configured to acquire a picture processing module and/or an image processing module matching the at least one image processing task to be performed when the at least one image processing task to be performed is acquired through the task delivery layer a video processing module; the picture processing module is used for realizing picture processing; the video processing module is used for realizing video processing;

所述图像处理装置还包括:The image processing device further includes:

添加单元,用于将所述图片处理模块和/或所述视频处理模块添加至待处理图像处理框架的视图处理层,得到所述图像处理框架。The adding unit is configured to add the picture processing module and/or the video processing module to the view processing layer of the to-be-processed image processing frame to obtain the image processing frame.

第五方面,提供了一种处理器,所述处理器用于执行如上述第一方面及其任意一实施方式中的方法,或者所述处理器用于执行如上述第二方面及其任意一实施方式中的方法。In a fifth aspect, a processor is provided, and the processor is configured to execute the method in the above-mentioned first aspect and any one of its embodiments, or the processor is configured to execute the above-mentioned second aspect and any one of its embodiments. method in .

第六方面,提供了一种电子设备,包括:处理器、发送装置、输入装置、输出装置和存储器,所述存储器用于存储计算机程序代码,所述计算机程序代码包括计算机指令,在所述处理器执行所述计算机指令的情况下,所述电子设备运行如上述第一方面及其任意一实施方式中的方法,或者所述电子设备运行如上述第二方面及其任意一实施方式中的方法。In a sixth aspect, an electronic device is provided, comprising: a processor, a sending device, an input device, an output device, and a memory, the memory is used to store computer program code, the computer program code includes computer instructions, in the processing When the computer executes the computer instructions, the electronic device operates as the method in the first aspect and any one of its embodiments, or the electronic device operates as the method in the second aspect and any one of its embodiments. .

第七方面,提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机程序,所述计算机程序包括程序指令,在所述程序指令被处理器执行的情况下,使所述处理器运行如第一方面及其任意一实施方式中的方法,或者使所述处理器运行如第二方面及其任意一实施方式中的方法。In a seventh aspect, a computer-readable storage medium is provided, where a computer program is stored in the computer-readable storage medium, and the computer program includes program instructions that, when the program instructions are executed by a processor, cause all The processor is caused to perform the method as in the first aspect and any embodiment thereof, or the processor is caused to perform the method as in the second aspect and any embodiment thereof.

第八方面,提供了一种计算机程序产品,所述计算机程序产品包括计算机程序或指令,在所述计算机程序或指令在计算机上运行的情况下,使得所述计算机运行第一方面及其任意一实施方式中的方法,或者使得所述计算机运行第二方面及其任意一实施方式中的方法。In an eighth aspect, a computer program product is provided, the computer program product includes a computer program or an instruction, and when the computer program or instruction is run on a computer, the computer is made to run the first aspect and any one thereof The method of an embodiment, or causing the computer to run the method of the second aspect and any one of its embodiments.

应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,而非限制本申请。It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.

附图说明Description of drawings

为了更清楚地说明本申请实施例或背景技术中的技术方案,下面将对本申请实施例或背景技术中所需要使用的附图进行说明。In order to more clearly illustrate the technical solutions in the embodiments of the present application or the background technology, the accompanying drawings required in the embodiments or the background technology of the present application will be described below.

此处的附图被并入说明书中并构成本说明书的一部分,这些附图示出了符合本申请的实施例,并与说明书一起用于说明本申请的技术方案。The accompanying drawings, which are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present application, and together with the description, serve to explain the technical solutions of the present application.

图1为本申请实施例提供的一种图像处理框架的结构示意图;FIG. 1 is a schematic structural diagram of an image processing framework provided by an embodiment of the present application;

图2为本申请实施例提供的一种图像处理方法的流程示意图;2 is a schematic flowchart of an image processing method provided by an embodiment of the present application;

图3为本申请实施例提供的另一种图像处理方法的流程示意图;3 is a schematic flowchart of another image processing method provided by an embodiment of the present application;

图4为本申请实施例提供的另一种图像处理方法的流程示意图;4 is a schematic flowchart of another image processing method provided by an embodiment of the present application;

图5为本申请实施例提供的另一种图像处理方法的流程示意图;FIG. 5 is a schematic flowchart of another image processing method provided by an embodiment of the present application;

图6为本申请实施例提供的一种图像处理方法的流程示意图;6 is a schematic flowchart of an image processing method provided by an embodiment of the present application;

图7为本申请实施例提供的一种数据流向示意图;FIG. 7 is a schematic diagram of a data flow provided by an embodiment of the present application;

图8为本申请实施例提供的另一种数据流向示意图;FIG. 8 is a schematic diagram of another data flow provided by an embodiment of the present application;

图9为本申请实施例提供的一种图像处理装置的结构示意图;FIG. 9 is a schematic structural diagram of an image processing apparatus according to an embodiment of the present application;

图10为本申请实施例提供的另一种图像处理装置的结构示意图;FIG. 10 is a schematic structural diagram of another image processing apparatus provided by an embodiment of the present application;

图11为本申请实施例提供的一种图像处理装置的硬件结构示意图。FIG. 11 is a schematic diagram of a hardware structure of an image processing apparatus according to an embodiment of the present application.

具体实施方式Detailed ways

为了使本技术领域的人员更好地理解本申请方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。In order to make those skilled in the art better understand the solutions of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only It is a part of the embodiments of the present application, but not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.

本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别不同对象,而不是用于描述特定顺序。此外,术语“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可选地还包括没有列出的步骤或单元,或可选地还包括对于这些过程、方法、产品或设备固有的其他步骤或单元。The terms "first", "second" and the like in the description and claims of the present application and the above drawings are used to distinguish different objects, rather than to describe a specific order. Furthermore, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but optionally also includes unlisted steps or units, or optionally also includes For other steps or units inherent to these processes, methods, products or devices.

应当理解,在本申请中,“至少一个(项)”是指一个或者多个,“多个”是指两个或两个以上,“至少两个(项)”是指两个或三个及三个以上,“和/或”,用于描述关联对象的关联关系,表示可以存在三种关系,例如,“A和/或B”可以表示:只存在A,只存在B以及同时存在A和B三种情况,其中A,B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。“以下至少一项(个)”或其类似表达,是指这些项中的任意组合,包括单项(个)或复数项(个)的任意组合。例如,a,b或c中的至少一项(个),可以表示:a,b,c,“a和b”,“a和c”,“b和c”,或“a和b和c”,其中a,b,c可以是单个,也可以是多个。It should be understood that in this application, "at least one (item)" refers to one or more, "multiple" refers to two or more, and "at least two (item)" refers to two or three And three or more, "and/or" is used to describe the association relationship of related objects, indicating that three kinds of relationships can exist, for example, "A and/or B" can mean: only A exists, only B exists, and A exists at the same time and B three cases, where A, B can be singular or plural. The character "/" generally indicates that the associated objects are an "or" relationship. "At least one item(s) below" or similar expressions thereof refer to any combination of these items, including any combination of single item(s) or plural items(s). For example, at least one (a) of a, b or c, can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c" ", where a, b, c can be single or multiple.

在本文中提及“实施例”意味着,结合实施例描述的特定特征、结构或特性可以包含在本申请的至少一个实施例中。在说明书中的各个位置出现该短语并不一定均是指相同的实施例,也不是与其它实施例互斥的独立的或备选的实施例。本领域技术人员显式地和隐式地理解的是,本文所描述的实施例可以与其它实施例相结合。Reference herein to an "embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the present application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor a separate or alternative embodiment that is mutually exclusive of other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

随着计算视觉技术的快速发展,各种具备不同功能的计算机视觉模型应运而生,例如,人脸识别模型可用于进行人脸识别,物体检测模型可用于检测物体,动作监测模型可用于监测是否发生特定动作。With the rapid development of computational vision technology, various computer vision models with different functions have emerged. For example, face recognition models can be used for face recognition, object detection models can be used to detect objects, and motion monitoring models can be used to monitor whether A specific action occurs.

将图像作为计算机视觉模型的输入,计算机视觉模型可输出通过对图像进行处理得到的处理结果。例如,将人脸图像输入至人脸识别模型,经人脸识别模型对人脸图像进行处理,输出的处理结果包括:携带人脸图像的语义信息的特征向量、人脸关键点的位置、人脸属性(如性别、年龄、人种)。又例如,将包含物体的图像输入至物体检测模型,经物体检测模型对该图像进行处理,输出的处理结果包括:携带该图像的语义信息的特征向量、物体在图像中的位置、物体的类别(如物体是桌子还是椅子)、物体属性(如颜色、形状)。The image is used as the input of the computer vision model, and the computer vision model can output the processing result obtained by processing the image. For example, a face image is input into a face recognition model, and the face image is processed by the face recognition model, and the output processing results include: a feature vector carrying the semantic information of the face image, the position of the key points of the face, the Face attributes (eg gender, age, race). For another example, an image containing an object is input into the object detection model, the image is processed by the object detection model, and the output processing result includes: a feature vector carrying the semantic information of the image, the position of the object in the image, and the category of the object. (such as whether the object is a table or a chair), object attributes (such as color, shape).

设备(包括:手机、电脑、处理器、平板电脑)依据与图像处理任务匹配的业务逻辑对计算机视觉模型输出的处理结果进行处理,可完成图像处理任务。例如(例1),假设设备为A公司的门禁设备,图像处理任务为人脸识别,该任务具体包括:确定采集到的人脸图像(下文将称为待识别人脸图像)中的人物(下文将称为待识别人物)是否为A公司的员工。门禁设备的人脸图像库中存储有A公司所有员工的人脸图像。门禁设备执行该图像处理任务的过程如下:确定待识别人脸图像与人脸图像库中的图像之间的相似度,得到相似度集。在相似度集中的最大值大于或等于相似度阈值的情况下,确定待识别人物为A公司的员工,在相似度集中的最大值小于相似度阈值的情况下,确定待识别人物不是A公司的员工。依据上述过程可确定与该图像处理任务匹配的业务逻辑为:通过门禁设备采集待识别人脸图像,使用人脸识别模型确定待识别人脸图像与人脸图像库中的图像之间的相似度,得到相似度集,依据相似度集中的最大值与相似度阈值之间的大小关系,确定待识别人脸图像中的人物是否为A公司的员工。The device (including: mobile phone, computer, processor, tablet computer) processes the processing result output by the computer vision model according to the business logic matching the image processing task, and can complete the image processing task. For example (Example 1), assuming that the device is an access control device of Company A, and the image processing task is face recognition, the task specifically includes: determining the person (hereinafter referred to as the face image to be recognized) in the collected face image (hereinafter referred to as the face image to be recognized). will be referred to as the person to be identified) is an employee of Company A. The face image database of the access control device stores the face images of all employees of company A. The process for the access control device to perform the image processing task is as follows: determine the similarity between the face image to be recognized and the image in the face image database, and obtain a similarity set. If the maximum value in the similarity set is greater than or equal to the similarity threshold, determine that the person to be identified is an employee of company A, and if the maximum value in the similarity set is less than the similarity threshold, determine that the person to be identified is not from company A Staff. According to the above process, it can be determined that the business logic matching the image processing task is: collecting the face image to be recognized through the access control device, and using the face recognition model to determine the similarity between the face image to be recognized and the image in the face image library. , obtain a similarity set, and determine whether the person in the face image to be recognized is an employee of company A according to the magnitude relationship between the maximum value in the similarity set and the similarity threshold.

从例1中可以看出,对完成图像处理任务而言,计算机视觉模型对图像的处理和业务逻辑缺一不可。通过软件开发一个包含计算机视觉模型以及业务逻辑的软件,使用该软件对图像进行处理可完成图像处理任务。As can be seen from Example 1, to complete the image processing task, the image processing and business logic of the computer vision model are indispensable. Through software development, a software including computer vision model and business logic can be used to process images to complete image processing tasks.

为提高开发效率,可使用软件框架(software framework)进行开发。在使用传统软件框架进行开发的过程中,通过将用于实现业务逻辑的代码(下文将称为业务逻辑层)和用于实现计算机视觉模型的代码(下文将称为模型引擎层)集成于传统软件框架中,可得到用于完成图像处理任务的软件。由于在传统软件框架中,业务逻辑层、模型引擎层、传统软件框架三者是绑定在一起的,在执行新的图像处理任务时,需要基于传统软件框架开发用于执行新的图像处理任务的软件。接着例1继续举例(例2),将例1中的业务逻辑层和模型引擎层集成于传统软件框架中,得到一个可用于执行例1中的人脸识别的软件(下文将称为人脸识别软件)。假如A公司的业务包括机械加工,在A公司的车间中,放置有大量用于机械加工的零配件,如:螺钉、螺栓。由于大量螺钉和螺栓被放置在一起,现需要对螺钉和螺栓进行分拣。出于节省人力成本的考虑,A公司希望通过计算视觉技术完成对螺钉和螺栓的分拣,具体的,该分拣过程如下:分拣机通过摄像头采集待识别零配件图像,使用物体检测模型对待识别零配件图像进行处理,得到待识别零配件图像中的待识别零配件的类别。分拣机将待识别零配件放置于与待识别零配件的类别匹配的区域。依据该分拣过程,可确定分拣的业务逻辑为:分拣机采集待识别零配件的图像,得到待识别零配件图像,分拣机将待识别零配件图像输入至物体检测模型(该模型可用于识别物体是螺钉还是螺栓),经物体检测模型对待识别零配件图像进行处理,输出待识别零配件的类别,将待识别零配件放置于与待识别零配件的类别匹配的区域。由于人脸识别软件中的业务逻辑与分拣过程中的业务逻辑不同,无法通过将人脸识别软件中的人脸识别模型替换成物体检测模型,得到可用于分拣零配件的软件。因此需要基于传统软件框架重新开发一个可用于分拣零配件的软件,即将用于实现分拣的业务逻辑的代码和用于实现物体监测模型的代码集成于传统软件框架中,得到用于分拣零配件的软件。In order to improve development efficiency, software framework can be used for development. In the process of development using a traditional software framework, by integrating the code for implementing business logic (hereinafter referred to as the business logic layer) and the code for implementing the computer vision model (hereinafter referred to as the model engine layer) in the traditional In the software framework, software for completing image processing tasks is available. Since in the traditional software framework, the business logic layer, the model engine layer, and the traditional software framework are bound together, when performing new image processing tasks, it is necessary to develop new image processing tasks based on the traditional software framework. software. Continue with Example 1 (Example 2), integrate the business logic layer and model engine layer in Example 1 into the traditional software framework, and obtain a software that can be used to perform the face recognition in Example 1 (hereinafter referred to as face recognition software). If company A's business includes machining, a large number of spare parts for machining, such as screws and bolts, are placed in company A's workshop. Sorting of screws and bolts is now required due to the large number of them being placed together. For the sake of saving labor costs, Company A hopes to complete the sorting of screws and bolts through computational vision technology. Specifically, the sorting process is as follows: the sorting machine collects images of the parts to be identified through the camera, and uses the object detection model to treat them. The image of the identified spare parts is processed to obtain the category of the spare parts to be identified in the image of the spare parts to be identified. The sorter places the parts to be identified in the area that matches the category of the parts to be identified. According to the sorting process, the business logic of sorting can be determined as follows: the sorter collects the image of the spare parts to be identified, obtains the image of the spare parts to be identified, and the sorter inputs the image of the spare parts to be identified into the object detection model (the model). It can be used to identify whether the object is a screw or a bolt). The object detection model processes the image of the spare parts to be identified, outputs the category of the spare parts to be identified, and places the spare parts to be identified in the area that matches the category of the spare parts to be identified. Since the business logic in the face recognition software is different from the business logic in the sorting process, it is impossible to obtain software that can be used for sorting spare parts by replacing the face recognition model in the face recognition software with an object detection model. Therefore, it is necessary to re-develop a software that can be used to sort spare parts based on the traditional software framework, that is, to integrate the code used to implement the business logic of sorting and the code used to implement the object monitoring model into the traditional software framework to obtain the code used for sorting. software for spare parts.

显然,基于传统软件框架开发得到的软件的通用性低,进而导致开发效率低,图像处理效率低。为提高开发效率和图像处理效率,本申请实施例提供了一种图像处理框架,可通过更换计算机视觉模型,得到用于执行不同的图像处理任务的软件,以此提高开发效率和图像处理效率。Obviously, the software developed based on the traditional software framework has low generality, which in turn leads to low development efficiency and low image processing efficiency. In order to improve development efficiency and image processing efficiency, the embodiments of the present application provide an image processing framework, which can obtain software for performing different image processing tasks by replacing computer vision models, thereby improving development efficiency and image processing efficiency.

图1所示为本申请实施例提供的一种图像处理框架的架构图,如图1所示,图像处理框架包括视图接入层、视图处理层、任务下发层。FIG. 1 shows an architecture diagram of an image processing framework provided by an embodiment of the present application. As shown in FIG. 1 , the image processing framework includes a view access layer, a view processing layer, and a task delivery layer.

视图接入层用于获取至少一张第一待处理图像,并将至少一张第一待处理图像传输至视图处理层。视图处理层用于对上述至少一张第一待处理图像进行处理,得到至少一个第一处理结果。存储层对视图处理层得到的至少一个第一处理结果进行存储。任务下发层用于获取至少一个待执行图像处理任务,并依据上述至少一个待执行图像处理任务,对存储于存储层中的至少一个第一处理结果进行处理,得到第二处理结果,从而完成图像处理任务。The view access layer is configured to acquire at least one first image to be processed, and transmit the at least one first image to be processed to the view processing layer. The view processing layer is configured to process the at least one first image to be processed to obtain at least one first processing result. The storage layer stores at least one first processing result obtained by the view processing layer. The task delivery layer is used to obtain at least one image processing task to be executed, and according to the at least one image processing task to be executed, process at least one first processing result stored in the storage layer to obtain a second processing result, thereby completing image processing tasks.

运行本申请提供的图像处理框架的设备可以是图像处理装置。可选的,图像处理装置可以是以下中的一种:手机、计算机、服务器、处理器、平板电脑。下面结合本申请实施例中的附图,对使用图像处理框架执行图像处理任务的过程进行描述。The device running the image processing framework provided by this application may be an image processing apparatus. Optionally, the image processing apparatus may be one of the following: a mobile phone, a computer, a server, a processor, and a tablet computer. The following describes the process of using the image processing framework to perform image processing tasks with reference to the accompanying drawings in the embodiments of the present application.

请参阅图2,图2是本申请实施例提供的一种使用图像处理框架执行图像处理任务的流程示意图。Please refer to FIG. 2. FIG. 2 is a schematic flowchart of an image processing task performed by using an image processing framework provided by an embodiment of the present application.

201、视图接入层获取至少一张第一待处理图像。201. The view access layer acquires at least one first image to be processed.

本申请实施例中,第一待处理图像可以包含任意内容。例如,第一待处理图像可以包括道路。又例如,第一待处理图像可以包括道路和车辆。再例如,第一待处理图像可以包括人。本申请对第一待处理图像中的内容不做限定。In this embodiment of the present application, the first image to be processed may contain any content. For example, the first image to be processed may include a road. As another example, the first image to be processed may include roads and vehicles. As another example, the first image to be processed may include a person. The present application does not limit the content of the first image to be processed.

在一种获取至少一张第一待处理图像的实现方式中,视图接入层接收用户通过输入组件输入的至少一张第一待处理图像。上述输入组件包括:键盘、鼠标、触控屏、触控板和音频输入器等。In an implementation manner of acquiring at least one first image to be processed, the view access layer receives at least one first image to be processed input by the user through the input component. The above input components include: keyboard, mouse, touch screen, touch pad, audio input and so on.

在另一种获取至少一张第一待处理图像的实现方式中,视图接入层接收第一终端发送的至少一张第一待处理图像。可选的,第一终端可以是以下任意一种:手机、计算机、平板电脑、服务器、可穿戴设备。In another implementation manner of acquiring at least one first image to be processed, the view access layer receives at least one first image to be processed sent by the first terminal. Optionally, the first terminal may be any one of the following: a mobile phone, a computer, a tablet computer, a server, and a wearable device.

在又一种获取至少一张第一待处理图像的实现方式中,图像处理装置与监控摄像头之间具有通信连接,视图接入层可通过该通信连接接收监控摄像头发送的至少一张第一待处理图像。可选的,该监控摄像头部署于公路或室内。In yet another implementation manner of acquiring at least one first image to be processed, a communication connection is provided between the image processing device and the surveillance camera, and the view access layer can receive at least one first image to be processed sent by the surveillance camera through the communication connection. Process images. Optionally, the surveillance camera is deployed on the road or indoors.

在又一种获取至少一张第一待处理图像的实现方式中,图像处理装置与监控摄像头之间具有通信连接,视图接入层可通过该通信连接接收监控摄像头发送的视频流,将视频流中的至少一张图像作为至少一张第一待处理图像。可选的,该监控摄像头部署于公路或室内。In another implementation manner of acquiring at least one first image to be processed, a communication connection is provided between the image processing device and the surveillance camera, and the view access layer can receive the video stream sent by the surveillance camera through the communication connection, and convert the video stream to the surveillance camera. At least one image in is used as at least one first image to be processed. Optionally, the surveillance camera is deployed on the road or indoors.

在又一种获取第一待处理图像的实现方式中,视图接入层可以通过自身的图像采集组件,例如摄像头,直接采集得到待处理图像。In another implementation manner of acquiring the first image to be processed, the view access layer may directly acquire the image to be processed through its own image acquisition component, such as a camera.

202、任务下发层获取至少一个待执行图像处理任务。202. The task delivery layer acquires at least one image processing task to be executed.

本申请实施例中,待执行图像处理任务为基于计算机视觉模型所需达到的目标,例如,待执行图像处理任务可以是基于人脸识别实现无感开门。又例如,待执行图像处理任务可以是零配件的分类。再例如,待执行图像处理任务可以是监测是否有行人摔倒、是否佩戴安全帽、是否有烟雾、是否有明火。In the embodiment of the present application, the image processing task to be performed is a goal to be achieved based on a computer vision model. For example, the image processing task to be performed may be based on face recognition to realize the door opening without feeling. As another example, the image processing task to be performed may be the classification of spare parts. For another example, the image processing task to be performed may be to monitor whether a pedestrian falls, whether a safety helmet is worn, whether there is smoke, or whether there is an open flame.

显然,执行不同的待执行图像处理任务所需的业务逻辑不同。例如,实现无感开门所需的业务逻辑与实现零配件的分类的业务逻辑不同。Obviously, the business logic required to perform different image processing tasks to be performed is different. For example, the business logic required to implement a sensorless door opening is different from the business logic that implements the classification of spare parts.

本申请实施例中,在待执行图像处理任务的数量大于或等于2的情况下,任意两个待执行图像处理任务均不同,相应的,执行任意两个待执行图像处理任务所需的业务逻辑均不同。例如,获取到的至少一个待执行图像处理任务包括:待执行图像处理任务A和待执行图像处理任务B,其中,执行待执行图像处理任务A所需的业务逻辑与执行待执行图像处理任务B所需的业务逻辑不同。In this embodiment of the present application, when the number of image processing tasks to be executed is greater than or equal to 2, any two image processing tasks to be executed are different, and accordingly, the business logic required to execute any two image processing tasks to be executed are different. For example, the acquired at least one to-be-executed image processing task includes: to-be-executed image processing task A and to-be-executed image processing task B, wherein the business logic required to execute to-be-executed image processing task A and the to-be-executed image processing task B The required business logic is different.

在一种获取至少一个待执行图像处理任务的实现方式中,任务下发层接收用户通过输入组件输入的至少一个待执行图像处理任务。上述输入组件包括:键盘、鼠标、触控屏、触控板和音频输入器等。In an implementation manner of acquiring at least one to-be-executed image processing task, the task delivery layer receives at least one to-be-executed image processing task input by a user through an input component. The above input components include: keyboard, mouse, touch screen, touch pad, audio input and so on.

在另一种获取至少一个待执行图像处理任务的实现方式中,任务下发层接收第二终端发送的至少一个待执行图像处理任务。第二终端包括手机、计算机、平板电脑、服务器、可穿戴设备。In another implementation manner of acquiring at least one to-be-executed image processing task, the task delivery layer receives at least one to-be-executed image processing task sent by the second terminal. The second terminal includes a mobile phone, a computer, a tablet computer, a server, and a wearable device.

在又一种获取至少一个待执行图像处理任务的实现方式中,任务下发层接收用户输入的选择指令,并依据该选择指令,从存储于任务下发层中的图像处理任务库中选取至少一个图像处理任务,作为至少一个待执行图像处理任务。In yet another implementation manner of acquiring at least one image processing task to be executed, the task delivery layer receives a selection instruction input by the user, and according to the selection instruction, selects at least one image processing task library stored in the task delivery layer. An image processing task, as at least one image processing task to be executed.

在又一种获取至少一个待执行图像处理任务的实现方式中,任务下发层根据预先设置的触发规则,例如定时触发或检测到目标物体即触发等,从存储于任务下发层中的图像处理任务库中选择规则对应的至少一个图像处理任务,作为至少一个待执行图像处理任务。In yet another implementation manner of acquiring at least one image processing task to be executed, the task delivery layer, according to preset triggering rules, such as timing triggering or triggering when a target object is detected, etc., from the image stored in the task delivery layer At least one image processing task corresponding to the selection rule in the processing task library is used as the at least one image processing task to be executed.

203、视图处理层对上述至少一张第一待处理图像进行图像处理,得到至少一个第一处理结果。203. The view processing layer performs image processing on the at least one first image to be processed to obtain at least one first processing result.

本申请实施例中,视图处理层包含计算机视觉模型,上述计算机视觉模型包括以下至少一个:人脸识别模型、物体检测模型、动作识别模型、行人重识别模型、图像质量检测模型。In this embodiment of the present application, the view processing layer includes a computer vision model, and the computer vision model includes at least one of the following: a face recognition model, an object detection model, an action recognition model, a pedestrian re-identification model, and an image quality detection model.

本申请实施例中,视图处理层可通过对一张第一待处理图像进行图像处理,得到一个第一处理结果。视图处理层也可通过对至少两张第一待处理图像进行图像处理,得到一个第一处理结果。例如,使用人脸识别模型对一张第一待处理图像进行处理,得到一个第一处理结果,该第一处理结果包括:携带第一待处理图像的语义信息的特征向量、人脸关键点的位置、人脸属性(如性别、年龄、人种)。又例如,使用摔倒监测模型对至少两张第一待处理图像进行处理,得到一个第一处理结果,该第一处理结果包括:至少两张第一待处理图像中包含的人物是否摔倒、该人物在每一张第一待处理图像中的位置。In this embodiment of the present application, the view processing layer may obtain a first processing result by performing image processing on a first image to be processed. The view processing layer may also obtain a first processing result by performing image processing on at least two first images to be processed. For example, a face recognition model is used to process a first image to be processed, and a first processing result is obtained, where the first processing result includes: a feature vector carrying semantic information of the first image to be processed, a Location, face attributes (eg gender, age, race). For another example, use the fall detection model to process at least two first images to be processed to obtain a first processing result, where the first processing result includes: whether the characters included in the at least two first images to be processed have fallen, The position of the person in each of the first images to be processed.

204、存储层存储上述至少一个第一处理结果。204. The storage layer stores the at least one first processing result.

传统软件框架在使用计算机视觉模型对图像进行处理,得到中间处理结果后,依据业务逻辑,对中间处理结果进行处理,得到目标处理结果,可完成图像处理任务。例如(例3),若基于传统软件框架开发一个人脸识别软件用以完成例1中的图像处理任务。使用人脸识别模型对待识别人脸图像进行处理,得到的中间处理结果包括:待识别人脸图像的特征向量、待识别人脸图像中的人物属性(包括:性别、年龄、脸型、肤色、发型)。由于通过计算待识别人脸图像的特征向量与人脸图像库中的图像的特征向量,可得到相似度集,且在得到相似度集的过程中,无需利用人物属性,这样,依据业务逻辑,对中间处理结果进行处理得到目标处理结果的过程为:基于相似度集与相似度阈值,确定待识别人脸图像中的人物是否为A公司的员工。The traditional software framework uses the computer vision model to process the image, and after obtaining the intermediate processing result, according to the business logic, the intermediate processing result is processed to obtain the target processing result, and the image processing task can be completed. For example (Example 3), if a face recognition software is developed based on a traditional software framework to complete the image processing task in Example 1. Using the face recognition model to process the face image to be recognized, the obtained intermediate processing results include: the feature vector of the face image to be recognized, the character attributes in the face image to be recognized (including: gender, age, face shape, skin color, hairstyle ). Since the similarity set can be obtained by calculating the feature vector of the face image to be recognized and the feature vector of the image in the face image database, and in the process of obtaining the similarity set, there is no need to use the character attributes, so, according to the business logic, The process of processing the intermediate processing result to obtain the target processing result is as follows: based on the similarity set and the similarity threshold, it is determined whether the person in the face image to be identified is an employee of company A.

在执行图像处理任务的过程中,通过计算机视觉模型得到的中间处理结果包含多种数据,但由于传统软件框架的业务逻辑是固定的,中间处理结果中完成业务逻辑所需的数据(下文将称为所需数据)才会被存储及利用,中间处理结果中除所需数据之外的数据将被丢弃。接着例3继续举例(例4),在通过人脸识别模型得到特征向量和人物属性后,将从中间处理结果中选取特征向量用以实现业务逻辑,而不对人物属性进行存储。这样将导致基于传统软件框架开发的软件的通用性差,从而导致基于传统软件框架开发软件的效率低。接着例4继续举例,虽然人脸识别模型可提取待识别人脸图像的人物属性,但由于人脸识别软件只能得到待识别人脸图像中的人物是否为A公司的员工、待识别人脸图像的特征向量以及相似度集,使用例人脸识别软件对待识别人脸图像进行处理,不能输出待识别人脸图像的人物属性。若需要通过人脸识别模型得到待识别人脸图像的人物属性,需要基于传统软件框架重新开发一个人物属性提取软件。In the process of performing image processing tasks, the intermediate processing results obtained by the computer vision model contain a variety of data, but since the business logic of the traditional software framework is fixed, the data required to complete the business logic in the intermediate processing results (hereinafter referred to as required data) will be stored and used, and the data other than the required data in the intermediate processing result will be discarded. Continuing with Example 3 (Example 4), after obtaining the feature vector and person attribute through the face recognition model, the feature vector will be selected from the intermediate processing result to realize the business logic without storing the person attribute. This will lead to poor generality of software developed based on traditional software frameworks, resulting in low efficiency in developing software based on traditional software frameworks. Continuing with example 4, although the face recognition model can extract the character attributes of the face image to be recognized, the face recognition software can only obtain whether the person in the face image to be recognized is an employee of company A, the face to be recognized or not. The feature vector and similarity set of the image are used for example. The face recognition software processes the face image to be recognized, and cannot output the character attributes of the face image to be recognized. If it is necessary to obtain the character attributes of the face image to be recognized through the face recognition model, it is necessary to re-develop a character attribute extraction software based on the traditional software framework.

在本申请提供的图像处理框架中,在通过视图处理层得到至少一个第一处理结果后,图像处理装置将该至少一个第一处理结果存储至存储层,即对至少一个第一处理结果中的所有数据进行存储。这样,在后续处理中,可依据不同的待执行图像处理任务,使用至少一个处理结果中不同的数据,从而可完成不同的待执行图像处理任务。In the image processing framework provided by the present application, after obtaining at least one first processing result through the view processing layer, the image processing apparatus stores the at least one first processing result in the storage layer, that is, the image processing apparatus stores the at least one first processing result in the storage layer. All data is stored. In this way, in the subsequent processing, different data in at least one processing result can be used according to different image processing tasks to be executed, so that different image processing tasks to be executed can be completed.

205、上述任务下发层依据上述至少一个待执行图像处理任务,对上述至少一个第一处理结果进行处理,得到第二处理结果。205. The above-mentioned task issuing layer processes the above-mentioned at least one first processing result according to the above-mentioned at least one to-be-executed image processing task to obtain a second processing result.

依据至少一个待执行图像处理任务,可确定至少一个业务逻辑。依据至少一个业务逻辑,可对上述至少一个第一处理结果中的数据进行处理,得到第二处理结果,完成上述至少一个待执行图像处理任务。At least one business logic may be determined based on at least one image processing task to be performed. According to the at least one business logic, the data in the at least one first processing result can be processed to obtain a second processing result, and the at least one image processing task to be executed can be completed.

例如(例5),存储于存储层中的第一处理结果通过使用人脸识别模型对人脸图像a进行处理得到,该第一处理结果包括:人物属性、人脸图像a的特征向量(下文将称为特征向量b)。至少一个待执行图像处理任务包括:人脸识别。依据人脸识别确定的业务逻辑,计算特征向量b与人脸图像库中的图像的特征向量之间的相似度,得到相似度集,并基于相似度集与相似度阈值,确定人脸图像a中的人物的身份。For example (Example 5), the first processing result stored in the storage layer is obtained by using the face recognition model to process the face image a, and the first processing result includes: character attributes, the feature vector of the face image a (below will be called eigenvector b). At least one image processing task to be performed includes: face recognition. According to the business logic determined by face recognition, calculate the similarity between the feature vector b and the feature vector of the image in the face image database to obtain a similarity set, and determine the face image a based on the similarity set and the similarity threshold identities of the characters in .

由于业务逻辑通过待执行图像处理任务得到,而在本申请提供的图像处理框架中,待执行图像处理任务通过业务下发层获取得到,也就是说,业务逻辑与计算机视觉模型是相互独立的。这样可提高基于图像处理框架开发的软件的通用性。接着例5继续举例,假设例5中的人脸识别模型属于人物属性提取软件,人物属性提取软件基于图像处理框架开发得到。由于人物属性提取软件在对人脸图像进行处理的过程中,不仅可得到人脸图像的特征向量和人脸图像中的人物的身份,还可得到人脸图像中的人物属性,因此还可将人物属性提取软件用于提取人脸图像的人物属性。Since the business logic is obtained through the image processing task to be executed, in the image processing framework provided by this application, the image processing task to be executed is obtained through the service delivery layer, that is to say, the business logic and the computer vision model are independent of each other. This increases the versatility of software developed based on the image processing framework. Continuing with example 5, it is assumed that the face recognition model in example 5 belongs to the character attribute extraction software, and the character attribute extraction software is developed based on the image processing framework. Since the character attribute extraction software can not only obtain the feature vector of the face image and the identity of the character in the face image, but also obtain the character attribute in the face image, so it can also obtain the character attribute of the face image. The character attribute extraction software is used to extract the character attributes of the face image.

此外,基于本申请提供的图像处理框架进行开发,还可提高开发效率。例如,在例2中,在基于传统软件框架开发得到人脸识别软件的情况下,A公司需要重新开发一个软件用于分拣零配件。而在基于本申请的图像处理框架开发得到人脸识别软件的情况下,通过将人脸识别软件中的人脸识别模型替换成物体检测模型,即可得到分拣零配件软件,无需重新开发一个软件,从而提高开发效率。In addition, development based on the image processing framework provided by this application can also improve development efficiency. For example, in Example 2, when the face recognition software is developed based on the traditional software framework, Company A needs to re-develop a software for sorting spare parts. In the case of developing a face recognition software based on the image processing framework of the present application, by replacing the face recognition model in the face recognition software with an object detection model, the software for sorting spare parts can be obtained, and there is no need to develop a new one. software to improve development efficiency.

由于业务逻辑通过待执行图像处理任务确定,而在本申请实施例提供的图像处理框架中,待执行图像处理任务通过任务下发层获取得到,业务逻辑和计算机视觉模型是相互独立的。这样,在基于图像处理框架开发得到图像处理软件后,通过向图像处理软件的任务下发层输入不同的待执行图像处理任务,和/或,通过更新(此处的更新包括一下至少一种操作:替换、删减、增加)软件中的计算机视觉模型,可使更新后的软件用于实现不同的功能,从而提高软件的通用性,以及开发人员的开发效率,进而提高图像处理效率和灵活性。Since the business logic is determined by the image processing task to be executed, in the image processing framework provided by the embodiment of the present application, the image processing task to be executed is obtained through the task delivery layer, and the business logic and the computer vision model are independent of each other. In this way, after the image processing software is developed based on the image processing framework, different to-be-executed image processing tasks are input to the task delivery layer of the image processing software, and/or, by updating (the updating here includes at least one of the following operations) : replace, delete, add) the computer vision model in the software, so that the updated software can be used to realize different functions, thereby improving the versatility of the software and the development efficiency of developers, thereby improving the efficiency and flexibility of image processing .

作为一种可选的实施方式,上述图像处理框架还包括信息索引层。信息索引层用于获取检索信息,并使用检索信息检索上述至少一个第一处理结果,得到第五处理结果。As an optional implementation manner, the above-mentioned image processing framework further includes an information index layer. The information index layer is used for acquiring retrieval information, and using the retrieval information to retrieve the at least one first processing result to obtain a fifth processing result.

其中,检索信息可以通过解析待执行的图像处理任务获得,例如信息索引层可以从任务下发层获得待执行图像处理任务进行解析,即可得到检索目标的检索信息。The retrieval information can be obtained by parsing the image processing tasks to be executed. For example, the information index layer can obtain the image processing tasks to be executed from the task delivery layer for analysis, and then the retrieval information of the retrieval target can be obtained.

例如,待执行图像任务为:从至少一张第一待处理图像中确定与参考行人属性匹配的图像。信息索引层获取到的检索信息为参考行人属性,该参考行人属性为:白色上衣、黑色裤子、白色帽子。信息索引层使用参考行人属性检索至少一个第一处理结果,得到具有与参考行人属性匹配的第五处理结果,作为该待执行图像任务的第二处理结果。For example, the image task to be executed is: determining an image matching the attribute of the reference pedestrian from at least one first image to be processed. The retrieval information obtained by the information index layer is the reference pedestrian attribute, and the reference pedestrian attribute is: white shirt, black pants, and white hat. The information indexing layer retrieves at least one first processing result using the reference pedestrian attribute, and obtains a fifth processing result matching the reference pedestrian attribute as the second processing result of the image task to be executed.

又例如,至少一张第一待处理图像包括A区域的图像,待执行图像任务为:从A区域的图像中确定与参考行人属性匹配的图像。信息索引层获取到的参考行人属性为:白色上衣、黑色裤子、白色帽子。依据任务下发层获取到的待执行图像任务,可从至少一个第一处理结果中选取依据A区域的图像得到的处理结果,得到待选处理结果。信息索引层使用参考行人属性检索待选处理结果,得到具有与参考行人属性匹配的第五处理结果,作为该待执行图像任务的第二处理结果。For another example, the at least one first image to be processed includes an image in area A, and the image task to be executed is: determining an image matching the attribute of the reference pedestrian from the image in area A. The reference pedestrian attributes obtained by the information index layer are: white shirt, black pants, and white hat. According to the to-be-executed image task obtained by the task delivery layer, the processing result obtained according to the image of the A area may be selected from at least one first processing result to obtain the processing result to be selected. The information index layer uses the reference pedestrian attribute to retrieve the candidate processing result, and obtains a fifth processing result matching the reference pedestrian attribute as the second processing result of the to-be-executed image task.

请参阅图3,图3为本申请实施例提供步骤204的一种可能实现的方式的流程示意图。Please refer to FIG. 3 , which is a schematic flowchart of a possible implementation manner of step 204 provided in this embodiment of the present application.

301、将图像数据存储于图像数据存储模块,将非图像数据存储于非图像数据存储模块。301. Store image data in an image data storage module, and store non-image data in a non-image data storage module.

本申请实施例中,存储层包括图像数据存储模块和非图像数据存储模块;至少一个第一处理结果包括图像数据和非图像数据。图像数据包括图片和视频流。非图像数据包括除图像数据之外的数据,非图像数据包括以下至少一种:人物属性、车辆属性、物体属性、第一待处理图像中对象的识别结果(包括:车辆是否违章停车、是否佩戴安全帽、是否有行人摔倒、是否有烟雾、是否有明火)、第一待处理图像的特征向量、人物在第一待处理图像中的位置。In this embodiment of the present application, the storage layer includes an image data storage module and a non-image data storage module; at least one first processing result includes image data and non-image data. Image data includes pictures and video streams. The non-image data includes data other than image data, and the non-image data includes at least one of the following: character attributes, vehicle attributes, object attributes, and the recognition result of the object in the first image to be processed (including: whether the vehicle is parked illegally, whether the vehicle is worn safety helmet, whether a pedestrian has fallen, whether there is smoke, whether there is an open flame), the feature vector of the first image to be processed, and the position of the person in the first image to be processed.

通过对至少一张第一待处理图像进行处理,可得到非图像数据,而在实际应用中,不仅需要使用非图像数据,可能还需使用图像数据,例如,基于图像处理框架开发了一个人物属性提取软件,可用于提取人物属性。使用该人物属性提取软件对从A地的监控摄像头获取到的图像进行处理,可得到A地图像中的人物属性。现A地发生抢劫案,据现场目击证人提供的信息,犯罪嫌疑人身着黑色上衣、黑色裤子、白色鞋子,且该嫌疑人戴口罩,留一头黑色短发。警方在获知犯罪嫌疑人的属性(即黑色上衣、黑色裤子、白色鞋子、戴口罩、黑色短发)后,可使用犯罪嫌疑人的属性检索A地图像中的人物属性,得到具有与犯罪嫌疑人的属性匹配的人物属性的图像,作为目标图像。在警方确定目标图像中的人物为犯罪嫌疑人的情况下,可依据目标图像的采集时间和目标图像的采集地点,确定犯罪嫌疑人的行踪。By processing at least one first image to be processed, non-image data can be obtained. In practical applications, not only non-image data but also image data may be used. For example, a character attribute is developed based on the image processing framework. Extraction software that can be used to extract character attributes. Using the human attribute extraction software to process the image obtained from the surveillance camera in place A, the human attribute in the image of place A can be obtained. There is a robbery in place A. According to the information provided by witnesses at the scene, the suspect was wearing a black shirt, black pants, and white shoes. The suspect wore a mask and had short black hair. After the police know the attributes of the criminal suspect (i.e. black shirt, black pants, white shoes, wearing a mask, short black hair), they can use the attributes of the criminal suspect to retrieve the attributes of the characters in the image of location A, and get the attributes that are related to the criminal suspect. The image of the attributes of the person whose attributes match, as the target image. When the police determine that the person in the target image is the criminal suspect, the whereabouts of the criminal suspect can be determined according to the collection time of the target image and the collection location of the target image.

因此,不仅需要对非图像数据进行存储,还需对图像数据进行存储。本申请实施例中,存储层包括非图像数据存储模块和图像数据存储模块,其中,非图像数据存储模块用于存储非图像数据,图像数据存储模块用于存储图像数据。可选的,非图像数据存储模块包括以下至少一种组件:信息存储组件(kafka)、文件存储组件(seaweeds)、分布式存储组件(minio)、本地文件存储组件(local-FS)、数据库存储组件(cassandra)。图像数据存储模块包括:图像存储组件(open scene graph,OSG)。Therefore, not only non-image data but also image data need to be stored. In the embodiment of the present application, the storage layer includes a non-image data storage module and an image data storage module, wherein the non-image data storage module is used to store non-image data, and the image data storage module is used to store image data. Optionally, the non-image data storage module includes at least one of the following components: an information storage component (kafka), a file storage component (seaweeds), a distributed storage component (minio), a local file storage component (local-FS), a database storage component Components (cassandra). The image data storage module includes: an image storage component (open scene graph, OSG).

例如,第一待处理图像包含第一车辆,使用车辆属性提取模型对第一待处理图像进行车辆属性提取处理,得到第一车辆的属性(如:白色、三厢),则第一处理结果包括第一车辆的属性和第一待处理图像。在存储第一处理结果的过程中,可将第一车辆的属性存储至非图像数据存储模块,将第一待处理图像存储至图像数据存储模块。For example, the first image to be processed contains the first vehicle, and the vehicle attribute extraction process is performed on the first image to be processed by using the vehicle attribute extraction model to obtain the attributes of the first vehicle (eg, white, sedan), and the first processing result includes The attributes of the first vehicle and the first image to be processed. In the process of storing the first processing result, the attributes of the first vehicle may be stored in the non-image data storage module, and the first image to be processed may be stored in the image data storage module.

又例如,假设至少一张第一待处理图像包括图像a和图像b,图像a和图像b均包含第二车辆,使用违章停车监测模型对包括图像a和图像b进行处理,得到的识别结果为:第二车辆违章停车,则基于图像a和图像b得到的第一处理结果包括:图像a、图像b、第二车辆违章停车。在存储第一处理结果的过程中,可将第二车辆违章停车存储至非图像数据存储模块,将图像a和图像b存储至图像数据存储模块。For another example, assuming that at least one first image to be processed includes image a and image b, both image a and image b include the second vehicle, and the illegal parking monitoring model is used to process image a and image b, the obtained recognition result is: : the second vehicle is illegally parked, then the first processing result obtained based on the image a and the image b includes: the image a, the image b, and the second vehicle illegally parked. In the process of storing the first processing result, the illegal parking of the second vehicle may be stored in the non-image data storage module, and the image a and the image b may be stored in the image data storage module.

通过将图像数据和非图像数据分开存储,有利于对至少一个第一处理结果的管理,以及后续对至少一个第一处理结果的处理。By storing the image data and the non-image data separately, the management of the at least one first processing result and the subsequent processing of the at least one first processing result are facilitated.

302、通过将上述非图像数据作为上述图像数据的索引款目,在上述图像数据和上述非图像数据之间建立索引。302. Establish an index between the above-mentioned image data and the above-mentioned non-image data by using the above-mentioned non-image data as an index entry of the above-mentioned image data.

通过将上述非图像数据作为上述图像数据的索引款目,在上述图像数据和上述非图像数据之间建立索引,可通过非图像数据存储模块中的非图像数据快速查找图像数据存储模块中的图像。By taking the above non-image data as the index entry of the above image data, and establishing an index between the above image data and the above non-image data, the image in the image data storage module can be quickly searched through the non-image data in the non-image data storage module .

如上所述,使用计算机视觉模型对至少一张第一待处理图像进行处理,得到的第一处理结果包括以下至少一种数据:人物属性、特征向量、动作识别结果(如是否摔倒)。对计算机视觉模型而言,获得不同的数据所需的图像的数量不同,例如,使用人物属性提取模型对一张第一待处理图像进行处理可得到人物属性,而通过动作识别模型得到动作识别结果需要至少两张第一待处理图像。可选的,依据所需的图像的数量可将计算机视觉模型分为图片处理模型和视频处理模型,依据所需的图像的数量还可将图像处理任务分为图片处理任务和视频处理任务,其中,图片处理模型和图片处理任务所需的图像的数量大于或等于1,视频处理模型和视频处理任务所需的图像的数量大于或等于2。例如,使用人脸识别模型对一张人脸图像进行处理,可得到该人脸图像的人物属性,则用于获得人物属性的人脸识别模型为图片处理模型,人物属性提取为图片处理任务。使用摔倒监测模型对至少两张图像进行处理,可确定至少两张图像中的人物是否摔倒,则用于监测人物是否摔倒的摔倒监测模型为视频处理模型,摔倒监测为视频处理任务。As described above, the computer vision model is used to process at least one first image to be processed, and the obtained first processing result includes at least one of the following data: character attributes, feature vectors, and action recognition results (such as whether to fall). For computer vision models, the number of images required to obtain different data is different. For example, using the character attribute extraction model to process a first image to be processed can obtain character attributes, and using the action recognition model to obtain the action recognition result. At least two first images to be processed are required. Optionally, computer vision models can be divided into image processing models and video processing models according to the number of required images, and image processing tasks can also be divided into image processing tasks and video processing tasks according to the number of required images. , the number of images required by the image processing model and the image processing task is greater than or equal to 1, and the number of images required by the video processing model and the video processing task is greater than or equal to 2. For example, using a face recognition model to process a face image can obtain the character attributes of the face image, then the face recognition model used to obtain the character attributes is a picture processing model, and the character attribute extraction is a picture processing task. Use the fall detection model to process at least two images to determine whether the person in the at least two images falls down, then the fall detection model used to monitor whether the person falls is a video processing model, and the fall detection is video processing Task.

在实际应用中,所需执行的图像处理任务可能既包括图片处理任务又包括视频处理任务,因此如何依据视图处理任务的类别对获取到的第一待处理图像进行相应的处理,具有重要的意义。请参阅图4,图4是本申请实施例提供的步骤203的一种可能实现的方式的流程示意图。In practical applications, the image processing tasks to be performed may include both picture processing tasks and video processing tasks. Therefore, it is of great significance to perform corresponding processing on the first acquired image to be processed according to the category of the view processing task. . Please refer to FIG. 4. FIG. 4 is a schematic flowchart of a possible implementation manner of step 203 provided by an embodiment of the present application.

401、在上述第一待处理图像的数量大于或等于2,且接收到执行图片处理指令和执行视频处理指令的情况下,依据上述执行图片处理指令,从上述至少两张第一待处理图像中选取至少一张第二待处理图像。401. In the case where the number of the above-mentioned first images to be processed is greater than or equal to 2, and the execution of the picture processing instruction and the execution of the video processing instruction are received, according to the above-mentioned execution of the picture processing instruction, from the at least two first images to be processed. Select at least one second image to be processed.

在本申请实施例中,视图处理层包括图片处理模块和视频处理模块,其中,图片处理模块包括图片处理模型,视频处理模块包括视频处理模型,即使用图片处理模块对一张图像进行处理可得到一个处理结果,使用视频处理模块对至少两张图像进行处理可得到一个处理结果。In this embodiment of the present application, the view processing layer includes a picture processing module and a video processing module, wherein the picture processing module includes a picture processing model, and the video processing module includes a video processing model, that is, using the picture processing module to process an image can obtain For a processing result, a processing result can be obtained by using the video processing module to process at least two images.

上述图片处理指令用于指示图像处理装置执行图片处理任务。可选的,图片处理指令携带以下信息:所需执行的图片处理任务、所需处理的图像。例如,图像处理装置获取到的至少一张第一待处理图像包括:图像a、图像b,图片处理指令携带的信息包括对图像a进行人物属性提取处理。又例如,图像处理装置与摄像头A之间具有通信连接,图像处理装置与摄像头B之间也具有通信连接,将从摄像头A中获取到的图像和摄像头B中获取到的图像均为第一待处理图像。图片处理指令携带的信息包括对从摄像头A获取到的图像进行人物属性提取处理。The above picture processing instruction is used to instruct the image processing apparatus to perform the picture processing task. Optionally, the picture processing instruction carries the following information: the picture processing task to be executed and the image to be processed. For example, the at least one first image to be processed obtained by the image processing apparatus includes: image a and image b, and the information carried by the image processing instruction includes performing a character attribute extraction process on image a. For another example, there is a communication connection between the image processing device and the camera A, and there is also a communication connection between the image processing device and the camera B, and the image obtained from the camera A and the image obtained from the camera B are the first to be Process images. The information carried by the image processing instruction includes performing human attribute extraction processing on the image obtained from the camera A.

上述视频处理指令用于指示图像处理装置执行视频处理任务。可选的,视频处理指令携带以下信息:所需执行的视频处理任务、所需处理的图像。例如,图像处理装置获取到的至少一张第一待处理图像包括:图像a、图像b、图像c,图片处理指令携带的信息包括对图像a和图像b进行摔倒监测处理。又例如,图像处理装置与摄像头A之间具有通信连接,图像处理装置与摄像头B之间也具有通信连接,将从摄像头A中获取到的图像和摄像头B中获取到的图像均为第一待处理图像。图片处理指令携带的信息包括对从摄像头A获取到的至少两张图像进行摔倒监测处理。The above video processing instructions are used to instruct the image processing apparatus to perform video processing tasks. Optionally, the video processing instruction carries the following information: the video processing task to be executed, and the image to be processed. For example, the at least one first image to be processed obtained by the image processing apparatus includes: image a, image b, and image c, and the information carried by the image processing instruction includes performing fall monitoring processing on image a and image b. For another example, there is a communication connection between the image processing device and the camera A, and there is also a communication connection between the image processing device and the camera B, and the image obtained from the camera A and the image obtained from the camera B are the first to be Process images. The information carried by the image processing instruction includes performing fall detection processing on at least two images acquired from the camera A.

图像处理装置接收到图片处理指令和视频处理指令,表征图像处理装置既需要执行图片处理任务又需要执行视频处理任务。在执行图片处理任务之前,需要从至少两张第一待处理图像中确定执行图片处理任务所需的图像。在图像处理框架中,依据图片处理指令从至少两张第一待处理图像中选取至少一张图像,作为至少一张第二待处理图像,用于执行图片处理任务。The image processing apparatus receives the picture processing instruction and the video processing instruction, indicating that the image processing apparatus needs to perform both the picture processing task and the video processing task. Before performing the picture processing task, it is necessary to determine the images required to perform the picture processing task from at least two first images to be processed. In the image processing framework, at least one image is selected from the at least two first images to be processed according to the image processing instruction, as at least one second image to be processed, for performing the image processing task.

402、使用上述图片处理模块对上述至少一张第二待处理图像进行处理,得到至少一个第三处理结果。402. Use the image processing module to process the at least one second image to be processed to obtain at least one third processing result.

使用图片处理模块对一张第二待处理图像进行处理,可得到一个第三处理结果。Using the image processing module to process a second image to be processed, a third processing result can be obtained.

例如,假设至少一张第二待处理图像包括:图像a和图像b,图片处理模块包括人物属性提取模型。使用图片处理模块对图像a进行处理,得到第三处理结果A,其中,第三处理结果A包括:白色上衣、黑色裤子、黄色长头发。使用图片处理模块对图像b进行处理,得到第三处理结果B,其中,第三处理结果B包括:黑色上衣、蓝色裤子、黄色长头发。For example, it is assumed that at least one second image to be processed includes: image a and image b, and the image processing module includes a character attribute extraction model. The image a is processed by the image processing module to obtain a third processing result A, wherein the third processing result A includes: a white shirt, black pants, and long yellow hair. The image b is processed by the image processing module to obtain a third processing result B, wherein the third processing result B includes: a black top, blue pants, and long yellow hair.

403、依据上述执行视频处理指令,从上述至少两张第一待处理图像中选取至少两张第三待处理图像。403. Select at least two third images to be processed from the at least two first images to be processed according to the above execution video processing instruction.

在执行图片处理任务之前,需要从至少两张第一待处理图像中确定执行视频处理任务所需的图像。在图像处理框架中,依据视频处理指令从至少两张第一待处理图像中选取至少两张图像,作为至少两张第三待处理图像,用于执行视频处理任务。Before performing the picture processing task, the images required to perform the video processing task need to be determined from at least two first images to be processed. In the image processing framework, at least two images are selected from the at least two first images to be processed according to the video processing instructions, as at least two third images to be processed, for performing video processing tasks.

可理解的是,至少两张第一待处理图像中的某张图像既可以是第二待处理图像也可以是第三待处理图像。例如,至少两张第一待处理图像包括:图像a、图像b、图像c。依据图片处理任务指令从至少两张第一待处理图像中确定的至少一张第二待处理图像包括图像a,依据视频处理任务指令从至少两张第一待处理图像中确定的至少两张第三待处理图像包括图像a和图像b,此时,图像a既是第二待处理图像也是第三待处理图像。It is understandable that one of the at least two first images to be processed may be either the second image to be processed or the third image to be processed. For example, the at least two first images to be processed include: image a, image b, and image c. At least one second to-be-processed image determined from the at least two first to-be-processed images according to the picture processing task instruction includes image a, and at least two second to-be-processed images determined from the at least two first to-be-processed images according to the video processing task instruction The three images to be processed include image a and image b. At this time, image a is both the second image to be processed and the third image to be processed.

404、使用上述视频处理模块对上述至少两张第三待处理图像进行处理,得到至少一个第四处理结果。404. Use the video processing module to process the at least two third images to be processed to obtain at least one fourth processing result.

使用视频处理模块对至少两张第三待处理图像进行处理,可得到一个第四处理结果。A fourth processing result can be obtained by processing at least two third images to be processed by using the video processing module.

例如,假设:至少一张第三待处理图像包括:图像a、图像b、图像c,视频处理模块包括摔倒监测模型。使用视频处理模块对图像a和图像b进行处理,得到第四处理结果A,其中,第四处理结果A包括:图像a和图像b中包含的人物未摔倒。使用视频处理模块对图像b和图像c进行处理,得到第四处理结果B,其中,第四处理结果B包括:图像b和图像c中包含的人物已摔倒。使用视频处理模块对图像a、图像b和图像c进行处理,得到第四处理结果C,其中,图像a、图像b和图像c均包含同一个人物,第四处理结果C包括:该人物摔倒。For example, it is assumed that at least one third image to be processed includes: image a, image b, and image c, and the video processing module includes a fall monitoring model. The image a and the image b are processed by the video processing module, and a fourth processing result A is obtained, wherein the fourth processing result A includes: the characters included in the image a and the image b have not fallen. The image b and the image c are processed by the video processing module, and a fourth processing result B is obtained, wherein the fourth processing result B includes: the person included in the image b and the image c has fallen. Use the video processing module to process the image a, the image b and the image c to obtain a fourth processing result C, wherein the image a, the image b and the image c all contain the same person, and the fourth processing result C includes: the person falls .

405、依据上述至少一个第三处理结果和上述至少一个第四处理结果,得到上述至少一个第一处理结果。405. Obtain the at least one first processing result according to the at least one third processing result and the at least one fourth processing result.

本申请实施例中,图片处理模块对至少一张第二待处理图像的处理与视频处理模块对至少两张第三待处理图像的处理,是两个独立的过程。通过图片处理模块得到的至少一个第三处理结果和通过视频处理模块得到的至少一个第四处理结果,均为视图处理层得到的处理结果,即至少一个第一处理结果包括至少一个第三处理结果和至少一个第四处理结果。In the embodiment of the present application, the processing of the at least one second image to be processed by the picture processing module and the processing of the at least two third images to be processed by the video processing module are two independent processes. At least one third processing result obtained by the picture processing module and at least one fourth processing result obtained by the video processing module are both processing results obtained by the view processing layer, that is, at least one first processing result includes at least one third processing result and at least one fourth processing result.

在一种可能实现的方式中,将至少一个第三处理结果和至少一个第四处理结果,作为至少一个第一处理结果。例如,至少一个第三处理结果包括第三处理结果a和第三处理结果b,至少一个第四处理结果包括第四处理结果c和第四处理结果d,则至少一个第一处理结果包括:第三处理结果a、第三处理结果b、第四处理结果c、第四处理结果d。In a possible implementation manner, at least one third processing result and at least one fourth processing result are used as at least one first processing result. For example, if at least one third processing result includes third processing result a and third processing result b, and at least one fourth processing result includes fourth processing result c and fourth processing result d, then at least one first processing result includes: Three processing results a, third processing results b, fourth processing results c, and fourth processing results d.

在另一种可能实现的方式中,对至少一个第三处理结果和至少一个第四处理结果进行划分,得到至少一个第一处理结果。例如,至少一个第三处理结果包括第三处理结果a和第三处理结果b,至少一个第四处理结果包括第四处理结果c和第四处理结果d,其中,第三处理结果a的时间戳和第四处理结果c的时间戳相同,第三处理结果b的时间戳和第四处理结果d的时间戳相同。将第三处理结果a和第四处理结果c,作为第一处理结果e。将第三处理结果b和第四处理结果d,作为第一处理结果f。至少一个第一处理结果包括:第一处理结果e和第一处理结果f。In another possible implementation manner, at least one third processing result and at least one fourth processing result are divided to obtain at least one first processing result. For example, at least one third processing result includes a third processing result a and a third processing result b, and at least one fourth processing result includes a fourth processing result c and a fourth processing result d, wherein the timestamp of the third processing result a The timestamp of the fourth processing result c is the same as that of the fourth processing result c, and the timestamp of the third processing result b is the same as the timestamp of the fourth processing result d. The third processing result a and the fourth processing result c are taken as the first processing result e. The third processing result b and the fourth processing result d are taken as the first processing result f. The at least one first processing result includes: a first processing result e and a first processing result f.

由于在图像处理框架中,图片处理模块对至少一张第二待处理图像的处理和视频处理模块对至少两张第三待处理图像的处理,是两个独立的过程,基于图像处理框架开发的软件既可用于执行图片处理任务,又可用于执行视频处理任务,还可用于同时执行图片处理任务和视频处理任务。In the image processing framework, the processing of at least one second image to be processed by the image processing module and the processing of at least two third images to be processed by the video processing module are two independent processes, developed based on the image processing framework. The software can be used to perform both picture processing tasks and video processing tasks, and can also be used to perform picture processing tasks and video processing tasks at the same time.

例如,A公司开发了一个人物属性提取软件,用于提取图像中的人物属性。现A公司想开发一个摔倒监测软件,用于监测手扶电梯处是否有行人摔倒。假设人物属性提取软件基于图像处理框架开发得到,则在人物属性提取软件中,人物属性提取模型处于图片处理模块内,现通过在人物属性提取软件的视频处理模块中添加摔倒监测模型,并将从用于监控手扶电梯的摄像头获取到的图像输入至摔倒监测模型,即可得到一个既可用于提取人物属性、又可用于监测手扶电梯处是否有行人摔倒的软件。For example, Company A has developed a human attribute extraction software for extracting human attributes in images. Now Company A wants to develop a fall detection software to detect whether a pedestrian falls at the escalator. Assuming that the character attribute extraction software is developed based on the image processing framework, in the character attribute extraction software, the character attribute extraction model is located in the image processing module. From the image input of the camera used to monitor the escalator to the fall detection model, a software can be obtained that can not only be used to extract human attributes, but also can be used to detect whether a pedestrian falls at the escalator.

又例如,A公司开发了一个既可用于提取人物属性、又可用于监测手扶电梯处是否有行人摔倒的软件(下文将称为第一软件)。现B公司想从A公司购买一个用于监测手扶电梯处是否有行人摔倒的软件。虽然第一软件可用于监测手扶电梯处是否有行人摔倒的软件,但第一软件还包含了提取人物属性所需的人物属性提取模型,而提取人物属性所需的功能模块对B公司而言是多余的,因此需要将第一软件中的人物属性提取模型去除。假设第一软件基于图像处理框架开发得到,则在第一软件中,人物属性提取模型处于图片处理模块内,摔倒监测模型处于视频处理模块内,现通过将图片处理模块内的人物属性提取模型删除,即可得到一个用于监测手扶电梯处是否有行人摔倒的软件。For another example, Company A has developed a software (hereinafter referred to as the first software) that can be used not only for extracting person attributes, but also for monitoring whether a pedestrian falls at the escalator. Now Company B wants to purchase a software from Company A for detecting whether a pedestrian falls at the escalator. Although the first software can be used to monitor whether a pedestrian falls at the escalator, the first software also includes a character attribute extraction model required for extracting character attributes, and the functional modules required for extracting character attributes are very important to Company B. The language is redundant, so it is necessary to remove the character attribute extraction model in the first software. Assuming that the first software is developed based on the image processing framework, in the first software, the human attribute extraction model is located in the image processing module, and the fall detection model is located in the video processing module. Delete it, and you can get a software for monitoring whether a pedestrian falls at the escalator.

从上述两个示例中可以看出,由于图片处理模块与视频处理模块为相互独立的两个模块,图像处理框架还可提高开发人员的开发效率。As can be seen from the above two examples, since the picture processing module and the video processing module are two independent modules, the image processing framework can also improve the development efficiency of developers.

请参阅图5,图5为本申请实施例提供的步骤402的一种可能实现的方式的流程示意图。Please refer to FIG. 5 , which is a schematic flowchart of a possible implementation manner of step 402 provided by an embodiment of the present application.

501、获取第四待处理图像。501. Acquire a fourth image to be processed.

本申请实施例中的第四待处理图像为至少一张第二待处理图像中的一张图像,获取第四待处理图像的实现方式可参见步骤201,此处将不再赘述。The fourth image to be processed in the embodiment of the present application is one image in the at least one second image to be processed. For an implementation manner of acquiring the fourth image to be processed, reference may be made to step 201, which will not be repeated here.

502、使用上述图片处理模块对上述第四待处理图像进行对象检测处理,得到第一对象在上述第四待处理图像中的位置。502. Use the image processing module to perform object detection processing on the fourth image to be processed, to obtain the position of the first object in the fourth image to be processed.

本申请实施例中,第一对象属于第四待处理图像。例如,第四待处理图像包括一辆车,则该辆车为第一对象。又例如,第四待处理图像包括一个人,则这个人为第一对象。再例如,第四待处理图像包括一个人和一辆车,第一对象可以是人和车中的一个。In this embodiment of the present application, the first object belongs to the fourth image to be processed. For example, if the fourth image to be processed includes a car, the car is the first object. For another example, if the fourth image to be processed includes a person, the person is the first object. For another example, the fourth image to be processed includes a person and a car, and the first object may be one of the person and the car.

本申请实施例中,通过对第四待处理图像进行对象检测处理,可确定第四待处理图像中是否包含对象。在第四待处理图像中包含对象的情况下,可得到对象在第四待处理图像中的位置。上述位置可以是包含对象的对象框的任意一对对角在像素坐标系下的坐标,或者是包含对象的对象框中心和其中一个对角在像素坐标系下的坐标。In this embodiment of the present application, by performing object detection processing on the fourth image to be processed, it can be determined whether the fourth image to be processed contains an object. When the fourth image to be processed contains an object, the position of the object in the fourth image to be processed can be obtained. The above position may be the coordinates of any pair of diagonal corners of the object frame containing the object in the pixel coordinate system, or the coordinates of the center of the object frame containing the object and one of the diagonal corners in the pixel coordinate system.

在一种可能实现的方式中,图片处理模块包括卷积神经网络,对第四待处理图像进行对象检测处理可通过卷积神经网络实现。通过将多张带有标注信息的图像作为训练数据,对卷积神经网络进行训练,使训练后的卷积神经网络可完成对图像的对象检测处理。训练数据中的图像的标注信息为对象以及对象的位置。在使用训练数据对卷积神经网络进行训练的过程中,卷积神经网络从图像中提取出图像的特征数据,并依据特征数据确定图像中是否有对象,在图像中有对象的情况下,依据图像的特征数据得到对象的位置。以标注信息为监督信息监督卷积神经网络在训练过程中得到的结果,并更新卷积神经网络的参数,完成对卷积神经网络的训练。这样,可使用训练后的卷积神经网络对第四待处理图像进行处理,以得到第一对象在第四待处理图像中的位置。In a possible implementation manner, the image processing module includes a convolutional neural network, and the object detection processing on the fourth image to be processed may be implemented by a convolutional neural network. By using multiple images with annotation information as training data, the convolutional neural network is trained, so that the trained convolutional neural network can complete the object detection processing on the image. The annotation information of the images in the training data is the object and the position of the object. In the process of using the training data to train the convolutional neural network, the convolutional neural network extracts the characteristic data of the image from the image, and determines whether there is an object in the image according to the characteristic data. The feature data of the image gets the position of the object. The annotation information is used as the supervision information to supervise the results obtained by the convolutional neural network in the training process, and the parameters of the convolutional neural network are updated to complete the training of the convolutional neural network. In this way, the trained convolutional neural network can be used to process the fourth image to be processed to obtain the position of the first object in the fourth image to be processed.

在另一种可能实现的方式中,图片处理模块包括对象检测处理算法,对象检测处理可通过对象检测算法实现。可选的,上述对象检测处理可通过以下算法中的一种实现:只需一眼算法(you only look once,YOLO)、目标检测算法(deformable part model,DMP)、单张图像多目标检测算法(single shot multiBox detector,SSD)、Faster-RCNN算法等等,本申请对实现对象检测处理的对象检测算法不做具体限定。In another possible implementation manner, the image processing module includes an object detection processing algorithm, and the object detection processing can be implemented by the object detection algorithm. Optionally, the above-mentioned object detection processing can be implemented by one of the following algorithms: you only look once algorithm (you only look once, YOLO), target detection algorithm (deformable part model, DMP), single image multi-target detection algorithm ( single shot multiBox detector, SSD), Faster-RCNN algorithm, etc. This application does not specifically limit the object detection algorithm for implementing object detection processing.

503、从上述第四待处理图像中截取由上述位置确定的像素区域,得到对象图像。503. Intercept the pixel area determined by the foregoing position from the foregoing fourth image to be processed to obtain an object image.

在一种可能的实现方式中,根据第一对象在第四待处理图像中的位置,在第四待处理图像中确定相应的像素区域,并从第四待处理图像中截取该像素区域,得到包含第一对象的对象图像。可选的,上述像素区域的形状可以是任意形状,如:矩形、圆形、菱形,本申请对上述像素区域的形状不做限定。In a possible implementation manner, according to the position of the first object in the fourth image to be processed, a corresponding pixel area is determined in the fourth image to be processed, and the pixel area is intercepted from the fourth image to be processed to obtain An object image containing the first object. Optionally, the shape of the above-mentioned pixel area may be any shape, such as a rectangle, a circle, and a rhombus, and the present application does not limit the shape of the above-mentioned pixel area.

需要理解的是,每张对象图像均只包含一个对象,在第四待处理图像包含多个对象的情况下,将获得多张对象图像,例如,第四待处理图像包含人物A和人物B,通过对第四待处理图像进行处理,可得到包含人物A的对象图像和包含人物B的对象图像。It should be understood that each object image contains only one object. In the case where the fourth image to be processed contains multiple objects, multiple object images will be obtained. For example, the fourth image to be processed contains person A and person B, By processing the fourth image to be processed, an object image including person A and an object image including person B can be obtained.

504、使用图片处理模块对上述对象图像进行属性提取处理,得到上述第一对象的属性。504. Use an image processing module to perform attribute extraction processing on the object image to obtain the attribute of the first object.

其中,图片处理模块包括属性提取模型,使用属性提取模型对对象图像进行属性提取处理,可得到第一对像的属性。例如,属性提取模型可以是人物属性提取模型,使用人物属性提取模型对对象图像进行属性提取处理,可得到第一对象的人物属性。又例如,属性提取模型可以是车辆属性提取模型,使用车辆属性提取模型对对象图像进行属性提取处理,可得到第一对象的车辆属性。The image processing module includes an attribute extraction model, and the attribute extraction process is performed on the object image by using the attribute extraction model to obtain the attribute of the first object. For example, the attribute extraction model may be a character attribute extraction model, and the attribute extraction process is performed on the object image by using the character attribute extraction model to obtain the character attribute of the first object. For another example, the attribute extraction model may be a vehicle attribute extraction model, and the vehicle attribute of the first object can be obtained by performing attribute extraction processing on the object image by using the vehicle attribute extraction model.

由于对象图像包含的数据量小于第四待处理图像包含的数据量,对对象图像进行属性提取处理带来的数据处理量小于对第四待处理图像进行属性提取处理带来的数据处理量,从而通过对对象图像进行属性提取处理得到第一对象的属性,可减小数据处理量、提高处理速度。Since the amount of data contained in the object image is smaller than the amount of data contained in the fourth image to be processed, the amount of data processing brought by the attribute extraction processing on the object image is smaller than the amount of data processing caused by the attribute extraction processing on the fourth image to be processed. The attributes of the first object are obtained by performing attribute extraction processing on the object image, which can reduce the amount of data processing and improve the processing speed.

为提高社会治安管控能力,维护良好社会治安环境,越来越多的地方布置了监控摄像头,相关人员在需要找寻目标对象时,可根据该目标对象的属性从布置在不同位置的监控摄像头采集的图像中确定该目标对象的行踪。例如,A地发生了抢劫案,案发现场的目击证人向警方提供的嫌疑人信息包括:身着黑色上衣、黑色裤子,面戴口罩,留一头黑色的短发。警方可使用依据嫌疑人信息确定的目标属性(即黑色上衣、黑色裤子、面戴口罩、黑色短发)对A地的数据库(该数据库包括:通过A地的监控摄像头采集到的图像、采集到的图像中的人物的属性),得到包含目标对象的图像,作为目标图像。依据目标图像的采集时间和/或采集位置,可确定目标对象的行踪。In order to improve the ability of social security management and control and maintain a good social security environment, surveillance cameras are installed in more and more places. When the relevant personnel need to find the target object, they can collect the data from the surveillance cameras arranged in different locations according to the attributes of the target object. Determine the whereabouts of the target object in the image. For example, there was a robbery in place A, and the information about the suspect provided to the police by witnesses at the crime scene included: wearing a black shirt, black pants, a mask, and short black hair. The police can use the target attributes determined based on the suspect’s information (i.e. black shirt, black pants, face mask, black short hair) to compare the database of place A (the database includes: images collected through surveillance cameras in place A, The attributes of the people in the image), get the image containing the target object, as the target image. According to the acquisition time and/or acquisition location of the target image, the whereabouts of the target object can be determined.

由于第一待处理图像中可能包含多个对象,为方便用户(此处指向图像处理装置输入目标属性的用户)辨认具有与目标属性匹配的属性的对象是否为目标对象,可向用户展示具有与目标属性匹配的属性的对象图像,作为目标对象图像。在用户确定目标对象图像中对象为目标对象是大概率事件的情况下,可进一步展示包含该目标对象图像的第一待处理图像。可选的,至少一个第一处理结果包括对象图像,即图像数据包括上述对象图像和至少一张第一待处理图像。作为一种可选的实施方式,步骤301包括以下步骤:Since the first image to be processed may contain multiple objects, in order to facilitate the user (here, the user who points to the image processing device and input the target attribute) to identify whether the object with the attribute matching the target attribute is the target The object image of the attribute whose target attribute matches, as the target object image. When the user determines that it is a high probability event that the object in the target object image is the target object, the first to-be-processed image including the target object image may be further displayed. Optionally, the at least one first processing result includes an object image, that is, the image data includes the aforementioned object image and at least one first image to be processed. As an optional implementation manner, step 301 includes the following steps:

31、将上述第一对象的属性存储至上述非图像数据存储模块,将上述第四待处理图像、上述对象图像存储至上述图像数据存储模块。31. Store the attributes of the first object in the non-image data storage module, and store the fourth to-be-processed image and the object image in the image data storage module.

作为一种可选的实施方式,步骤302包括以下步骤:As an optional implementation manner, step 302 includes the following steps:

32、通过将上述第一对象的属性作为上述第四待处理图像的索引款目,以及将上述第一对象的属性作为上述对象图像的索引款目,在上述图像数据和上述非图像数据之间建立索引。32. By taking the attribute of the first object as the index entry of the fourth image to be processed, and the attribute of the first object as the index entry of the object image, between the image data and the non-image data Build an index.

通过将第一对象的属性作为第四待处理图像的索引款目,以及将第一对象的属性作为对象图像的索引款目,在上述图像数据和上述非图像数据之间建立索引,可通过存储于非图像数据模块中的第一对象的属性,快速查找存储于图像数据存储模块中的对象图像以及第四待处理图像。By using the attribute of the first object as the index entry of the fourth image to be processed, and using the attribute of the first object as the index entry of the object image, an index is established between the above-mentioned image data and the above-mentioned non-image data, which can be stored by storing Based on the attributes of the first object in the non-image data module, the object image and the fourth to-be-processed image stored in the image data storage module are quickly searched.

作为一种可选的实施方式,步骤201具体包括以下步骤:As an optional implementation manner, step 201 specifically includes the following steps:

21、视图接入层获取至少一张第五待处理图像。21. The view access layer acquires at least one fifth image to be processed.

一种可能的实现方式中,图像处理装置与至少一个成像设备(包括以下至少一种:相机、手机、摄像头)之间通信连接,视图接入层通过该通信连接从至少一个成像设备中获取至少一张图像,作为上述至少一张第五待处理图像。In a possible implementation manner, the image processing apparatus is communicatively connected with at least one imaging device (including at least one of the following: a camera, a mobile phone, and a camera), and the view access layer obtains at least one image from the at least one imaging device through the communication connection. An image as the at least one fifth image to be processed.

22、在上述至少一张第五待处理图像的通信协议与上述图像处理框架所使用的通信协议不同的情况下,将上述至少一张第五待处理图像的通信协议转换成上述图像处理框架所使用的通信协议,得到上述至少一张第一待处理图像。22. If the communication protocol of the at least one fifth image to be processed is different from the communication protocol used by the image processing framework, convert the communication protocol of the at least one fifth image to be processed into the communication protocol of the image processing framework. Using the communication protocol used, the at least one first image to be processed is obtained.

在成像设备所使用的通信协议与图像处理框架所使用的通信协议不同的情况下,图像处理框架无法解析从成像设备获取到的图像,进而无法对该图像进行处理。因此,在成像设备所使用的通信协议与图像处理框架所使用的通信协议不同的情况下,需要对从成像设备获取到的图像的通信协议转换成图像处理框架所使用的通信协议,得到至少一张转换后的图像,作为至少一张第一待处理图像。In the case where the communication protocol used by the imaging device is different from that used by the image processing framework, the image processing framework cannot parse the image acquired from the imaging device, and thus cannot process the image. Therefore, when the communication protocol used by the imaging device is different from the communication protocol used by the image processing framework, it is necessary to convert the communication protocol of the image obtained from the imaging device into the communication protocol used by the image processing framework to obtain at least one The converted images are used as at least one first image to be processed.

例如,A公司基于图像处理框架为B公司开发了一个行人属性提取软件,该行人属性提取软件所使用的通信协议与B公司的监控摄像头所使用的通信协议相同。现C公司也希望A公司为其开发一个行人属性提取软件,但C公司的监控摄像头所使用的通信协议与B公司的监控摄像头所使用的通信协议不同。虽然C公司的监控摄像头所使用的通信协议与行人属性提取软件所使用的通信协议不同,但是在使用行人属性提取软件对从C公司的监控摄像头获取到的图像进行处理的过程中,行人属性提取软件通过对将C公司的监控摄像头获取到的图像的通信协议转换为B公司的监控摄像头所使用的通信协议,可实现对从C公司的监控摄像头获取到的图像的处理。For example, company A developed a pedestrian attribute extraction software for company B based on the image processing framework. The communication protocol used by the pedestrian attribute extraction software is the same as that used by company B's surveillance cameras. Now Company C also wants Company A to develop a pedestrian attribute extraction software for it, but the communication protocol used by Company C's surveillance cameras is different from that used by Company B's surveillance cameras. Although the communication protocol used by the surveillance cameras of Company C is different from that used by the pedestrian attribute extraction software, in the process of using the pedestrian attribute extraction software to process the images obtained from the surveillance cameras of Company C, the pedestrian attribute extraction The software can process the images obtained from the surveillance cameras of Company C by converting the communication protocol of the images obtained by the surveillance cameras of Company C into the communication protocols used by the surveillance cameras of Company B.

在从成像设备获取到的图像的通信协议与图像处理框架所使用的通信协议不同的情况下,通过将获取到的图像的通信协议转换成图像处理框架所使用的通信协议,使基于图像处理框架开发的软件可对从任意成像设备获取到的图像进行处理。In the case where the communication protocol of the image acquired from the imaging device is different from the communication protocol used by the image processing framework, by converting the communication protocol of the acquired image into the communication protocol used by the image processing framework, make the image processing framework based The developed software can process images acquired from any imaging device.

本申请实施例还提供了一种使用基于上述图像处理框架开发的软件执行图像处理任务的实现方式。请参阅图6,图6为本申请实施例提供的另一种图像处理方法的流程示意图。The embodiments of the present application also provide an implementation manner of performing image processing tasks by using software developed based on the above-mentioned image processing framework. Please refer to FIG. 6, which is a schematic flowchart of another image processing method provided by an embodiment of the present application.

601、获取至少一张第一待处理图像和至少一个待执行图像处理任务。601. Acquire at least one first image to be processed and at least one image processing task to be executed.

本步骤中的至少一张第一待处理图像与步骤201中的至少一张第一待处理图像相同,本步骤中的至少一个待执行图像处理任务与步骤202中的至少一个待执行图像处理任务相同。At least one first image to be processed in this step is the same as at least one first image to be processed in step 201 , and at least one image processing task to be executed in this step is the same as at least one image processing task to be executed in step 202 same.

图像处理装置获取至少一张第一待处理图像的实现方式可参见步骤201,图像处理装置获取至少一个待执行图像处理任务的实现方式均可参见步骤202,此处将不再赘述。Refer to step 201 for the implementation manner of the image processing apparatus acquiring at least one first image to be processed, and for the implementation manner of acquiring at least one image processing task to be performed by the image processing apparatus, referring to step 202, which will not be repeated here.

602、对上述至少一张第一待处理图像进行图片处理和/或视频处理,得到至少一个第一处理结果。602. Perform picture processing and/or video processing on the at least one first image to be processed to obtain at least one first processing result.

本申请实施例中,图片处理指对通过对至少一张图像进行处理得到一个处理结果,视频处理指对通过对至少两张图像进行处理得到一个处理结果。In the embodiments of the present application, picture processing refers to obtaining a processing result by processing at least one image, and video processing refers to obtaining a processing result by processing at least two images.

本步骤的实现方式,可参见步骤401~步骤405,此处将不再赘述。For the implementation of this step, reference may be made to steps 401 to 405, which will not be repeated here.

603、存储上述至少一个第一处理结果。603. Store the at least one first processing result.

本步骤的实现方式可参见步骤204,此处将不再赘述。For the implementation of this step, reference may be made to step 204, which will not be repeated here.

604、依据上述至少一个待执行图像处理任务,对存储于上述存储层中的上述至少一个第一处理结果进行处理,得到第二处理结果。604. Process the at least one first processing result stored in the storage layer according to the at least one image processing task to be executed to obtain a second processing result.

本步骤的实现方式可参见步骤205,此处将不再赘述。For the implementation of this step, reference may be made to step 205, which will not be repeated here.

可选的,本申请实施例还提供了一种构建图像处理框架的方法,该方法包括以下步骤:Optionally, an embodiment of the present application further provides a method for constructing an image processing framework, the method comprising the following steps:

61、获取上述至少一个待执行图像处理任务和待处理框架,其中,上述待处理框架包括视图处理层、存储层、任务下发层。61. Obtain the at least one image processing task to be executed and a frame to be processed, wherein the frame to be processed includes a view processing layer, a storage layer, and a task delivery layer.

本申请实施例中,待处理框架的架构与图像处理框架的架构相同。可选的,待处理框架的架构可参见图1。In this embodiment of the present application, the architecture of the frame to be processed is the same as the architecture of the image processing frame. Optionally, refer to FIG. 1 for the architecture of the frame to be processed.

62、在通过上述任务下发层获取到上述至少一个待执行图像处理任务的情况下,获取与上述至少一个待执行图像处理任务匹配的图片处理模块和/或视频处理模块。62. When the at least one image processing task to be executed is obtained through the task delivery layer, obtain a picture processing module and/or video processing module matching the at least one image processing task to be executed.

上述图片处理模块用于实现图片处理,上述视频处理模块用于实现视频处理。与至少一个待执行图像处理任务匹配的图片处理模块和/或视频处理模块指,图片处理模块和/或视频处理模块可用于执行至少一个待执行图像处理任务。例如,至少一个待执行图像处理任务包括:人脸识别。与至少一个待执行图像处理任务匹配的图片处理模块和/或视频处理模块包括:人脸识别模型。又例如,至少一个待执行图像处理任务包括:摔倒监测。与至少一个待执行图像处理任务匹配的图片处理模块和/或视频处理模块包括:摔倒监测模型。再例如,至少一个待执行图像处理任务包括:人脸识别和摔倒监测。与至少一个待执行图像处理任务匹配的图片处理模块和/或视频处理模块包括:人脸识别模型和摔倒监测模型。The above picture processing module is used for image processing, and the above video processing module is used for video processing. The picture processing module and/or video processing module matched with the at least one image processing task to be executed means that the picture processing module and/or the video processing module can be used to execute the at least one image processing task to be executed. For example, the at least one image processing task to be performed includes: face recognition. The picture processing module and/or video processing module matched with at least one image processing task to be performed includes: a face recognition model. For another example, the at least one image processing task to be performed includes: fall detection. The picture processing module and/or video processing module matched with at least one image processing task to be executed includes: a fall detection model. For another example, the at least one image processing task to be performed includes: face recognition and fall detection. The picture processing module and/or video processing module matched with at least one image processing task to be performed includes: a face recognition model and a fall detection model.

在一种可能实现的方式中,在图像处理装置通过任务下发层获取到至少一个待执行图像处理任务的情况下,图像处理装置输出至少一个待执行图像处理任务的信息,以便用户依据至少一个待执行图像处理任务的信息,选取与至少一个待执行图像处理任务匹配的图片处理模块和/或视频处理模块。图像处理装置将用户针对至少一个待执行图像处理任务的信息输入的图片处理模块和/或视频处理模块,作为与至少一个待执行图像处理任务匹配的图片处理模块和/或视频处理模块。In a possible implementation manner, when the image processing apparatus obtains at least one image processing task to be executed through the task delivery layer, the image processing apparatus outputs the information of the at least one image processing task to be executed, so that the user can rely on the at least one image processing task. For the information of the image processing task to be executed, select the picture processing module and/or video processing module matching with at least one image processing task to be executed. The image processing apparatus takes the picture processing module and/or video processing module input by the user for the information of at least one image processing task to be performed as the picture processing module and/or video processing module matching the at least one image processing task to be performed.

在另一种可能实现的方式中,在图像处理装置通过任务下发层获取到至少一个待执行图像处理任务的情况下,图像处理装置从模型库中选取与至少一个待执行图像处理任务匹配的图片处理模块和/或视频处理模块。In another possible implementation manner, when the image processing apparatus obtains at least one image processing task to be executed through the task delivery layer, the image processing apparatus selects from the model library the image processing task that matches the at least one image processing task to be executed. Picture processing module and/or video processing module.

63、将上述图片处理模块和/或上述视频处理模块添加至待处理图像处理框架的视图处理层,得到上述图像处理框架。63. Add the above-mentioned picture processing module and/or the above-mentioned video processing module to the view processing layer of the to-be-processed image processing framework to obtain the above-mentioned image processing framework.

图像处理装置将与至少一个待执行图像处理任务匹配的图片处理模块和/或视频处理模块添加至视图处理层,即可得到上述图像处理框架。The image processing apparatus adds a picture processing module and/or a video processing module matching at least one image processing task to be performed to the view processing layer, so as to obtain the above-mentioned image processing framework.

基于本申请实施例提供的图像处理框架,本申请实施例还提供了几种可能的应用场景。Based on the image processing framework provided by the embodiments of the present application, the embodiments of the present application further provide several possible application scenarios.

场景1:随着公共场所内摄像头数量的快速增长,如何有效的通过海量视频流确定视频流中的人物的属性,并依据人物的属性,确定人物的行踪具有重要意义。Scenario 1: With the rapid growth of the number of cameras in public places, how to effectively determine the attributes of the characters in the video stream through massive video streams, and determine the whereabouts of the characters based on the attributes of the characters is of great significance.

在智慧园区内发生盗窃时,智慧园区的管理人员希望通过监控软件对智慧园区内的监控摄像头采集到的视频和/或图像(下文将监控摄像头采集到的视频和/或图像称为第一原始图像)进行处理,确定抢盗窃案嫌疑犯的行踪,该监控软件基于本申请提供的图像处理框架开发得到。监控软件运行于服务器,服务器与智慧园区内的监控摄像头之间具有通信连接。When theft occurs in the smart park, the managers of the smart park hope to use the monitoring software to monitor the video and/or images collected by the surveillance cameras in the smart park (hereinafter, the videos and/or images collected by the surveillance cameras will be referred to as the first original image) to determine the whereabouts of the suspect in the robbery case, the monitoring software is developed based on the image processing framework provided by this application. The monitoring software runs on the server, and there is a communication connection between the server and the monitoring cameras in the smart park.

图7所示为监控软件对第一原始图像进行处理的过程中数据的流向。如图7所示,视图接入层与监控摄像头之间通信连接,通过该通信连接,视图接入层可从监控摄像头获取第一原始图像。视图接入层可将获取到的第一原始图像输入至视图处理层,也可通过视图预览模块对第一原始图像进行显示,例如,用户通过视图预览模块向服务器输入预览第一原始图像的指令,服务器在接收到预览第一原始图像的指令的情况下,通过视图预览模块显示第一原始图像。FIG. 7 shows the data flow in the process of processing the first original image by the monitoring software. As shown in FIG. 7 , the view access layer and the surveillance camera are connected in communication, and through the communication connection, the view access layer can obtain the first original image from the surveillance camera. The view access layer can input the acquired first original image to the view processing layer, and can also display the first original image through the view preview module. For example, the user inputs an instruction to preview the first original image to the server through the view preview module. , the server displays the first original image through the view preview module when receiving the instruction to preview the first original image.

图7所示的图像存储组件、信息存储组件、索引存储组件、时空数据存储组件、目标属性存储组件均属于存储层,其中,图像存储组件用于存储图像数据,信息存储组件、索引存储组件、时空数据存储组件、目标属性存储组件均用于存储非图像数数据。在图7中,经视图处理层对第一原始图像进行处理,可得到至少一个第一处理结果,将至少一个第一处理结果中的图像数据存储至图像存储组件,并将非图像数据中的特征向量和属性存储于信息存储组件,将非图像数据中的时间信息和空间信息存储于时空数据存储组件。例如(例6),第一原始图像包括:图像a、图像b,其中,图像a的时间戳为t1,图像b的时间戳为t2,图像a由1号监控摄像头采集,图像b由2号监控摄像头采集。经视图处理层对第一原始图像进行处理,确定图像a包含人物、图像b不包含人物。进一步的,通过对图像a进行处理,得到图像a中人物的属性、图像a的特征向量、从图像a中截取包含人物的人物对象图像。将图像a和人物对象图像存储于OSG,将t1、t2、1号监控摄像头的位置、2号监控摄像头的位置存储至TFD,将图像a中人物的属性、图像a的特征向量存储于Kafka。The image storage component, information storage component, index storage component, spatiotemporal data storage component, and target attribute storage component shown in FIG. 7 all belong to the storage layer, wherein the image storage component is used to store image data, and the information storage component, index storage component, Both the spatiotemporal data storage component and the target attribute storage component are used to store non-image data. In FIG. 7 , by processing the first original image through the view processing layer, at least one first processing result can be obtained, the image data in the at least one first processing result is stored in the image storage component, and the non-image data is stored in the image storage component. The feature vectors and attributes are stored in the information storage component, and the temporal information and spatial information in the non-image data are stored in the spatiotemporal data storage component. For example (Example 6), the first original image includes: image a and image b, wherein the timestamp of image a is t 1 , the timestamp of image b is t 2 , image a is captured by surveillance camera No. 1, and image b is captured by Captured by surveillance camera No. 2. The first original image is processed by the view processing layer, and it is determined that the image a contains a person and the image b does not contain a person. Further, by processing the image a, the attributes of the person in the image a, the feature vector of the image a are obtained, and the person object image including the person is intercepted from the image a. Store the image a and the human object image in the OSG, store t 1 , t 2 , the position of the surveillance camera No. 1, and the location of the surveillance camera No. 2 in the TFD, and store the attributes of the person in the image a and the feature vector of the image a in the Kafka.

通过将非图像数据作为图像数据的索引款目,在非图像数据与图像数据之间建立索引,并将索引款目存储至信息存储组件。在非图像数据与时空信息之间建立索引,并将索引款目存储至索引存储组件。接着例6继续举例,将图像a中人物的属性、图像a的特征向量、作为图像a的索引款目(下文将称为索引款目1),并将t1、1号摄像头的位置作为图像a的特征向量的索引款目(下文将称为索引款目2)。将图像b中人物的属性、图像b的特征向量作为图像b的索引款目(下文将称为索引款目3),并将t2、2号摄像头的位置作为图像b的特征向量的索引款目(下文将称为索引款目4)。将索引款目1和索引款目3存储至信息存储组件,将索引款目2和索引款目4存储至索引存储组件。By using the non-image data as an index entry of the image data, an index is established between the non-image data and the image data, and the index entry is stored in the information storage component. Create an index between non-image data and spatiotemporal information, and store the index entries to the index storage component. Continue with example 6, take the attributes of the person in image a, the feature vector of image a, as the index entry of image a (hereinafter referred to as index entry 1), and take the position of camera t 1 and No. 1 as the image The index entry of the feature vector of a (hereinafter referred to as index entry 2). The attributes of the person in the image b and the feature vector of the image b are used as the index entry of the image b (hereinafter referred to as index entry 3), and the position of the camera t 2 and No. 2 are used as the index entry of the feature vector of the image b (hereinafter referred to as index entry 4). The index entry 1 and the index entry 3 are stored in the information storage component, and the index entry 2 and the index entry 4 are stored in the index storage component.

此外,可将经视图处理层对第一原始图像处理得到的第二原始图像存储至视图存储组件。例如,经视图处理层对第一原始图像进行处理,在第一原始图像中添加人物框,得到第二原始图像,其中,该人物框中的人物为嫌疑犯。这样,智慧园区的管理人员通过视图预览模块查看第二原始图像,可更高效的确定嫌疑犯的行踪。In addition, the second original image obtained by processing the first original image by the view processing layer may be stored in the view storage component. For example, the first original image is processed by the view processing layer, and a character frame is added to the first original image to obtain the second original image, wherein the character in the character frame is a suspect. In this way, the manager of the smart park can view the second original image through the view preview module, which can more efficiently determine the whereabouts of the suspect.

通过图7中的任务下发层可获得监控任务,监控任务携带嫌疑犯的特征(下文将称为目标特征)。例如,智慧园区通过向服务器输入执行嫌犯跟踪的任务的指令,该指令携带的目标特征包括:白色上衣、黑色裤子、黑色长发、出现在3号监控摄像头的位置。服务器在获取监控任务后,使用监控任务中的时空信息(即3号监控摄像头)对索引存储组件中的数据进行检索,得到与时空信息匹配的索引款目,作为第一目标索引款目。依据第一索引款目,从信息存储组件中确定第一非图像数据,并将第一非图像数据提取至目标特征存储组件。使用目标特征中除时空信息之外的特征(下文将称为目标属性)检索目标特征存储组件中的第一非图像数据,得到与目标属性匹配的第二非图像数据,作为检索结果。将检索结果推送至信息存储组件,以使信息存储组件输出第二非图像数据,并依据第二非图像数据以及存储于信息存储组件中的索引款目,从图像存储组件中确定与第二非图像数据对应的图像数据(下文将称为包含嫌疑犯的图像)。通过任务下发层输出包含嫌疑犯的图像和与第二非图像数据,以使智慧园区的管理员获知嫌疑人的行踪。Monitoring tasks can be obtained through the task issuing layer in FIG. 7 , and the monitoring tasks carry characteristics of suspects (hereinafter referred to as target characteristics). For example, the smart park enters the command to the server to perform the task of tracking the suspect. The target characteristics carried by the command include: white shirt, black pants, long black hair, and appearing at the position of the No. 3 surveillance camera. After acquiring the monitoring task, the server uses the spatiotemporal information in the monitoring task (ie, the No. 3 surveillance camera) to retrieve the data in the index storage component, and obtains an index entry that matches the spatiotemporal information as the first target index entry. According to the first index entry, the first non-image data is determined from the information storage component, and the first non-image data is extracted to the target feature storage component. The first non-image data in the target feature storage component is retrieved using the features other than the spatiotemporal information in the target features (hereinafter referred to as target attributes), and the second non-image data matching the target attribute is obtained as the retrieval result. Push the retrieval result to the information storage component, so that the information storage component outputs the second non-image data, and according to the second non-image data and the index entry stored in the information storage component, determine from the image storage component the difference between the second non-image data and the second non-image data. Image data corresponding to the image data (hereinafter will be referred to as an image containing a suspect). The image and the second non-image data containing the suspect are output through the task delivery layer, so that the administrator of the smart park can know the whereabouts of the suspect.

可选的,在场景1的一个具体的示例中,上述图像处理组件为OSG,上述信息存储组件为Kafka,上述索引存储组件为keyspaces。Optionally, in a specific example of scenario 1, the above image processing component is OSG, the above information storage component is Kafka, and the above index storage component is keyspaces.

在图像处理装置使用基于图像处理框架开发的软件执行图像处理任务之前,通过图像处理装置在OSG构建图片存储空间(bucket)、在Kafka中构建数据主题(kafka-topic)、在Cassandra中构建键值存储空间(keyspaces)。Before the image processing device uses the software developed based on the image processing framework to perform image processing tasks, the image processing device builds a picture storage space (bucket) in OSG, builds a data topic (kafka-topic) in Kafka, and builds a key value in Cassandra Storage space (keyspaces).

通过图像处理装置向视图接入层输入摄像机的地址。视图接入层进而可依据该地址,生成“通信协议”,该“通信协议”为图像处理框架可解析的通信协议对应的消息代码。该“通信协议”以基于64个可打印字符来表示二进制数据(base64)的方式编码,例如,post/engine/video-ingress/v1/generate_rtsp_address。Input the address of the camera to the view access layer via the image processing device. The view access layer can further generate a "communication protocol" according to the address, where the "communication protocol" is a message code corresponding to a communication protocol that can be parsed by the image processing framework. This "communication protocol" is encoded in a way to represent binary data (base64) based on 64 printable characters, eg, post/engine/video-ingress/v1/generate_rtsp_address.

图像处理装置依据该“通信协议”和摄像机的地址,从摄像机获取视频流,并将视频流推送至视图预览模块和视图处理层。例如,摄像机的地址为:vis's address,“通信协议”为post/engine/video-ingress/v1/generate_rtsp_address。将“vis's address+‘通信协议’”称为目标地址,图像处理装置可依据目标地址,从摄像机获取视频流。The image processing device obtains the video stream from the camera according to the "communication protocol" and the address of the camera, and pushes the video stream to the view preview module and the view processing layer. For example, the address of the camera is: vis's address, and the "communication protocol" is post/engine/video-ingress/v1/generate_rtsp_address. The "vis's address + 'communication protocol'" is called the target address, and the image processing device can obtain the video stream from the camera according to the target address.

在图像处理装置获取到视频流后,可将视频流传输至视图预览模块,以展示视频流的内容。图像处理装置也可使用视图处理层中的图片处理模块和/或视频处理模块,对视频流进行处理,得到图像数据和非图像数据。将图像数据存储于bucket,将非图像数据存储于kafka-topic。在图像数据和非图像数据之间建立索引(下文将称为图像索引款目),并将图像索引款目存储于kafka-topic。After the image processing apparatus acquires the video stream, the video stream can be transmitted to the view preview module to display the content of the video stream. The image processing apparatus may also use the picture processing module and/or the video processing module in the view processing layer to process the video stream to obtain image data and non-image data. Store image data in bucket, and store non-image data in kafka-topic. Create an index between image data and non-image data (hereinafter referred to as an image index entry), and store the image index entry in kafka-topic.

图像处理装置将非图像数据的时空信息存储于存储层中的时空库。图像处理装置在非图像数据与时空信息之间建立索引(下文将称为时空索引款目),并将时空索引款目存储于keyspaces。The image processing apparatus stores the spatiotemporal information of the non-image data in the spatiotemporal library in the storage layer. The image processing apparatus establishes an index between non-image data and spatiotemporal information (hereinafter referred to as spatiotemporal index entry), and stores the spatiotemporal index entry in keyspaces.

在通过图像处理装置创建待执行图像处理任务的过程中,在静态库(即图7中的目标特征存储组件)中构建目标库,并将目标对象的非图像数据存储至目标库。In the process of creating an image processing task to be executed by the image processing apparatus, a target library is constructed in a static library (ie, the target feature storage component in FIG. 7 ), and the non-image data of the target object is stored in the target library.

在通过图像处理装置完成待执行图像处理任务的创建后,图像处理装置依据待执行图像处理任务的时空信息,从kafka-topic中确定与待执行图像处理任务的时空信息匹配的非图像数据,并将与待执行图像处理任务的时空信息匹配的非图像数据提取至目标库。图像处理装置使用目标对象的非图像数据,检索静态库中与待执行图像处理任务的时空信息匹配的非图像数据得到检索结果,并将检索结果推送至kafka-topic。After completing the creation of the image processing task to be executed by the image processing device, the image processing device determines the non-image data matching the spatiotemporal information of the image processing task to be executed from the kafka-topic according to the spatiotemporal information of the image processing task to be executed, and Extract the non-image data matching the spatiotemporal information of the image processing task to be performed to the target library. The image processing device uses the non-image data of the target object to retrieve the non-image data in the static library that matches the spatiotemporal information of the image processing task to be executed to obtain the retrieval result, and pushes the retrieval result to kafka-topic.

场景2:在人流量较大的情况下,若手扶电梯处有人摔倒,将带来很大的安全隐患。因此,智慧园区的管理人员希望通过监控软件实现对手扶电梯处是否有行人摔倒的监测,以减少安全事故的发生。Scenario 2: In the case of a large flow of people, if someone falls at the escalator, it will bring a great safety hazard. Therefore, the managers of the smart park hope to use monitoring software to monitor whether there is a pedestrian falling at the escalator, so as to reduce the occurrence of safety accidents.

在场景1中,视图处理层中包含的计算机视觉模型为人物属性提取模型。由于人物属性提取模型无法实现行人摔倒监测,监控软件无法实现行人摔倒监测。通过将监控软件中的人物属性提取模型更换为行人摔倒监测模型,得到监测软件。通过监测软件对手扶电梯处的监控摄像头采集到的视频流(下文将手扶电梯处的监控摄像头采集到的视频流称为第一原始视频流)进行处理,可监测手扶电梯处是否有行人摔倒。In Scenario 1, the computer vision model included in the view processing layer is the character attribute extraction model. Since the human attribute extraction model cannot realize the pedestrian fall detection, the monitoring software cannot realize the pedestrian fall detection. The monitoring software is obtained by replacing the character attribute extraction model in the monitoring software with the pedestrian fall monitoring model. By processing the video stream collected by the surveillance camera at the escalator (hereinafter, the video stream collected by the surveillance camera at the escalator is called the first original video stream), it is possible to monitor whether there are pedestrians at the escalator. fall.

图8所示为监测软件对第一原始视频流进行处理的过程中数据的流向。如图8所示,视图接入层与监控摄像头之间通信连接,通过该通信连接,视图接入层可从监控摄像头获取第一原始视频流。视图接入层可将获取到的第一原始视频流输入至视图处理层,也可通过视图预览模块对第一原始视频流进行显示,例如,用户通过视图预览模块向服务器输入预览第一原始视频流的指令,服务器在接收到预览第一原始视频流的指令的情况下,通过视图预览模块显示第一原始视频流。FIG. 8 shows the data flow in the process of processing the first original video stream by the monitoring software. As shown in FIG. 8 , the view access layer and the surveillance camera are connected in communication, and through the communication connection, the view access layer can obtain the first original video stream from the surveillance camera. The view access layer can input the acquired first original video stream to the view processing layer, and can also display the first original video stream through the view preview module. For example, the user inputs the preview first original video to the server through the view preview module. Stream instruction, when the server receives the instruction to preview the first original video stream, display the first original video stream through the view preview module.

图8所示的网络视频录像机、信息存储组件、云端存储组件、监测结果存储组件均属于存储层。经视图处理层对第一原始视频流处理后,将非图像数据存储于信息存储组件,在非图像数据包含有行人摔倒的监测结果的情况下,将摔倒的行人的信息存储于监测结果存储组件,以便管理人员通过业务下发层获取存储于监测结果存储模块中的摔倒的行人的信息(包括:人物属性、摔倒的位置、摔倒的时间)进行查看。在非图像数据包含有行人摔倒的监测结果的情况下,信息存储组件通过剪辑模块向网络视频录像机(network videorecorder,NVR)发送视频剪辑指令,以指示NVR从第一原始视频流中剪辑出行人摔倒的视频流,得到摔倒视频流。NVR通过剪辑模块将摔倒视频流上传至云端存储组件,以便管理人员通过业务下发层查看存储于云端存储组件中的摔倒视频流。例如,经视图处理层对第一原始视频流进行处理,确定有行人摔倒的情况下,监测软件可通过业务下发层输出告警信息,以提示管理人员有行人摔倒。管理人员可通过业务下发层查看存储于云端存储组件中的行人摔倒的视频流,和/或,查看存储于监测结果存储组件中的摔倒的行人的信息。The network video recorder, the information storage component, the cloud storage component, and the monitoring result storage component shown in FIG. 8 all belong to the storage layer. After the first original video stream is processed by the view processing layer, the non-image data is stored in the information storage component, and in the case that the non-image data includes the monitoring result of pedestrian falling, the information of the falling pedestrian is stored in the monitoring result. A storage component, so that managers can obtain the information of the fallen pedestrian (including: person attribute, falling position, and falling time) stored in the monitoring result storage module through the service delivery layer for viewing. In the case that the non-image data includes the monitoring result of the pedestrian falling, the information storage component sends a video editing instruction to a network video recorder (NVR) through the editing module, so as to instruct the NVR to edit the pedestrian from the first original video stream. Fall down video stream, get fall down video stream. The NVR uploads the fall video stream to the cloud storage component through the editing module, so that managers can view the fall video stream stored in the cloud storage component through the service delivery layer. For example, when the first original video stream is processed by the view processing layer, and it is determined that a pedestrian has fallen, the monitoring software can output alarm information through the service delivery layer to prompt the management personnel that a pedestrian has fallen. The administrator can view the video stream of the falling pedestrian stored in the cloud storage component through the service delivery layer, and/or view the information of the falling pedestrian stored in the monitoring result storage component.

此外,可将经视图处理层对第一原始视频流处理得到的第二原始视频流存储至视图存储组件。例如,经视图处理层对第一原始图像进行处理,在第一原始视频流中添加人物框,得到第二原始视频流,其中,该人物框中的人物为摔倒的行人。这样,智慧园区的管理人员通过查看第二原始视频流,可更高效的确定摔倒的行人所处的位置。In addition, the second original video stream obtained by processing the first original video stream by the view processing layer may be stored in the view storage component. For example, the first original image is processed by the view processing layer, and a character frame is added to the first original video stream to obtain the second original video stream, wherein the character in the character frame is a fallen pedestrian. In this way, the managers of the smart park can more efficiently determine the location of the fallen pedestrian by viewing the second original video stream.

从场景1和场景2中可以看出,通过将监控软件中的人物属性提取模型替换为摔倒监测模型,并调整存储层中的存储组件,即可得到用于监测是否有行人摔倒的监测软件。It can be seen from Scenario 1 and Scenario 2 that by replacing the character attribute extraction model in the monitoring software with the fall monitoring model, and adjusting the storage components in the storage layer, the monitoring system for detecting whether a pedestrian falls can be obtained. software.

本领域技术人员可以理解,在具体实施方式的上述方法中,各步骤的撰写顺序并不意味着严格的执行顺序而对实施过程构成任何限定,各步骤的具体执行顺序应当以其功能和可能的内在逻辑确定。Those skilled in the art can understand that in the above method of the specific implementation, the writing order of each step does not mean a strict execution order but constitutes any limitation on the implementation process, and the specific execution order of each step should be based on its function and possible Internal logic is determined.

上述详细阐述了本申请实施例的方法,下面提供了本申请实施例的装置。The methods of the embodiments of the present application are described in detail above, and the apparatuses of the embodiments of the present application are provided below.

请参阅图9,图9为本申请实施例提供的一种图像处理装置的结构示意图,该图像处理装置1包括:视图接入单元11、任务下发单元12、视图处理单元13、存储单元14、信息索引单元15,其中:Please refer to FIG. 9 , which is a schematic structural diagram of an image processing apparatus according to an embodiment of the present application. The image processing apparatus 1 includes: a view access unit 11 , a task issuing unit 12 , a view processing unit 13 , and a storage unit 14 , the information indexing unit 15, wherein:

视图接入单元,用于获取至少一张第一待处理图像;a view access unit, configured to acquire at least one first image to be processed;

任务下发单元,用于获取至少一个待执行图像处理任务;a task issuing unit, used for acquiring at least one image processing task to be executed;

视图处理单元,用于对所述至少一张第一待处理图像进行处理,得到至少一个第一处理结果;a view processing unit, configured to process the at least one first image to be processed to obtain at least one first processing result;

存储单元,用于存储所述至少一个第一处理结果;a storage unit for storing the at least one first processing result;

任务下发单元,用于依据所述至少一个待执行图像处理任务,对存储于所述存储层中的所述至少一个第一处理结果进行处理,得到第二处理结果。A task issuing unit, configured to process the at least one first processing result stored in the storage layer according to the at least one image processing task to be executed to obtain a second processing result.

结合本申请任一实施方式,所述至少一个第一处理结果包括图像数据和非图像数据;所述存储单元包括图像数据存储子单元和非图像数据存储子单元;With reference to any embodiment of the present application, the at least one first processing result includes image data and non-image data; the storage unit includes an image data storage subunit and a non-image data storage subunit;

所述存储单元,用于:The storage unit is used for:

将所述图像数据存储于所述图像数据存储子单元,将所述非图像数据存储于所述非图像数据存储子单元;storing the image data in the image data storage subunit, and storing the non-image data in the non-image data storage subunit;

通过将所述非图像数据作为所述图像数据的索引款目,在所述图像数据和所述非图像数据之间建立索引。An index is established between the image data and the non-image data by using the non-image data as an index entry for the image data.

结合本申请任一实施方式,所述视图处理单元包括图片处理子单元和视频处理子单元;所述视图处理单元用于:With reference to any embodiment of the present application, the view processing unit includes a picture processing subunit and a video processing subunit; the view processing unit is used for:

在所述第一待处理图像的数量大于或等于2,且接收到执行图片处理指令和执行视频处理指令的情况下,依据所述执行图片处理指令,从至少两张所述第一待处理图像中选取至少一张第二待处理图像;In the case where the number of the first images to be processed is greater than or equal to 2, and an instruction to perform image processing and an instruction to perform video processing are received, according to the instruction to perform image processing, from at least two of the first images to be processed Select at least one second image to be processed from the

使用所述图片处理子单元对所述至少一张第二待处理图像进行处理,得到至少一个第三处理结果;Using the picture processing subunit to process the at least one second image to be processed to obtain at least one third processing result;

依据所述执行视频处理指令,从所述至少两张所述第一待处理图像中选取至少两张第三待处理图像;Selecting at least two third images to be processed from the at least two first images to be processed according to the executing video processing instruction;

使用所述视频处理子单元对所述至少两张第三待处理图像进行处理,得到至少一个第四处理结果;using the video processing subunit to process the at least two third images to be processed to obtain at least one fourth processing result;

依据所述至少一个第三处理结果和所述至少一个第四处理结果,得到所述至少一个第一处理结果。The at least one first processing result is obtained according to the at least one third processing result and the at least one fourth processing result.

结合本申请任一实施方式,所述视图处理单元用于:With reference to any embodiment of the present application, the view processing unit is used for:

使用所述图片处理子单元对第四待处理图像进行对象检测处理,得到第一对象在所述第四待处理图像中的位置;所述第四待处理图像属于所述至少一张第二待处理图像;所述第一对象属于所述第四待处理图像;Using the image processing subunit to perform object detection processing on the fourth image to be processed to obtain the position of the first object in the fourth image to be processed; the fourth image to be processed belongs to the at least one second image to be processed processing an image; the first object belongs to the fourth image to be processed;

依据所述位置,确定包含所述第一对象的像素区域;determining a pixel area including the first object according to the position;

从所述第四待处理图像中截取所述像素区域,得到对象图像;Intercept the pixel area from the fourth to-be-processed image to obtain an object image;

使用所述图片处理子单元对所述对象图像进行属性提取处理,得到所述第一对象的属性。Using the image processing subunit to perform attribute extraction processing on the object image to obtain the attribute of the first object.

结合本申请任一实施方式,所述图像数据包括所述至少一张第一待处理图像和所述对象图像,所述非图像数据包括所述第一对象的属性。With reference to any embodiment of the present application, the image data includes the at least one first image to be processed and the object image, and the non-image data includes attributes of the first object.

结合本申请任一实施方式,所述视图接入单元用于:With reference to any embodiment of the present application, the view access unit is used for:

获取至少一张第五待处理图像;Acquire at least one fifth image to be processed;

在所述至少一张第五待处理图像的通信协议与所述图像处理框架所使用的通信协议不同的情况下,将所述至少一张第五待处理图像的通信协议转换成所述图像处理框架所使用的通信协议,得到所述至少一张第一待处理图像。If the communication protocol of the at least one fifth image to be processed is different from the communication protocol used by the image processing framework, converting the communication protocol of the at least one fifth image to be processed into the image processing The communication protocol used by the framework to obtain the at least one first image to be processed.

结合本申请任一实施方式,所述图像处理装置还包括:信息索引单元;With reference to any embodiment of the present application, the image processing apparatus further includes: an information indexing unit;

所述信息索引单元,用于获取检索信息,以及使用所述检索信息检索所述至少一个第一处理结果,得到第五处理结果。The information indexing unit is configured to acquire retrieval information, and use the retrieval information to retrieve the at least one first processing result to obtain a fifth processing result.

请参阅图10,图10为本申请实施例提供的另一种图像处理装置的结构示意图,该图像处理装置2包括:获取单元21、第一处理单元22、存储单元23、第二处理单元24、添加单元25,其中:Please refer to FIG. 10 . FIG. 10 is a schematic structural diagram of another image processing apparatus provided by an embodiment of the present application. The image processing apparatus 2 includes: an acquisition unit 21 , a first processing unit 22 , a storage unit 23 , and a second processing unit 24 , adding unit 25, wherein:

所述图像处理装置包括:The image processing device includes:

获取单元,用于获取至少一张第一待处理图像和至少一个待执行图像处理任务;an acquisition unit, configured to acquire at least one first image to be processed and at least one image processing task to be performed;

第一处理单元,用于对所述至少一张第一待处理图像进行图片处理和/或视频处理,得到至少一个第一处理结果;a first processing unit, configured to perform picture processing and/or video processing on the at least one first image to be processed to obtain at least one first processing result;

存储单元,用于存储所述至少一个第一处理结果;a storage unit for storing the at least one first processing result;

第二处理单元,用于依据所述至少一个待执行图像处理任务,对存储于所述存储层中的所述至少一个第一处理结果进行处理,得到第二处理结果。The second processing unit is configured to process the at least one first processing result stored in the storage layer according to the at least one image processing task to be executed to obtain a second processing result.

结合本申请任一实施方式,所述图像处理装置所执行的方法通过图像处理框架实现,所述获取单元,还用于获取所述至少一个待执行图像处理任务和待处理框架;所述待处理框架包括视图处理层、存储层、任务下发层;With reference to any embodiment of the present application, the method executed by the image processing apparatus is implemented by an image processing framework, and the acquiring unit is further configured to acquire the at least one image processing task to be executed and the frame to be processed; the to-be-processed The framework includes a view processing layer, a storage layer, and a task delivery layer;

所述获取单元,还用于在通过所述任务下发层获取到所述至少一个待执行图像处理任务的情况下,获取与所述至少一个待执行图像处理任务匹配的图片处理模块和/或视频处理模块;所述图片处理模块用于实现图片处理;所述视频处理模块用于实现视频处理;The acquiring unit is further configured to acquire a picture processing module and/or an image processing module matching the at least one image processing task to be performed when the at least one image processing task to be performed is acquired through the task delivery layer a video processing module; the picture processing module is used for realizing picture processing; the video processing module is used for realizing video processing;

所述图像处理装置还包括:添加单元,用于将所述图片处理模块和/或所述视频处理模块添加至待处理图像处理框架的视图处理层,得到所述图像处理框架。The image processing apparatus further includes: an adding unit, configured to add the picture processing module and/or the video processing module to the view processing layer of the to-be-processed image processing frame to obtain the image processing frame.

在一些实施例中,本申请实施例提供的装置具有的功能或包含的模块可以用于执行上文方法实施例描述的方法,其具体实现可以参照上文方法实施例的描述,为了简洁,这里不再赘述。In some embodiments, the functions or modules included in the apparatuses provided in the embodiments of the present application may be used to execute the methods described in the above method embodiments. For specific implementation, reference may be made to the above method embodiments. For brevity, here No longer.

图11为本申请实施例提供的一种图像处理装置的硬件结构示意图。该图像处理装置3包括处理器31,存储器32,输入装置33,输出装置34。该处理器31、存储器32、输入装置33和输出装置34通过连接器相耦合,该连接器包括各类接口、传输线或总线等等,本申请实施例对此不作限定。应当理解,本申请的各个实施例中,耦合是指通过特定方式的相互联系,包括直接相连或者通过其他设备间接相连,例如可以通过各类接口、传输线、总线等相连。FIG. 11 is a schematic diagram of a hardware structure of an image processing apparatus according to an embodiment of the present application. The image processing device 3 includes a processor 31 , a memory 32 , an input device 33 , and an output device 34 . The processor 31, the memory 32, the input device 33, and the output device 34 are coupled through a connector, and the connector includes various types of interfaces, transmission lines, or buses, which are not limited in this embodiment of the present application. It should be understood that, in various embodiments of the present application, coupling refers to mutual connection in a specific manner, including direct connection or indirect connection through other devices, such as various interfaces, transmission lines, and buses.

处理器31可以是一个或多个图形处理器(graphics processing unit,GPU),在处理器31是一个GPU的情况下,该GPU可以是单核GPU,也可以是多核GPU。可选的,处理器31可以是多个GPU构成的处理器组,多个处理器之间通过一个或多个总线彼此耦合。可选的,该处理器还可以为其他类型的处理器等等,本申请实施例不作限定。The processor 31 may be one or more graphics processing units (graphics processing units, GPUs). In the case where the processor 31 is a GPU, the GPU may be a single-core GPU or a multi-core GPU. Optionally, the processor 31 may be a processor group composed of multiple GPUs, and the multiple processors are coupled to each other through one or more buses. Optionally, the processor may also be another type of processor, etc., which is not limited in this embodiment of the present application.

存储器32可用于存储计算机程序指令,以及用于执行本申请方案的程序代码在内的各类计算机程序代码。可选地,存储器包括但不限于是随机存储记忆体(random accessmemory,RAM)、只读存储器(read-only memory,ROM)、可擦除可编程只读存储器(erasableprogrammable read only memory,EPROM)、或便携式只读存储器(compact disc read-only memory,CD-ROM),该存储器用于相关指令及数据。The memory 32 may be used to store computer program instructions and various types of computer program codes including program codes for executing the solutions of the present application. Optionally, the memory includes, but is not limited to, random access memory (RAM), read-only memory (ROM), erasable programmable read only memory (EPROM), Or portable read-only memory (compact disc read-only memory, CD-ROM), which is used for related instructions and data.

输入装置33用于输入数据和/或信号,以及输出装置34用于输出数据和/或信号。输入装置33和输出装置34可以是独立的器件,也可以是一个整体的器件。The input device 33 is used for inputting data and/or signals, and the output device 34 is used for outputting data and/or signals. The input device 33 and the output device 34 may be independent devices or may be an integral device.

可理解,本申请实施例中,存储器32不仅可用于存储相关指令,还可用于存储相关数据,如该存储器32可用于存储通过输入装置33获取的至少一张第一待处理图像,又或者该存储器32还可用于存储通过处理器31得到的至少一个第一处理结果等等,本申请实施例对于该存储器中具体所存储的数据不作限定。It can be understood that, in this embodiment of the present application, the memory 32 can be used not only to store related instructions, but also to store related data. For example, the memory 32 can be used to store at least one first image to be processed obtained through the input device 33 , or the The memory 32 may also be used to store at least one first processing result obtained by the processor 31, etc., and the data stored in the memory is not limited in this embodiment of the present application.

可以理解的是,图11仅仅示出了一种图像处理装置的简化设计。在实际应用中,图像处理装置还可以分别包含必要的其他元件,包含但不限于任意数量的输入/输出装置、处理器、存储器等,而所有可以实现本申请实施例的图像处理装置都在本申请的保护范围之内。It can be understood that FIG. 11 only shows a simplified design of an image processing apparatus. In practical applications, the image processing apparatus may also include other necessary elements, including but not limited to any number of input/output devices, processors, memories, etc., and all image processing apparatuses that can implement the embodiments of the present application are included in this application. within the scope of protection of the application.

本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each particular application, but such implementations should not be considered beyond the scope of this application.

所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。所属领域的技术人员还可以清楚地了解到,本申请各个实施例描述各有侧重,为描述的方便和简洁,相同或类似的部分在不同实施例中可能没有赘述,因此,在某一实施例未描述或未详细描述的部分可以参见其他实施例的记载。Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described systems, devices and units may refer to the corresponding processes in the foregoing method embodiments, which will not be repeated here. Those skilled in the art can also clearly understand that the description of each embodiment of the present application has its own emphasis. For the convenience and brevity of the description, the same or similar parts may not be repeated in different embodiments. Therefore, in a certain embodiment For the parts that are not described or not described in detail, reference may be made to the descriptions of other embodiments.

在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not implemented. On the other hand, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.

所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.

另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.

在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者通过所述计算机可读存储介质进行传输。所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(digital subscriberline,DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,数字通用光盘(digital versatiledisc,DVD))、或者半导体介质(例如固态硬盘(solid state disk,SSD))等。In the above-mentioned embodiments, it may be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented in software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present application are generated. The computer may be a general purpose computer, special purpose computer, computer network, or other programmable device. The computer instructions may be stored in or transmitted over a computer-readable storage medium. The computer instructions can be sent from one website site, computer, server, or data center to another via wired (eg, coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (eg, infrared, wireless, microwave, etc.) means. A website site, computer, server or data center for transmission. The computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that includes an integration of one or more available media. The usable media may be magnetic media (eg, floppy disks, hard disks, magnetic tapes), optical media (eg, digital versatile disc (DVD)), or semiconductor media (eg, solid state disk (SSD)) Wait.

本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,该流程可以由计算机程序来指令相关的硬件完成,该程序可存储于计算机可读取存储介质中,该程序在执行时,可包括如上述各方法实施例的流程。而前述的存储介质包括:只读存储器(read-only memory,ROM)或随机存储存储器(random access memory,RAM)、磁碟或者光盘等各种可存储程序代码的介质。Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be implemented. The process can be completed by instructing the relevant hardware by a computer program, and the program can be stored in a computer-readable storage medium. When the program is executed , which may include the processes of the foregoing method embodiments. The aforementioned storage medium includes: read-only memory (ROM) or random access memory (RAM), magnetic disk or optical disk and other mediums that can store program codes.

Claims (13)

1. An image processing method is characterized in that the image processing method is realized through an image processing framework, and the image processing framework comprises a view access layer, a view processing layer, a storage layer and a task issuing layer;
the view access layer is used for acquiring at least one first image to be processed;
the task issuing layer is used for acquiring at least one image processing task to be executed;
the view processing layer is used for processing the at least one first image to be processed to obtain at least one first processing result;
the storage layer is used for storing the at least one first processing result;
and the task issuing layer is used for processing the at least one first processing result stored in the storage layer according to the at least one image processing task to be executed to obtain a second processing result.
2. The method of claim 1, wherein the at least one first processing result comprises image data and non-image data; the storage layer comprises an image data storage module and a non-image data storage module;
the storage layer is further to:
storing the image data in the image data storage module, and storing the non-image data in the non-image data storage module;
and establishing an index between the image data and the non-image data by using the non-image data as an index entry of the image data.
3. The method according to claim 1 or 2, wherein the view processing layer comprises a picture processing module and a video processing module; the view processing layer is further to:
under the condition that the number of the first images to be processed is greater than or equal to 2 and an execution image processing instruction and an execution video processing instruction are received, selecting at least one second image to be processed from at least two first images to be processed according to the execution image processing instruction;
processing the at least one second image to be processed by using the image processing module to obtain at least one third processing result;
selecting at least two third images to be processed from the at least two first images to be processed according to the executing video processing instruction;
processing the at least two third images to be processed by using the video processing module to obtain at least one fourth processing result;
and obtaining the at least one first processing result according to the at least one third processing result and the at least one fourth processing result.
4. The method of claim 3, wherein the view processing layer is further configured to:
using the image processing module to perform object detection processing on a fourth image to be processed to obtain the position of a first object in the fourth image to be processed; the fourth image to be processed belongs to the at least one second image to be processed; the first object belongs to the fourth image to be processed;
determining a pixel region containing the first object according to the position;
intercepting the pixel area from the fourth image to be processed to obtain an object image;
and performing attribute extraction processing on the object image by using the image processing module to obtain the attribute of the first object.
5. The method according to claim 4, characterized in that the image data comprise the at least one first image to be processed and the object image, and the non-image data comprise properties of the first object.
6. The method of any of claims 1 to 5, wherein the view access layer is further configured to:
acquiring at least one fifth image to be processed;
and under the condition that the communication protocol of the at least one fifth image to be processed is different from the communication protocol used by the image processing framework, converting the communication protocol of the at least one fifth image to be processed into the communication protocol used by the image processing framework to obtain the at least one first image to be processed.
7. The method of any of claims 1 to 6, wherein the image processing framework further comprises an information indexing layer;
the information index layer is used for acquiring retrieval information;
and retrieving the at least one first processing result by using the retrieval information to obtain a fifth processing result.
8. An image processing method, characterized in that the method comprises:
acquiring at least one first image to be processed and at least one image processing task to be executed;
performing picture processing and/or video processing on the at least one first image to be processed to obtain at least one first processing result;
storing the at least one first processing result;
and processing the at least one first processing result stored in the storage layer according to the at least one image processing task to be executed to obtain a second processing result.
9. The method according to claim 8, wherein the image processing method is implemented by an image processing framework, and the construction process of the image processing framework comprises:
acquiring the at least one image processing task to be executed and a frame to be processed; the frame to be processed comprises a view processing layer, a storage layer and a task issuing layer;
under the condition that the at least one image processing task to be executed is obtained through the task issuing layer, obtaining an image processing module and/or a video processing module matched with the at least one image processing task to be executed; the picture processing module is used for realizing picture processing; the video processing module is used for realizing video processing;
and adding the picture processing module and/or the video processing module to a view processing layer of an image processing frame to be processed to obtain the image processing frame.
10. An image processing apparatus characterized by comprising:
the view access unit is used for acquiring at least one first image to be processed;
the task issuing unit is used for acquiring at least one image processing task to be executed;
the view processing unit is used for processing the at least one first image to be processed to obtain at least one first processing result;
a storage unit for storing the at least one first processing result;
and the task issuing unit is used for processing the at least one first processing result stored in the storage layer according to the at least one image processing task to be executed to obtain a second processing result.
11. An image processing apparatus characterized by comprising:
the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring at least one first image to be processed and at least one image processing task to be executed;
the first processing unit is used for carrying out picture processing and/or video processing on the at least one first image to be processed to obtain at least one first processing result;
a storage unit for storing the at least one first processing result;
and the second processing unit is used for processing the at least one first processing result stored in the storage layer according to the at least one image processing task to be executed to obtain a second processing result.
12. An electronic device, comprising: a processor and a memory for storing computer program code comprising computer instructions which, when executed by the processor, the electronic device executes the image processing framework of any of claims 1 to 7 or the electronic device executes the image processing method of claim 8 or 9.
13. A computer-readable storage medium, in which a computer program is stored, which computer program comprises program instructions which, when executed by a processor, cause the processor to execute an image processing framework according to any one of claims 1 to 7, or cause the processor to execute an image processing method according to claim 8 or 9.
CN202010402713.6A 2020-05-13 2020-05-13 Image processing method, image processing apparatus, electronic device, and storage medium Pending CN111563174A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010402713.6A CN111563174A (en) 2020-05-13 2020-05-13 Image processing method, image processing apparatus, electronic device, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010402713.6A CN111563174A (en) 2020-05-13 2020-05-13 Image processing method, image processing apparatus, electronic device, and storage medium

Publications (1)

Publication Number Publication Date
CN111563174A true CN111563174A (en) 2020-08-21

Family

ID=72074729

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010402713.6A Pending CN111563174A (en) 2020-05-13 2020-05-13 Image processing method, image processing apparatus, electronic device, and storage medium

Country Status (1)

Country Link
CN (1) CN111563174A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112632300A (en) * 2020-09-29 2021-04-09 深圳市商汤科技有限公司 Image retrieval method and device, electronic device and storage medium
CN113849454A (en) * 2021-09-08 2021-12-28 北京灵汐科技有限公司 Computing system

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106447625A (en) * 2016-09-05 2017-02-22 北京中科奥森数据科技有限公司 Facial image series-based attribute identification method and device
CN108683877A (en) * 2018-03-30 2018-10-19 中国科学院自动化研究所 Spark-based distributed massive video analysis system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106447625A (en) * 2016-09-05 2017-02-22 北京中科奥森数据科技有限公司 Facial image series-based attribute identification method and device
CN108683877A (en) * 2018-03-30 2018-10-19 中国科学院自动化研究所 Spark-based distributed massive video analysis system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112632300A (en) * 2020-09-29 2021-04-09 深圳市商汤科技有限公司 Image retrieval method and device, electronic device and storage medium
CN113849454A (en) * 2021-09-08 2021-12-28 北京灵汐科技有限公司 Computing system

Similar Documents

Publication Publication Date Title
US20220301317A1 (en) Method and device for constructing object motion trajectory, and computer storage medium
US6774905B2 (en) Image data processing
CN104519316B (en) Monitoring system, monitoring method and recording medium
Filonenko et al. Unattended object identification for intelligent surveillance systems using sequence of dual background difference
US20190051127A1 (en) A method and apparatus for conducting surveillance
CN110263613A (en) Monitor video processing method and processing device
CN108229323A (en) Supervision method and device, electronic equipment, computer storage media
CN112163503A (en) Method, system, storage medium and device for generating non-sensing trajectory of personnel in case handling area
CN110442742A (en) Retrieve method and device, processor, electronic equipment and the storage medium of image
KR101084914B1 (en) Indexing Management System of Vehicle Number and Person Image
US20210089784A1 (en) System and Method for Processing Video Data from Archive
WO2021180004A1 (en) Video analysis method, video analysis management method, and related device
CN117998039A (en) Video data processing method, device, equipment and storage medium
CN111563174A (en) Image processing method, image processing apparatus, electronic device, and storage medium
KR101547255B1 (en) Object-based Searching Method for Intelligent Surveillance System
CN116170104A (en) A system and method for detecting and calibrating video and image acquisition equipment time anomalies in real time
US10783365B2 (en) Image processing device and image processing system
US20220130174A1 (en) Image processing apparatus, control method, and non-transitory storage medium
CN107301373B (en) Data processing method, device and storage medium
CN116529792A (en) Computer-implemented method, apparatus and computer program for privacy-masking video surveillance data
KR20250081717A (en) Apparatus and method for reproducing video using object contextualization data
CN112419638A (en) Method and device for acquiring alarm video
CN111491133A (en) Shopping mall security monitoring system using electronic portrait locking technology
CN112419637A (en) Security image data processing method and device
TW202213123A (en) Image retrieval method, electronic equipment and storage medium thereof

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200821