Skip to main content

Re: J2ME Help required (URGENT !!!)

1 reply [Last post]

Hi Mubin,

- to convert the jpeg into something you can use for filter (to get pixels value):

byte[] byteImage = vc.getSnapshot(null);
Image camImage = Image.createImage(byteImage, 0, byteImage.length);

>From the Image, you can then get an array filled with the RGB values :

canImage.getRGBImage (int[] rgbData, int offset, int scanlength, int x, int y, int width, int height)

then get the pixels one by one from the array :
int rgbpixel= rgbData[x+y*width];

you may want to processs the image by parts , to avoid memory explosion (it'll be 1 int per pixel, with a default image res to 1280x960)

you also might want to reduce the capture resolution, depending on the firmware version you get, you can add those parameters :

( if the handset gives those values trough getProperty("video.snapshot.encodings") ... depends on the firmware version.

- to remove the confirmation message : you can set the application settings to 'ask once' instead of 'ask every time'. Popup will appear only once.
You also can sign with verisign certificate, when signed you can set the value to 'never ask'.


-----Message d'origine-----
De : A mailing list for KVM discussion [mailto:KVM-INTEREST@JAVA.SUN.COM] De la part de meinterest@MOBILEANDEMBEDDED.ORG
Envoyé : mercredi 1 août 2007 16:29
Objet : J2ME Help required (URGENT !!!)

Hello everyone,
Well I'm a newbie to this J2ME thing, I am working on a project right now which requires me to develop an application for my mobile phone Sony Ericsson W810i. This application accesses the on board camera and take images after every 1 sec and keep on saving the last 2 images in 2 different files or buffers. Once the images are obtained, Sobel Filter (Image processing) is applied on it for edge detection. Can anyone please help me with this all, I am really desperate and time is running out.
At the moment, I found this code on Sony Ericsson Developer forums which works perfectly fine with my W810i, the link to the code is as follows,

Well this takes one image and shows it on the canvas, however I am still trying to figure out a way to remove the question it asks whenever i press the button SNAPSHOT, it asks "Do u want to allow the application to access Camera?", is there a way to remove this as well. Please let me know.
Last thing, the getSnapshot is used as vc.getSnapshot(null), i read and changed it to vc.getSnapshot("encoding=jpeg");
This works fine with my mobile as well, but now i cant find any help on how to apply image processing on this encoded jpeg !!! Well please reply, as much as u know, u dun have to answer all the questions, any information regarding this is helpful, I'll be extremely grateful !!!

Thanks a lot,
Mubin Khan
[Message sent by forum member 'mobeenkhan' (mobeenkhan)]

To unsubscribe, send email to and include in the body
of the message "signoff KVM-INTEREST". For general help, send email to and include in the body of the message "help".

To unsubscribe, send email to and include in the body
of the message "signoff KVM-INTEREST". For general help, send email to and include in the body of the message "help".

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2007-07-24

Thanks a lot Chris,
I'll check this out and will let u know how it turns up. As far as the image size is concerned, I have tried that already, it fails when it comes to W810i, it gives errors.

Well another thing i wanted to know, where can i find help regarding image manipulations commands, which API should i look into, simple J2SE Documentation? If you are aware of the Sobel Filter, it takes a block of pixels and work its way through out the image, so i hope that doesnt cause any memory problems or something ...

Well I'll let u know in a day, Thanks a lot for the help !!!

Mubin Khan