i need some help in understanding the following codes.thanks..

Ads
 

i need some help in understanding the following codes.thanks..

this code is to perform LocalColorHistogram.But i can't understand it

public Vector<Double> getFeatureVector(int[] inImg, int height, int width, int[] maskImg, int flag, double feature, int featureDimension) { int gridCount = 4; int row = gridCount * gridCount; Vector<Double> localColorHistogram = new Vector<Double>(row * 64); int size = width * height; int i = 0; int j = 0; int k = 0; double[][] histogram = new double[row][64];

    for(i=0 ; i<row ; i++){
        histogram[i] = new double[64];
        for(j=0 ; j<64 ; j++){
            histogram[i][j] = 0.0d;
        }
    }
    for(i=0 ; i<size ; i++){
        k = (inImg[i]>>18 & 0x30) | (inImg[i]>>12 & 0xc) | (inImg[i]>>6 & 0x3);
        j = getGrid(i, width, height, gridCount);
        histogram[j][k] += 1.0;
    }
    for(i=0 ; i<gridCount ; i++)
        for(j=0 ; j<64 ; j++)
            localColorHistogram.add(round(((double)histogram[i][j]/(size/gridCount))));
    histogram = null;
    return localColorHistogram;

}
private int getGrid(double j, double width, double height, int gridCount){
    double localWidth = width/gridCount;
    double localHeight = height/gridCount;
    int cell = (int)(j/width/localHeight)*gridCount + (int)((j % width)/localWidth);
    return cell;
}
View Answers

Ads









Related Tutorials/Questions & Answers:
i need some help in understanding the following codes.thanks..
i need some help in understanding the following codes.thanks..  this code is to perform LocalColorHistogram.But i can't understand it public... * height; int i = 0; int j = 0; int k = 0; double
Need some help urgently
Need some help urgently  Can someone please help me with this below question. I need to write a class for this. If you roll Y standard six-sided dice... number of possible combinations.   The actual question got some error. Its
Advertisements
hello there i need help
hello there i need help  : i need to do a program like... i am a beginner, and aside from that i am really eager to learn java please help me with the codes and please explain to me how it works. i only need to use
i need a help in this please
i need a help in this please  The factorial of a nonnegative integer n is written n! (pronounced ‚?? n factorial‚??) and is defined as follows: n!=n...=input.nextInt(); long num=m; for(int i=m;i>1;i
I have need to help
I have need to help  Write a program that, for four points A, B, C and P, draws a triangle formed by ABC and a small cross showing the position of P; and displays a line of text indicating which of the following three cases
PLZ Need some help JAVA...HELP !!
PLZ Need some help JAVA...HELP !!  Create a class names Purchase Each purchase contains an invoice number, amount of sale and amount of sales tax. Include set methods for the invoice number and sale amount. Within the set
Need some help creating an order form.
Need some help creating an order form.  Hi there. I am looking to create an order form for clients to customize the way a product looks. The codes I found on the form html page are useful. My question is: can I tie them all
i need help to solve this problem
i need help to solve this problem  Write a stack class... after perform each of the following sequence of events: a. start with an empty.... H and I join the queue h. G leaves the queue i. H and I leave the queue
i need help plz .... Quickly
i need help plz .... Quickly   how can i count how many numbers enterd by the user so the output would be like this Total number of Scores = .... this is my code :- import java.util.Scanner; public class SCORES { public
Java Question Anyone need some HELP !!
Java Question Anyone need some HELP !!  Create a file that contains... of the two files. Note: For the above code, you need POI api. import... zip file from the following link: http://download.nextag.com/apache/poi/release
pls i need help with my assignment
pls i need help with my assignment  how to write a code that ask the user for the height of the triangle and prints the triangle using * eg if height is 3 it prints * and also using import java.util.Scanner
PLZ HELP ME. i need php code.
PLZ HELP ME. i need php code.   I want php code for bellow OUTPUT. output is just example but it must be letters only. abc bcd efg jku rgt azs hje qqc wws adt
PLZ Need some help on the 2nd part of this question...Someone please help !!!!
PLZ Need some help on the 2nd part of this question...Someone please help !!!!  write an application that displays a menue of three items in a restaurant as follows: 1.Cheeseburger 4.99 2.Pepsi 2.00 3.Chips 0.75 prompt the user
need help pleaseee....i weak in java
need help pleaseee....i weak in java  QUESTION 1 You are required... to develop the above system by following the steps below: a) Prompt the user...) Separate them as either R/r for Residential or I/i for Industrial. You can use
this is my javascript code and i am not understanding the mistake in this,please help me?
this is my javascript code and i am not understanding the mistake in this,please help me?  <html> <h2>Form Validation</h2> <script language = "Javascript"> function checkEmail
I need your help - Java Beginners
I need your help  For this one I need to create delivery class.... Keep prompting the user for each of the following values until they are valid... to describe the purpose of the program.   Hi Friend, Try the following
I want to build sessionfactory in hibernate 4. Need help.
I want to build sessionfactory in hibernate 4. Need help.  Hello, I want to build sessionfactory in hibernate 4. Need help
in my project, i have to add scrollbars to a panel,. i need some example on it,how to doit.
in my project, i have to add scrollbars to a panel,. i need some example on it,how to doit.  in my project, i have to add scrollbars to a panel,. i need some example on it,how to doit. Thanks In Advance   Please
i need latest oracle certified java dumps.. Pleas help me?
i need latest oracle certified java dumps.. Pleas help me?  i need latest oracle certified java dumps.. Pleas help me
Need help
Need help  Hello... I need some help I have a method which contains 1 string value and i wnat when this method get called den that string value should b assigned as array name.. for example.. i have a method name() which
Need help
Need help  Hello... I need some help I have a method which contains 1 string value and i wnat when this method get called den that string value should b assigned as array name.. for example.. i have a method name() which
in my project, i have to add only vertical scrollbar to a panel,but not horizontal scrollbar. i need some example on it,how to doit.
in my project, i have to add only vertical scrollbar to a panel,but not horizontal scrollbar. i need some example on it,how to doit.  in my project.... i need some example on it,how to doit. Thanks in advance
Need help
Need help  Dear sir, I have a problem. How to write JSP coding, if a user select a value from drop down list for example department, the another drop.... This name list should get from the database. Please help me. By the way, I'm
hi .. need help ASAP ..i have a project buit in eclipse , i have installed jasper. i want the steps to work on it ..
hi .. need help ASAP ..i have a project buit in eclipse , i have installed jasper. i want the steps to work on it ..   hi .. need help ASAP ..i have a project buit in eclipse , i have installed jasper. i want the steps to work
I really need help with this assignment question Please help me out Please
I really need help with this assignment question Please help me out Please ... in MySQL. For this purpose you will need to use the sheridancollege database we...?. The LaptopPool table should contain the following fields: StudentID, FirstName
Need help with this!
Need help with this!  Can anyone please help me... to effectivly end the loop with out the need to break it. for(i=(0); i <... to a file at all at this time. Any help would be greatly appreciated, thank you
I need help on my Java code.... please please help me out!?
I need help on my Java code.... please please help me out!?  Well my... the anagram on screen or the output file! Please show me whats wrong. Thanks i need a part of the code thats fixed if possible! Heres is the code: import
need a java program for the following
need a java program for the following  Write a java program with three horizontal sliders. Name the sliders, the first one as red, the second one as green and the third one as blue. You design the program such that on varying
Need help with nested queries
Need help with nested queries  Hello, Table1 has "id", "votes" columns. Table2 has "id", "Name" column. I need to retrieve Name and its corresponging Votes. I tried with nested queries but its confusing. Can anyone please help
need help please
need help please  Dear sir, my name is logeswaran. I have a big problem that I can't find the solution for a program. How can I block a user from enter a page second time. Please help me. By the way I'm using Access database
need help to create applet
need help to create applet  Can u help me..?? I get a task ...and i dont know how to make it... So I hope that u can help me... Here is the task... e) CardLayout If u can help me, then please

Ads