Our Feeds

Saturday, 18 March 2017

Ajith KP

RAW image to PNG Mass Converter in Java

The RAW format is used to store image files. The RAW images will have high size because it stores raw image data. To minimise the size of image file we can use this massive converter.

Raw to PNG Converter in Java

Download Link: https://github.com/ajithkp560/raw2png/archive/master.zip
Source: https://github.com/ajithkp560/raw2png

Thursday, 9 March 2017

Ajith KP

PGM Image Viewer for Windows

The "PGM"(Portable Graymap Format) file is one of the extension of image file. This type of image is normally used for researches. Most of face database is created in this format. Eg. AT & T face database. The Windows OS have no default application to open "PGM" files. This application can read and show "PGM" images. Also it can convert the PGM images to PNG/JPG/BMP formats.
You can use this application as default application for open PGM images. You can change settings by right click on PGM file and select "Open With" option and make this utility as default PGM file opener.
Download Link: https://github.com/ajithkp560/PGM_Viewer/archive/master.zip
Source Code: https://github.com/ajithkp560/PGM_Viewer

PGM File viewer and converter for Windows

Monday, 6 March 2017

Ajith KP

AT&T Face Database in PNG

AT&T database is one of the popular face database which is used to calculate the accuracy of face recognition system. The original AT&T face images are in "PGM" file format. The "PGM" files cannot open in some programming languages directly. Eg. Java cannot open PGM files and cannot convert it to BufferedImage object. So, the database files are converted into PNG files. This database is also known as: Olivetti - AT&T - ORL.
AT & T Face database in PNG
AT&T Face Database Sample

The original database link: http://www.cl.cam.ac.uk/research/dtg/attarchive/facedatabase.html
The database in PNG: https://drive.google.com/file/d/0B7n9cqbjuPmIWmw4V25kTEsydVk/view?usp=sharing

Friday, 3 March 2017

Ajith KP

Histogram Equalization for Color Images: Make Your Image More Clear

I have written histogram equalization tutorial with gray-scale images before. You can read that from here: http://terminalcoders.blogspot.in/2017/02/histogram-equalisation-in-java.html
The tutorial explains what is histogram equalization, algorithm and its implementation in Java. Here I'm not explaining anything about histogram equalization because already explained in that tutorial post. Only Java implementation code is sharing.
Histogram equlaization in color images

Source Code

import java.awt.GridLayout;
import java.awt.image.BufferedImage;
import java.awt.image.WritableRaster;
import java.io.File;
import javax.imageio.ImageIO;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import java.awt.*;


/**
 *
 * @author AJITH KP (http://fb.com/ajithkp560)
 * http://www.tctech.in --- Coming Soon...
 * http://www.terminalcoders.blogspot.com
 * 
 */
public class HistogramEqualization extends JFrame{
    HistogramEqualization(String in, String out){
        super("..:: Histogram Equalization ::..");
        try {
            this.setLayout(new GridLayout(1, 2, 10, 10));
            JPanel img1 = new JPanel();
            JPanel img2 = new JPanel();
            File f1 = new File(in);
            File f2 = new File(out);
            BufferedImage image1 = ImageIO.read(f1);
            img1.add(new JLabel(new ImageIcon(image1)));
            BufferedImage image2 = equalize(image1);
            ImageIO.write(image2, "png", f2);
            img2.add(new JLabel(new ImageIcon(image2)));
            this.add(img1);
            this.add(img2);
        } catch (Exception ex) {
            System.out.println(ex.getMessage());
        }
    }
    BufferedImage equalize(BufferedImage src){
        BufferedImage nImg = new BufferedImage(src.getWidth(), src.getHeight(), src.getType());
        int[] hr = new int[256];
        int[] hg = new int[256];
        int[] hb = new int[256];
        int totpix = src.getWidth() * src.getHeight();

        for (int x = 0; x < src.getWidth(); x++) {
            for (int y = 0; y < src.getHeight(); y++) {
                Color c = new Color(src.getRGB(x, y));
                hr[c.getRed()]++;
                hg[c.getGreen()]++;
                hb[c.getBlue()]++;
            }
        }
        
        int[] chr = new int[256];
        int[] chg = new int[256];
        int[] chb = new int[256];
        chr[0] = hr[0];
        chg[0] = hg[0];
        chb[0] = hb[0];
        for(int i=1;i<256;i++){
            chr[i] = chr[i-1] + hr[i];
            chg[i] = chg[i-1] + hg[i];
            chb[i] = chb[i-1] + hb[i];
        }
        
        float[] arr = new float[256];
        float[] arg = new float[256];
        float[] arb = new float[256];
        for(int i=0;i<256;i++){
            arr[i] =  (float)((chr[i]*255.0)/(float)totpix);
            arg[i] =  (float)((chg[i]*255.0)/(float)totpix);
            arb[i] =  (float)((chb[i]*255.0)/(float)totpix);
        }
        
        for (int x = 0; x < src.getWidth(); x++) {
            for (int y = 0; y < src.getHeight(); y++) {
                Color c = new Color(src.getRGB(x, y));
                Color nc = new Color((int)arr[c.getRed()], (int)arg[c.getGreen()], (int)arb[c.getBlue()]);
                nImg.setRGB(x, y, nc.getRGB());
            }
        }
        return nImg;
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        System.out.println("#! TERMINALCODERS ::..\nhttp://www.terminalcoders.blogspot.com\nhttp://www.tctech.in");
        if(args.length<2){
            System.out.println("Usage: java HistogramEqualization <input file name> <output file name>");
        }
        else{
            HistogramEqualization he = new HistogramEqualization(args[0], args[1]);
            he.setSize(1024, 500);
            he.setVisible(true);
            he.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        }
    }
    
}

Sunday, 26 February 2017

Ajith KP

Nokia 3310 is Back to action

Which is Nokia's most popular phone? Most of your's answer will be Nokia 3310. Nokia is going to relaunch their most popular model. Nokia 3310 launched at HMD Global's Sunday launch event at MWC 2017 in Barcelona.

Features


  • 2.40 Inch Touchscreen Display.
  • Resolution 240x320 pixel.
  • Internal storage 16MB and expandable upto 32GB via microSD card.
  • Rear cameral of 2 Megapixel.
  • Battery: 1200mAh.
  • Dual SIM supported. Both slots will be designed for micro SIM.

Video

Saturday, 25 February 2017

t3rminalc0d3r

How to increase the JIO Internet Downloading Speed After Exceeding Full Speed Limit

We know the most trending in India is JIO NET. Nowadays the JIO Internet limited their free Internet to 1GB from 4GB.
Now the main problem is that "after 1GB the net speed get reduced to 128Kbps". DFAQ that speed is death-slow and  we are getting a download speed of 12-30KBps slower than 3G!!!!.


Image Source: https://wordle.gr/internet/pos-tha-metrisis-me-akrivia-tin-tachitita-tou-internet-pou-echis-sto-spiti/

Every one is googling "How to increase the JIO Internet downloading speed" including ME!!!!.
If you already searched to increase the speed of JIO Internet you may have seen a lots of tricks with APN, other third party software etc. I have tried these most of all tricks.......Nothing is working.
Now I'm using JIO Internet with high speed with simple tricks.
You may know about VPN. Yaaah... Virtual Privet Net.
I have tried a lots of VPN to increase the speed of JIO Internet. I have tried Psiphone,VPN master, Snap VPN  etc..etc. Finally I have  found a VPN networks which is capable of increasing JIO Internet. It is HOTSPOT SHIELD.




If you want to enjoy maximum speed you should download HOTSPOT SHIELD ELITE version.

I have added a link to download HOTSPOT SHIELD ELITE Version APK.

Click image icon to download HOTSPOT SHIELD

If this link is not working you can search it in Google.
here is the deference between HOTSPOT SHIELD  ON and OFF condition

 When HOTSPOT SHIELD is OFF and my 1GB has been exhausted



When HOTSPOT SHIELD is ON


It is true.....
You can increase the JIO INTERNET speed with this trick......


Enoy High Speed Internet....
Thank you...

Friday, 24 February 2017

Ajith KP

Web Application Vulnerabilities: Dawn, Detection, Exploitation and Defence Slide Show

ABSTRACT
Web applications are popular software application types in which the client runs the application stored in server in his/her web browser. The most important think is the developers considers only on their productivity, but fails to provide security. This causes vulnerabilities in web applications. These vulnerabilities not only causes intruders to access servers, but also causes access the clients’ private details. So, the research on the subject `web application’s vulnerabilities` is very important.
The top vulnerabilities visible in web applications are Injection vulnerabilities (Remote Code Execution (RCE), SQL Injection (SQLi)), File Inclusion, Cross Site Scripting (XSS), Cross Site Request Forgery (CSRF), Broken Authentication and Session Management, Insecure direct object reference, Unvalidated redirects and forwards, Arbitrary file upload, etc.


INTRODUCTION
Vulnerabilities in web application may results the stealing of sensitive data and provide unauthorized accesses to the hackers/crackers. According to the survey of web application security firm Acunetix, the 60% of found vulnerabilities affects web applications.
According to the security vendor Cenzic, the top vulnerabilities in March 2012 include:
Percentage
Vulnerability
37%
Cross-site scripting
16%
SQL injection
5%
Path disclosure
5%
Denial-of-service attack
4%
Arbitrary code execution
4%
Memory corruption
4%
Cross-site request forgery
5%
File inclusion
3%
Data breach (information disclosure)
16%
Other, including code injection
According to OWASP, the most efficient way of finding security vulnerabilities in web applications is manual code review. This technique is very time-consuming, requires expert skills, and is prone to overlooked errors. Therefore, security society actively develops automated approaches to finding security vulnerabilities. These approaches can be divided into two wide categories: black-box and white-box testing.


The above image is the screenshot of website 0day.today, the repository of exploits. If you analyze the verified vulnerability exploits submitted to this website you can recognize how many exploits are releasing daily for newly detected vulnerabilities, it will be a large number. And also recognize most share of exploits are for exploiting web applications including popular frameworks like Wordpress, Drupal, etc.

So the, research on web application vulnerability and security is important as well as productivity of applications. 

PRESENTATION

Thursday, 23 February 2017

Ajith KP

Histogram Equalization Algorithm and Implementation in Java

Histogram equalization is a technique used to enhance the contrast of image using the histogram of image. The histogram of image represents the frequency of gray levels in the image.The gray levels of image varying from 0 to 255, that is a gray scale image's pixel size is 8 bits(1 byte). So the histogram contains frequency of occurrence of values from 0 to 255.
The aim of histogram equalization is used in digital image processing is to generate an image with equally distributed brightness level over the whole brightness scale.

Histogram Equalization
Histogram equalization can enhance contrast for brightness values close to histogram maxima and decrease contrast near minima.

ALGORITHM

Step 1. Image size: NxM, gray level from 0 to 255, create an array H of size 256 and initialise it with 0.
Step 2: Create image histogram by scan every pixel of image and increment the relevant member of array.
            H[grayval(pix)] = H[grayval(pix)]+1.
Step 3: Form a cumulative histogram CH of size 256.
            CH[0] = H[0]
            CH[i] =  CH[i-1] + H[i], i=1,2,3,...255.
Step 4: Set T[i] = Round((255*CH[i])/(NxM))
Step 4: Rescan image and create new image with gray level value,
            NewImg[x][y] = T[OldImg[x][y]]

SCREENSHOTS

Histogram Equalisation
Histogram Equalisation in Java: 1

Histogram Equalisation in Java
Histogram Equalisation in Java: 2

SOURCE CODE

import java.awt.GridLayout;
import java.awt.image.BufferedImage;
import java.awt.image.WritableRaster;
import java.io.File;
import javax.imageio.ImageIO;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;


/**
 *
 * @author AJITH KP (http://fb.com/ajithkp560)
 * http://www.tctech.in --- Coming Soon...
 * http://www.terminalcoders.blogspot.com
 * 
 */
public class HistogramEqualization extends JFrame{
    HistogramEqualization(String in, String out){
        super("..:: Histogram Equalization ::..");
        try {
            this.setLayout(new GridLayout(1, 2, 10, 10));
            JPanel img1 = new JPanel();
            JPanel img2 = new JPanel();
            File f1 = new File(in);
            File f2 = new File(out);
            BufferedImage image1 = getGrayscaleImage(ImageIO.read(f1));
            img1.add(new JLabel(new ImageIcon(image1)));
            BufferedImage image2 = equalize(image1);
            ImageIO.write(image2, "png", f2);
            img2.add(new JLabel(new ImageIcon(image2)));
            this.add(img1);
            this.add(img2);
        } catch (Exception ex) {
            System.out.println(ex.getMessage());
        }
    }
    BufferedImage equalize(BufferedImage src){
        BufferedImage nImg = new BufferedImage(src.getWidth(), src.getHeight(), BufferedImage.TYPE_BYTE_GRAY);
        WritableRaster wr = src.getRaster();
        WritableRaster er = nImg.getRaster();
        int totpix= wr.getWidth()*wr.getHeight();
        int[] histogram = new int[256];

        for (int x = 1; x < wr.getWidth(); x++) {
            for (int y = 1; y < wr.getHeight(); y++) {
                histogram[wr.getSample(x, y, 0)]++;
            }
        }
        
        int[] chistogram = new int[256];
        chistogram[0] = histogram[0];
        for(int i=1;i<256;i++){
            chistogram[i] = chistogram[i-1] + histogram[i];
        }
        
        float[] arr = new float[256];
        for(int i=0;i<256;i++){
            arr[i] =  (float)((chistogram[i]*255.0)/(float)totpix);
        }
        
        for (int x = 0; x < wr.getWidth(); x++) {
            for (int y = 0; y < wr.getHeight(); y++) {
                int nVal = (int) arr[wr.getSample(x, y, 0)];
                er.setSample(x, y, 0, nVal);
            }
        }
        nImg.setData(er);
        return nImg;
    }
    BufferedImage getGrayscaleImage(BufferedImage src) {
        BufferedImage gImg = new BufferedImage(src.getWidth(), src.getHeight(), BufferedImage.TYPE_BYTE_GRAY);
        WritableRaster wr = src.getRaster();
        WritableRaster gr = gImg.getRaster();
        for(int i=0;i<wr.getWidth();i++){
            for(int j=0;j<wr.getHeight();j++){
                gr.setSample(i, j, 0, wr.getSample(i, j, 0));
            }
        }
        gImg.setData(gr);
        return gImg;
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        System.out.println("#! TERMINALCODERS ::..\nhttp://www.terminalcoders.blogspot.com");
        if(args.length<2){
            System.out.println("Usage: java HistogramEqualization <input file name> <output file name>");
        }
        else{
            HistogramEqualization he = new HistogramEqualization(args[0], args[1]);
            he.setSize(1024, 500);
            he.setVisible(true);
            he.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        }
    }
    
}

Sunday, 19 February 2017

Ajith KP

Easiest way to convert RGB Color Image to Gray scale Image in Java

Hello GuyZ,
     I would like to share Java code to convert RGB images to Gray scale images. I have seen many Java codes which converts image to Gray scale by decomposing each pixel value to red, green and blue values. Then calculate (R+G+B)/3 and set this value to corresponding pixel.
     But I would like to share simplest code to convert color images to gray scale without calculations. The method I'm following is creating an Raster object, I'm using WritableRaster - because it allows reading and writing pixel values. Here I'm creating two WritableRaster objects - one for source image reading, second for writing pixels in output file.

WritableRaster wr = src.getRaster();
WritableRaster gr = gImg.getRaster();

Then using loop, read all pixels from source image and write it to output file. To read pixels, I used getSample(i, j, 0) function of WritableRaster, where i - column number, j - row number of pixel and 0 to get gray scale value for that pixel. After read gray scale value, set this value for output WritableRaster by using function, setSample(i, j, 0, gray_value). The gray_value is the value returned by getSample() function.
RGB Color image to Gray scale conversion Java
before converting to gray scale image
RGB Color image to Gray scale conversion Java
After converting to gray scale

Java Source Code

import java.awt.image.BufferedImage;
import java.awt.image.WritableRaster;
import java.io.File;
import javax.imageio.ImageIO;

/*
(C) AJITH KP (C) : TERMINALCODERS
*/

public class GrayscaleConversion {
    public static void main(String[] args) {
        System.out.println("#! TERMINALCODERS ::..\nhttp://www.terminalcoders.blogspot.com");
        if(args.length<2){
            System.out.println("Usage: java GrayscaleConversion <input file name> <output file name>");
        }
        else{
            try{
                File in = new File(args[0]);
                File out = new File(args[1]);
                BufferedImage img = ImageIO.read(in);
                BufferedImage gray = getGrayscaleImage(img);
                ImageIO.write(gray, "png", out);
                System.out.println("Grayscale image is saved in file: "+args[1]);
            } catch(Exception e){
                System.out.println(e);
            }
        }
    }

    private static BufferedImage getGrayscaleImage(BufferedImage src) {
        BufferedImage gImg = new BufferedImage(src.getWidth(), src.getHeight(), BufferedImage.TYPE_BYTE_GRAY);
        WritableRaster wr = src.getRaster();
        WritableRaster gr = gImg.getRaster();
        for(int i=0;i<wr.getWidth();i++){
            for(int j=0;j<wr.getHeight();j++){
                gr.setSample(i, j, 0, wr.getSample(i, j, 0));
            }
        }
        gImg.setData(gr);
        return gImg;
    }
    
}


Sunday, 12 February 2017

Ajith KP

Activator for Windows 7, 8, 8.1, 10 and Microsoft Office

Hi GuyZ,
     The activator `KMSpico` can activate your Windows 7, Windows 8, Windows 8.1 and Windows 10 operating system. Also it can activate other windows products like Microsoft Office.
Activate windows 10, 8.1, 8, 7 and Microsoft Office Tools
Download from: http://kmspico10.com/wp-content/uploads/2016/05/kmspico-download.png

     If your desktop turned into black, no doubt your trial period has been expired and you need to activate it. You can use this application to extend your trial period periodically. That means you can enjoy full freedom by extending trial period infinitely. Enjoy...