Solved

Simple Edge Detection Class

Posted on 2004-09-10
8
613 Views
Last Modified: 2009-12-16
Hi,

I am new to java, i am making a simple edge detection program in java which takes a black and white striped jpg file. The aim of the program is that after reading the file from the disk, it  detects the black stripes from the white. The out put image need not be shown

I want to know which classes can be used for edge detection and how? I will appreciate your help in this regard.
0
Comment
Question by:dbms_dumb
  • 3
  • 3
8 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 12030945
Since it's pretty simple, you can determine which pixels are black and which white:

http://javaalmanac.com/egs/java.awt.image/ImagePixel.html
0
 

Author Comment

by:dbms_dumb
ID: 12031032
should i resize the image before i work on it, or leave it at its original size (400 x 500)? would this effect the detection?
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 12031049
>>would this effect the detection?

Yes. The pixels would be different
0
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 

Author Comment

by:dbms_dumb
ID: 12031122
the link you sent just gets and sets the pixels. how do i compare the pixels?
and exactly how do i do the edge detection ?
an example algo will be helpful.

Ta.
0
 
LVL 86

Accepted Solution

by:
CEHJ earned 250 total points
ID: 12031184
if (rgbs[index] == 0xFFFFFF) {
    // white
}
else {
   // black
}
0
 

Author Comment

by:dbms_dumb
ID: 12031262
well i am leaving this for now.(too late here 0300)..will b back on sunday...thanx alot for your help. I'll bug you again ;)
0
 
LVL 92

Expert Comment

by:objects
ID: 12031768
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to parse custom JSON to POJO java 4 72
java 8 lambda expresssions exception handling 3 88
Java Options in Zimbra Server 2 50
String array comparison 4 32
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question