Giter VIP home page Giter VIP logo

logistic_map's Introduction

多媒体取证与安全 logistic混沌实验

实验步骤

1. 安装依赖:

pip install -r requirements.txt

2. 生成logistic混沌序列的分岔图:

python src/logistic.py

生成图像保存为image/logistic.png

3. 基于logistic混沌序列实现对原始图像的置乱处理:

python src/encrypt.py

将image/original_image.png进行置乱处理,置乱处理后的图像保存为image/encrypted_image.png

4. 生成原始图像和加密图像的灰度直方图:

python src/hist.py

生成的灰度直方图分别为image/original_hist.png和image/encrypted_hist.png

实验分析

logistic映射

介绍

logistic映射是一个经典的混沌模型,其方程形式如下:x(k+1)=u * x(k) * [1-x(k)] 初始条件为x(0),对于任意的k,x(k)∈[0,1],u是一个可调的控制参数,为了保证”对于任意的k,x(k)∈(0,1)”,u∈[0,4] 所以在该模型中x(0)与u是未知量,是我们可以设定的。该混沌模型随u的取值的变化如下:

  • 0<u<1 x经过多次迭代都会渐进趋近于0
  • 1<u<2 x经过多次迭代会趋近于(u-1)/u
  • 2<u<3 x经过多次迭代后会收敛于(u-1)/u,注意此时用的是收敛,因为一开始会在这个值的左右振动
  • 3<u<约3.5699 系统呈现周期状态,且随u值增大,周期长度增大
  • 约3.5699<u<4 u取此区间的值的时候,系统呈现混乱与周期相交替的状态,因为对于某些特定的u的取值(如3.82),系统会呈现周期状态
  • u=4 系统完全混乱

分岔图

分岔图的纵坐标为x的值,横坐标为u的值。选取x的初始值x0=0.1,u在[0,4] 的范围内每次增加u_step=0.001,在x进行iterations-num_plot=900次迭代后,选取num_plot=100个x的取值进行画图。生成的图像很好的印证了上述的分析。

利用logistic混沌对图像进行置乱处理

实现思路

根据原图的宽width和高height,根据选定的x0和u,进行width * height次logistic迭代,并且将xk的值归一化到[0,width * height-1] 作为原始坐标打乱后的新的坐标。同时,为了解决坐标冲突的问题,使用一个bool型的列表记录每个坐标是否被占据,如果一个坐标已经被占据,则继续迭代直到产生的坐标没有被占据为止。

灰度直方图

灰度直方图是对图像中灰度级分布的统计。灰度直方图是将数字图像中的所有像素,按照灰度值的大小,统计其出现的频率。由于置乱处理只是改变了图像的像素的坐标,因此置乱前后的图像拥有相同的灰度直方图。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.