In the development of Android often use the image upload function, commonly used is to call the Android system comes with the library and photo function. The sample code is as follows:Java code:public class Testactivity extends Activity {public final static int photo_zoom = 0; Public final static int take_photo = 1; Public final static int photo_result = 2; public static final String image_unspecif
finally gets a darker image. This pattern is symmetric, which means that the exchange base and the blend color get the same result.F (b) = AB, where a is the base color and B is a blend color.Filter--First, the pixel values of the two-layer images are complementary, then multiply them, and finally the complementary number. This is the opposite of the result from the multiply. It will get a brighter image.F (b) =1-(1-a) (1-b), where a is the base color and B is a blend color.Overlay-combines mul
As a reference for the realization of image recognition in the Java layer. It is best to find a hole in the JNI layer to extract the data.
--leon
Http://blog.csdn.net/chenji001/archive/2010/08/25/5836685.aspx
In Android, if you want to process preivew data (such as face tracking), the callback function directly on the Java layer can cause frequent memory requests and copy, even with the latest Setpreviewcallbackwithbuffer functions, Memory co
Android Camera Real-Time Filter (4), androidcameraImplementation of custom algorithms based on PS special effects on Android platform
Created with Rapha rjl 2.1.2
Start
Image Bitmap
Get pixel getPixels
is as follows:
[Java] Public void onDrawFrame (GL10 gl ){// TODO Auto-generated method stubGl. glClear (GL10.GL _ COLOR_BUFFER_BIT | GL10.GL _ DEPTH_BUFFER_BIT );MTriangle. draw (gl );}Public void onDrawFrame (GL10 gl ){// TODO Auto-generated method stubGl. glClear (GL10.GL _ COLOR_BUFFER_BIT | GL10.GL _ DEPTH_BUFFER_BIT );MTriangle. draw (gl );}
In this way, we have drawn a plane triangle. However, we found that this triangle is not an equilateral triangle as we defined it. This is because O
The previous two blogs are all about Android 2D animations, what if you want to make a very cool 3D animation effect? Android does not provide 3D animation interface to the user, so we have to rewrite such a 3D interface animation ourselves.The interface is as follows:/* * @Title: My3danimation.java * @Description:todoThe sample code is as follows:Package Com.xjp.animator;import Com.xjp.animator.r;import An
Reposted from hi_android: The final editor hi_android
The following code calls the system photo program,
12
Intent it = newintent ("android. Media. Action. image_capture ");Startactivityforresult (it, activity. default_keys_dialer );
After you press the photo key, your activity will be returned. Therefore, you must add a processing method to the onactivityresult method,
The following code calls the system photo program,
12
Intent it = newintent ("android. Media. Action. image_capture ");Startactivityforresult (it, activity. default_keys_dialer );
After you press the photo key, your activity will be returned. Therefore, you must add a processing method to the onactivityresult method,
12345678910111213
Protectedvoidonactivityresult (intrequestcode, intresultcode, intent data ){Super. onac
Because the decode out of the picture is too small, smaller than the screen. As a result, the image is magnified slightly when displayed, causing the line shape to appear jagged.You can modify the size of the Getscreenimagesize method, such as 133, to make it larger.The specific changes are as follows:Modify Getscreenimagesize function in Filtershowactivity.java file about lines 507.private int getscreenimagesize () {Displaymetrics metrics = new Displaymetrics ();Display display = Getwindowmanag
When Android 2.3.7.r1 presses the menu key, the video is stopped. Press the menu key when you change the video to do not process it. The following modifications can be made:
In packages/apps/CameraOpen/src/com/mediatek/camera/VideoCamera. java
In the onKeyDown () method:
Modify
Case KeyEvent. KEYCODE_MENU:
If (mHeadUpDisplay! = Null mGLRootView! = Null
! MAlertShowing ! MMediaRecorderRecording
MHeadUpDisp
Android native camera ane packaged with opencv2.4.9 NDKIt's not very useful now.Ability to run in Nexus7-i (4.4.4)But not at the Sony lt18i yet.Private Function Opencam (): void{if (! camera.issupported)Returnvar cameranam:array = camera.names;var cameraid:uint = 0;if (cameranam.length = = 2) {Cameraid = 1099;////for back or 1098 for front}_cam = nativecamera.instance;_cam.addeventlistener (nativecamera.nat
(path, options); if (convertedbitmap! = null) {final int realwidth = Convertedbitmap.getwidth (); Final int realheight = Convertedbitmap.getheight (); } return Convertedbitmap; } private static int computeinitialsamplesize (bitmapfactory.options Options, int minsidelength, int maxnumofpixels) { Double w = options.outwidth; Double h = options.outheight; int lowerbound = (Maxnumofpixels = =-1)? 1: (int) Math.ceil (math.sqrt (w * h/maxnumofpixels));
System camera call method:
Step 1:
Intent bycamera = new intent ("android. Media. Action. image_capture"); bycamera. putextra (mediastore. extra_output, Uri. fromfile (yourfilepath); startactivityforresult (bycamera, 0 );
Step 2:
Obtain the returned data in the onactivityresult (INT, Int, intent) method of the current activity.
Protected void onactivityresult (INT requestcode, int resultcode, i
Android Camera Real-Time Filter (5), androidcameraAndroid static filter implementation 1. Review knowledge point 1. Basic filter effect implementation (black and white filter)
The technology used is ColorMatrix. The image imaging effect is changed by changing the RGBA coefficient.
Created with Rapha rjl 2.1.2
Image Bitmap
ColorMatei
Implementation of Camera Real-Time Filter on Android platform (7) -- Basic filter creation method (1)
Regarding how to make filters, zhihu's top ticket in this Q A gave a professional answer
In addition, InstagramFilters, an open-source project of githunb, once provided some filter code of the first version of Instagram, which is less than 20 types. GPUImage also has some image processing algorithms for le
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.