colored object tracking in java- javacv code

Code for this demo video - Color Based Image Segmentation to Track Path of Moving Object


Working Source Code :
import static com.googlecode.javacv.cpp.opencv_core.IPL_DEPTH_8U;
import static com.googlecode.javacv.cpp.opencv_core.cvCreateImage;
import static com.googlecode.javacv.cpp.opencv_core.cvFlip;
import static com.googlecode.javacv.cpp.opencv_core.cvGetSize;
import static com.googlecode.javacv.cpp.opencv_core.cvInRangeS;
import static com.googlecode.javacv.cpp.opencv_core.cvScalar;
import static com.googlecode.javacv.cpp.opencv_imgproc.CV_BGR2GRAY;
import static com.googlecode.javacv.cpp.opencv_imgproc.CV_MEDIAN;
import static com.googlecode.javacv.cpp.opencv_imgproc.cvCvtColor;
import static com.googlecode.javacv.cpp.opencv_imgproc.cvEqualizeHist;
import static com.googlecode.javacv.cpp.opencv_imgproc.cvGetCentralMoment;
import static com.googlecode.javacv.cpp.opencv_imgproc.cvGetSpatialMoment;
import static com.googlecode.javacv.cpp.opencv_imgproc.cvMoments;
import static com.googlecode.javacv.cpp.opencv_imgproc.cvSmooth;
import static com.googlecode.javacv.cpp.opencv_highgui.*;

import java.awt.Color;
import java.awt.Graphics;
import java.awt.image.BufferedImage;

import javax.swing.JPanel;

import com.googlecode.javacv.CanvasFrame;
import com.googlecode.javacv.FrameGrabber;
import com.googlecode.javacv.VideoInputFrameGrabber;
import com.googlecode.javacv.cpp.opencv_core.CvScalar;
import com.googlecode.javacv.cpp.opencv_core.IplImage;
import com.googlecode.javacv.cpp.opencv_imgproc.CvMoments;

public class ColoredObjectTrack implements Runnable {
    final int INTERVAL = 1000;// 1sec
    final int CAMERA_NUM = 0; // Default camera for this time

Mouse Gesture Recognition Using Hidden Markov Model - Java Source Code

Hi everyone, I have uploaded the codes for my project - "Mouse Gesture Recognition with Hidden Markov Model - Java".

You can find it @ google code : https://code.google.com/p/mouse-gesture-recognition-java-hidden-markov-model/.

This svn repository @ google code contains eclipse source code (VQ and HMM codes from OCVolume Project.) , trained hmm models and codebook, captured data for few gestures.

Similar codes for Speech Recognition System using HMM/VQ + MFCC will be uploaded SOON.

DEMO VIDEO: http://www.youtube.com/watch?v=0CNJ2fCj4xQ


maven install jar to repository locally

Run the following command to install the "MyJar-x.x.x.jar" into Local maven repository. The underlined  values vary in your case.
mvn install:install-file -Dfile=PathOFJar_MyJar-x.x.x.jar -DgroupId=com.mycompany -DartifactId=myJar -Dversion=x.x.x -Dpackaging=jar

After installing, Add the dependency into Pom.xml :
        <dependency>
            <groupId>com.mycompany</groupId>
            <artifactId>myJar</artifactId>
            <version>x.x.x</version>
        </dependency>

As an alternative, you can directly refer to a jar file in your file system. This eliminates the hassle that every team member and build server to run the mvn:install command every time someone adds some local jar in pom.xml.

Take a look at following blog post for the details.
http://ganeshtiwaridotcomdotnp.blogspot.com/2016/12/maven-use-local-jar-without-installing.html


Java grey image from RGB image convert full source code

The java code below is for making grey image from a image
public static void main(String[] args) {
        BufferedImage org = getImage("test.jpg");
        BufferedImage greyImage = getGrayScaleAvg(org);
        new ImageFrame(org, "Original");
        new ImageFrame(greyImage, "After GrayScale");
    }

Full working source code : averages the pixels to obtain grey image
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

import javax.imageio.ImageIO;

public class tempgrey {
    public static void main(String[] args) {
        BufferedImage org = getImage("test.jpg");//valid input image
        BufferedImage greyImage = getGrayScaleAvg(org);
        new ImageFrame(org, "Original");
        new ImageFrame(greyImage, "After GrayScale");
    }

    public static BufferedImage getImage(String imageName) {
        try {
            File input = new File(imageName);
            BufferedImage image = ImageIO.read(input);
            return image;

Job Interview Question Answer Frequently Asked - programmer


Some Common and most asked job interview question ( for programmer) and their answers. In Nepali Context.

These questions are the most common questions ( in my job haunt experience) that will be asked to you in your interview.

1. Tell me about yourself:
After finishing computer engineering from ABC campus last year, i worked as java developer. I have good command of Java related technologies. I also have interest in ABC. I find myself as a hard worker and quick learner. And I think i am a good candidate for the position.

2. Last Jobs:
My first job was at ABC as N months contract. Our responsibilites were bug fixing and upgrading an existing ABC system. It was a web app. I mainly worked in feature enhancement like : ABC and some business modules like report generations.
After finishing the contract, i joined ABC as java developer. There too i worked  in a business application for healthcare related dataprocessing/reporting application . I mainly write code for ABC , ABC etc.

3. Why did you leave your last job?
In fact it was a good time working for ABC but i couldnot find any learning opportunity there, I always wanted a challanging job where i can contribute myself and learn something. I worked there for N months and decided to quit the job.

What did you did in this free time :
After i quit the job - besides job haunting, i did a freelancing project- it was ABC,..,
Meanwhile, i learned android framework and teach java in an institute for about 1 month.


6. How do you know about this position?
I knew about this org from the job vacancy notice posted in ABC.com.

7. What do you know about this organization?
ABC is a 10 year old software company located in ABC. it mainly works on ABC. Its major clients are ABC. Major products are ABC.

11. What kind of salary do you need?
As i have few experience and skills, and this might be somehow different job from my previous ... ummm...well ... NN000 NRS/Mo will be fine.

13. How long would you expect to work for us if hired?
I would work as long as you and i both enjoy working me in ABC. I am certain that, I will enjoy the job at ABC##??

25. What are you looking for in a job?
Where i can contribute more and learn new things in the process . not only technically but also the detail of business domain on which i am working at.

50. Do you have any questions for me?
Well ... yes i think i  have one.

>> what will be the next possible step in selection process.
>> what type of responsibilities
>>

Correct way of connecting ADSL splitter and router

REMEMBER : If you need extensions, connect it after splitter only. 
Right way of connecting adsl splitter and router in telephone line
Wrong way of connecting adsl router, splitter in telephone line

correct adsl connection diagram, router, computer, splitter, telephone line

NTC ADSL Configuration Working Way

To configure ADSL setting in a ADSL Router, you need to enter the following informations .


The (generic) easy steps :


1) Open 192.168.1.1 (in most routers) in router,
        use admin for username and admin for password (If it doesnot work, refer to the manual of router, the login information can be found on back of router)

2) Search for the ADSL settings page in the router config -
For Routing Mode (where router automatically dials the connection), You need to provide/choose the following minimum settings there

>Choose PPPOE LLC for Connection type or encapsulation
>Enter correct username and password given by NTC
>Choose authentication AUTO
>provide 8 for VPI, and 81 for VCI

3) Save the connection settings and restart the router.
4) Make sure all the LEDS including internet is ON.

tips - learn programming faster and effectively

How to learn programming effectively- tips for developing programming skills


Tip1 : Have detail knowledge of following and practice them in your favorite programming language
  • Design Patterns / Anti Patterns
  • UML
  • OOAD

Career suggestion for nepali computer engineers programmers student

Career Suggestions/guidelines to Computer Engineering BE, BCA, BTech, BSc-CS, BIT students 
  • Self Study
  • Internet is your library - Search, search and search more
  • Try to understand the concept of programming not language
  • Algorithms and Data Structures are everything
  • Do you know Design Patterns ?
  • Projects are portfolio for your first job interview

teacher student - problems nepali collages university

Problems with teacher and student in Nepali collages/universities

Teacher
  •     Theory focus
  •     No senior lecturers available (almost all of them left country for higher education)
  •     Weak at practical implementation of the course
  •     Teach to earn mindset
  •     Can teach anything.. any subject to any faculty (ridiculous)
  •     Knows everything in theory
  •     Lack of subject domain expertise

Student
  •     Theory Focus
  •     Lack of seriousness in course study
  •     Lack of knowledge about scope of course
  •     Lack of practical application of theory
  •     Takes projects as burden
  •     Exam centric study
  •     No interest in self learning
  •     Stressed of unnecessary subjects (irrelevant ones)
  •     No idea of Collaborative Development
  •     No Interest in professional latest happenings

    This list reflects those who do a irresponsible teaching and the students who loose their interest in study in the middle of the course. Writing these as an outsider – there came these points needed to be managed during college life. These scenario needs to be changed. We need to inherit the sharing, caring and collaborating culture from the history of world’s technical developments.