Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 how to write java code to detect the white string?
Index -> Programming, Java -> Java Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
ika




PostPosted: Tue Jun 05, 2012 3:37 am   Post subject: how to write java code to detect the white string?

hello fellows,

please help me to solve this problem.
i.m new in using java and i do not really understand how to use java..

my problem is, how to detect the white string on the human body from the picture



image_jpg.jpg
 Description:
 Filesize:  16.11 KB
 Viewed:  289 Time(s)

image_jpg.jpg


Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Tue Jun 05, 2012 11:16 am   Post subject: Re: how to write java code to detect the white string?

ika @ Tue Jun 05, 2012 3:37 am wrote:
i do not really understand how to use java..

Then this is definitely not the problem for you to get started with.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
ika




PostPosted: Mon Jun 11, 2012 4:01 am   Post subject: Re: how to write java code to detect the white string?

the string have been detected, but then i still dot get the solution how to detect the shoulder and get the measurement..

help me please.. Crying or Very sad
Dan




PostPosted: Mon Jun 11, 2012 10:38 am   Post subject: RE:how to write java code to detect the white string?

As Tony stated, this is not a simple project for some one new to Java and algorthims for tracking objects in real time can be rather complex.

However, there are some libraries and APIs out there to help with the task and obscure some of the compleixy. I recomend you start Googling for a montion tracking or augmented reality framework for Java.

If you do want to implment it your self, I am sure there are many documents out there describe the comonly used algorithms.


Edit: If your goal is just to try and get body measurements of the person in a static image, then the task is much easier if the length of the white string is fixed. You can use the fixed length of the string to determine the scale of pixels in the image to a real mesurment and would just need to filter out the background to determine where the persons body is.
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
ika




PostPosted: Mon Jun 18, 2012 2:58 am   Post subject: Re: how to write java code to detect the white string?

this is some of my work....

import java.io.*;
import java.awt.*;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;

public class GetPixelColor
{
private static int maxCnt;

public static void main(String args[]) throws IOException
{

File file= new File("image.jpg");
BufferedImage image = ImageIO.read(file);
int array[][] = new int [300][400];


for(int i=0; i<300; i++)
{
for(int j=0; j<400; j++)
{
// Getting pixel color by position x=j and y=j
int clr= image.getRGB(j,i);
int red = (clr & 0x00ff0000) >> 16;
int green = (clr & 0x0000ff00) >> 8;
int blue = clr & 0x000000ff;

//System.out.println("..................................");
//System.out.println("Red Color value = "+ red);
//System.out.println("Green Color value = "+ green);
//System.out.println("Blue Color value = "+ blue);
//System.out.println("..................................");

if((red >= 160 && red <= 200) && (green >= 160 && green <= 190) && (blue >= 160 && blue <= 180))
{
//if(red > 160 && green > 160 && blue > 180)
// System.out.print("{"+j+"||"+i+"[0]}");
array[i][j] = 0;
System.out.print("0");
}
else
{
array[i][j] = 1;
System.out.print("-");
}
}
System.out.println();
}

System.out.println(array[0].length);
System.out.println(array.length);

for (int i = (400-1); i >= 0; i--)
{
for(int j = (300-1); j >= 0; j--)
{
System.out.print(array[j][i]);
if(array[j][i] == 0)
{
System.out.print("position2 : x="+i+" y="+j);
i = -1;
break;
}
}
System.out.println();
}

for (int i = 0; i <400; i++)
{
for(int j = 0; j < 300; j++)
{
System.out.print(array[j][i]);
if(array[j][i] == 0)
{
System.out.print("position1 : x="+i+" y="+j);
i = 400;
break;
}
}
System.out.println();
}
}

}



//there is lots of work should i improve Sad
ika




PostPosted: Mon Jun 18, 2012 3:01 am   Post subject: RE:how to write java code to detect the white string?

the string on the body is 10 inches
Display posts from previous:   
   Index -> Programming, Java -> Java Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 6 Posts ]
Jump to:   


Style:  
Search: