GithubHelp home page GithubHelp logo

camerafilter's Introduction

Hi ㊎㊍㊌㊋㊏

Nekocode's github stats

I'm Mark Yang, a full-stack engineer and specialize in frontend (web/flutter/android) development. I’m also an open source enthusiast and have contributed dozens of projects to the community.

wired cat

Websites: nekocode.cn | agilebyte.cc | emu666.com

Repository Gallery | Pull Requests | Zhihu | WeChat Official Account

Proficient in:

  • TypeScript, Dart, Java, Kotlin programming language
  • Web application development practices with React, Next.js
  • Flutter application development
  • Android application development, Gradle plugin development

camerafilter's People

Contributors

benjaminwegener avatar bryant1410 avatar mapleqin avatar nekocode avatar winstonwool avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

camerafilter's Issues

Lanscape mode

Can you help me with landscape mode? I am trying to modify your source code, but nothing comes

How to make more custom filters from the Default filters

I rilly like the EmInterference, and would like to create another type of this which instead of green tone, will be yellow or red tones e.t.c as well as the "Contrast Filter", how can i go about this please. Thanks for the anticipated support :)

AVG reports a trojan for v2.2

A check with VirusTotal reports a trojan named "Android/C2M.I.62A80EEE7B6C" for v2.2. Any idea what could cause it? To me it looks like a "false positive" (especially as only 1 out of 55 engines reports it), but there's no background info on it. Would be nice to get rid of that nasty flag :)

Camera access is required

I just run on android studio3.1.2, but when app run, show this error:"Camera access is required". And I look at the source .code, it is here, how can I resolve this bug?

 if (ContextCompat.checkSelfPermission(this,
            Manifest.permission.CAMERA)
            != PackageManager.PERMISSION_GRANTED && permit) {

        // Should we show an explanation?
        if (ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.CAMERA)) {
            Toast.makeText(this, "Camera access is required.", Toast.LENGTH_SHORT).show();

        } else {
            ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.CAMERA},
                    REQUEST_CAMERA_PERMISSION);
        }

    } else {
        setupCameraPreviewView();
    }

Camera not working for first time

In android 7.0, app first of all asks for permission to take pictures and record video . On allowing it, just the white screen comes with no camera as shown. Although, on restarting the app , camera is working absolutely fine.
screenshot_2017-12-04-01-22-27-738_cn nekocode camerafilter

Also, in the Filter named 'Cracked', the feature is working fine but with a little bit of lag

Please check

Texture2D compatibility issue

I was using ShaderToy to create a filter of my own and when I put it on the app, it seems to be a compatibility issue involving the texture class.

It appears that ShaderToy has the new version in which Texture2D was replaced by only texture and that's how I built my shader on the online tool:

void mainImage(out vec4 fragColor, in vec2 fragCoord) {
    vec2 uv = fragCoord.xy;
    int id = 5;
    vec3 s = texture(iChannel0, fragCoord.xy / iResolution.xy).xyz;

    vec3 c = vec3(50, 50, 50);
    vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
    vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g));
    vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r));
    float d = q.x - min(q.w, q.y);
    float e = 1.0e-10;
    vec3 dest = vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x);

    vec3 color = max(s,dest);
    fragColor = vec4(color,1.0);
}

If I put the code like this on the app, the screen turns black, that because of the texture that is not supported. If I simply change from texture to texture2D in line 4, is like the entire screen in only one huge pixel that changes color as I move my camera.

Do you have any idea how I can change this code or the one on MyGLUtils class so it will work properly?

Filter Chain

Hi,

How can i create a filter chain?

I need multiple outputs with different filters and blend them to single frame?

Camera Preview Shows Mirror image

Hello,

when i o camera it show mirror image.
i need to show it as it is no need to mirror it.

Please give me some solution for this issue
thanks in advance.

How to change SQUARE_COORDS[] To FullScreen Coords[].

Hello nekocode. Great work there. Am only battling with how to make the rendere looks better, if am choosing to be on fullscreen mode. i.e layoutWidth and Height = "match_parent".

How can i go about this, thank you for all your help and libraries, hoping to get a reply from you soon.

在显示自定义照相界面调用照相机api回调result_code=0 In the display of the custom camera interface to call the camera API callback result_code=0

I have a Project dialog box pop-up options are to achieve the switch call comes with the camera's current interface display video camera, that is, the use of your framework, as well as the call to select the local album API
I called the interface initialization after the start of the preview, and then call the system comes with a camera callback is always 0 activity.RESULT_CODE=CANNEL, which is how it happened? As well as the choice of album came back and then click to take pictures
Thread already started va.lang.IllegalThreadStateException:
Java.lang.Thread.checkNotStarted at (Thread.java:849)
Java.lang.Thread.start at (Thread.java:1059)
Cn.nekocode.camerafilter.CameraRenderer.onSurfaceTextureAvailable at (CameraRenderer.java:121)

camptured image is show low quality

Hello,
thank you in advance,

i use this library to take camera image but image quality is not that much good.
i use below capture code

private boolean caputre() {

	String mPath = genSaveFileName(getTitle().toString() + "_", ".png");
	File imageFile = new File(mPath);
	if (imageFile.exists()) {
		imageFile.delete();
	}

	//sessionManager.setStringData(SessionManager.KEY_picturepath);
	sessionManager.putStringData(SessionManager.KEY_picturepath,mPath);

	// create bitmap screen capture
	Bitmap bitmap = textureView.getBitmap();
	//Bitmap bitmap = textureView.getDrawingCache();

	OutputStream outputStream = null;

	try {
		outputStream = new FileOutputStream(imageFile);
	//	bitmap.compress(Bitmap.CompressFormat.PNG, 100, outputStream);
		bitmap.compress(Bitmap.CompressFormat.PNG, 100, outputStream);

		outputStream.flush();
		outputStream.close();

	} catch (FileNotFoundException e) {
		e.printStackTrace();
		return false;
	} catch (IOException e) {
		e.printStackTrace();
		return false;
	}

	return true;
}

please give some solution to improve quality

I tried to run the app on Android 6.0 device, but crashed.

07-29 10:05:28.757 32089-32089/? I/art: Late-enabling -Xcheck:jni
07-29 10:05:28.757 32089-32089/? I/art: Late-enabling JIT
07-29 10:05:28.776 32089-32089/? I/art: JIT created with code_cache_capacity=2MB compile_threshold=1000
07-29 10:05:28.839 32089-32089/cn.nekocode.camerafilter W/System: ClassLoader referenced unknown path: /data/app/cn.nekocode.camerafilter-2/lib/arm
07-29 10:05:28.924 32089-32089/cn.nekocode.camerafilter W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
07-29 10:05:29.170 32089-32116/cn.nekocode.camerafilter D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
07-29 10:05:29.222 32089-32116/cn.nekocode.camerafilter I/mali_so: [File] : hardware/arm/maliT760/driver/product/base/src/mali_base_kbase.c; [Line] : 928; [Func] : base_context_deal_with_version_affairs_rk_ext;
arm_release_ver of this mali_so is 'r12p0-04rel0', rk_so_ver is '13@0', built at '15:42:56', on 'Aug 16 2016'.
07-29 10:05:29.222 32089-32116/cn.nekocode.camerafilter I/mali_so: [File] : hardware/arm/maliT760/driver/product/base/src/mali_base_kbase.c; [Line] : 955; [Func] : base_context_deal_with_version_affairs_rk_ext;
mali_ver_property has been set to 'r12p0-04rel0-13-13@0', to return.
07-29 10:05:29.224 32089-32116/cn.nekocode.camerafilter I/OpenGLRenderer: Initialized EGL, version 1.4
07-29 10:05:29.232 32089-32116/cn.nekocode.camerafilter D/Surface: Surface::final mReqUsage=a00
07-29 10:05:29.232 32089-32116/cn.nekocode.camerafilter D/mali_winsys: EGLint new_window_surface(egl_winsys_display*, void*, EGLSurface, EGLConfig, egl_winsys_surface**, egl_color_buffer_format*, EGLBoolean) returns 0x3000
07-29 10:05:29.343 32089-32089/cn.nekocode.camerafilter W/art: Before Android 4.1, method int android.support.v7.widget.ListViewCompat.lookForSelectablePosition(int, boolean) would have incorrectly overridden the package-private method in android.widget.ListView
07-29 10:05:29.947 32089-32161/cn.nekocode.camerafilter D/Surface: Surface::final mReqUsage=200
07-29 10:05:29.947 32089-32161/cn.nekocode.camerafilter D/mali_winsys: EGLint new_window_surface(egl_winsys_display*, void*, EGLSurface, EGLConfig, egl_winsys_surface**, egl_color_buffer_format*, EGLBoolean) returns 0x3000
07-29 10:05:30.288 32089-32161/cn.nekocode.camerafilter D/skia: ---- fAsset->read(1024) returned 0
07-29 10:05:31.174 32089-32161/cn.nekocode.camerafilter E/GLConsumer: error creating EGLImage: 0x3003
07-29 10:05:31.174 32089-32161/cn.nekocode.camerafilter E/GLConsumer: Failed to create image. size=2200x1650 st=2200 usage=0x333 fmt=21
07-29 10:05:31.174 32089-32161/cn.nekocode.camerafilter W/GLConsumer: [SurfaceTexture-3-32089-1] updateAndRelease: unable to createImage on display=0x1 slot=0
07-29 10:05:31.178 32089-32161/cn.nekocode.camerafilter E/AndroidRuntime: FATAL EXCEPTION: Thread-229
Process: cn.nekocode.camerafilter, PID: 32089
java.lang.RuntimeException: Error during updateTexImage (see logcat for details)
at android.graphics.SurfaceTexture.nativeUpdateTexImage(Native Method)
at android.graphics.SurfaceTexture.updateTexImage(SurfaceTexture.java:240)
at cn.nekocode.camerafilter.CameraRenderer.run(CameraRenderer.java:190)
at java.lang.Thread.run(Thread.java:818)
07-29 10:10:31.281 32089-32161/cn.nekocode.camerafilter I/Process: Sending signal. PID: 32089 SIG: 9

Apply Custom Filter?

I want to apply my custom filters like Vignette, GrayScale, Blur, Blue Mess and many more, how can i achieve using your code.?

Realtime camera zoomIn and zoomOut

Hi, Nikocode! First of all, thank you for your work! I can 't figure out how I can zoom in and zoom out real time camera in your programm? setParameters.setZoom() is not working! Thanks!

continues crash on camera preview : issue in camera rendering

please provied solution for below issue :

E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.remfit.pillowsuggester, PID: 4655
java.lang.NullPointerException: Attempt to read from field 'java.lang.Object android.util.Pair.second' on a null object reference
at com.remfit.pillowsuggester.CameraFilter.CameraRenderer.onSurfaceTextureAvailable(CameraRenderer.java:159)
at android.view.TextureView.getHardwareLayer(TextureView.java:370)
at android.view.View.updateDisplayListIfDirty(View.java:14274)
at android.view.View.getDisplayList(View.java:14319)
at android.view.View.draw(View.java:15089)
at android.view.ViewGroup.drawChild(ViewGroup.java:3405)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3198)
at android.view.View.updateDisplayListIfDirty(View.java:14292)
at android.view.View.getDisplayList(View.java:14319)
at android.view.View.draw(View.java:15089)
at android.view.ViewGroup.drawChild(ViewGroup.java:3405)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3198)
at android.view.View.draw(View.java:15364)
at android.widget.FrameLayout.draw(FrameLayout.java:600)
at android.view.View.updateDisplayListIfDirty(View.java:14297)
at android.view.View.getDisplayList(View.java:14319)
at android.view.View.draw(View.java:15089)
at android.view.ViewGroup.drawChild(ViewGroup.java:3405)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3198)
at android.view.View.draw(View.java:15364)
at android.view.View.updateDisplayListIfDirty(View.java:14297)
at android.view.View.getDisplayList(View.java:14319)
at android.view.View.draw(View.java:15089)
at android.view.ViewGroup.drawChild(ViewGroup.java:3405)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3198)
at android.view.View.updateDisplayListIfDirty(View.java:14292)
at android.view.View.getDisplayList(View.java:14319)
at android.view.View.draw(View.java:15089)
at android.view.ViewGroup.drawChild(ViewGroup.java:3405)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3198)
at android.view.View.updateDisplayListIfDirty(View.java:14292)
at android.view.View.getDisplayList(View.java:14319)
at android.view.View.draw(View.java:15089)
at android.view.ViewGroup.drawChild(ViewGroup.java:3405)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3198)
at android.view.View.draw(View.java:15364)
at android.widget.FrameLayout.draw(FrameLayout.java:600)
at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:2835)
at android.view.View.updateDisplayListIfDirty(View.java:14297)
at android.view.View.getDisplayList(View.java:14319)
at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:273)
at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:279)
at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:318)
at android.view.ViewRootImpl.draw(ViewRootImpl.java:2646)
at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2468)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2098)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1161)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6198)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:767)
at android.view.Choreographer.doCallbacks(Choreographer.java:580)
at android.view.Choreographer.doFrame(Choreographer.java:550)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:753)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5280)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:963)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:758)

frame > float[] > render float[]

Hi,
After lots of time trying to find a camera preview approach for fast video processing, this one seems the best.
Our goal is to

  • capture each frame using this library
  • get the rbg values into a float[]
  • send it to a tensorflow graph & get it back
  • render the new float[] using this library, like overriding the OriginalFilter

Could you please help us finding the fastest way to achieve the 2nd and 4th steps ?

Front camera keeps rotating upside down

Hello nekocode. Am trying to use the front camera, but the view is rotated upside down. I tried camera.setDisplayOrientation(90); but didnt work as well as parameter.setRotation(90) .

Please how can i go about this. Thank you for the time invested in this library.

Error while changing view visibility

va.lang.IllegalThreadStateException: Thread already started
at java.lang.Thread.checkNotStarted(Thread.java:849)
at java.lang.Thread.start(Thread.java:1059)
at cn.nekocode.camerafilter.CameraRenderer.onSurfaceTextureAvailable(CameraRenderer.java:121)

APK files in releases show wrong version number

For the 1.4 release, the APK still shows 1.4:

package: name='cn.nekocode.camerafilter' versionCode='1' versionName='1.0'

Could you please upload a fixed version, and keep numbers in sync? Thanks in advance!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.