• 大小: 43KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-06-11
  • 语言: Java
  • 标签: Java  图像检索  

资源简介

可用来提取图像的颜色特征、纹理特征(Gabor Filter)以及形状特征,并在此基础上判断图像相关性。

资源截图

代码片段和文件信息



package Distances;

import Test_Color.*;
import java.math.*;

public class Crosscorrelation_neg {

   private double arr[];        //  query image histogram
   private double brr[];        //  comparing image histogram
   private double drr[];        //  difference
   private double err[];        //  matrix multipication
   private double matrixA[][];

   private int arrlen ;

   public Crosscorrelation_neg(double ar1[]){

       arr = new double[arrlen = ar1.length];
       arr = ar1;
       
       matrixA = new double[arrlen][arrlen];
       brr = new double[arrlen];
       drr = new double[arrlen];

       for(int i=0;i           for(int j=0;j
               matrixA[i][j] = 1 - Math.abs((double)(i-j))/(arrlen-1);   //**********************
               System.out.printf(“\t“ + matrixA[i][j]);
               }
           System.out.println(“\n“);
           }

      int sum1 = 0 ;                          //       normalize arr

      
      for(int i=0;i           sum1 += arr[i];
      for(int i=0;i           arr[i] /= sum1;

       System.out.println(“*************\n\n***********\n“);



   };
   
   public double crdistance (double array[]){

       
       double distance = 0;

       if(array.length==arrlen){                          // begin if 1
       brr = array;

       //normalize();

       int sum = 0;
       for(int i=0;i           sum += brr[i];

       for(int i=0;i           brr[i] /= sum;

        for(int i=0;i           drr[i]= (arr[i]-brr[i]);            // DIFFERENCE     *********************************
           System.out.println(drr[i]+ “\n“);
           }

        distance = matrix_multiply();
        }                                                    // end if 1

       else{

           System.out.println(“  Error :  Unequal  BINCOUNT \n “);
       }

       
       return distance;

   }

   public double intrdistance(double array[]){

       if(array.length == arrlen){

           double sum1 = 0; double sum2 = 0; double sum3=0;

           for(int i=0 ; i
               sum1 += ((arr[i]<=array[i]) ? arr[i]: array[i] );
               sum2 += arr[i];
               sum3 += array[i];
               
           }

           return((sum2 <= sum3) ? (sum1/sum2) : (sum1/sum3));

                 
       }

       else return -1;




       }

   private void normalize(){

       int sum = 0;
       for(int i=0;i           sum += brr[i];

       for(int i=0;i           brr[i] /= sum;
       
   }

   private double matrix_multiply(){

       err = new double[arrlen];

       double tempsum;

       for(int i=0;i           tempsum = 0;
           for(int j=0;j
               tempsum += matrixA[i][j]*drr[j];

           }
           err[i] = tempsum;
       }

       tempsum = 0;

       for(int i=0;i
               tempsum += drr[i]*err[i

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2015-06-01 17:11  src\
     目录           0  2015-06-01 17:11  src\Distances\
     文件        3045  2010-11-17 00:24  src\Distances\Crosscorrelation_neg.java
     文件         477  2010-11-17 00:24  src\Distances\Euclidean_distance.java
     文件         703  2010-11-17 00:24  src\Distances\Intersection_distance.java
     目录           0  2015-06-01 17:11  src\Interface\
     文件        1384  2010-12-07 19:04  src\Interface\BrowsePane.java
     文件        4331  2010-12-07 19:04  src\Interface\Mainframe.java
     文件        2801  2010-12-07 19:04  src\Interface\MouseHandler.java
     文件        4287  2010-12-09 12:01  src\Interface\UserPane.form
     文件        2034  2010-12-09 12:01  src\Interface\UserPane.java
     文件        2671  2010-12-07 19:04  src\Interface\XLabel.java
     文件         432  2010-12-07 19:04  src\Interface\interface_main.java
     目录           0  2015-06-01 17:11  src\Interface_test\
     文件        1389  2010-12-07 00:38  src\Interface_test\BrowsePane.java
     文件       12127  2010-12-11 00:26  src\Interface_test\Mainframe.java
     文件        2781  2010-12-07 18:57  src\Interface_test\MouseHandler.java
     文件        5722  2010-12-11 00:21  src\Interface_test\UserPane.form
     文件        3565  2010-12-11 00:21  src\Interface_test\UserPane.java
     文件        2890  2010-12-07 19:46  src\Interface_test\XLabel.java
     文件         437  2010-12-07 00:38  src\Interface_test\interface_main.java
     目录           0  2015-06-01 17:11  src\Test_Color\
     文件        5997  2010-11-17 00:24  src\Test_Color\Class_Color.java
     文件        3025  2010-11-17 00:24  src\Test_Color\Crosscorrelation_neg.java
     文件         885  2010-11-17 00:24  src\Test_Color\Test_cl_main.java
     目录           0  2015-06-01 17:11  src\Test_Shape\
     文件         211  2010-11-17 00:24  src\Test_Shape\Binarization.java
     文件        3350  2010-11-17 00:24  src\Test_Shape\Class_fft.java
     文件         235  2010-11-17 00:24  src\Test_Shape\EdgeDetection.java
     文件        2073  2010-11-17 00:24  src\Test_Shape\PolarRaster.java
     文件          67  2010-11-17 00:24  src\Test_Shape\RegionalSegmentation.java
............此处省略24个文件信息

评论

共有 条评论