Skip to content

Instantly share code, notes, and snippets.

public class Gp4 {
public static void main(String... args ){
java.util.Scanner read = new java.util.Scanner(System.in);
System.out.println("Number of Lines are: ");
int no = read.nextInt();
String[] input = new String[no];
for(int i=0; i<no ; ){
// System.out.println("Enter for i = "+i);
@maheshmc2
maheshmc2 / Scroller.java
Created March 13, 2011 12:06
JScrollPane Issue
this.queryName = qname;
JFrame frame = new JFrame(title);
frame.setLayout(new GridLayout(2, 1)); //.. UPPER FOR QUERY AND LOWER FOR RESULT
this.ijtable = new ImageJTable(result, Setting.getColumnCount());
ijtable.setVisible(true);
JScrollPane pane = new JScrollPane(ijtable);
JLabel query = new JLabel(new ImageIcon(ImageResize.resize(queryName, Setting.getQueryWidth(), Setting.getQueryWidth())));
@maheshmc2
maheshmc2 / TestFileChooser.java
Created March 4, 2011 14:25
Sample JFileChooser
import java.io.File;
import javax.swing.JFileChooser;
import javax.swing.JPanel;
public class TestFileChooser extends JPanel {
public static void main(String... args){
TestFileChooser tf = new TestFileChooser();
tf.showMe();
// jf.showOpenDialog(TestFileChooser.this);
@maheshmc2
maheshmc2 / getTexture.m
Created March 2, 2011 11:18
To get Texture using GLCM
function F = getTexture(image)
output_bits=1;
input_bits=8;
theta=45;
d=205;
% getting the size of the input image
Create table employee (
id Number,
name Varchar(20),
Primary Key(id)
)
CREATE TYPE Texture AS OBJECT(
entropy NUMBER(10,10),
energy NUMBER(10,10),
inertia NUMBER(10,10),
inverseDiffMoment NUMBER(10,10),
correlation NUMBER(10,10),
infoCorrelation1 NUMBER(10,10),
infoCorrelation2 NUMBER(10,10),
sumAvg NUMBER(10,10),
sumVar NUMBER(10,10),
function [Similarity] = HSVcomp(Hist1, Hist2)
range = 0.0:0.1:1.0;
rangeNew = 0.0:0.05:1.0;
[x,y,z] = meshgrid(range);
[x2,y2,z2] = meshgrid(rangeNew);
% decision thresholds:
t = 0.010;
t2 = 0.8;
@maheshmc2
maheshmc2 / HSVcomp.m
Created February 20, 2011 08:52
I've checked it.. It is working fine.. Check if its not working then plz let me know... Low Similarity means more similarity...
function [Similarity] = HSVcomp(Hist1, Hist2)
range = 0.0:0.1:1.0;
rangeNew = 0.0:0.05:1.0;
[x,y,z] = meshgrid(range);
[x2,y2,z2] = meshgrid(rangeNew);
% decision thresholds:
t = 0.010;
t2 = 0.8;
@maheshmc2
maheshmc2 / Comparison
Created February 20, 2011 05:26
Just Check if this comparison code is working or not.. In my computer it was working yesterday night but now not :'(
clc;
clear all;
Hist1 = getHSVHistogram('C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\Winter.jpg');
Hist2 = getHSVHistogram('C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\Water lilies.jpg');
% decision thresholds:
t = 0.010;
t2 = 0.8;
@maheshmc2
maheshmc2 / DAC.m
Created February 19, 2011 04:43
Distance Histogram...
function [Centroid, Area, Eccentricity, Perimeter, shape_histogram] = DAC(imgname)
%% Basic Processing
I = imgname;
I = rgb2gray(I);
threshold = graythresh(I);
BW = im2bw(I, threshold);
BW = ~BW;