BebopVideoView to Mat


#21

thread management… You don’t want to leave the cv processing thread running while the activity is not active.

resume starts the thread and pause tears it down


Construct cv::Mat from the frame Bebop send to iOS (ARCONTROLLER_Frame_t)
#22

I am working on an image processing app on bebop drone and I am facing the same problem, i.e., the taken image is black:( My template is parrot sample project At first, i changed BebobVideoView into TextureView. Then, when I try to get image from BebobActivity as

final Bitmap bit = mVideoView.getBitmap();
ImageView im = (ImageView) findViewById(R.id.imageView);
im.setImageBitmap(bit);

the image is black. So I tried to create class in original BebopActivity class, where the new class extends thread. The process of taking bitmap is then run in an own thread as is it seen in synman example but again the image is black:(

Can someone please post working BebopActivity where working getBitmap() is shown? Thank you


#23

I have used to take CVClassifierView and create own view of this class. In bebobActitivity I take the id and call resume. I the CVClassifierView, i try to paint the bitmap, but again, the output is black:(


#24

Solved:) It has needed to append "this.setSurfaceTextureListener(this); " into the bebopVideoView


#26

@hmattolou

hello.
I guess @mastemace comment would mean the code below.


[BebopActivity.java]

private void initIHM() {
      mVideoView = (BebopVideoView) findViewById(R.id.videoView);
      mVideoView.setSurfaceTextureListener(mVideoView);
 ...
}

[BebopVideoView.java]

public BebopVideoView(Context context) {
    this(context, null);
    ...
    setSurfaceTextureListener(this);
}

public BebopVideoView(Context context, AttributeSet attrs) {
    this(context, attrs, 0);
    ...
    setSurfaceTextureListener(this);
}

public BebopVideoView(Context context, AttributeSet attrs, int defStyleAttr) {
    super(context, attrs, defStyleAttr);
    ...
    setSurfaceTextureListener(this);
}

BebopVideoView is TextureView.


I think you can solve the problem by writing code like above.
Thanks.


#28

Hi synman!!!
I’m mingyu from south korea and student.
Actually i have a final project with BebopDrone for my graduate what is SelfiDrone.
I saw your codes BebopVideoView & CVClassifierView file. But i don’t understand about thread.
If you don’t mind, Could you send me your wholecode of project? (i want to know procedure)

My email address is ‘darkpmg@gmail.com’.

Thank you synman.
Regards


#29

Hi! mastemace!
I have some problem. If you are fine, could you send me BebopActivity.java and activity_bebop.xml?

my email is darkpmg@gmail.com

thank you