This is my code
import java.awt.image.BufferedImage;
public class HaarFeature {
public static void GetFeature(BufferedImage image){
int width = image.getWidth();
int height = image.getHeight();
//int feature_width=1*scale_width;
//int feature_height=1*scale_height;
int[][] iI = IntegralImage.convIntegralImage(image);
int white=0;
int black=0;
int feature=0;
for(int i=0;i<height;i++){
for(int j=0;j<width;j++){
if(i<(height-1) && j<(width-3)){
if(i==0 && j==0){
black=iI[i][j+3];
white=iI[i+1][j+3]-iI[i][j+3];
feature=black-white;
System.out.print(feature+" ");
}
else if(i==0){
black=iI[i][j+3]-iI[i][j-1];
white=iI[i+1][j+3]+iI[i][j-1]-iI[i][j+3]-iI[i+1][j-1];
feature=black-white;
System.out.print(feature+" ");
}
else if(j==0){
black=iI[i][j+3]-iI[i-1][j+3];
white=iI[i+1][j+3]-iI[i][j+3];
feature=black-white;
System.out.print(feature+" ");
}
else{
black=iI[i][j+3]+iI[i-1][j-1]-iI[i][j-1]-iI[i-1][j+3];
white=iI[i+1][j+3]+iI[i][j-1]-iI[i][j+3]-iI[i+1][j-1];
feature=black-white;
System.out.print(feature+" ");
}
}
}
System.out.println();
}
}
}
This code just generate one rectangle features 2px x 4px. As I know, there are so many rectangle features in haar features. How code to make scale in haar features? Please help me