Skip to content

Instantly share code, notes, and snippets.

public class Element implements Comparable<Element>{
String val;
int count;
String code = null;
Element leftChild;
Element rightChild;
public Element(String v, int c){
this.val = v;
this.count = c;
val(:,:,1) =
Columns 1 through 8
0.8428 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
@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;
@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 / 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;
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;
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),
Create table employee (
id Number,
name Varchar(20),
Primary Key(id)
)
@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
@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);