JavaCameraView delivers same frame twice (Bug #3123)


Added by Daniel Schlick over 11 years ago. Updated over 11 years ago.


Status:Done Start date:2013-07-01
Priority:Normal Due date:
Assignee:Alexander Smorkalov % Done:

0%

Category:android
Target version:-
Affected version:branch '2.4' Operating System:Android
Difficulty: HW Platform:ARM
Pull request:https://github.com/Itseez/opencv/pull/1073

Description

I created an android application based on difference image. Every secound difference frame has no difference. Finnally i found a problem in JavaCameraView class.

In method initialzeCamera() the JavaCameraFrame class will be instantiated:
mCameraFrame = new JavaCameraFrame(mFrameChain[mChainIdx], mFrameWidth, mFrameHeight);

this object will now always use the Mat from mChanIdx 0.

In CameraWorker Thread the deliverAndDrawFrame method alaways gets the mat stored in mFrameChain index 0 because mCameraFrame gets no update about the new frame if mChainIdx has value 1.
if (!mStopThread) {
if (!mFrameChain[mChainIdx].empty())
deliverAndDrawFrame(mCameraFrame);
mChainIdx = 1 - mChainIdx;
}

We propose to update the mCameraFrame object with the current Mat in the onPreviewFrame method.

Thank you!


Associated revisions

Revision 91b713b8
Added by Alexander Smorkalov over 11 years ago

JavaCameraView delivers same frame twice (Bug #3123) fixed.

History

Updated by Christopher Schott over 11 years ago

Hello,

I found the same issue.

Thank you!

Updated by Maria Dimashova over 11 years ago

Daniel, thank you for the bug report!
If you know the problem and propose a solution, the fastest way to push it into OpenCV is to open a request for https://github.com/Itseez/opencv (the instruction for this is here). Could you please create such request?

Updated by Daniel Schlick over 11 years ago

Hi Maria,

thank you for your answer. the request should be pulled.

Updated by Alexander Smorkalov over 11 years ago

Solution without object construction on every frame. IMHO, it must be faster.

  • Pull request set to https://github.com/Itseez/opencv/pull/1073
  • Affected version changed from 2.4.5 (latest release) to branch '2.4'

Updated by Alexander Smorkalov over 11 years ago

  • Status changed from New to Open

Updated by Alexander Smorkalov over 11 years ago

  • Status changed from Open to Done

Also available in: Atom PDF