Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 10 of 10

Thread: android image processing ( cropping)

  1. #1
    Junior Member
    Join Date
    Sep 2013
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default android image processing ( cropping)

    Hi all, i am new with android programming and not really mastering java language programming..
    I got a final project about image processing in android, overall i know what i have to do to finish that project but i am stuck with the most important part. that is cropping an image.
    i have upload the image. i captured it with my android camera and i named it lff.jpg
    i want to split that image into 6 part automatically, i have done it manually using paint and uploaded that in attachment..

    How can i do that in java ? what algorithm i should use ?

    thanks all, sorry for my bad english, i really need your help
    Attached Images Attached Images


  2. #2
    Super Moderator jps's Avatar
    Join Date
    Jul 2012
    Posts
    2,642
    My Mood
    Daring
    Thanks
    90
    Thanked 263 Times in 232 Posts

    Default Re: android image processing ( cropping)

    Write down the steps you took to do it in paint
    Translate that into android
    Post questions if you get stuck along the way. Do not forget to include your list of steps and a description of what you are stuck on

  3. #3
    Junior Member
    Join Date
    Sep 2013
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: android image processing ( cropping)

    the problem is i don't know how to translate it to android...
    do you understand what steps need to split that image ?

  4. #4
    Super Moderator jps's Avatar
    Join Date
    Jul 2012
    Posts
    2,642
    My Mood
    Daring
    Thanks
    90
    Thanked 263 Times in 232 Posts

    Default Re: android image processing ( cropping)

    Quote Originally Posted by bangun View Post
    do you understand what steps need to split that image ?
    Yes.
    How did you do it in paint? Forget the code for now, work on the solution.

  5. #5
    Junior Member
    Join Date
    Sep 2013
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: android image processing ( cropping)

    i just crop it using the panel in Paint..~

    --- Update ---

    i rectangle each part that i want to split then i crop it...

  6. #6
    Super Moderator jps's Avatar
    Join Date
    Jul 2012
    Posts
    2,642
    My Mood
    Daring
    Thanks
    90
    Thanked 263 Times in 232 Posts

    Default Re: android image processing ( cropping)

    To put it in general terms, "you rectangle each part that you want to split, then you crop it"
    But how did you decide where to rectangle each part? What did you look at, what question did you ask yourself, get specific... That is how the computer will need to be told

  7. #7
    Junior Member
    Join Date
    Sep 2013
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: android image processing ( cropping)

    oke i understand, what i have done so far :
    1. read image in java
    2. convert to grayscale
    3. binarize image using otsu method
    4. traverse each pixel from width() and height()

    after that i get coordinat xmin ymin and xmax ymax. xmin and ymin represent the top left of the image (that i want to split) and xmax,ymax represent the bottow rigth.. but i don't know how to crop it with certain coordinat (xmin,ymin to xmax,ymax)

    how do you think about my steps ?
    thank you very much

  8. #8
    Super Moderator jps's Avatar
    Join Date
    Jul 2012
    Posts
    2,642
    My Mood
    Daring
    Thanks
    90
    Thanked 263 Times in 232 Posts

    Default Re: android image processing ( cropping)

    The steps can still be broken down into smaller steps, but so far they look good.
    For example 1. read image in java (There are many steps to this.. setting up a place to read it into, how it will be read, where it will be read from)
    Continue to break the steps down into small steps that almost seem like short-hand for code before you start writing the code.
    Sometimes it helps to use outline form:
    1. -----
    a. -----
    b. -----
    2. -----
    a. -----
    etc
    using the list you have now for the numbers and breaking those down into smaller steps labeled with the letters
    Ask questions if you get stuck, and be sure to explain what step or sub-step you are on and what the problem is

    Read the documentation to see what methods are available for working with parts of an image

  9. #9
    Junior Member
    Join Date
    Sep 2013
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: android image processing ( cropping)

    Quote Originally Posted by jps View Post
    Read the documentation to see what methods are available for working with parts of an image
    where can i get the documentation ?

    mmm, i am stuck to crop it while i have got the coordinat

  10. #10
    Super Moderator jps's Avatar
    Join Date
    Jul 2012
    Posts
    2,642
    My Mood
    Daring
    Thanks
    90
    Thanked 263 Times in 232 Posts

    Default Re: android image processing ( cropping)

    Java™ Platform, Standard Edition 7 API Specification ...assuming you are working with SE7. If not use a search engine to find what you are working with

Similar Threads

  1. Android image processing
    By bangun in forum Android Development
    Replies: 0
    Last Post: September 16th, 2013, 10:31 PM
  2. Image Processing
    By sachinshahi_2010 in forum What's Wrong With My Code?
    Replies: 2
    Last Post: April 25th, 2013, 12:45 PM
  3. Android processing .md2 model java.lang.outOfMemoryError
    By polyfrag in forum Android Development
    Replies: 0
    Last Post: March 25th, 2013, 11:56 AM
  4. Need help in image processing
    By ath in forum Object Oriented Programming
    Replies: 3
    Last Post: March 8th, 2012, 11:18 AM
  5. Image Processing
    By subash in forum File I/O & Other I/O Streams
    Replies: 4
    Last Post: June 8th, 2011, 08:40 AM