[go: up one dir, main page]

CN118590680A - A subway monitoring image data encryption transmission method, system, device and medium - Google Patents

A subway monitoring image data encryption transmission method, system, device and medium Download PDF

Info

Publication number
CN118590680A
CN118590680A CN202410977544.7A CN202410977544A CN118590680A CN 118590680 A CN118590680 A CN 118590680A CN 202410977544 A CN202410977544 A CN 202410977544A CN 118590680 A CN118590680 A CN 118590680A
Authority
CN
China
Prior art keywords
signal
output
image data
positive
encrypted
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.)
Withdrawn
Application number
CN202410977544.7A
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.)
Nanjing Institute of Railway Technology
Original Assignee
Nanjing Institute of Railway Technology
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 Nanjing Institute of Railway Technology filed Critical Nanjing Institute of Railway Technology
Priority to CN202410977544.7A priority Critical patent/CN118590680A/en
Publication of CN118590680A publication Critical patent/CN118590680A/en
Withdrawn legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
    • H04N21/2347Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving video stream encryption
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
    • H04N21/2343Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements
    • H04N21/234381Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements by altering the temporal resolution, e.g. decreasing the frame rate by frame skipping
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/4402Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display
    • H04N21/440281Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display by altering the temporal resolution, e.g. by frame skipping
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/4408Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving video stream encryption, e.g. re-encrypting a decrypted video stream for redistribution in a home network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/475End-user interface for inputting end-user data, e.g. personal identification number [PIN], preference data
    • H04N21/4753End-user interface for inputting end-user data, e.g. personal identification number [PIN], preference data for user identification, e.g. by entering a PIN or password
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N7/00Television systems
    • H04N7/18Closed-circuit television [CCTV] systems, i.e. systems in which the video signal is not broadcast

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Human Computer Interaction (AREA)
  • Image Processing (AREA)

Abstract

The invention discloses a subway monitoring image data encryption transmission method, a system, equipment and a medium, which relate to the technical field of monitoring image transmission and comprise the following steps: acquiring image data through an external camera; confirming image information of the image data; encrypting the image data based on the image information and transmitting the image data to obtain encrypted information; confirming the identity of the visitor and decrypting the encrypted information to obtain image information; the invention is used for solving the problem that the privacy of the user is easy to be revealed due to the lack of encryption of image data in the existing monitoring image transmission technology.

Description

一种地铁监控图像数据加密传输方法、系统、设备及介质A subway monitoring image data encryption transmission method, system, device and medium

技术领域Technical Field

本发明涉及监控图像传输技术领域,具体为一种地铁监控图像数据加密传输方法、系统、设备及介质。The present invention relates to the technical field of monitoring image transmission, and in particular to a method, system, equipment and medium for encrypting and transmitting subway monitoring image data.

背景技术Background Art

地铁监控能够有效的监控各个地铁站的出入状况,在日间正常运营情况下、紧急突发情况下各相关系统设备之间协调互动等高级功能,从而保证地铁的正常运行;监控图像传输技术,是指将摄像头捕捉到的图像数据通过某种方式传输到其他设备或系统中的技术,这种技术通常用于视频监控、视频会议、远程监视和其他需要实时图像传输的应用中,且需要保证图像数据的安全性,避免泄露用户隐私。Subway monitoring can effectively monitor the entry and exit status of each subway station, and has advanced functions such as coordination and interaction between relevant system equipment under normal daytime operation and emergency situations, so as to ensure the normal operation of the subway; monitoring image transmission technology refers to the technology of transmitting the image data captured by the camera to other devices or systems in some way. This technology is usually used in video surveillance, video conferencing, remote monitoring and other applications that require real-time image transmission, and it is necessary to ensure the security of image data to avoid leaking user privacy.

现有的监控图像传输技术通常都是基于USB传输或WIFI传输等有线传输和无线传输方法进行直接传输,没有对摄像头拍摄的视频数据进行一定的隐私保护,若不对视频数据进行保护,则可能被他人破解并对摄像头的拍摄区域进行监视或查找过往视频,而这种行为可能进一步导致犯罪行为的发生,尤其应用在一些公共场所时,例如应用在地铁领域时需要对监控视频传输的安全性进行升级,因此,应该对摄像头所拍摄的视频数据进行一定的加密,防止他人非法获取,比如在申请公开号为CN115696062A的中国专利中,公开了基于Android系统下的YUV摄像头数据传输方法,该方案就缺少对摄像头拍摄的图像数据的加密,导致图像数据易被他人窃取,从而危害到他人的隐私,现有的监控图像传输技术还存在缺少对图像数据的加密,导致用户隐私易被泄露的问题。Existing surveillance image transmission technologies are usually based on direct transmission through wired and wireless transmission methods such as USB transmission or WIFI transmission, and do not provide certain privacy protection for the video data captured by the camera. If the video data is not protected, it may be cracked by others and the camera's shooting area may be monitored or past videos may be searched, and this behavior may further lead to the occurrence of criminal acts, especially when used in some public places, such as when used in the subway field, the security of surveillance video transmission needs to be upgraded. Therefore, the video data captured by the camera should be encrypted to prevent others from illegally obtaining it. For example, in the Chinese patent application publication number CN115696062A, a YUV camera data transmission method based on the Android system is disclosed. This solution lacks encryption of the image data captured by the camera, resulting in the image data being easily stolen by others, thereby endangering the privacy of others. The existing surveillance image transmission technology also lacks encryption of image data, resulting in the problem that user privacy is easily leaked.

发明内容Summary of the invention

本发明旨在至少在一定程度上解决现有技术中的技术问题之一,通过获取外置摄像头所拍摄的图像数据的图像分辨率,基于图像分辨率对像素点进行编号,再提取用户密码中的数字组成数字密码,基于像素编号对像素点采用不同的加密方法,再基于像素点的像素色以及数字密码对像素点进行加密,得到加密图像,再通过摄像头连接程序对访问者的身份进行验证,验证成功后再对加密图像进行解密,得到图像数据,以解决现有的监控图像传输技术还存在缺少对图像数据的加密,导致用户隐私易被泄露的问题。The present invention aims to solve one of the technical problems in the prior art to at least a certain extent, by obtaining the image resolution of image data taken by an external camera, numbering pixels based on the image resolution, extracting numbers in the user password to form a digital password, using different encryption methods for the pixels based on the pixel numbers, encrypting the pixels based on the pixel colors of the pixels and the digital password to obtain an encrypted image, and then verifying the identity of the visitor through a camera connection program. After successful verification, the encrypted image is decrypted to obtain image data, so as to solve the problem that the existing monitoring image transmission technology still lacks encryption of image data, resulting in easy leakage of user privacy.

为实现上述目的,第一方面,本申请提供一种地铁监控图像数据加密传输方法,包括如下步骤:To achieve the above objectives, in a first aspect, the present application provides a method for encrypting and transmitting subway monitoring image data, comprising the following steps:

通过外置摄像头获取图像数据;Acquire image data through an external camera;

确认图像数据的图像信息;confirming image information of the image data;

基于图像信息对图像数据进行加密并对图像数据进行传输,得到加密信息;Encrypting the image data based on the image information and transmitting the image data to obtain encrypted information;

确认访问者身份并对加密信息进行解密,得到图像信息。Confirm the visitor's identity and decrypt the encrypted information to obtain the image information.

进一步地,通过外置摄像头获取图像数据包括如下子步骤:Furthermore, obtaining image data through an external camera includes the following sub-steps:

安装外置摄像头;Install an external camera;

通过外置摄像头对地铁监控区域进行拍摄,得到图像数据。The subway monitoring area is photographed by an external camera to obtain image data.

进一步地,确认图像数据的图像信息包括获取图像数据的分辨率,命名为图像分辨率;所述图像分辨率格式为n×m,图像数据内包含n×m个像素点,n与m均为正整数。Furthermore, confirming the image information of the image data includes obtaining the resolution of the image data, which is named as image resolution; the image resolution format is n×m, the image data contains n×m pixels, and n and m are both positive integers.

进一步地,基于图像信息对图像数据进行加密并对图像数据进行传输加密包括如下子步骤:Furthermore, encrypting the image data based on the image information and encrypting the image data for transmission includes the following sub-steps:

对像素点进行编号,命名为像素编号,通过符号S(n,m)表示,S(n,m)具体表示为第n列第m行的像素点;The pixels are numbered and named as pixel numbers, which are represented by the symbol S(n,m), where S(n,m) specifically represents the pixel in the nth column and the mth row;

获取用户设置的用户密码,依次提取用户密码中的数字,命名为数字密码;Get the user password set by the user, extract the numbers in the user password one by one, and name it as a digital password;

对数字密码进行编号,命名为密码编号,通过符号Fi表示,i为正整数;The digital password is numbered and named as the password number, which is represented by the symbol Fi, where i is a positive integer;

针对S(n,m),计算(n+m)%2,%为模运算符,将计算结果命名为判断余数,若判断余数为0,则输出正加密信号;若判断余数为1,则输出反加密信号;For S(n,m), calculate (n+m)%2, where % is the modulus operator. The calculation result is named the judgment remainder. If the judgment remainder is 0, the positive encryption signal is output; if the judgment remainder is 1, the negative encryption signal is output;

获取S(n,m)像素点的像素色,所述像素色为(R,G,B);Get the pixel color of the S(n,m) pixel point, where the pixel color is (R, G, B);

若输出正加密信号,则通过正加密方法对像素点进行加密;若输出反加密信号,则通过反加密方法对像素点进行加密。If a positive encryption signal is output, the pixel points are encrypted using a positive encryption method; if a negative encryption signal is output, the pixel points are encrypted using a negative encryption method.

进一步地,若输出正加密信号,则通过正加密方法对像素点进行加密;若输出反加密信号,则通过反加密方法对像素点进行加密包括如下子步骤:Further, if a positive encryption signal is output, the pixel point is encrypted by a positive encryption method; if a reverse encryption signal is output, the pixel point is encrypted by a reverse encryption method, including the following sub-steps:

输出正加密信号时,获取R,将R-G+B得到r;检测r是否小于0或大于255,若r小于0,则将r增加255;若r大于255,则将r减小255;否则输出色值正常信号;When outputting a positive encrypted signal, obtain R, and add R-G+B to get r; check whether r is less than 0 or greater than 255. If r is less than 0, increase r by 255; if r is greater than 255, decrease r by 255; otherwise, output a signal with normal color value;

输出正加密信号时,获取G,将G+B得到g;检测g是否小于0或大于255,若g小于0,则将g增加255;若g大于255,则将g减小255;否则输出色值正常信号;When outputting a positive encrypted signal, obtain G, add G+B to get g; check whether g is less than 0 or greater than 255. If g is less than 0, increase g by 255; if g is greater than 255, decrease g by 255; otherwise, output a signal with normal color value;

输出正加密信号时,获取B以及Fi,计算i%2的值,将计算结果命名为加减值;若加减值为0,则输出相加信号;若加减值为1,则输出相减信号;若输出相减信号,则将Fi对应的数字变为负数,即-Fi;When outputting a positive encrypted signal, obtain B and Fi, calculate the value of i%2, and name the calculation result as the addition and subtraction value; if the addition and subtraction value is 0, output the addition signal; if the addition and subtraction value is 1, output the subtraction signal; if the subtraction signal is output, change the number corresponding to Fi to a negative number, that is, -Fi;

输出反加密信号时,获取R,将R+G-B得到r;检测r是否小于0或大于255,若r小于0,则将r增加255;若r大于255,则将r减小255;否则输出色值正常信号;When outputting the decrypted signal, obtain R, add R+G-B to get r; check whether r is less than 0 or greater than 255. If r is less than 0, increase r by 255; if r is greater than 255, decrease r by 255; otherwise, output a signal with normal color value;

输出反加密信号时,获取G,将G-B得到g;检测g是否小于0或大于255,若g小于0,则将g增加255;若g大于255,则将g减小255;否则输出色值正常信号;When outputting the decrypted signal, obtain G, and obtain g by subtracting G from B; detect whether g is less than 0 or greater than 255. If g is less than 0, increase g by 255; if g is greater than 255, decrease g by 255; otherwise, output a signal with normal color value;

输出反加密信号时,获取B以及Fi,计算i%2的值,将计算结果命名为加减值;若加减值为0,则输出相减信号;若加减值为1,则输出相加信号;若输出相减信号,则将Fi对应的数字变为负数,即-Fi;When outputting the decrypted signal, obtain B and Fi, calculate the value of i%2, and name the calculation result as the addition and subtraction value; if the addition and subtraction value is 0, output the subtraction signal; if the addition and subtraction value is 1, output the addition signal; if the subtraction signal is output, the number corresponding to Fi is changed to a negative number, that is, -Fi;

依次计算B+F1+……+Fi的值,将计算结果标记为b,检测b是否小于0或大于255,若b小于0,则将b增加255;若b大于255,则将b减小255;否则输出色值正常信号;Calculate the value of B+F1+…+Fi in sequence, mark the calculation result as b, and check whether b is less than 0 or greater than 255. If b is less than 0, increase b by 255; if b is greater than 255, decrease b by 255; otherwise, output a normal color value signal;

将r、g以及b填充至像素色内,得到(r,g,b),将(r,g,b)作为像素点S(n,m)的像素色;Fill r, g and b into the pixel color to obtain (r, g, b), and use (r, g, b) as the pixel color of the pixel point S(n, m);

对图像数据的所有像素点进行加密后得到加密图像,将加密图像传输至摄像头连接程序。After all pixels of the image data are encrypted, an encrypted image is obtained, and the encrypted image is transmitted to the camera connection program.

进一步地,确认访问者身份并对加密信息进行解密,得到图像信息包括如下子步骤:Furthermore, confirming the identity of the visitor and decrypting the encrypted information to obtain the image information includes the following sub-steps:

由摄像头连接程序对访问者身份进行确认;The identity of the visitor is confirmed by the camera connection program;

确认完成后,获取加密图像的图像分辨率,得到像素点K(x,y),x与y均为正整数,x即为图像分辨率中的n,y即为图像分辨率中的m;After confirmation, the image resolution of the encrypted image is obtained to obtain the pixel point K(x,y), where x and y are both positive integers, x is n in the image resolution, and y is m in the image resolution;

计算(x+y)%2,将计算结果命名为解密余数,若解密余数为0,则输出正解密信号;若解密余数为1,则输出反解密信号;Calculate (x+y)%2, and name the calculation result as the decryption remainder. If the decryption remainder is 0, output the positive decryption signal; if the decryption remainder is 1, output the negative decryption signal;

获取K(x,y)的像素色(R,G,B);Get the pixel color (R, G, B) of K(x, y);

若输出正解密信号,则通过正解密方法对像素点进行解密;若输出反解密信号,则通过反解密方法对像素点进行解密。If a positive decryption signal is output, the pixel is decrypted by a positive decryption method; if an inverse decryption signal is output, the pixel is decrypted by an inverse decryption method.

进一步地,若输出正解密信号,则通过正解密方法对像素点进行解密;若输出反解密信号,则通过反解密方法对像素点进行解密包括如下子步骤:Further, if a positive decryption signal is output, the pixel is decrypted by a positive decryption method; if an inverse decryption signal is output, the pixel is decrypted by an inverse decryption method, including the following sub-steps:

输出正解密信号时,获取e以及Fi,计算i%2的值,将计算结果命名为正反值;若正反值为0,则输出相减信号;若正反值为1,则输出相加信号;When outputting the positive and negative decryption signals, obtain e and Fi, calculate the value of i%2, and name the calculation result as the positive and negative values; if the positive and negative values are 0, output the subtraction signal; if the positive and negative values are 1, output the addition signal;

输出反解密信号时,获取e以及Fi,计算正反值;若正反值为0,则输出相加信号;若正反值为1,则输出相减信号;When outputting the inverse decryption signal, obtain e and Fi, and calculate the positive and negative values; if the positive and negative values are 0, output the addition signal; if the positive and negative values are 1, output the subtraction signal;

若输出相减信号,则将Fi对应的数字变为负数,即-Fi;If a subtraction signal is output, the number corresponding to Fi is changed to a negative number, i.e. -Fi;

依次计算e+F1+……+Fi的值,将计算结果标记为e,检测e是否小于0或大于255,若e小于0,则将e增加255;若e大于255,则将e减小255;否则输出色值正常信号;Calculate the value of e+F1+…+Fi in sequence, mark the calculation result as e, and check whether e is less than 0 or greater than 255. If e is less than 0, increase e by 255; if e is greater than 255, decrease e by 255; otherwise, output a normal color value signal;

输出正解密信号时,获取w,将w-e得到w;检测w是否小于0或大于255,若w小于0,则将w增加255;若w大于255,则将w减小255;否则输出色值正常信号;When outputting the positive decryption signal, get w, and get w by subtracting w from e; check whether w is less than 0 or greater than 255. If w is less than 0, increase w by 255; if w is greater than 255, decrease w by 255; otherwise, output a signal with normal color value;

输出正解密信号时,获取q,将q+w-e得到q;检测q是否小于0或大于255,若q小于0,则将q增加255;若q大于255,则将q减小255;否则输出色值正常信号;When outputting the positive decryption signal, get q, add q+w-e to get q; check whether q is less than 0 or greater than 255. If q is less than 0, increase q by 255; if q is greater than 255, decrease q by 255; otherwise, output a signal with normal color value;

输出反解密信号时,获取w,将w+e得到w;检测w是否小于0或大于255,若w小于0,则将w增加255;若w大于255,则将w减小255;否则输出色值正常信号;When outputting the decrypted signal, get w, add w+e to get w; check whether w is less than 0 or greater than 255. If w is less than 0, increase w by 255; if w is greater than 255, decrease w by 255; otherwise, output a signal with normal color value;

输出反解密信号时,获取q,将q-w+e得到q;检测q是否小于0或大于255,若q小于0,则将q增加255;若q大于255,则将q减小255;否则输出色值正常信号;When outputting the decrypted signal, get q, and add q-w+e to get q; check whether q is less than 0 or greater than 255. If q is less than 0, increase q by 255; if q is greater than 255, decrease q by 255; otherwise, output a signal with normal color value;

将q、w以及e填充至像素色内,得到(q,w,e),将(q,w,e)作为像素点K(x,y)的像素色;Fill q, w and e into the pixel color to obtain (q, w, e), and use (q, w, e) as the pixel color of the pixel point K(x, y);

将加密图像内所有的像素点解密完成后得到图像数据并通过摄像头连接程序实时解密并展现给用户。After all pixels in the encrypted image are decrypted, the image data is obtained and decrypted in real time through the camera connection program and displayed to the user.

第二方面,本申请提供外置摄像头图像数据传输系统,包括外置摄像头、图像信息获取模块、图像数据加密模块以及加密图像解密模块;所述外置摄像头、图像信息获取模块以及加密图像解密模块分别与图像数据加密模块数据连接;In a second aspect, the present application provides an external camera image data transmission system, including an external camera, an image information acquisition module, an image data encryption module, and an encrypted image decryption module; the external camera, the image information acquisition module, and the encrypted image decryption module are respectively data-connected to the image data encryption module;

所述外置摄像头用于通过外置摄像头获取图像数据;The external camera is used to obtain image data through the external camera;

所述图像信息获取模块用于确认图像数据的图像信息;The image information acquisition module is used to confirm the image information of the image data;

所述图像数据加密模块用于基于图像信息对图像数据进行加密并对图像数据进行传输,得到加密信息;The image data encryption module is used to encrypt the image data based on the image information and transmit the image data to obtain encrypted information;

所述加密图像解密模块用于确认访问者身份并对加密信息进行解密,得到图像信息。The encrypted image decryption module is used to confirm the identity of the visitor and decrypt the encrypted information to obtain image information.

第三方面,本申请提供一种电子设备,包括处理器以及存储器,所述存储器存储有计算机可读取指令,当所述计算机可读取指令由所述处理器执行时,运行如上方法中的步骤。In a third aspect, the present application provides an electronic device, comprising a processor and a memory, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the steps in the above method are executed.

第四方面,本申请提供一种存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时,运行如上方法中的步骤。In a fourth aspect, the present application provides a storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps in the above method are executed.

本发明的有益效果:本发明通过获取用户密码并提取其中的数字,组成数字密码,优势在于,每个用户都有他自己独特的用户密码,而由用户密码中的数字组成数字密码进而对图像数据进行加密可以确保数字密码的唯一性,提高了图像数据的安全性;Beneficial effects of the present invention: The present invention obtains the user password and extracts the numbers therein to form a digital password. The advantage is that each user has his own unique user password, and the digital password formed by the numbers in the user password and then encrypting the image data can ensure the uniqueness of the digital password and improve the security of the image data.

本发明通过基于图像分辨率对像素点进行编号,得到像素编号,再基于像素编号对像素点采用不同的加密方法进行加密,优势在于,通过不同的加密方法对不同的像素点进行加密可以避免同一图像数据经由相同的加密方法加密后的加密图像具有一定规律,同时增加了破解的难度,提高了图像数据的安全性以及图像数据加密的有效性;The present invention obtains pixel numbers by numbering the pixel points based on the image resolution, and then encrypts the pixel points using different encryption methods based on the pixel numbers. The advantage is that encrypting different pixel points using different encryption methods can avoid the encrypted images of the same image data encrypted by the same encryption method having certain regularities, and at the same time increases the difficulty of cracking, improves the security of the image data and the effectiveness of the image data encryption;

本发明通过获取像素点的像素色,结合数字密码以及加密方法对像素点进行加密得到加密图像,优势在于,加密图像中的像素点之间没有规律,对图像数据本身进行加密也可以防止他人对摄像头进行破解从而获取到图像数据,只有通过身份认证后才能得到原始的图像数据,进一步提高了图像数据的安全性以及隐私性。The present invention obtains the pixel color of the pixel point and encrypts the pixel point in combination with a digital password and an encryption method to obtain an encrypted image. The advantage is that there is no regularity between the pixels in the encrypted image. Encrypting the image data itself can also prevent others from cracking the camera and obtaining the image data. The original image data can only be obtained after identity authentication, which further improves the security and privacy of the image data.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

图1为本发明的系统的原理框图;Fig. 1 is a functional block diagram of a system of the present invention;

图2为本发明的图像数据;FIG. 2 is image data of the present invention;

图3为本发明的方法的步骤流程图。FIG. 3 is a flow chart showing the steps of the method of the present invention.

具体实施方式DETAILED DESCRIPTION

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

实施例1,请参阅图1所示,第一方面,本申请提供外置摄像头图像数据传输系统,包括外置摄像头、图像信息获取模块、图像数据加密模块以及加密图像解密模块;外置摄像头、图像信息获取模块以及加密图像解密模块分别与图像数据加密模块数据连接;Embodiment 1, please refer to FIG1 , in the first aspect, the present application provides an external camera image data transmission system, including an external camera, an image information acquisition module, an image data encryption module and an encrypted image decryption module; the external camera, the image information acquisition module and the encrypted image decryption module are respectively connected to the image data encryption module;

请参阅图2所示,外置摄像头用于通过外置摄像头获取图像数据;安装外置摄像头;通过外置摄像头对地铁监控区域进行拍摄,得到图像数据;Please refer to FIG. 2 , the external camera is used to obtain image data through the external camera; the external camera is installed; the subway monitoring area is photographed through the external camera to obtain image data;

具体实施中,外置摄像头采用现有的高清摄像头。通过外置摄像头拍摄得到图像数据如涉及用户隐私,因此本实施例中的图像数据仅展示部分自然区域,且图像分辨率过大时不利于本实施例对图像加密的原理进行具体解释,因此仅截取原图中的部分图像得到图2,将图2设置为图像数据并进行后续处理,本实施例旨在解释说明图像数据的具体分析过程及原理,视频数据则获取其每一帧的图像数据进行加密。In the specific implementation, the external camera uses an existing high-definition camera. The image data obtained by shooting with an external camera involves user privacy. Therefore, the image data in this embodiment only shows part of the natural area, and when the image resolution is too large, it is not conducive to the specific explanation of the principle of image encryption in this embodiment. Therefore, only part of the image in the original image is intercepted to obtain Figure 2, and Figure 2 is set as image data and subsequently processed. This embodiment aims to explain the specific analysis process and principle of image data. The video data obtains the image data of each frame for encryption.

图像信息获取模块用于确认图像数据的图像信息;获取图像数据的分辨率,命名为图像分辨率;图像分辨率格式为n×m,图像数据内包含n×m个像素点,n与m均为正整数;The image information acquisition module is used to confirm the image information of the image data; obtain the resolution of the image data, which is named image resolution; the image resolution format is n×m, and the image data contains n×m pixels, where n and m are both positive integers;

具体实施中,获取到图像分辨率为16×16,1≤n≤16,1≤m≤≤16。In a specific implementation, the obtained image resolution is 16×16, 1≤n≤16, 1≤m≤≤16.

图像数据加密模块用于基于图像信息对图像数据进行加密并对图像数据进行传输,得到加密信息;图像数据加密模块包括加密决策单元以及图像加密单元;The image data encryption module is used to encrypt the image data based on the image information and transmit the image data to obtain the encrypted information; the image data encryption module includes an encryption decision unit and an image encryption unit;

加密决策单元配置有加密决策策略,加密决策策略包括:The encryption decision unit is configured with an encryption decision strategy, which includes:

对像素点进行编号,命名为像素编号,通过符号S(n,m)表示,S(n,m)具体表示为第n列第m行的像素点;The pixels are numbered and named as pixel numbers, which are represented by the symbol S(n,m), where S(n,m) specifically represents the pixel in the nth column and the mth row;

获取用户设置的用户密码,依次提取用户密码中的数字,命名为数字密码;Get the user password set by the user, extract the numbers in the user password one by one, and name it as a digital password;

对数字密码进行编号,命名为密码编号,通过符号Fi表示,i为正整数;The digital password is numbered and named as the password number, which is represented by the symbol Fi, where i is a positive integer;

具体实施中,对像素点进行编号,得到像素编号为S(1,1)至S(16,16);获取到用户密码为TEST134test556,依次提取到数字为1、3、4、5、5以及6,即数字密码为134556,对数字密码进行编号,得到密码编号为F1至F6,1≤i≤6;In a specific implementation, the pixels are numbered to obtain pixel numbers S(1,1) to S(16,16); the user password is obtained as TEST134test556, and the numbers 1, 3, 4, 5, 5 and 6 are extracted in sequence, that is, the digital password is 134556, and the digital passwords are numbered to obtain password numbers F1 to F6, 1≤i≤6;

针对S(n,m),计算(n+m)%2,%为模运算符,将计算结果命名为判断余数,若判断余数为0,则输出正加密信号;若判断余数为1,则输出反加密信号;For S(n,m), calculate (n+m)%2, where % is the modulus operator. The calculation result is named the judgment remainder. If the judgment remainder is 0, the positive encryption signal is output; if the judgment remainder is 1, the negative encryption signal is output;

获取S(n,m)像素点的像素色,像素色为(R,G,B);Get the pixel color of pixel S(n,m), the pixel color is (R, G, B);

若输出正加密信号,则通过正加密方法对像素点进行加密;若输出反加密信号,则通过反加密方法对像素点进行加密;If a positive encryption signal is output, the pixel is encrypted by a positive encryption method; if a negative encryption signal is output, the pixel is encrypted by a negative encryption method;

具体实施中,本实施例以S(1,1)与S(1,2)进行举例说明,其余像素点的分析过程与S(1,1)以及S(1,2)相同;针对S(1,1),n=1,m=1,计算得到判断余数为0,输出正加密信号,通过正加密方法对像素点S(1,1)进行加密;针对S(1,2),n=1,m=2,计算得到判断余数为1,输出反加密信号,通过反加密方法对像素点S(1,2)进行加密;获取到S(1,1)的像素色为(76,76,76),S(1,2)的像素色为(206,206,206);In the specific implementation, this embodiment takes S(1,1) and S(1,2) as examples, and the analysis process of the remaining pixels is the same as that of S(1,1) and S(1,2); for S(1,1), n=1, m=1, the calculated judgment remainder is 0, and the positive encryption signal is output, and the pixel point S(1,1) is encrypted by the positive encryption method; for S(1,2), n=1, m=2, the calculated judgment remainder is 1, and the reverse encryption signal is output, and the pixel point S(1,2) is encrypted by the reverse encryption method; the pixel color of S(1,1) is obtained to be (76, 76, 76), and the pixel color of S(1,2) is obtained to be (206, 206, 206);

图像加密单元配置有图像加密策略,图像加密策略包括:The image encryption unit is configured with an image encryption strategy, which includes:

输出正加密信号时,获取R,将R-G+B得到r;检测r是否小于0或大于255,若r小于0,则将r增加255;若r大于255,则将r减小255;否则输出色值正常信号;When outputting a positive encrypted signal, obtain R, and add R-G+B to get r; check whether r is less than 0 or greater than 255. If r is less than 0, increase r by 255; if r is greater than 255, decrease r by 255; otherwise, output a signal with normal color value;

输出正加密信号时,获取G,将G+B得到g;检测g是否小于0或大于255,若g小于0,则将g增加255;若g大于255,则将g减小255;否则输出色值正常信号;实际应用中,图像数据为彩色图像,通常情况下R、G以及B不相等,本实施例中的图像数据为灰度图像,因此R、G以及B相等,导致加密效果会减弱,但不影响实际使用,本实施例仅用于解释说明加密过程;When outputting a positive encrypted signal, obtain G, and add G to B to obtain g; detect whether g is less than 0 or greater than 255, if g is less than 0, increase g by 255; if g is greater than 255, decrease g by 255; otherwise, output a signal with normal color value; in practical applications, the image data is a color image, and usually R, G, and B are not equal. In this embodiment, the image data is a grayscale image, so R, G, and B are equal, which weakens the encryption effect, but does not affect the actual use. This embodiment is only used to explain the encryption process;

具体实施中,像素点S(1,1)输出了正加密信号,S(1,1)的像素色为(76,76,76),获取到R为76,G为76,B为76,R-G+B得到r=76,通过比对得到r大于0且小于255,输出色值正常信号;将G+B得到g=152,通过比对得到g大于0且小于255,输出色值正常信号;In the specific implementation, the pixel point S(1,1) outputs a positive encrypted signal. The pixel color of S(1,1) is (76, 76, 76). R is 76, G is 76, and B is 76. R-G+B gets r=76. By comparison, it is found that r is greater than 0 and less than 255, and the color value is normal. G+B gets g=152. By comparison, it is found that g is greater than 0 and less than 255, and the color value is normal.

输出正加密信号时,获取B以及Fi,计算i%2的值,将计算结果命名为加减值;若加减值为0,则输出相加信号;若加减值为1,则输出相减信号;若输出相减信号,则将Fi对应的数字变为负数,即-Fi;When outputting a positive encrypted signal, obtain B and Fi, calculate the value of i%2, and name the calculation result as the addition and subtraction value; if the addition and subtraction value is 0, output the addition signal; if the addition and subtraction value is 1, output the subtraction signal; if the subtraction signal is output, change the number corresponding to Fi to a negative number, that is, -Fi;

具体实施中,像素点S(1,1)输出了正加密信号,获取F1至F6依次为1、3、4、5、5以及6,针对F1,i=1,计算得到加减值为1,则输出相减信号,将F1更改为负数,即-1;同理分析得到F2为3,F3为-4,F4为5,F5为-5,F6为6;In the specific implementation, the pixel point S(1,1) outputs a positive encrypted signal, and F1 to F6 are obtained as 1, 3, 4, 5, 5 and 6 respectively. For F1, i=1, the calculated addition and subtraction value is 1, then the subtraction signal is output, and F1 is changed to a negative number, that is, -1; similarly, F2 is 3, F3 is -4, F4 is 5, F5 is -5, and F6 is 6;

输出反加密信号时,获取R,将R+G-B得到r;检测r是否小于0或大于255,若r小于0,则将r增加255;若r大于255,则将r减小255;否则输出色值正常信号;When outputting the decrypted signal, obtain R, add R+G-B to get r; check whether r is less than 0 or greater than 255. If r is less than 0, increase r by 255; if r is greater than 255, decrease r by 255; otherwise, output a signal with normal color value;

输出反加密信号时,获取G,将G-B得到g;检测g是否小于0或大于255,若g小于0,则将g增加255;若g大于255,则将g减小255;否则输出色值正常信号;When outputting the decrypted signal, obtain G, and obtain g by subtracting G from B; detect whether g is less than 0 or greater than 255. If g is less than 0, increase g by 255; if g is greater than 255, decrease g by 255; otherwise, output a signal with normal color value;

具体实施中,像素点S(1,2)输出了反加密信号,S(1,2)的像素色为(206,206,206),获取到R为206,G为206,B为206,R+G-B得到r=206,通过比对得到r大于0且小于255,输出色值正常信号;将G-B得到g=0,通过比对得到g等于0,输出色值正常信号;In the specific implementation, the pixel point S(1,2) outputs the anti-encryption signal. The pixel color of S(1,2) is (206, 206, 206). R is 206, G is 206, and B is 206. R+G-B gets r=206. By comparison, it is found that r is greater than 0 and less than 255, and the color value is output as a normal signal; G-B gets g=0. By comparison, it is found that g is equal to 0, and the color value is output as a normal signal;

输出反加密信号时,获取B以及Fi,计算i%2的值,将计算结果命名为加减值;若加减值为0,则输出相减信号;若加减值为1,则输出相加信号;若输出相减信号,则将Fi对应的数字变为负数,即-Fi;When outputting the decrypted signal, obtain B and Fi, calculate the value of i%2, and name the calculation result as the addition and subtraction value; if the addition and subtraction value is 0, output the subtraction signal; if the addition and subtraction value is 1, output the addition signal; if the subtraction signal is output, the number corresponding to Fi is changed to a negative number, that is, -Fi;

具体实施中,像素点S(1,2)输出了正加密信号,获取F1至F6依次为1、3、4、5、5以及6,针对F2,i=2,计算得到加减值为0,则输出相减信号,将F2更改为负数,即-3;同理分析得到F1为1,F3为4,F4为-5,F5为5,F6为-6;In the specific implementation, the pixel point S(1,2) outputs a positive encrypted signal, and F1 to F6 are obtained as 1, 3, 4, 5, 5 and 6 respectively. For F2, i=2, the calculated addition and subtraction value is 0, then the subtraction signal is output, and F2 is changed to a negative number, that is, -3; similarly, F1 is 1, F3 is 4, F4 is -5, F5 is 5, and F6 is -6;

依次计算B+F1+……+Fi的值,将计算结果标记为b,检测b是否小于0或大于255,若b小于0,则将b增加255;若b大于255,则将b减小255;否则输出色值正常信号;Calculate the value of B+F1+…+Fi in sequence, mark the calculation result as b, and check whether b is less than 0 or greater than 255. If b is less than 0, increase b by 255; if b is greater than 255, decrease b by 255; otherwise, output a normal color value signal;

具体实施中,对于S(1,1),B为76,F1为-1,F2为3,F3为-4,F4为5,F5为-5,F6为6,计算得到b=80,通过比对得到b大于0且小于255,输出色值正常信号;In the specific implementation, for S(1,1), B is 76, F1 is -1, F2 is 3, F3 is -4, F4 is 5, F5 is -5, F6 is 6, and b=80 is calculated. By comparison, it is found that b is greater than 0 and less than 255, and the output color value is a normal signal;

对于S(1,2),B为206,F1为1,F2为-3,F3为4,F4为-5,F5为5,F6为-6,计算得到b=202,通过比对得到b大于0且小于255,输出色值正常信号;For S(1,2), B is 206, F1 is 1, F2 is -3, F3 is 4, F4 is -5, F5 is 5, and F6 is -6. The calculated value is b=202. By comparison, it is found that b is greater than 0 and less than 255, and the output color value is normal.

将r、g以及b填充至像素色内,得到(r,g,b),将(r,g,b)作为像素点S(n,m)的像素色;Fill r, g and b into the pixel color to obtain (r, g, b), and use (r, g, b) as the pixel color of the pixel point S(n, m);

对图像数据的所有像素点进行加密后得到加密图像,将加密图像传输至摄像头连接程序;After encrypting all pixels of the image data, an encrypted image is obtained, and the encrypted image is transmitted to the camera connection program;

具体实施中,对于S(1,1),计算得到r=76,g=152,b=80,则将(76,152,80)作为像素点S(1,1)的像素色并填充至S(1,1);对于S(1,2),计算得到r=206,g=0,b=202,则将(206,0,202)作为像素点S(1,2)的像素色并填充至S(1,2);对所有像素点进行加密后得到加密图像,由于加密后的像素色为彩色,本实施例中不对加密图像进行展示,加密图像中部分像素点的像素色如下表1所示:In a specific implementation, for S(1,1), r=76, g=152, b=80 are calculated, and (76, 152, 80) is used as the pixel color of the pixel point S(1,1) and filled to S(1,1); for S(1,2), r=206, g=0, b=202 are calculated, and (206, 0, 202) is used as the pixel color of the pixel point S(1,2) and filled to S(1,2); after all pixels are encrypted, an encrypted image is obtained. Since the encrypted pixel color is in color, the encrypted image is not displayed in this embodiment. The pixel colors of some pixels in the encrypted image are shown in Table 1 below:

表1加密图像中部分像素点的像素色Table 1 Pixel colors of some pixels in the encrypted image

由于数据过多,本实施例中仅展示部分数据。Due to the excessive amount of data, only part of the data is shown in this embodiment.

加密图像解密模块用于确认访问者身份并对加密信息进行解密,得到图像信息;加密图像解密模块包括解密决策单元以及图像解密单元;The encrypted image decryption module is used to confirm the identity of the visitor and decrypt the encrypted information to obtain the image information; the encrypted image decryption module includes a decryption decision unit and an image decryption unit;

解密决策单元配置有解密决策策略,解密决策策略包括:The decryption decision unit is configured with a decryption decision strategy, which includes:

由摄像头连接程序对访问者身份进行确认;The identity of the visitor is confirmed by the camera connection program;

确认完成后,获取加密图像的图像分辨率,得到像素点K(x,y),x与y均为正整数,x即为图像分辨率中的n,y即为图像分辨率中的m;After confirmation, the image resolution of the encrypted image is obtained to obtain the pixel point K(x,y), where x and y are both positive integers, x is n in the image resolution, and y is m in the image resolution;

具体实施中,摄像头连接程序为现有的高清摄像头自行配备的访问程序,能够通过账号密码或验证码等方式对访问者的身份进行确认;确认完成后,获取到加密图像的图像分辨率为16×16,得到像素点K(1,1)至K(16,16);本实施例中针对K(1,1)以及K(1,2)进行分析,与S(1,1)和S(1,2)相对应,旨在解释说明像素点具体的解密过程,其余像素点的解密过程与K(1,1)以及K(1,2)相同;In a specific implementation, the camera connection program is an access program that is equipped by an existing high-definition camera, and can confirm the identity of the visitor through an account password or a verification code. After the confirmation is completed, the image resolution of the encrypted image is 16×16, and the pixels K(1,1) to K(16,16) are obtained. In this embodiment, K(1,1) and K(1,2) are analyzed, corresponding to S(1,1) and S(1,2), in order to explain the specific decryption process of the pixels. The decryption process of the remaining pixels is the same as that of K(1,1) and K(1,2).

计算(x+y)%2,将计算结果命名为解密余数,若解密余数为0,则输出正解密信号;若解密余数为1,则输出反解密信号;Calculate (x+y)%2, and name the calculation result as the decryption remainder. If the decryption remainder is 0, output the positive decryption signal; if the decryption remainder is 1, output the negative decryption signal;

获取K(x,y)的像素色(R,G,B);Get the pixel color (R, G, B) of K(x, y);

若输出正解密信号,则通过正解密方法对像素点进行解密;若输出反解密信号,则通过反解密方法对像素点进行解密;If a positive decryption signal is output, the pixel is decrypted by a positive decryption method; if an inverse decryption signal is output, the pixel is decrypted by an inverse decryption method;

具体实施中,对于K(1,1),x=1,y=1,通过计算得到解密余数为0,输出正解密信号,通过正解密方法对像素点进行解密;对于K(1,2),x=1,y=2,通过计算得到解密余数为1,输出反解密信号,通过反解密方法对像素点进行解密;获取到K(1,1)的像素色为(76,152,80),K(1,2)的像素色为(206,0,202);In the specific implementation, for K(1,1), x=1, y=1, the decryption remainder obtained by calculation is 0, the positive decryption signal is output, and the pixel point is decrypted by the positive decryption method; for K(1,2), x=1, y=2, the decryption remainder obtained by calculation is 1, the reverse decryption signal is output, and the pixel point is decrypted by the reverse decryption method; the pixel color of K(1,1) is obtained to be (76, 152, 80), and the pixel color of K(1,2) is obtained to be (206, 0, 202);

图像解密单元配置有图像解密策略,图像解密策略包括:The image decryption unit is configured with an image decryption strategy, which includes:

输出正解密信号时,获取e以及Fi,计算i%2的值,将计算结果命名为正反值;若正反值为0,则输出相减信号;若正反值为1,则输出相加信号;When outputting the positive and negative decryption signals, obtain e and Fi, calculate the value of i%2, and name the calculation result as the positive and negative values; if the positive and negative values are 0, output the subtraction signal; if the positive and negative values are 1, output the addition signal;

输出反解密信号时,获取e以及Fi,计算正反值;若正反值为0,则输出相加信号;若正反值为1,则输出相减信号;When outputting the inverse decryption signal, obtain e and Fi, and calculate the positive and negative values; if the positive and negative values are 0, output the addition signal; if the positive and negative values are 1, output the subtraction signal;

若输出相减信号,则将Fi对应的数字变为负数,即-Fi;If a subtraction signal is output, the number corresponding to Fi is changed to a negative number, i.e. -Fi;

具体实施中,K(1,1)输出了正解密信号,获取到Fi依次为1、3、4、5、5以及6,对于F2,i=2,计算得到正反值为0,输出相减信号,将F2更改为负数,F2为3,即将F2更改为-3,同理可得F1为1,F3为4,F4为-5,F5为5,F6为-6;In the specific implementation, K(1,1) outputs a positive decryption signal, and the obtained Fi are 1, 3, 4, 5, 5 and 6 respectively. For F2, i=2, the calculated positive and negative values are 0, and the subtraction signal is output to change F2 to a negative number. F2 is 3, that is, F2 is changed to -3. Similarly, F1 is 1, F3 is 4, F4 is -5, F5 is 5, and F6 is -6.

K(1,2)输出了反解密信号,Fi依次为1、3、4、5、5以及6,对于F1,i=1,计算得到正反值为1,输出相减信号,将F1更改为负数,F2为1,即将F1更改为-1,同理可得F2为3,F3为-4,F4为5,F5为-5,F6为6;K(1,2) outputs the inverse decryption signal. Fi is 1, 3, 4, 5, 5 and 6. For F1, i=1, the calculated positive and negative values are 1, and the subtraction signal is output. F1 is changed to a negative number. F2 is 1, that is, F1 is changed to -1. Similarly, F2 is 3, F3 is -4, F4 is 5, F5 is -5, and F6 is 6.

依次计算e+F1+……+Fi的值,将计算结果标记为e,检测e是否小于0或大于255,若e小于0,则将e增加255;若e大于255,则将e减小255;否则输出色值正常信号;Calculate the value of e+F1+…+Fi in sequence, mark the calculation result as e, and check whether e is less than 0 or greater than 255. If e is less than 0, increase e by 255; if e is greater than 255, decrease e by 255; otherwise, output a normal color value signal;

具体实施中,对于K(1,1),e为80,计算得到e+F1+F2+F3+F4+F5+F6=80+1-3+4-5+5-6=e=76,通过比对得到e大于0且小于255,输出色值正常信号;In the specific implementation, for K(1,1), e is 80, and the calculation results are e+F1+F2+F3+F4+F5+F6=80+1-3+4-5+5-6=e=76. By comparison, it is found that e is greater than 0 and less than 255, and the output color value is a normal signal;

对于K(1,2),e为202,计算得到e+F1+F2+F3+F4+F5+F6=202-1+3-4+5-5+6=e=206,通过比对得到e大于0且小于255,输出色值正常信号;For K(1,2), e is 202, and we get e+F1+F2+F3+F4+F5+F6=202-1+3-4+5-5+6=e=206. By comparison, we get that e is greater than 0 and less than 255, and the output color value is a normal signal.

输出正解密信号时,获取w,将w-e得到w;检测w是否小于0或大于255,若w小于0,则将w增加255;若w大于255,则将w减小255;否则输出色值正常信号;When outputting the positive decryption signal, get w, and get w by subtracting w from e; check whether w is less than 0 or greater than 255. If w is less than 0, increase w by 255; if w is greater than 255, decrease w by 255; otherwise, output a signal with normal color value;

输出正解密信号时,获取q,将q+w-e得到q;检测q是否小于0或大于255,若q小于0,则将q增加255;若q大于255,则将q减小255;否则输出色值正常信号;When outputting the positive decryption signal, get q, add q+w-e to get q; check whether q is less than 0 or greater than 255. If q is less than 0, increase q by 255; if q is greater than 255, decrease q by 255; otherwise, output a signal with normal color value;

具体实施中,K(1,1)输出了正解密信号,获取到w为152,计算得到e为76,则计算w-e得到w为76,通过比对得到w大于0且小于255,输出色值正常信号;获取到q为76,计算得到w为76,e为76,则计算q+w-e得到q为76,通过比对得到q大于0且小于255,输出色值正常信号;In the specific implementation, K(1,1) outputs a positive decryption signal, obtains w as 152, calculates e as 76, then calculates w-e to get w as 76, and by comparison, w is greater than 0 and less than 255, and outputs a signal with normal color value; obtains q as 76, calculates w as 76, and e is 76, then calculates q+w-e to get q as 76, and by comparison, q is greater than 0 and less than 255, and outputs a signal with normal color value;

输出反解密信号时,获取w,将w+e得到w;检测w是否小于0或大于255,若w小于0,则将w增加255;若w大于255,则将w减小255;否则输出色值正常信号;When outputting the decrypted signal, get w, add w+e to get w; check whether w is less than 0 or greater than 255. If w is less than 0, increase w by 255; if w is greater than 255, decrease w by 255; otherwise, output a signal with normal color value;

输出反解密信号时,获取q,将q-w+e得到q;检测q是否小于0或大于255,若q小于0,则将q增加255;若q大于255,则将q减小255;否则输出色值正常信号;When outputting the decrypted signal, get q, and add q-w+e to get q; check whether q is less than 0 or greater than 255. If q is less than 0, increase q by 255; if q is greater than 255, decrease q by 255; otherwise, output a signal with normal color value;

具体实施中,K(1,2)输出了反解密信号,获取到w为0,计算得到e为206,则计算w+e得到w为206,通过比对得到w大于0且小于255,输出色值正常信号;获取到q为206,计算得到w为206,e为206,则计算q-w+e得到q为206,通过比对得到q大于0且小于255,输出色值正常信号;In the specific implementation, K(1,2) outputs the decrypted signal, obtains w as 0, calculates e as 206, then calculates w+e to obtain w as 206, and by comparison, it is found that w is greater than 0 and less than 255, and the color value is output as a normal signal; obtains q as 206, calculates w as 206, and e is 206, then calculates q-w+e to obtain q as 206, and by comparison, it is found that q is greater than 0 and less than 255, and the color value is output as a normal signal;

将q、w以及e填充至像素色内,得到(q,w,e),将(q,w,e)作为像素点K(x,y)的像素色;Fill q, w and e into the pixel color to obtain (q, w, e), and use (q, w, e) as the pixel color of the pixel point K(x, y);

将加密图像内所有的像素点解密完成后得到图像数据并通过摄像头连接程序实时解密并展现给用户;After all pixels in the encrypted image are decrypted, the image data is obtained and decrypted in real time through the camera connection program and displayed to the user;

具体实施中,对于K(1,1),计算得到q为76,w为76,e为76,则将(76,76,76)作为像素点K(1,1)的像素色并填充至K(1,1);对于K(1,2),计算得到q为206,w为206,e为206,则将(206,206,206)作为像素点K(1,2)的像素色并填充至K(1,2);对所有像素点进行解密得到图像数据并通过摄像头连接程序展现给用户。In the specific implementation, for K(1,1), q is calculated to be 76, w is 76, and e is 76, then (76, 76, 76) is used as the pixel color of the pixel point K(1,1) and filled to K(1,1); for K(1,2), q is calculated to be 206, w is 206, and e is 206, then (206, 206, 206) is used as the pixel color of the pixel point K(1,2) and filled to K(1,2); all pixels are decrypted to obtain image data and displayed to the user through the camera connection program.

实施例2,请参阅图3所示,第二方面,本申请提供一种地铁监控图像数据加密传输方法,包括如下步骤:Embodiment 2, please refer to FIG3 , in a second aspect, the present application provides a method for encrypting and transmitting subway monitoring image data, comprising the following steps:

步骤S1,通过外置摄像头获取图像数据;步骤S1包括如下子步骤:Step S1, acquiring image data through an external camera; Step S1 includes the following sub-steps:

步骤S101,安装外置摄像头;Step S101, installing an external camera;

步骤S102,通过外置摄像头对地铁监控区域进行拍摄,得到图像数据;Step S102, photographing the subway monitoring area through an external camera to obtain image data;

步骤S2,确认图像数据的图像信息;确认图像数据的图像信息包括获取图像数据的分辨率,命名为图像分辨率;图像分辨率格式为n×m,图像数据内包含n×m个像素点,n与m均为正整数;Step S2, confirming the image information of the image data; confirming the image information of the image data includes obtaining the resolution of the image data, which is named as the image resolution; the image resolution format is n×m, the image data contains n×m pixels, and n and m are both positive integers;

步骤S3,基于图像信息对图像数据进行加密并对图像数据进行传输,得到加密信息;步骤S3包括如下子步骤:Step S3, encrypting the image data based on the image information and transmitting the image data to obtain encrypted information; Step S3 includes the following sub-steps:

步骤S301,对像素点进行编号,命名为像素编号,通过符号S(n,m)表示,S(n,m)具体表示为第n列第m行的像素点;Step S301, numbering the pixels, named as pixel numbers, represented by the symbol S(n,m), where S(n,m) specifically represents the pixel in the nth column and the mth row;

步骤S302,获取用户设置的用户密码,依次提取用户密码中的数字,命名为数字密码;Step S302, obtaining a user password set by the user, extracting numbers from the user password in sequence, and naming them as digital passwords;

步骤S303,对数字密码进行编号,命名为密码编号,通过符号Fi表示,i为正整数;Step S303, numbering the digital password, naming it as the password number, represented by the symbol Fi, where i is a positive integer;

步骤S304,针对S(n,m),计算(n+m)%2,%为模运算符,将计算结果命名为判断余数,若判断余数为0,则输出正加密信号;若判断余数为1,则输出反加密信号;Step S304, for S(n,m), calculate (n+m)%2, where % is a modulo operator, and name the calculation result as the judgment remainder. If the judgment remainder is 0, output the positive encryption signal; if the judgment remainder is 1, output the reverse encryption signal;

步骤S305,获取S(n,m)像素点的像素色,像素色为(R,G,B);Step S305, obtaining the pixel color of the S(n,m) pixel point, the pixel color is (R, G, B);

步骤S306,若输出正加密信号,则通过正加密方法对像素点进行加密;若输出反加密信号,则通过反加密方法对像素点进行加密;Step S306: if a positive encryption signal is output, the pixel is encrypted by a positive encryption method; if a negative encryption signal is output, the pixel is encrypted by a negative encryption method;

步骤S306包括如下子步骤:Step S306 includes the following sub-steps:

步骤S30601,输出正加密信号时,获取R,将R-G+B得到r;检测r是否小于0或大于255,若r小于0,则将r增加255;若r大于255,则将r减小255;否则输出色值正常信号;Step S30601, when outputting a positive encrypted signal, obtain R, and obtain r by adding R-G+B; detect whether r is less than 0 or greater than 255, if r is less than 0, increase r by 255; if r is greater than 255, decrease r by 255; otherwise, output a signal with normal color value;

步骤S30602,输出正加密信号时,获取G,将G+B得到g;检测g是否小于0或大于255,若g小于0,则将g增加255;若g大于255,则将g减小255;否则输出色值正常信号;Step S30602, when outputting a positive encrypted signal, obtain G, add G to B to get g; detect whether g is less than 0 or greater than 255, if g is less than 0, increase g by 255; if g is greater than 255, decrease g by 255; otherwise, output a signal with normal color value;

步骤S30603,输出正加密信号时,获取B以及Fi,计算i%2的值,将计算结果命名为加减值;若加减值为0,则输出相加信号;若加减值为1,则输出相减信号;若输出相减信号,则将Fi对应的数字变为负数,即-Fi;Step S30603, when outputting a positive encrypted signal, obtain B and Fi, calculate the value of i%2, and name the calculation result as the addition and subtraction value; if the addition and subtraction value is 0, output the addition signal; if the addition and subtraction value is 1, output the subtraction signal; if the subtraction signal is output, change the number corresponding to Fi to a negative number, that is, -Fi;

步骤S30604,输出反加密信号时,获取R,将R+G-B得到r;检测r是否小于0或大于255,若r小于0,则将r增加255;若r大于255,则将r减小255;否则输出色值正常信号;Step S30604, when outputting the de-encrypted signal, obtain R, add R to G-B to get r; detect whether r is less than 0 or greater than 255, if r is less than 0, increase r by 255; if r is greater than 255, decrease r by 255; otherwise, output a signal with normal color value;

步骤S30605,输出反加密信号时,获取G,将G-B得到g;检测g是否小于0或大于255,若g小于0,则将g增加255;若g大于255,则将g减小255;否则输出色值正常信号;Step S30605, when outputting the decrypted signal, obtain G, and obtain g by subtracting G from B; detect whether g is less than 0 or greater than 255, if g is less than 0, increase g by 255; if g is greater than 255, decrease g by 255; otherwise, output a signal with normal color value;

步骤S30606,输出反加密信号时,获取B以及Fi,计算i%2的值,将计算结果命名为加减值;若加减值为0,则输出相减信号;若加减值为1,则输出相加信号;若输出相减信号,则将Fi对应的数字变为负数,即-Fi;Step S30606, when outputting the decrypted signal, obtain B and Fi, calculate the value of i%2, and name the calculation result as the addition and subtraction value; if the addition and subtraction value is 0, output the subtraction signal; if the addition and subtraction value is 1, output the addition signal; if the subtraction signal is output, the number corresponding to Fi is changed to a negative number, that is, -Fi;

步骤S30607,依次计算B+F1+……+Fi的值,将计算结果标记为b,检测b是否小于0或大于255,若b小于0,则将b增加255;若b大于255,则将b减小255;否则输出色值正常信号;Step S30607, calculate the value of B+F1+...+Fi in sequence, mark the calculation result as b, and detect whether b is less than 0 or greater than 255. If b is less than 0, increase b by 255; if b is greater than 255, decrease b by 255; otherwise, output a signal with normal color value;

步骤S30608,将r、g以及b填充至像素色内,得到(r,g,b),将(r,g,b)作为像素点S(n,m)的像素色;Step S30608, fill r, g and b into the pixel color to obtain (r, g, b), and use (r, g, b) as the pixel color of the pixel point S(n, m);

步骤S30609,对图像数据的所有像素点进行加密后得到加密图像,将加密图像传输至摄像头连接程序。Step S30609, encrypt all pixels of the image data to obtain an encrypted image, and transmit the encrypted image to the camera connection program.

步骤S4,确认访问者身份并对加密信息进行解密,得到图像信息;步骤S4包括如下子步骤:Step S4, confirming the identity of the visitor and decrypting the encrypted information to obtain image information; Step S4 includes the following sub-steps:

步骤S401,由摄像头连接程序对访问者身份进行确认;Step S401, the camera connection program confirms the visitor's identity;

步骤S402,确认完成后,获取加密图像的图像分辨率,得到像素点K(x,y),x与y均为正整数,x即为图像分辨率中的n,y即为图像分辨率中的m;Step S402, after confirmation, obtain the image resolution of the encrypted image to obtain the pixel point K(x,y), where x and y are both positive integers, x is n in the image resolution, and y is m in the image resolution;

步骤S403,计算(x+y)%2,将计算结果命名为解密余数,若解密余数为0,则输出正解密信号;若解密余数为1,则输出反解密信号;Step S403, calculate (x+y)%2, and name the calculation result as the decryption remainder. If the decryption remainder is 0, a positive decryption signal is output; if the decryption remainder is 1, a negative decryption signal is output;

步骤S404,获取K(x,y)的像素色(R,G,B);Step S404, obtaining the pixel color (R, G, B) of K(x, y);

步骤S405,若输出正解密信号,则通过正解密方法对像素点进行解密;若输出反解密信号,则通过反解密方法对像素点进行解密Step S405: if a positive decryption signal is output, the pixel is decrypted by a positive decryption method; if a negative decryption signal is output, the pixel is decrypted by a negative decryption method.

步骤S405包括如下子步骤:Step S405 includes the following sub-steps:

步骤S40501,输出正解密信号时,获取e以及Fi,计算i%2的值,将计算结果命名为正反值;若正反值为0,则输出相减信号;若正反值为1,则输出相加信号;Step S40501, when outputting the positive and negative decryption signals, obtain e and Fi, calculate the value of i%2, and name the calculation result as positive and negative values; if the positive and negative values are 0, output the subtraction signal; if the positive and negative values are 1, output the addition signal;

步骤S40502,输出反解密信号时,获取e以及Fi,计算正反值;若正反值为0,则输出相加信号;若正反值为1,则输出相减信号;Step S40502, when outputting the inverse decryption signal, obtain e and Fi, and calculate the positive and negative values; if the positive and negative values are 0, output the addition signal; if the positive and negative values are 1, output the subtraction signal;

步骤S40503,若输出相减信号,则将Fi对应的数字变为负数,即-Fi;Step S40503, if a subtraction signal is output, the number corresponding to Fi is changed to a negative number, i.e. -Fi;

步骤S40504,依次计算e+F1+……+Fi的值,将计算结果标记为e,检测e是否小于0或大于255,若e小于0,则将e增加255;若e大于255,则将e减小255;否则输出色值正常信号;Step S40504, calculate the value of e+F1+...+Fi in sequence, mark the calculation result as e, and detect whether e is less than 0 or greater than 255. If e is less than 0, increase e by 255; if e is greater than 255, decrease e by 255; otherwise, output a signal with normal color value;

步骤S40505,输出正解密信号时,获取w,将w-e得到w;检测w是否小于0或大于255,若w小于0,则将w增加255;若w大于255,则将w减小255;否则输出色值正常信号;Step S40505, when outputting the positive decryption signal, obtain w, and obtain w by subtracting w from e; detect whether w is less than 0 or greater than 255, if w is less than 0, increase w by 255; if w is greater than 255, decrease w by 255; otherwise, output a signal with normal color value;

步骤S40506,输出正解密信号时,获取q,将q+w-e得到q;检测q是否小于0或大于255,若q小于0,则将q增加255;若q大于255,则将q减小255;否则输出色值正常信号;Step S40506, when outputting the positive decryption signal, obtain q, add q+w-e to get q; detect whether q is less than 0 or greater than 255, if q is less than 0, increase q by 255; if q is greater than 255, decrease q by 255; otherwise, output a signal with normal color value;

步骤S40507,输出反解密信号时,获取w,将w+e得到w;检测w是否小于0或大于255,若w小于0,则将w增加255;若w大于255,则将w减小255;否则输出色值正常信号;Step S40507, when outputting the decrypted signal, obtain w, add w+e to get w; detect whether w is less than 0 or greater than 255, if w is less than 0, increase w by 255; if w is greater than 255, decrease w by 255; otherwise, output a signal with normal color value;

步骤S40508,输出反解密信号时,获取q,将q-w+e得到q;检测q是否小于0或大于255,若q小于0,则将q增加255;若q大于255,则将q减小255;否则输出色值正常信号;Step S40508, when outputting the decrypted signal, obtain q, and obtain q by adding q-w+e; detect whether q is less than 0 or greater than 255, if q is less than 0, increase q by 255; if q is greater than 255, decrease q by 255; otherwise, output a signal with normal color value;

步骤S40509,将q、w以及e填充至像素色内,得到(q,w,e),将(q,w,e)作为像素点K(x,y)的像素色;Step S40509, fill q, w and e into the pixel color to obtain (q, w, e), and use (q, w, e) as the pixel color of the pixel point K(x, y);

步骤S40510,将加密图像内所有的像素点解密完成后得到图像数据并通过摄像头连接程序实时解密并展现给用户。Step S40510, after all pixels in the encrypted image are decrypted, the image data is obtained and decrypted in real time through the camera connection program and displayed to the user.

实施例3,第三方面,本申请提供一种电子设备,包括处理器以及存储器,存储器存储有计算机可读取指令,当计算机可读取指令由处理器执行时,运行如上方法中的步骤。通过上述技术方案,处理器和存储器通过通信总线和/或其他形式的连接机构互连并相互通讯,存储器存储有处理器可执行的计算机程序,当电子设备运行时,处理器执行该计算机程序,以执行时执行上述实施例的任一可选的实现方式中的方法,以实现以下功能:通过外置摄像头获取图像数据;确认图像数据的图像信息;基于图像信息对图像数据进行加密并对图像数据进行传输,得到加密信息;确认访问者身份并对加密信息进行解密,得到图像信息。Embodiment 3, in the third aspect, the present application provides an electronic device, including a processor and a memory, the memory storing computer-readable instructions, and when the computer-readable instructions are executed by the processor, the steps in the above method are executed. Through the above technical solution, the processor and the memory are interconnected and communicate with each other through a communication bus and/or other forms of connection mechanisms, and the memory stores a computer program executable by the processor. When the electronic device is running, the processor executes the computer program to execute the method in any optional implementation of the above embodiment to achieve the following functions: acquiring image data through an external camera; confirming the image information of the image data; encrypting the image data based on the image information and transmitting the image data to obtain encrypted information; confirming the identity of the visitor and decrypting the encrypted information to obtain image information.

实施例4,第四方面,本申请提供一种存储介质,其上存储有计算机程序,计算机程序被处理器执行时,运行如上方法中的步骤。通过上述技术方案,计算机程序被处理器执行时,执行上述实施例的任一可选的实现方式中的方法,以实现以下功能:通过外置摄像头获取图像数据;确认图像数据的图像信息;基于图像信息对图像数据进行加密并对图像数据进行传输,得到加密信息;确认访问者身份并对加密信息进行解密,得到图像信息。Embodiment 4, in a fourth aspect, the present application provides a storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps in the above method are executed. Through the above technical solution, when the computer program is executed by the processor, the method in any optional implementation of the above embodiment is executed to achieve the following functions: acquiring image data through an external camera; confirming the image information of the image data; encrypting the image data based on the image information and transmitting the image data to obtain the encrypted information; confirming the identity of the visitor and decrypting the encrypted information to obtain the image information.

在本申请的上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

本领域内的技术人员应明白,本发明的实施例可提供为方法、系统或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质上实施的计算机程序产品的形式。其中,存储介质可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,如静态随机存取存储器(Static Random AccessMemory,简称SRAM),电可擦除可编程只读存储器(Electrically Erasable ProgrammableRead-Only Memory,简称EEPROM),可擦除可编程只读存储器(ErasableProgrammable ReadOnly Memory,简称EPROM),可编程只读存储器(Programmable Red-Only Memory,简称PROM),只读存储器(Read-OnlyMemory,简称ROM),磁存储器,快闪存储器,磁盘或光盘。这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。It should be understood by those skilled in the art that the embodiments of the present invention may be provided as methods, systems or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware aspects. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media containing computer-usable program codes. Among them, the storage medium may be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (Static Random Access Memory, referred to as SRAM), electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, referred to as EEPROM), erasable programmable read-only memory (Erasable Programmable Read-Only Memory, referred to as EPROM), programmable read-only memory (Programmable Red-Only Memory, referred to as PROM), read-only memory (Read-Only Memory, referred to as ROM), magnetic memory, flash memory, magnetic disk or optical disk. These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device that implements the functions specified in one or more processes in the flowchart and/or one or more boxes in the block diagram.

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

Claims (10)

1.一种地铁监控图像数据加密传输方法,其特征在于,包括如下步骤:1. A method for encrypting and transmitting subway monitoring image data, characterized in that it comprises the following steps: 通过外置摄像头获取图像数据;Acquire image data through an external camera; 确认图像数据的图像信息;confirming image information of the image data; 基于图像信息对图像数据进行加密并对图像数据进行传输,得到加密信息;Encrypting the image data based on the image information and transmitting the image data to obtain encrypted information; 确认访问者身份并对加密信息进行解密,得到图像信息。Confirm the visitor's identity and decrypt the encrypted information to obtain the image information. 2.根据权利要求1所述的一种地铁监控图像数据加密传输方法,其特征在于,通过外置摄像头获取图像数据包括如下子步骤:2. The method for encrypting and transmitting subway monitoring image data according to claim 1, wherein obtaining image data through an external camera comprises the following sub-steps: 安装外置摄像头;Install an external camera; 通过外置摄像头对地铁监控区域进行拍摄,得到图像数据。The subway monitoring area is photographed by an external camera to obtain image data. 3.根据权利要求2所述的一种地铁监控图像数据加密传输方法,其特征在于,确认图像数据的图像信息包括获取图像数据的分辨率,命名为图像分辨率;所述图像分辨率格式为n×m,图像数据内包含n×m个像素点,n与m均为正整数。3. According to claim 2, a subway monitoring image data encryption transmission method is characterized in that confirming the image information of the image data includes obtaining the resolution of the image data, which is named image resolution; the image resolution format is n×m, and the image data contains n×m pixels, and n and m are both positive integers. 4.根据权利要求3所述的一种地铁监控图像数据加密传输方法,其特征在于,基于图像信息对图像数据进行加密并对图像数据进行传输加密包括如下子步骤:4. A subway monitoring image data encryption transmission method according to claim 3, characterized in that encrypting the image data based on the image information and transmitting the encrypted image data comprises the following sub-steps: 对像素点进行编号,命名为像素编号,通过符号S(n,m)表示,S(n,m)具体表示为第n列第m行的像素点;The pixels are numbered and named as pixel numbers, which are represented by the symbol S(n,m), where S(n,m) specifically represents the pixel in the nth column and the mth row; 获取用户设置的用户密码,依次提取用户密码中的数字,命名为数字密码;Get the user password set by the user, extract the numbers in the user password one by one, and name it as a digital password; 对数字密码进行编号,命名为密码编号,通过符号Fi表示,i为正整数;The digital password is numbered and named as the password number, which is represented by the symbol Fi, where i is a positive integer; 针对S(n,m),计算(n+m)%2,%为模运算符,将计算结果命名为判断余数,若判断余数为0,则输出正加密信号;若判断余数为1,则输出反加密信号;For S(n,m), calculate (n+m)%2, where % is the modulus operator. The calculation result is named the judgment remainder. If the judgment remainder is 0, the positive encryption signal is output; if the judgment remainder is 1, the negative encryption signal is output; 获取S(n,m)像素点的像素色,所述像素色为(R,G,B);Get the pixel color of the S(n,m) pixel point, where the pixel color is (R, G, B); 若输出正加密信号,则通过正加密方法对像素点进行加密;若输出反加密信号,则通过反加密方法对像素点进行加密。If a positive encryption signal is output, the pixel points are encrypted using a positive encryption method; if a negative encryption signal is output, the pixel points are encrypted using a negative encryption method. 5.根据权利要求4所述的一种地铁监控图像数据加密传输方法,其特征在于,若输出正加密信号,则通过正加密方法对像素点进行加密;若输出反加密信号,则通过反加密方法对像素点进行加密包括如下子步骤:5. A subway monitoring image data encryption transmission method according to claim 4, characterized in that if a positive encryption signal is output, the pixel point is encrypted by a positive encryption method; if an inverse encryption signal is output, the pixel point is encrypted by an inverse encryption method, comprising the following sub-steps: 输出正加密信号时,获取R,将R-G+B得到r;检测r是否小于0或大于255,若r小于0,则将r增加255;若r大于255,则将r减小255;否则输出色值正常信号;When outputting a positive encrypted signal, obtain R, and add R-G+B to get r; check whether r is less than 0 or greater than 255. If r is less than 0, increase r by 255; if r is greater than 255, decrease r by 255; otherwise, output a signal with normal color value; 输出正加密信号时,获取G,将G+B得到g;检测g是否小于0或大于255,若g小于0,则将g增加255;若g大于255,则将g减小255;否则输出色值正常信号;When outputting a positive encrypted signal, obtain G, add G+B to get g; check whether g is less than 0 or greater than 255. If g is less than 0, increase g by 255; if g is greater than 255, decrease g by 255; otherwise, output a signal with normal color value; 输出正加密信号时,获取B以及Fi,计算i%2的值,将计算结果命名为加减值;若加减值为0,则输出相加信号;若加减值为1,则输出相减信号;若输出相减信号,则将Fi对应的数字变为负数,即-Fi;When outputting a positive encrypted signal, obtain B and Fi, calculate the value of i%2, and name the calculation result as the addition and subtraction value; if the addition and subtraction value is 0, output the addition signal; if the addition and subtraction value is 1, output the subtraction signal; if the subtraction signal is output, change the number corresponding to Fi to a negative number, that is, -Fi; 输出反加密信号时,获取R,将R+G-B得到r;检测r是否小于0或大于255,若r小于0,则将r增加255;若r大于255,则将r减小255;否则输出色值正常信号;When outputting the decrypted signal, obtain R, add R+G-B to get r; check whether r is less than 0 or greater than 255. If r is less than 0, increase r by 255; if r is greater than 255, decrease r by 255; otherwise, output a signal with normal color value; 输出反加密信号时,获取G,将G-B得到g;检测g是否小于0或大于255,若g小于0,则将g增加255;若g大于255,则将g减小255;否则输出色值正常信号;When outputting the decrypted signal, obtain G, and obtain g by subtracting G from B; detect whether g is less than 0 or greater than 255. If g is less than 0, increase g by 255; if g is greater than 255, decrease g by 255; otherwise, output a signal with normal color value; 输出反加密信号时,获取B以及Fi,计算i%2的值,将计算结果命名为加减值;若加减值为0,则输出相减信号;若加减值为1,则输出相加信号;若输出相减信号,则将Fi对应的数字变为负数,即-Fi;When outputting the decrypted signal, obtain B and Fi, calculate the value of i%2, and name the calculation result as the addition and subtraction value; if the addition and subtraction value is 0, output the subtraction signal; if the addition and subtraction value is 1, output the addition signal; if the subtraction signal is output, the number corresponding to Fi is changed to a negative number, that is, -Fi; 依次计算B+F1+……+Fi的值,将计算结果标记为b,检测b是否小于0或大于255,若b小于0,则将b增加255;若b大于255,则将b减小255;否则输出色值正常信号;Calculate the value of B+F1+…+Fi in sequence, mark the calculation result as b, and check whether b is less than 0 or greater than 255. If b is less than 0, increase b by 255; if b is greater than 255, decrease b by 255; otherwise, output a normal color value signal; 将r、g以及b填充至像素色内,得到(r,g,b),将(r,g,b)作为像素点S(n,m)的像素色;Fill r, g and b into the pixel color to obtain (r, g, b), and use (r, g, b) as the pixel color of the pixel point S(n, m); 对图像数据的所有像素点进行加密后得到加密图像,将加密图像传输至摄像头连接程序。After all pixels of the image data are encrypted, an encrypted image is obtained, and the encrypted image is transmitted to the camera connection program. 6.根据权利要求5所述的一种地铁监控图像数据加密传输方法,其特征在于,确认访问者身份并对加密信息进行解密,得到图像信息包括如下子步骤:6. A subway monitoring image data encryption transmission method according to claim 5, characterized in that confirming the identity of the visitor and decrypting the encrypted information to obtain the image information comprises the following sub-steps: 由摄像头连接程序对访问者身份进行确认;The identity of the visitor is confirmed by the camera connection program; 确认完成后,获取加密图像的图像分辨率,得到像素点K(x,y),x与y均为正整数,x即为图像分辨率中的n,y即为图像分辨率中的m;After confirmation, the image resolution of the encrypted image is obtained to obtain the pixel point K(x,y), where x and y are both positive integers, x is n in the image resolution, and y is m in the image resolution; 计算(x+y)%2,将计算结果命名为解密余数,若解密余数为0,则输出正解密信号;若解密余数为1,则输出反解密信号;Calculate (x+y)%2, and name the calculation result as the decryption remainder. If the decryption remainder is 0, output the positive decryption signal; if the decryption remainder is 1, output the negative decryption signal; 获取K(x,y)的像素色(R,G,B);Get the pixel color (R, G, B) of K(x, y); 若输出正解密信号,则通过正解密方法对像素点进行解密;若输出反解密信号,则通过反解密方法对像素点进行解密。If a positive decryption signal is output, the pixel is decrypted by a positive decryption method; if an inverse decryption signal is output, the pixel is decrypted by an inverse decryption method. 7.根据权利要求6所述的一种地铁监控图像数据加密传输方法,其特征在于,若输出正解密信号,则通过正解密方法对像素点进行解密;若输出反解密信号,则通过反解密方法对像素点进行解密包括如下子步骤:7. A subway monitoring image data encryption transmission method according to claim 6, characterized in that if a positive decryption signal is output, the pixel point is decrypted by a positive decryption method; if an inverse decryption signal is output, the pixel point is decrypted by an inverse decryption method, comprising the following sub-steps: 输出正解密信号时,获取e以及Fi,计算i%2的值,将计算结果命名为正反值;若正反值为0,则输出相减信号;若正反值为1,则输出相加信号;When outputting the positive and negative decryption signals, obtain e and Fi, calculate the value of i%2, and name the calculation result as the positive and negative values; if the positive and negative values are 0, output the subtraction signal; if the positive and negative values are 1, output the addition signal; 输出反解密信号时,获取e以及Fi,计算正反值;若正反值为0,则输出相加信号;若正反值为1,则输出相减信号;When outputting the inverse decryption signal, obtain e and Fi, and calculate the positive and negative values; if the positive and negative values are 0, output the addition signal; if the positive and negative values are 1, output the subtraction signal; 若输出相减信号,则将Fi对应的数字变为负数,即-Fi;If a subtraction signal is output, the number corresponding to Fi is changed to a negative number, i.e. -Fi; 依次计算e+F1+……+Fi的值,将计算结果标记为e,检测e是否小于0或大于255,若e小于0,则将e增加255;若e大于255,则将e减小255;否则输出色值正常信号;Calculate the value of e+F1+…+Fi in sequence, mark the calculation result as e, and check whether e is less than 0 or greater than 255. If e is less than 0, increase e by 255; if e is greater than 255, decrease e by 255; otherwise, output a normal color value signal; 输出正解密信号时,获取w,将w-e得到w;检测w是否小于0或大于255,若w小于0,则将w增加255;若w大于255,则将w减小255;否则输出色值正常信号;When outputting the positive decryption signal, get w, and get w by subtracting w from e; check whether w is less than 0 or greater than 255. If w is less than 0, increase w by 255; if w is greater than 255, decrease w by 255; otherwise, output a signal with normal color value; 输出正解密信号时,获取q,将q+w-e得到q;检测q是否小于0或大于255,若q小于0,则将q增加255;若q大于255,则将q减小255;否则输出色值正常信号;When outputting the positive decryption signal, get q, add q+w-e to get q; check whether q is less than 0 or greater than 255. If q is less than 0, increase q by 255; if q is greater than 255, decrease q by 255; otherwise, output a signal with normal color value; 输出反解密信号时,获取w,将w+e得到w;检测w是否小于0或大于255,若w小于0,则将w增加255;若w大于255,则将w减小255;否则输出色值正常信号;When outputting the decrypted signal, get w, add w+e to get w; check whether w is less than 0 or greater than 255. If w is less than 0, increase w by 255; if w is greater than 255, decrease w by 255; otherwise, output a signal with normal color value; 输出反解密信号时,获取q,将q-w+e得到q;检测q是否小于0或大于255,若q小于0,则将q增加255;若q大于255,则将q减小255;否则输出色值正常信号;When outputting the decrypted signal, get q, and add q-w+e to get q; check whether q is less than 0 or greater than 255. If q is less than 0, increase q by 255; if q is greater than 255, decrease q by 255; otherwise, output a signal with normal color value; 将q、w以及e填充至像素色内,得到(q,w,e),将(q,w,e)作为像素点K(x,y)的像素色;Fill q, w and e into the pixel color to obtain (q, w, e), and use (q, w, e) as the pixel color of the pixel point K(x, y); 将加密图像内所有的像素点解密完成后得到图像数据并通过摄像头连接程序实时解密并展现给用户。After all pixels in the encrypted image are decrypted, the image data is obtained and decrypted in real time through the camera connection program and displayed to the user. 8.适用于权利要求1-7任意一项所述的一种地铁监控图像数据加密传输方法的系统,其特征在于,包括外置摄像头、图像信息获取模块、图像数据加密模块以及加密图像解密模块;所述外置摄像头、图像信息获取模块以及加密图像解密模块分别与图像数据加密模块数据连接;8. A system for a subway monitoring image data encryption transmission method according to any one of claims 1 to 7, characterized in that it comprises an external camera, an image information acquisition module, an image data encryption module and an encrypted image decryption module; the external camera, the image information acquisition module and the encrypted image decryption module are respectively data-connected to the image data encryption module; 所述外置摄像头用于通过外置摄像头获取图像数据;The external camera is used to obtain image data through the external camera; 所述图像信息获取模块用于确认图像数据的图像信息;The image information acquisition module is used to confirm the image information of the image data; 所述图像数据加密模块用于基于图像信息对图像数据进行加密并对图像数据进行传输,得到加密信息;The image data encryption module is used to encrypt the image data based on the image information and transmit the image data to obtain encrypted information; 所述加密图像解密模块用于确认访问者身份并对加密信息进行解密,得到图像信息。The encrypted image decryption module is used to confirm the identity of the visitor and decrypt the encrypted information to obtain image information. 9.一种电子设备,其特征在于,包括处理器以及存储器,所述存储器存储有计算机可读取指令,当所述计算机可读取指令由所述处理器执行时,运行如权利要求1-7任一项所述方法中的步骤。9. An electronic device, comprising a processor and a memory, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the steps in the method according to any one of claims 1 to 7 are executed. 10.一种存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时,运行如权利要求1-7任一项所述方法中的步骤。10. A storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the steps in the method according to any one of claims 1 to 7 are executed.
CN202410977544.7A 2024-07-22 2024-07-22 A subway monitoring image data encryption transmission method, system, device and medium Withdrawn CN118590680A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410977544.7A CN118590680A (en) 2024-07-22 2024-07-22 A subway monitoring image data encryption transmission method, system, device and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410977544.7A CN118590680A (en) 2024-07-22 2024-07-22 A subway monitoring image data encryption transmission method, system, device and medium

Publications (1)

Publication Number Publication Date
CN118590680A true CN118590680A (en) 2024-09-03

Family

ID=92534201

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410977544.7A Withdrawn CN118590680A (en) 2024-07-22 2024-07-22 A subway monitoring image data encryption transmission method, system, device and medium

Country Status (1)

Country Link
CN (1) CN118590680A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119885243A (en) * 2025-03-26 2025-04-25 北京裕芃科技有限公司 Safe encryption method and system for digital collection

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119885243A (en) * 2025-03-26 2025-04-25 北京裕芃科技有限公司 Safe encryption method and system for digital collection

Similar Documents

Publication Publication Date Title
CN111586361B (en) Image processing method and related device
CN1150760C (en) Mehtod for protecting audio-visual data across NRSS interface
JP3154325B2 (en) System for hiding authentication information in images and image authentication system
US8572403B2 (en) Digital video guard
EP2832102B1 (en) Methods and systems for cryptographic access control of video
CN114390316B (en) Processing method and device for image acquisition synchronous encryption privacy protection
WO2018107729A1 (en) Method and apparatus for image display using privacy masking
US9215070B2 (en) Method for the cryptographic protection of an application
CN111741268B (en) Video transmission method, device, server, equipment and medium
CN101908113B (en) Authentication method and authentication system
EP3989206A1 (en) Cryptography key generation device and cryptography key generation method
CN114374773B (en) Method for encrypting image acquisition synchronization information and restoring using end decryption
CN118590680A (en) A subway monitoring image data encryption transmission method, system, device and medium
CN110582010A (en) Video/picture encryption transmission method and device, electronic equipment and storage medium
CN103004219A (en) System and method for preventing tampering of transmitted video data
US12106176B2 (en) True secure airgap
KR101784711B1 (en) Apparatus for processing picture intended for information protection, method thereof and computer recordable medium storing the method
CN106921827A (en) Secure network high-definition camera
CN111866547B (en) Novel video tamper-proofing method
CN116756750A (en) Medical sensitive data acquisition desensitization method
CN115967805A (en) Encryption coding and decoding method and device
CN118972166B (en) Data security sharing method, system, device and product for integrated system
Han et al. The privacy protection framework for biometric information in network based CCTV environment
CN117896167A (en) Server, terminal and security system
CN112085505B (en) Face payment method

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
WW01 Invention patent application withdrawn after publication

Application publication date: 20240903

WW01 Invention patent application withdrawn after publication