Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners i need some help in understanding the following codes.thanks..
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


renjithkumarjs
i need some help in understanding the following codes.thanks..
0 Answer(s)      a year and 8 months ago
Posted in : Java Beginners


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;
}

Advertisement
View Answers

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 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
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
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
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
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 - Development process
i need help  hello, i need help regarding this program. this program... IPAddress on command line, but i want to take it dynamically and it must store...?   hi subhash hope this code can help you, public class PingTest
i need help - Development process
i need help  hello, i need help regarding this program. public...()); } } } it is printing the result of ping in to a file,but if i want... the result in to the files,if i want to do this i must make my program running
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
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
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
really need help on how to write this program plz some 1 help out. - Java Beginners
really need help on how to write this program plz some 1 help out.  i am confused here on what to write can some 1 help out here i dont quite understand how to code it so can some 1 help out. Part II Write, compile and execute
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
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
i need your help - Java Interview Questions
i need your help  Write a java program that: i. Allows user to enter 2 numbers from the keyboard ii. Uses a method to compare the two numbers... than the other.   Hi Friend, Try the following code: import
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 your help - Java Beginners
I need your help  What is the purpose of garbage collection in Java, and when is it used?  Hi check out this url : http://www.artima.com/insidejvm/ed2/gc.html http://java.sun.com/javase/technologies/hotspot
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 need help in doing this. - Java Beginners
I need help in doing this.  Student DataBase i will need creating..., and the student's GPA.using arrays and objects, need to structure the information... objects that will house the birthdates for each student member. (I have
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
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
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 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
( Inheritance, Polymorphism, Overriding)i need help - Java Beginners
( Inheritance, Polymorphism, Overriding)i need help  Advanced Concepts with Classes( Inheritance, Polymorphism, Overriding) i need help to create this application,than you Employees in a company are divided into the classes
i am confused here on what to write can some 1 help out here - Java Beginners
i am confused here on what to write can some 1 help out here  i don't quite understand how to code it so can some one help out
Need the some guidence - Spring
Need the some guidence  Hi, MY name is pavan iam having mini projects in MCA these are the details reg projects below 1.project name:identical...; Hi pavan, I show your posted question but not not clear so can
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
Advertisements
 

 

 

DMCA.com