How To Get Grayscale Pixel Data From Image Or Preview
May 8, 2013
What I am needing is a method to get grayscale pixel data from an image or preview. I am not interested in saving the picture as a jpeg etc, just need the grayscale data.
I am aiming at API 10 (as this is the device available for testing).
On top of this, I am not having any luck getting the camera to work on the Eclipse emulator.
View 3 Replies
Jul 8, 2009
I have a camera application that captures a 640x480 image.I want to convert this image to grayscale.I know I have to use the setSaturatio (float sat) in the ColorMatrix method to zero but I don't know how I can set it to grayscale.
View 3 Replies
View Related
Oct 28, 2010
I am trying to use one of these algorithms to convert a RGB image to grayscale :
The lightness method averages the most prominent and least prominent colors:
(max(R, G, B) + min(R, G, B)) / 2.
The average method simply averages the values: (R + G + B) / 3.
The formula for luminosity is 0.21 R + 0.71 G + 0.07 B.
But i get very weird results ! I know there are other ways to achieve this but is it possible to do this way ?
here is the code...
View 4 Replies
View Related
Oct 7, 2012
I am wondering how do I go about writing code (or be directed to any existing relevant code), that allows me to average the grayscale values above a threshold (Otsu threshold) from a JPEG photo taken from an android device camera.
View 2 Replies
View Related
Jul 21, 2010
I am working on a little side project (program for Android platform)and I don't exactly have a problem, but I don't really know where to start. The project I am working on has to do with getting the info and manipulating a pixel's RGB values inside an image. I know this is a very basic program (not going to disclose all the information about the project), but I am a beginning android programmer.
View 1 Replies
View Related
Jun 24, 2010
File file = new File(fileName);
Iterator iter = ImageIO.getImageReadersByFormatName("Reader");
ImageReader reader = (ImageReader) iter.next();
ImageReadParam param= reader.getDefaultReadParam();
ImageInputStream iis = ImageIO.createImageInputStream(myFile);
reader.setInput(iis, false);
BufferedImage myJpegImage = reader.read(0, param);
How can i write equivalent codes for above codes on Android? Are there any hints how to read pixel data?
View 1 Replies
View Related
Nov 22, 2010
I have some png files that I am applying a color to. The color changes depending on a user selection. I change the color via 3 RGB values set from another method. The png files are a random shape with full transparency outside the shape. I don't want to modify the transparency, only the RGB value. Currently, I'm setting the RGB values pixel by pixel (see code below).I've come to realize this is incredibly slow and possibly just not efficient enough do in an application. Is there a better way I could do this? Here is what I am currently doing. You can see that the pixel array is enormous for an image that takes up a decent part of the screen
View 1 Replies
View Related
Jan 30, 2009
Does someone know how I can overlay an image over the camera preview?
View 6 Replies
View Related
Dec 10, 2009
I'm trying to get the preview images of the android Camera onto a opengl texture. I have been successful so far, it works most of the times. Though sometimes I will just get a black screen when starting/ resuming the application. I have been debugging for days, not finding any clue. When debugging I noticed that both the camera callback and the onDrawFrame are called in such situations. the bytearray of the camera does contain data.
View 10 Replies
View Related
Nov 8, 2010
Today I tried the sample code to get the camera preview working
(http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics/CameraPreview.html)
But the image looks distorted when I start the application on my Galaxy S.
View 5 Replies
View Related
Jun 11, 2009
This is the code that I have for camera preview and image capture.I am trying to do camera preview and as I press the space button I am trying to take picture and save it in the picture gallery of the Android development phone. The code compiles fine,but as I press the space button,it captures the image and throws an exception and closes the application...
CODE:...................
View 7 Replies
View Related
Jun 23, 2009
I would like to save a preview frame as a jpeg image.
I have tried to write the following code...
but it's not possible to open a saved file as a jpeg image. Does anyone know how to save preview frames as jpeg images?
View 3 Replies
View Related
Sep 29, 2010
File is present in sdcard/image.jpg I would like to create my own application (activity). On a button press, the image stored in the sdcard needs to be displayed using the built-in image viewer. On pressing the back button from the Image viewer, it should go back to my running application.
View 2 Replies
View Related
Jul 31, 2010
I am writing an app to capture the camera preview frames and convert it to bitmap in Android.
Here is my code:...........
After I start preview, the callback got called with data, but the bitmap is null.
What did I do wrong when convert the byte array to BitMap?
View 2 Replies
View Related
Mar 25, 2009
I want to receive the data from the preview of the Camera, but without having to set a SurfaceView with a SurfaceHolder in the view of my application. I want to do something like this: Camera cam = Camera.open(); cam.setPreviewCallback(new MyPreviewCallback()); cam.startPreview(); This will not work because I need to call setPreviewDisplay (SurfaceHoler) before I start the preview. I can get a SurfaceHolder from a SurfaceView, but I don't want a SurfaceView, because I don't need one. I just want to handle the preview data by myself.
View 2 Replies
View Related
Apr 20, 2009
I am trying to grayscale bitmap as follows, But it is crashing as soon as I run this method.
The problem is in last line. How can I assign "int" to "Color"? Or are there any better ways?
CODE:................
View 9 Replies
View Related
May 20, 2009
I would like to convert a Bitmap to a grayscale array of bytes (one byte per pixel). At the same time I want to just crop at section from the middle. Having looked though the various api's it is not clear to me what the best way would be.
1) What is ALPHA_8? is that grayscale? I have a feeling that the grayscale effect should be done via some "saturation" on the paint object, right?
2) once I have the Bitmap in grayscale and the right size, what is the best way to get that to a byte[] of pixels (one byte per pixel)?
View 2 Replies
View Related
Jul 5, 2010
I've seen this code on the web...
My questions are:
1. Is 'bmp' supposed to be the color bitmap I want to affect?
2. How do I get the 0-255 value of the grayscale?
View 1 Replies
View Related
Jul 30, 2010
I am new to this site, and I come with a question about Android.
Is there any way to convert a Bitmap to grayscale? I know how to draw a grayscale bitmap (using canvas operations: http://www.mail-archive.com/android-developers@googlegroups.com/msg38890.html) but I really need The actual bitmap in gray colors (or at least something that could be converted to a bitmap later on).
Do I have to implement it by hand (pixel by pixel operations)?
I've searched a lot, and still could not find. Anyone knows a easy/efficient way to do it?
View 2 Replies
View Related
Nov 24, 2009
What would be the right way to turn a color Drawable into a grayscale one (to indicate disabled state)?
View 3 Replies
View Related
Apr 10, 2009
I am working on image processing in mobile. When Camera,takePicture(null,null,pictureCallback) called I am getting (640*480) JPEG image data, its taking 1 second delay.When I try to get raw data it returns null value.I am interested only on delay.
View 2 Replies
View Related
Apr 13, 2009
I am confused on how to implement image processing algorithm on JPEG data.I have set P.setpicturesize (640,480) so the camera.takepicture (null,null,Imagecapture callbck) returns the image data. Void onPictureTaken(byte[] data, Camera Camera) returns JPEG data, but(x = data.length), the value of x is less than 640*480 bytes.Please kindly let me know how can I start editing pixel information of the image and image comparison algorithms.
View 2 Replies
View Related
Apr 30, 2010
I want to retrieve an image from my data/data/com.apps.myapp/images folder and display it in an ImageView. Any clue?
View 2 Replies
View Related
Jul 17, 2012
I can't create a backup using cwm. I get an Error while backing up image data!
I'm running stock but rooted
I want to run a custom ROM but really think I should do a nandroid first!??
Recovery.log...
I:Checking for extendedcommand...
I:Running extendedcommand...
Waiting for SD Card to mount (20s)
SD Card mounted...
Verifying SD Card marker...
SD Card marker not found...
Checking Internal SD Card marker...
I:using /data/media for /emmc.
4a49d47c869b879427a9526928d7394d
Error processing ROM Manager script. Please verify that you are performing the backup, restore, or ROM installation from ROM Manager v4.4.0.0 or higher.
I can pm my full recovery.log but I can't post as I'm being blocked as a new user.. Something about external links?
View 3 Replies
View Related
Apr 21, 2013
I get the error as the title. sd card space is not the problem. I tried formatting the sd card. I have less than 50 apps installed.
Wiped dalvik cache, and all other sorts people say on other posts. (my phone is LG P936 so "fix permission" screws up the phone. all text disappears) have latest cwm recovery.
and still get the error.
View 9 Replies
View Related
Jan 18, 2010
I am developing one application which fetches the list of data/images from the server and shows on to the device. When I change the orientation, press Back button after doing it for 4-5 times app gets crashed. I am handling orientation change within activity itself and not setting the new view.
[Code]
View 8 Replies
View Related
Jul 29, 2010
This is my code.
I got Http 400 error.
CODE:...................
View 2 Replies
View Related
Oct 27, 2010
I am new to android development.currently i am facing a problem while inserting/retrieving image to sqlite database using android Code...
View 1 Replies
View Related
Sep 17, 2010
I am a new to developing for Android and have been reading up and researching in order to become more familiar with the platform. My programming knowledge is moderate I have experience with C++ and a fairly proficient with Actionscript 3.0. I picked up programming primary to work on game development but come from a more artistic/design background.
I have a relatively simple idea for an app that I want to approach from the most practical way possible seeing how it's my first attempt. Essentially the core functionality of the app will be drawing information I will be getting from an ephemeris chart. At a certain time in the day which is based on the data from the chart I want to change an image/display information based on that day. I am trying to wrap my head around the best possible way to do this. Also I would like to give the user an option of having a notification of some kind when the change occurs, but that is something I have come across in terms of basic implementation.
So my question is if you were to approach setting something like this up how would you? What I am not sure about is setting up a time element so the application knows when to change the image/data to display.
View 1 Replies
View Related
Jul 21, 2010
I use http://stackoverflow.com/questions/541966/android-how-do-i-do-a-lazy-load-of-images-in-listview/3068012#3068012 to load images in a ListView and a GridView. It works but the images are loaded form bpttom to top. How to fix that?
Bonus Question: Can I use a loading animation in a image view while the real image is loaded? Right now it's just a default image.
View 1 Replies
View Related