Re: J2ME Help required (URGENT !!!)

Christophe Planty <[email protected]>
Newsgroups gmane.comp.java.sun.kvm
Message-ID <B0D36A13C7B6CA4BBF71DC60519E89900191A9B2@par-exch-prd1.myopwv.com>
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 :
                getSnapshot("encoding=jpeg&width=120&height=160")
                "encoding=jpeg&width=240&height=320"
                "encoding=jpeg&width=480&height=640"
                "encoding=jpeg&width=960&height=1280"

( 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'.



/Chris


-----Message d'origine-----
De : A mailing list for KVM discussion [mailto:[email protected]] De la part de [email protected]
Envoyé : mercredi 1 août 2007 16:29
À : [email protected]
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,

http://developer.sonyericsson.com/site/global/techsupport/tipstrickscode/java/p_java_0403.jsp

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,
Regards,
Mubin Khan
[Message sent by forum member 'mobeenkhan' (mobeenkhan)]

http://forums.java.net/jive/thread.jspa?messageID=229026

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

===========================================================================
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff KVM-INTEREST".  For general help, send email to
[email protected] and include in the body of the message "help".
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.