¡@

Home 

2014/10/16 ¤W¤È 08:28:10

android Programming Glossary: yuv

Android SDK: Get raw preview camera image without displaying it

http://stackoverflow.com/questions/10775942/android-sdk-get-raw-preview-camera-image-without-displaying-it

using setPreviewCallback and use that data typically in a YUV format for CPU processing. This is probably less efficient than..

Confusion on YUV NV21 conversion to RGB

http://stackoverflow.com/questions/12469730/confusion-on-yuv-nv21-conversion-to-rgb

on YUV NV21 conversion to RGB According to http developer.android.com.. format. There are quite a number of code on web regarding YUV NV21 to RGB conversion. However when I go through the code I.. by first component U According to http wiki.videolan.org YUV#NV21 NV21 is like NV12 but with U and V order reversed it starts..

Getting frames from Video Image in Android

http://stackoverflow.com/questions/1893072/getting-frames-from-video-image-in-android

it returns null. The format of the frame is a headerless YUV which could be translated to bitmap but it takes too long on.. method which can be found in the android help group. decodeYUV argb8888 data camSize.width camSize.height Bitmap bitmap Bitmap.createBitmap.. Config.ARGB_8888 ... decode Y U and V values on the YUV 420 buffer described as YCbCr_422_SP by Android David Manpearl..

android color between two colors, based on percentage?

http://stackoverflow.com/questions/4414673/android-color-between-two-colors-based-on-percentage

can I accomplish that Thanks UPDATE I tried to convert to YUV like it was suggested in the comments. But I still have the..

Android - Problem whith converting preview frame to bitmap

http://stackoverflow.com/questions/4768165/android-problem-whith-converting-preview-frame-to-bitmap

.getPreviewSize .height final int rgb decodeYUV420SP data width height Bitmap bmp Bitmap.createBitmap rgb width.. convert colors from this board i believe public int decodeYUV420SP byte yuv420sp int width int height final int frameSize.. an easier task than converting to bitmap no need for that YUV decoding code thanks to YuvImage class. import android.graphics.YuvImage..

How can I manipulate the camera preview?

http://stackoverflow.com/questions/6478375/how-can-i-manipulate-the-camera-preview

the raw data coming off of the camera. It's returned as a YUV byte array. You'd need to draw it manually onto a surface in.. Bitmaps and the BitmapDecoder don't seem to handle the YUV byte array very well at this point. There's been a bug filed.. So this data value you're getting back is formatted in YUV format and you can't do much with it until you convert it to..

Android: how to display camera preview with callback?

http://stackoverflow.com/questions/8350230/android-how-to-display-camera-preview-with-callback

need to preview grayscale image. Images from camera are in YUV format and you have to process it somehow which is the main.. preview on a GL SurfaceView using NDK to process the YUV data. I find a solution here that uses some C function and NDK... tutorial 0 androidcamera that demonstrates converting the YUV pixels to RGB and then writing them directly to a bitmap. The..

Apply custom filters to camera output

http://stackoverflow.com/questions/8371055/apply-custom-filters-to-camera-output

problem with performance. The byte from a camera is in YUV format which has to be converted to some sort of RGB format.. is slow. You can try to convert data from YUV to RGB with native code and android NDK but that's quite complicated... . But there is the same problem you need to convert YUV data. There is one chance you can display only luminance data..

Converting YUV->RGB(Image processing)->YUV during onPreviewFrame in android?

http://stackoverflow.com/questions/9325861/converting-yuv-rgbimage-processing-yuv-during-onpreviewframe-in-android

YUV RGB Image processing YUV during onPreviewFrame in android I.. YUV RGB Image processing YUV during onPreviewFrame in android I am capturing image using.. mWidth mHeight Decode Yuv data to integer array decodeYUV420SP mIntArray data mWidth mHeight Converting int mIntArray..

android color between two colors, based on percentage?

http://stackoverflow.com/questions/4414673/android-color-between-two-colors-based-on-percentage

Wikipedia public class ColorUtils private static class Yuv public float y public float u public float v public Yuv int.. Yuv public float y public float u public float v public Yuv int c int r Color.red c int g Color.green c int b Color.blue.. public static int getColor int color0 int color1 float p Yuv c0 new Yuv color0 Yuv c1 new Yuv color1 float y ave c0.y c1.y..

Displaying YUV Image in Android

http://stackoverflow.com/questions/9192982/displaying-yuv-image-in-android

code solve your problem and it may take less time on Yuv Format data because YuvImage class is provided with Android.. and it may take less time on Yuv Format data because YuvImage class is provided with Android SDK. You can try this ByteArrayOutputStream.. this ByteArrayOutputStream out new ByteArrayOutputStream YuvImage yuvImage new YuvImage data PictureFormat.NV21 width height..

Converting YUV->RGB(Image processing)->YUV during onPreviewFrame in android?

http://stackoverflow.com/questions/9325861/converting-yuv-rgbimage-processing-yuv-during-onpreviewframe-in-android

I am capturing image using SurfaceView and getting Yuv Raw preview data in public void onPreviewFrame4 byte data Camera.. image preprocessing in onPreviewFrame so i need to convert Yuv preview data to RGB data than image preprocessing and back to.. data to RGB data than image preprocessing and back to Yuv data. I have used both function for encoding and decoding Yuv..

Confusion on YUV NV21 conversion to RGB

http://stackoverflow.com/questions/12469730/confusion-on-yuv-nv21-conversion-to-rgb

follow. public static void YUV_NV21_TO_RGB int argb byte yuv int width int height final int frameSize width height final.. i ci di for int j 0 cj ij j width j cj dj int y 0xff int yuv ci width cj int v 0xff int yuv frameSize ci 1 width cj ~1 0.. j cj dj int y 0xff int yuv ci width cj int v 0xff int yuv frameSize ci 1 width cj ~1 0 int u 0xff int yuv frameSize ci..

Android - Problem whith converting preview frame to bitmap

http://stackoverflow.com/questions/4768165/android-problem-whith-converting-preview-frame-to-bitmap

from this board i believe public int decodeYUV420SP byte yuv420sp int width int height final int frameSize width height int.. j 1 width u 0 v 0 for int i 0 i width i yp int y 0xff int yuv420sp yp 16 if y 0 y 0 if i 1 0 v 0xff yuv420sp uvp 128 u.. y 0xff int yuv420sp yp 16 if y 0 y 0 if i 1 0 v 0xff yuv420sp uvp 128 u 0xff yuv420sp uvp 128 int y1192 1192 y int..

Convert bitmap array to YUV (YCbCr NV21)

http://stackoverflow.com/questions/5960247/convert-bitmap-array-to-yuv-ycbcr-nv21

in byte array android image processing android camera yuv android image share improve this question Here is some code.. argb 0 inputWidth 0 0 inputWidth inputHeight byte yuv new byte inputWidth inputHeight 3 2 encodeYUV420SP yuv argb.. yuv new byte inputWidth inputHeight 3 2 encodeYUV420SP yuv argb inputWidth inputHeight scaled.recycle return yuv void encodeYUV420SP..

Displaying YUV Image in Android

http://stackoverflow.com/questions/9192982/displaying-yuv-image-in-android

share your views. android image processing imageview yuv share improve this question Following code solve your problem.. out new ByteArrayOutputStream YuvImage yuvImage new YuvImage data PictureFormat.NV21 width height null.. new YuvImage data PictureFormat.NV21 width height null yuvImage.compressToJpeg new Rect 0 0 width height 50 out byte imageBytes..

Converting YUV->RGB(Image processing)->YUV during onPreviewFrame in android?

http://stackoverflow.com/questions/9325861/converting-yuv-rgbimage-processing-yuv-during-onpreviewframe-in-android

mHeight static public void decodeYUV420SP int rgba byte yuv420sp int width int height final int frameSize width height for.. j 1 width u 0 v 0 for int i 0 i width i yp int y 0xff int yuv420sp yp 16 if y 0 y 0 if i 1 0 v 0xff yuv420sp uvp 128 u.. int y 0xff int yuv420sp yp 16 if y 0 y 0 if i 1 0 v 0xff yuv420sp uvp 128 u 0xff yuv420sp uvp 128 int y1192 1192 y int..

Android SDK: Get raw preview camera image without displaying it

http://stackoverflow.com/questions/10775942/android-sdk-get-raw-preview-camera-image-without-displaying-it

passed into it by the camera. Then set up preview callbacks using setPreviewCallback and use that data typically in a YUV format for CPU processing. This is probably less efficient than #1 but does not require knowing OpenGL. share improve..

Confusion on YUV NV21 conversion to RGB

http://stackoverflow.com/questions/12469730/confusion-on-yuv-nv21-conversion-to-rgb

on YUV NV21 conversion to RGB According to http developer.android.com reference android graphics ImageFormat.html#NV21 NV21 is.. graphics ImageFormat.html#NV21 NV21 is the default used format. There are quite a number of code on web regarding YUV NV21 to RGB conversion. However when I go through the code I doubt on the correctness of the code. The first component V.. of the code. The first component V should come first followed by first component U According to http wiki.videolan.org YUV#NV21 NV21 is like NV12 but with U and V order reversed it starts with V. However when I went through the code implementation..

Getting frames from Video Image in Android

http://stackoverflow.com/questions/1893072/getting-frames-from-video-image-in-android

array and tried to decode it with the BitmapFactory class but it returns null. The format of the frame is a headerless YUV which could be translated to bitmap but it takes too long on a phone. Also I've read that the onPreviewFrame method has.. method and decoding the data in a seperate Thread using a method which can be found in the android help group. decodeYUV argb8888 data camSize.width camSize.height Bitmap bitmap Bitmap.createBitmap argb8888 camSize.width camSize.height Config.ARGB_8888.. bitmap Bitmap.createBitmap argb8888 camSize.width camSize.height Config.ARGB_8888 ... decode Y U and V values on the YUV 420 buffer described as YCbCr_422_SP by Android David Manpearl 081201 public void decodeYUV int out byte fg int width int..

android color between two colors, based on percentage?

http://stackoverflow.com/questions/4414673/android-color-between-two-colors-based-on-percentage

being more lightend as I use them on a grey background.. how can I accomplish that Thanks UPDATE I tried to convert to YUV like it was suggested in the comments. But I still have the same problem that at 50 it's to dark. Additional in this solution..

Android - Problem whith converting preview frame to bitmap

http://stackoverflow.com/questions/4768165/android-problem-whith-converting-preview-frame-to-bitmap

.getPreviewSize .width int height camera.getParameters .getPreviewSize .height final int rgb decodeYUV420SP data width height Bitmap bmp Bitmap.createBitmap rgb width height Bitmap.Config.ARGB_8888 String filename sdcard file.. out.close out null Here is the one of the methods i tried to convert colors from this board i believe public int decodeYUV420SP byte yuv420sp int width int height final int frameSize width height int rgb new int width height for int j 0 yp 0 j.. share improve this question Simply saving to a jpeg is an easier task than converting to bitmap no need for that YUV decoding code thanks to YuvImage class. import android.graphics.YuvImage @Override public void onPreviewFrame byte data..

How can I manipulate the camera preview?

http://stackoverflow.com/questions/6478375/how-can-i-manipulate-the-camera-preview

ish example. Here's what I found. It's pretty easy to get the raw data coming off of the camera. It's returned as a YUV byte array. You'd need to draw it manually onto a surface in order to be able to modify it. To do that you'd need to have.. need to convert the byte array into a bitmap of some sort. Bitmaps and the BitmapDecoder don't seem to handle the YUV byte array very well at this point. There's been a bug filed for this but don't don't what the status is on that. So people.. mHolder c mHolder.lockCanvas null Do your drawing here So this data value you're getting back is formatted in YUV format and you can't do much with it until you convert it to rgb int bwCounter 0 int yuvsCounter 0 for int y 0 y 160..

Android: how to display camera preview with callback?

http://stackoverflow.com/questions/8350230/android-how-to-display-camera-preview-with-callback

15fps on a real device. I don't even need the colors I just need to preview grayscale image. Images from camera are in YUV format and you have to process it somehow which is the main performance problem. I'm using API 8. In all cases I'm using.. Some details of this in another question . 3. Display camera preview on a GL SurfaceView using NDK to process the YUV data. I find a solution here that uses some C function and NDK. But I didn't manage to use it here some more details . But.. actually use opencv don't worry there's a project called tutorial 0 androidcamera that demonstrates converting the YUV pixels to RGB and then writing them directly to a bitmap. The relevant code is essentially public void onPreviewFrame byte..

Apply custom filters to camera output

http://stackoverflow.com/questions/8371055/apply-custom-filters-to-camera-output

there are several ways to do this. But there is a significant problem with performance. The byte from a camera is in YUV format which has to be converted to some sort of RGB format if you want to display it. This conversion is quite expensive.. performance will be low less than 8fps cause BitmapFactory.decodeByteArray is slow. You can try to convert data from YUV to RGB with native code and android NDK but that's quite complicated. The other option is to use openGL ES. You need GLSurfaceView.. so you use onPreviewFrame same way as in regular surface . But there is the same problem you need to convert YUV data. There is one chance you can display only luminance data from the preview greyscale image quite fast because the first..

Converting YUV->RGB(Image processing)->YUV during onPreviewFrame in android?

http://stackoverflow.com/questions/9325861/converting-yuv-rgbimage-processing-yuv-during-onpreviewframe-in-android

YUV RGB Image processing YUV during onPreviewFrame in android I am capturing image using SurfaceView and getting Yuv Raw preview.. YUV RGB Image processing YUV during onPreviewFrame in android I am capturing image using SurfaceView and getting Yuv Raw preview data in public void.. mSize.width int mHeight mSize.height int mIntArray new int mWidth mHeight Decode Yuv data to integer array decodeYUV420SP mIntArray data mWidth mHeight Converting int mIntArray to Bitmap and than image preprocessing and back to mIntArray...

android color between two colors, based on percentage?

http://stackoverflow.com/questions/4414673/android-color-between-two-colors-based-on-percentage

something wrong in the calculation The constants are taken from Wikipedia public class ColorUtils private static class Yuv public float y public float u public float v public Yuv int c int r Color.red c int g Color.green c int b Color.blue c.. from Wikipedia public class ColorUtils private static class Yuv public float y public float u public float v public Yuv int c int r Color.red c int g Color.green c int b Color.blue c this.y 0.299f r 0.587f g 0.114f b this.u b y 0.493f this.v.. r 0.587f g 0.114f b this.u b y 0.493f this.v r y 0.877f public static int getColor int color0 int color1 float p Yuv c0 new Yuv color0 Yuv c1 new Yuv color1 float y ave c0.y c1.y p float u ave c0.u c1.u p float v ave c0.v c1.v p int b int..

Displaying YUV Image in Android

http://stackoverflow.com/questions/9192982/displaying-yuv-image-in-android

imageview yuv share improve this question Following code solve your problem and it may take less time on Yuv Format data because YuvImage class is provided with Android SDK. You can try this ByteArrayOutputStream out new ByteArrayOutputStream.. share improve this question Following code solve your problem and it may take less time on Yuv Format data because YuvImage class is provided with Android SDK. You can try this ByteArrayOutputStream out new ByteArrayOutputStream YuvImage yuvImage.. YuvImage class is provided with Android SDK. You can try this ByteArrayOutputStream out new ByteArrayOutputStream YuvImage yuvImage new YuvImage data PictureFormat.NV21 width height null yuvImage.compressToJpeg new Rect 0 0 width height 50..

Converting YUV->RGB(Image processing)->YUV during onPreviewFrame in android?

http://stackoverflow.com/questions/9325861/converting-yuv-rgbimage-processing-yuv-during-onpreviewframe-in-android

YUV RGB Image processing YUV during onPreviewFrame in android I am capturing image using SurfaceView and getting Yuv Raw preview data in public void onPreviewFrame4 byte data Camera camera I have to perform some image preprocessing in onPreviewFrame.. byte data Camera camera I have to perform some image preprocessing in onPreviewFrame so i need to convert Yuv preview data to RGB data than image preprocessing and back to Yuv data. I have used both function for encoding and decoding.. preprocessing in onPreviewFrame so i need to convert Yuv preview data to RGB data than image preprocessing and back to Yuv data. I have used both function for encoding and decoding Yuv data to RGB as following public void onPreviewFrame byte data..

Confusion on YUV NV21 conversion to RGB

http://stackoverflow.com/questions/12469730/confusion-on-yuv-nv21-conversion-to-rgb

I have overlooked something Currently my implementation is as follow. public static void YUV_NV21_TO_RGB int argb byte yuv int width int height final int frameSize width height final int ii 0 final int ij 0 final int di 1 final int dj 1 int a.. int di 1 final int dj 1 int a 0 for int i 0 ci ii i height i ci di for int j 0 cj ij j width j cj dj int y 0xff int yuv ci width cj int v 0xff int yuv frameSize ci 1 width cj ~1 0 int u 0xff int yuv frameSize ci 1 width cj ~1 1 y y 16 16.. 0 for int i 0 ci ii i height i ci di for int j 0 cj ij j width j cj dj int y 0xff int yuv ci width cj int v 0xff int yuv frameSize ci 1 width cj ~1 0 int u 0xff int yuv frameSize ci 1 width cj ~1 1 y y 16 16 y int r int 1.164f y 16 1.596f..

Android - Problem whith converting preview frame to bitmap

http://stackoverflow.com/questions/4768165/android-problem-whith-converting-preview-frame-to-bitmap

null Here is the one of the methods i tried to convert colors from this board i believe public int decodeYUV420SP byte yuv420sp int width int height final int frameSize width height int rgb new int width height for int j 0 yp 0 j height j int.. width height for int j 0 yp 0 j height j int uvp frameSize j 1 width u 0 v 0 for int i 0 i width i yp int y 0xff int yuv420sp yp 16 if y 0 y 0 if i 1 0 v 0xff yuv420sp uvp 128 u 0xff yuv420sp uvp 128 int y1192 1192 y int r y1192 1634.. uvp frameSize j 1 width u 0 v 0 for int i 0 i width i yp int y 0xff int yuv420sp yp 16 if y 0 y 0 if i 1 0 v 0xff yuv420sp uvp 128 u 0xff yuv420sp uvp 128 int y1192 1192 y int r y1192 1634 v int g y1192 833 v 400 u int b y1192 2066..

Convert bitmap array to YUV (YCbCr NV21)

http://stackoverflow.com/questions/5960247/convert-bitmap-array-to-yuv-ycbcr-nv21

to YUV format simillar to what camera's onPreviewFrame returns in byte array android image processing android camera yuv android image share improve this question Here is some code that actually works untested function byte getNV21 int inputWidth.. scaled int argb new int inputWidth inputHeight scaled.getPixels argb 0 inputWidth 0 0 inputWidth inputHeight byte yuv new byte inputWidth inputHeight 3 2 encodeYUV420SP yuv argb inputWidth inputHeight scaled.recycle return yuv void encodeYUV420SP.. argb 0 inputWidth 0 0 inputWidth inputHeight byte yuv new byte inputWidth inputHeight 3 2 encodeYUV420SP yuv argb inputWidth inputHeight scaled.recycle return yuv void encodeYUV420SP byte yuv420sp int argb int width int height final..

Displaying YUV Image in Android

http://stackoverflow.com/questions/9192982/displaying-yuv-image-in-android

and do supply new buffer always as and when we received. please share your views. android image processing imageview yuv share improve this question Following code solve your problem and it may take less time on Yuv Format data because YuvImage.. class is provided with Android SDK. You can try this ByteArrayOutputStream out new ByteArrayOutputStream YuvImage yuvImage new YuvImage data PictureFormat.NV21 width height null yuvImage.compressToJpeg new Rect 0 0 width height 50 out byte.. out new ByteArrayOutputStream YuvImage yuvImage new YuvImage data PictureFormat.NV21 width height null yuvImage.compressToJpeg new Rect 0 0 width height 50 out byte imageBytes out.toByteArray Bitmap image BitmapFactory.decodeByteArray..

Converting YUV->RGB(Image processing)->YUV during onPreviewFrame in android?

http://stackoverflow.com/questions/9325861/converting-yuv-rgbimage-processing-yuv-during-onpreviewframe-in-android

intArray to Yuv data encodeYUV420SP data mIntArray mWidth mHeight static public void decodeYUV420SP int rgba byte yuv420sp int width int height final int frameSize width height for int j 0 yp 0 j height j int uvp frameSize j 1 width u 0 v.. width height for int j 0 yp 0 j height j int uvp frameSize j 1 width u 0 v 0 for int i 0 i width i yp int y 0xff int yuv420sp yp 16 if y 0 y 0 if i 1 0 v 0xff yuv420sp uvp 128 u 0xff yuv420sp uvp 128 int y1192 1192 y int r y1192 1634 v int.. uvp frameSize j 1 width u 0 v 0 for int i 0 i width i yp int y 0xff int yuv420sp yp 16 if y 0 y 0 if i 1 0 v 0xff yuv420sp uvp 128 u 0xff yuv420sp uvp 128 int y1192 1192 y int r y1192 1634 v int g y1192 833 v 400 u int b y1192 2066 u if..