Giter VIP home page Giter VIP logo

myrobot's People

Contributors

webjb 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

Watchers

 avatar  avatar  avatar  avatar

myrobot's Issues

Frame drop after some time

onResume is called twice which stops the camera preview. I removed the code from there and added the onResume code to onStart and onPause code to onStop. This solved the problem of this being called twice and stopping the camera feed.

But due to some reason, after a while, the number of frames drops significantly. It process at ~30-40 frames in the beginning and after a while, all of a sudden, decreases the fps to 1.
CPU usage is at 1% and there is no apparent memory leak either.

Cannot build the project using Android Studio 2.2.2

Import the project using Android Studio 2.2.2. When building, there is an error:

Error:A problem occurred configuring project ':app'.

Exception thrown while executing model rule: BaseComponentModelPlugin.Rules#createVariantData > afterEach()
Cannot evaluate module openCVLibrary310 : Configuration with name 'default' not found.

Please help fix it. Thanks.

BTW, could you help solve the related problem in stackoverflow. Thanks.

http://stackoverflow.com/questions/41922753/image-processing-framework-using-android-camera2-api-and-opencv

can't dequeue multiple buffers without setting the buffer count

I see above error when I use the similar implementation in my application.

One more question, I see NativeWindow have formats supported as
{ WINDOW_FORMAT_RGBA_8888 = 1, WINDOW_FORMAT_RGBX_8888 = 2, WINDOW_FORMAT_RGB_565 = 4 } .
Do you see if YUV_420_888 format is supported ?

What I am trying to do here is for POC , I take shared buffer from JNI and then do following

//
/
Render Image Function Call for first surface
/
*/
JNIEXPORT jint JNICALL
Java_com_siriuscam_Utility_JNIManager_renderImage1(JNIEnv * env, jobject jb,jobject surface,
jobject yBuffer, jobject uBuffer, jobject vBuffer, jint yBufSize, jint uBufSize, jint vBufSize)
{
LOGI("renderImage1() call");
//ANativeWindow *window = NULL;
jbyte jYBuffer = (jbyte)env->GetDirectBufferAddress(yBuffer);
unsigned char *srcLumaPtr = reinterpret_cast<unsigned char *>(env->GetDirectBufferAddress(yBuffer));
unsigned char *srcChromaUPtr = reinterpret_cast<unsigned char *>(env->GetDirectBufferAddress(uBuffer));
unsigned char *srcChromaVPtr = reinterpret_cast<unsigned char *>(env->GetDirectBufferAddress(vBuffer));

jbyte *jUBuffer = (jbyte*)env->GetDirectBufferAddress(uBuffer);
jbyte *jVBuffer = (jbyte*)env->GetDirectBufferAddress(vBuffer);

LOGI("Received image buffer");
//LOGI("Window1 size : %d x %d", mWidth1, mHeight1);

ANativeWindow *window = ANativeWindow_fromSurface(env, surface);
LOGI("ANativeWindow_fromSurface() done");
ANativeWindow_acquire(window);

//if(!isInit1){
    //ANativeWindow_setBuffersGeometry(window1, mPreviewWidth, mPreviewHeight,WINDOW_FORMAT_RGBA_8888);
    ANativeWindow_setBuffersGeometry(window, mPreviewWidth, mPreviewHeight,0);
    LOGI("ANativeWindow_setBuffersGeometry() done");
    isInit1 = 1;

//}

int lockResult = -1;
LOGI("ANativeWindow_lock");
lockResult = ANativeWindow_lock(window, &buffer1, NULL);
LOGI("buffer1.format 0x%x \n",buffer1.format);
LOGI("buffer1.stride %d \n",buffer1.stride);
LOGI("window format 0x%x  \n",ANativeWindow_getFormat(window));


if (lockResult >= 0) {
    LOGI("Writing data buffer1 on native window1");
    // color conversion from YUV420 to RGBA.
    ColorConversion_YUV420P_RGBA( (unsigned char*)srcLumaPtr, (unsigned char*)srcChromaUPtr, (unsigned char*)srcChromaVPtr, mPreviewWidth ,mPreviewHeight,(unsigned  int*)OutputData_RGBA_1);
    // copy data into window buffer
    unsigned char *sbuf = &OutputData_RGBA_1[0];
    unsigned char *dbuf = (unsigned char *)buffer1.bits;
    for(int i=0;i< 720 ;i++) {
            dbuf = dbuf +  (i * buffer1.stride * 4);
            LOGI("i %d \n",i);
            memcpy(dbuf, OutputData_RGBA_1, 1280 * 4);
            sbuf += 1280 * 4;
        }

    LOGI("ANativeWindow_unlockAndPost");
    ANativeWindow_unlockAndPost(window);
} else {
    LOGE("ANativeWindow_lock failed error %d", lockResult);
}
LOGI("Releasing window1");
ANativeWindow_release(window);
return 0;

}

無法Build 過

請問我在Android Studio 2.1.2 import source code 出現
Error: Configuration with name 'default' not found.
可能是缺少什麼設定?

Orientation sensor malfunction

Keeps returning values and onViewCreated is called constantly.

I removed the orientation sensor and the extra code and managed to run the whole thing but onResume is called twice which stops the camera feed.

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.