All Projects → ankitaggarwal011 → Pycnn

ankitaggarwal011 / Pycnn

Licence: mit
Image Processing with Cellular Neural Networks in Python

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Pycnn

Cute headers
Collection of cross-platform one-file C/C++ libraries with no dependencies, primarily used for games
Stars: ✭ 3,274 (+543.22%)
Mutual labels:  library, cross-platform
Td
Cross-platform library for building Telegram clients
Stars: ✭ 4,260 (+736.94%)
Mutual labels:  library, cross-platform
Csconsoleformat
.NET C# library for advanced formatting of console output [Apache]
Stars: ✭ 296 (-41.85%)
Mutual labels:  library, cross-platform
Androidrate
AndroidRate is a library to help you promote your Android app by prompting users to rate the app after using it for a few days.
Stars: ✭ 117 (-77.01%)
Mutual labels:  feedback, library
Tf Pose Estimation
Deep Pose Estimation implemented using Tensorflow with Custom Architectures for fast inference.
Stars: ✭ 3,856 (+657.56%)
Mutual labels:  cnn, image-processing
best AI papers 2021
A curated list of the latest breakthroughs in AI (in 2021) by release date with a clear video explanation, link to a more in-depth article, and code.
Stars: ✭ 2,740 (+438.31%)
Mutual labels:  computer-science, paper
Reproc
A cross-platform (C99/C++11) process library
Stars: ✭ 325 (-36.15%)
Mutual labels:  library, cross-platform
Automatic speech recognition
End-to-end Automatic Speech Recognition for Madarian and English in Tensorflow
Stars: ✭ 2,751 (+440.47%)
Mutual labels:  paper, cnn
Learning Deep Learning
Paper reading notes on Deep Learning and Machine Learning
Stars: ✭ 388 (-23.77%)
Mutual labels:  paper, cnn
Beam
✨ Expressive WebGL
Stars: ✭ 383 (-24.75%)
Mutual labels:  library, image-processing
Research In Production
A collection of research papers categorized by real-world systems that enact them
Stars: ✭ 205 (-59.72%)
Mutual labels:  computer-science, paper
Teaching
Teaching Materials for Dr. Waleed A. Yousef
Stars: ✭ 435 (-14.54%)
Mutual labels:  computer-science, image-processing
Openlib.cs
📚 A Collection of Free & Open Resources for University Coursework in Computer Science.
Stars: ✭ 198 (-61.1%)
Mutual labels:  computer-science, library
AutomationShield
Arduino library and MATLAB/Simulink API for the AutomationShield Arduino expansion boards for control engineering education.
Stars: ✭ 22 (-95.68%)
Mutual labels:  control, feedback
Library
Collection of papers in the field of distributed systems, game theory, cryptography, cryptoeconomics, zero knowledge
Stars: ✭ 100 (-80.35%)
Mutual labels:  computer-science, paper
Structopt
Parse command line arguments by defining a struct
Stars: ✭ 323 (-36.54%)
Mutual labels:  library, cross-platform
Deblurgan
Image Deblurring using Generative Adversarial Networks
Stars: ✭ 2,033 (+299.41%)
Mutual labels:  paper, image-processing
Item Nbt Api
Add custom NBT tags to Items/Tiles/Entities without NMS!
Stars: ✭ 163 (-67.98%)
Mutual labels:  paper, library
Kissme
Kissme: Kotlin Secure Storage Multiplatform
Stars: ✭ 351 (-31.04%)
Mutual labels:  library, cross-platform
Machineid
Get the unique machine id of any host (without admin privileges)
Stars: ✭ 422 (-17.09%)
Mutual labels:  library, cross-platform

PyCNN: Image Processing with Cellular Neural Networks in Python

Build Status Coverage Status

Cellular Neural Networks (CNN) [wikipedia] [paper] are a parallel computing paradigm that was first proposed in 1988. Cellular neural networks are similar to neural networks, with the difference that communication is allowed only between neighboring units. Image Processing is one of its applications. CNN processors were designed to perform image processing; specifically, the original application of CNN processors was to perform real-time ultra-high frame-rate (>10,000 frame/s) processing unachievable by digital processors.

This python library is the implementation of CNN for the application of Image Processing.

Note: The library has been cited in the research published on Using Python and Julia for Efficient Implementation of Natural Computing and Complexity Related Algorithms, look for the reference #19 in the references section. I'm glad that this library could be of help to the community.

Note: Cellular neural network (CNN) must not be confused with completely different convolutional neural network (ConvNet).

alt text

As shown in the above diagram, imagine a control system with a feedback loop. f(x) is the piece-wise linear sigmoid function. The control (template B) and the feedback (template A) templates (coefficients) are configurable and controls the output of the system. Significant research had been done in determining the templates for common image processing techniques, these templates are published in this Template Library.

Further reading:

Motivation

This is an extension of a demo at 14th Cellular Nanoscale Networks and Applications (CNNA) Conference 2014. I have written a blog post, available at Image Processing in CNN with Python on Raspberry Pi. The library was used in my paper B3: A plug-n-play internet enabled platform for real time image processing published in IEEE Xplore.

Dependencies

The library is supported for Python >= 2.7 and Python >= 3.3.

The python modules needed in order to use this library.

Pillow: 3.3.1
Scipy: 0.18.0
Numpy: 1.11.1 + mkl

Note: Scipy and Numpy can be installed on a Windows machines using binaries provided over here.

Example 1

$ python example.py

OR

from pycnn import PyCNN

cnn = PyCNN()

Input:

Edge Detection:

cnn.edgeDetection('images/input1.bmp', 'images/output1.png')

Grayscale Edge Detection

cnn.grayScaleEdgeDetection('images/input1.bmp', 'images/output2.png')

Corner Detection:

cnn.cornerDetection('images/input1.bmp', 'images/output3.png')

Diagonal line Detection:

cnn.diagonalLineDetection('images/input1.bmp', 'images/output4.png')

Inversion (Logic NOT):

cnn.inversion('images/input1.bmp', 'images/output5.png')

Optimal Edge Detection:

cnn.optimalEdgeDetection('images/input3.bmp', 'images/output6.png')

Example 2

$ python example_lenna.py

OR

from pycnn import PyCNN

cnn = PyCNN()

Input:

Edge Detection:

cnn.edgeDetection('images/lenna.gif', 'images/lenna_edge.png')

Diagonal line Detection:

cnn.diagonalLineDetection('images/lenna.gif', 'images/lenna_diagonal.png')

Usage

Import module

from pycnn import PyCNN

Initialize object

cnn = PyCNN()

# object variables: 
# m: width of the image (number of columns)
# n: height of image (number of rows)
# name: name of image processing method (say, Edge detection); type: string
# inputImageLocation: location of the input image; type: string.
# outputImageLocation: location of the output image; type: string.
# tempA_A: feedback template; type: n x n list, e.g. 3 x 3, 5 x 5.
# tempB_B: control template; type: n x n list, e.g. 3 x 3, 5 x 5.
# initialCondition: initial condition, type: float.
# Ib_b: bias, type: float.
# t: time points for integration, type: ndarray. 
  # Note: Some image processing methods might need more time point samples than default.
  #       Display the output with each time point to see the evolution until the final convergence 
  #       to the output, looks pretty cool.

General image processing

cnn.generalTemplates(name, inputImageLocation, outputImageLocation, tempA_A, tempB_B, 
                      initialCondition, Ib_b, t)

Edge detection

cnn.edgeDetection(inputImageLocation, outputImageLocation)

Grayscale edge detection

cnn.grayScaleEdgeDetection(inputImageLocation, outputImageLocation)

Corner detection

cnn.cornerDetection(inputImageLocation, outputImageLocation)

Diagonal line detection

cnn.diagonalLineDetection(inputImageLocation, outputImageLocation)

Inversion (Login NOT)

cnn.inversion(inputImageLocation, outputImageLocation)

Optimal Edge Detection

cnn.optimalEdgeDetection(inputImageLocation, outputImageLocation)

License

MIT License

Contribute

Want to work on the project? Any kind of contribution is welcome!

Follow these steps:

  • Fork the project.
  • Create a new branch.
  • Make your changes and write tests when practical.
  • Commit your changes to the new branch.
  • Send a pull request.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].