Results 1 to 4 of 4
  1. #1
    Cleeve is offline Member
    Join Date
    Jun 2011
    Posts
    14
    Rep Power
    0

    Default Why is JAVA such a battle?

    Using a high level language should make programming easier but I seem to be constantly fighting Java to find ways around its restrictions. I've struggled with the following two problems for ages and I'm not happy with the solutions I'm using. Please, can anybody tell me a better solution to either of them?

    1. I have a YUV camera and I need access to the Y and V values. Cuurently I convert to RGB and then average the R,G and B values for an approximation to grey-scale. This seems crazy, just to access the data in a form that it was already in. RGB has all the functions such a pixelgrabber and getRED etc so there can't be any ggod reason why Java doesn't have equivalent functions for YUV. I even considered hijacking the "convert YUV2RGB" but got lost at the point where it calls its "native functions". Any ideas how I can access Y, U and V as a data array?

    2. The program builds up a sequence of 16 images (RGB), stores them in an array of 16 elements, compresses them with JPG - each about 10KB (when compressed) and writes them to flash memory. Currently I write each jpg individually which is incredibly inefficient, writing data to flash in small blocks. Is there a way I can write the entire array of 16 images in a single transfer of 160KB (approx)?

    Thanks

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,457
    Rep Power
    20

    Default

    There may be something useful in Java Advanced Imaging (JAI).

    db

  3. #3
    Cleeve is offline Member
    Join Date
    Jun 2011
    Posts
    14
    Rep Power
    0

    Default

    Thanks, I'll take another look at JAI and if I find anything, this time, I will have to ask how to make it work.

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,224
    Rep Power
    20

    Default

    Quote Originally Posted by Cleeve View Post
    Using a high level language should make programming easier but I seem to be constantly fighting Java to find ways around its restrictions. I've struggled with the following two problems for ages and I'm not happy with the solutions I'm using. Please, can anybody tell me a better solution to either of them?

    1. I have a YUV camera and I need access to the Y and V values. Cuurently I convert to RGB and then average the R,G and B values for an approximation to grey-scale. This seems crazy, just to access the data in a form that it was already in. RGB has all the functions such a pixelgrabber and getRED etc so there can't be any ggod reason why Java doesn't have equivalent functions for YUV. I even considered hijacking the "convert YUV2RGB" but got lost at the point where it calls its "native functions". Any ideas how I can access Y, U and V as a data array?
    As soon as Java is forced to go native then you are talking about different implementations under the hood to develop whatever functionality is involved. In your case, YUV. Since Java is essentially free then you are reliant on Oracle producing something to do the job, or a third party.

    Quote Originally Posted by Cleeve View Post
    2. The program builds up a sequence of 16 images (RGB), stores them in an array of 16 elements, compresses them with JPG - each about 10KB (when compressed) and writes them to flash memory. Currently I write each jpg individually which is incredibly inefficient, writing data to flash in small blocks. Is there a way I can write the entire array of 16 images in a single transfer of 160KB (approx)?

    Thanks
    You are doing the equivalent of dragging your 16 images across from HD to flash. Which, as you say, is inefficient. Since the OS will have exactly the same problem in handling that as you are with your 16 images then I think it's harsh to blame Java. What would you do to speed this up manually? The only answer I can think of is to create a zip file.

Similar Threads

  1. shoddy battle problem
    By asdf in forum New To Java
    Replies: 2
    Last Post: 08-09-2010, 04:13 AM
  2. battle Ship game help!!
    By linux1man in forum New To Java
    Replies: 4
    Last Post: 06-03-2009, 02:47 AM
  3. Virtual Battle Programmer
    By ALATECjobs in forum Jobs Offered
    Replies: 2
    Last Post: 08-28-2008, 05:52 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •