Ask Your Question

damiannelus's profile - activity

2019-05-13 09:51:20 -0600 received badge  Notable Question (source)
2017-11-13 10:13:55 -0600 received badge  Popular Question (source)
2014-10-05 14:56:28 -0600 asked a question Android different preview resolution and onCameraFrame resolution.

Hi there,

i've got some question.

In

public class JavaCamResView extends JavaCameraView

i have this method:

public void setResolution(int w, int h) {
    disconnectCamera();
    Utils.writeToLog("setResolution", "camera connected with resolution: " + w +" x " + h, 1);
    connectCamera(w, h);
}

And resolution is set propperly to dimensions of mOpenCvCameraView.getWidth() and mOpenCvCameraView.getHeight(). mOpenCvCameraView is instance of JavaCamResView. Preview looks great and everything works fine, except...

in onCameraFrame method i got CvCameraViewFrame which have size: 1280 x 720.

What's wrong? To be honest i would have chance to choose even bigger resolutions to save image.

Pictures are saved through saveImage method in onCameraFrame. Literally, the saved picture comes from preview. Should i use onPictureTaken method?

2014-06-22 08:27:59 -0600 commented answer stitching vertical images

Ok, so as far as it works I assume it's my last question. I create destination image with reversed dimension of source image (height -> width; width -> height). Then I rotate source image by 90 degree and center in the center of source image. The problem is that destination picutre area doesn't match to rotated picture. Is there any other possibility than creating bigger destination image and then cropping?

2014-06-21 13:26:46 -0600 received badge  Scholar (source)
2014-06-17 14:10:48 -0600 commented answer stitching vertical images

Haris, it's tricky way. Maybe it doesn't sounds like solution, but definitely it is workaround. Thanks a lot! As far as i'm not able to test it now (some problems with device which i hope to manage in two days) could you tell me if you got same distortion as me without rotating images

2014-06-15 05:01:24 -0600 commented question stitching vertical images

I added examples of another scene. Building you can see was photographed aproximately 25 m. from camera.

2014-06-15 03:33:41 -0600 commented question stitching vertical images

Landscape scenes are corrupted as well. I made four photos of my flat's surroundings and two of them was stitched correctly, but the other two was disappointing.

2014-06-14 08:05:44 -0600 asked a question stitching vertical images

Hi, i'm trying to move further with my project of panorama stitching andoid app. Stitching horizontal images still need some improvements, but at the moment i'm satisfied. I got bigger problem with stitching vertical images (one above another).

Frome time to time it works fine: image description +

image description

image description

But more oftenly result image looks horrible: image description +

image description

image description

Can anyone give suggestions what i should check first? What might went wrong?

EDIT: Landscape scene examples image description +

image description

image description

EDIT: Another example. This time images were previously stitched and then i tried to make panorama putting one above the other. Results was completly wrong. image description + image description

=

image description


EDIT:

My problem, as stated above has been solved. Once again - big thanks to Harris. But there is another issue also connected to stitching vertical images. I guess it's better to continue my question here to get comprehensive problem answear.

I rotate two images (partial panoramas): first partial panorama second partial panorama.

Then I create object for result image:

size = com.googlecode.javacv.cpp.opencv_core.cvSize(640,480);
resultImage = com.googlecode.javacv.cpp.opencv_core.cvCreateImage(
    size,
    com.googlecode.javacv.cpp.opencv_core.IPL_DEPTH_8U, 
    1);

Loaded images and resultImage are passed as arguments to Stitcher.stitch method:

status = stitcher.stitch(images, resultImage);

As a result i get below image: result image

It's not the rule. Sometimes this method generates good panoramas, but unfortunately not always. It seems there something with image ratio goes wrong. Can anyone give me a hint what should I change?

2014-05-02 08:01:07 -0600 commented answer Creating a panorama from multiple images. How to reduce calculation time?

Steven, i've noticed the difference and firstly asked my question in javacv mailing list from where i've been redirected here. Kind of circle ;-) But, as we speaking of differences between wrapper and interface. Is there in official OpenCV java's interface Stitcher class or does the full stitching pipeline need to be build step by step?

2014-05-01 06:05:42 -0600 answered a question Creating a panorama from multiple images. How to reduce calculation time?

Hi, i've build simple stitching app with JavaCV. And as mentioned in opening question for this topic calculation time grows with number of images growth. Does author solved the problem and can share experience?

Following approaches comes to my mind: - dive into stitching algorithm and recreate stich method step by step with blocks delivered in jCV (or maybe openCV4Android). - with information about shift between images (from magnetic field sensor and accelerometer) i can compute partial panoramas, then partial panoramas can build bigger panorama and so on.

Do you have any other suggestions? What do you think about those suggested by me? Thanks for any answear and I'll be very grateful for every discussion.

2014-04-18 04:02:41 -0600 commented question Android javacv stitcher

do you mean - OpenCV Library - 2.4.8 project? There's no stitching module (or i wasn't able to find it). Any details? Thanks for hint.

2014-04-17 16:00:19 -0600 asked a question Android javacv stitcher

Hi, after few days of digging, testing and getting frustrated I decided it's time to ask the question.

Error is generated by createDefault method. I get error log as attached below. But structure of my catalog looks fine (i think).

catalogs:

gen libs obj res src .classpath .project AndroidManifest.xml ic_launcher-web.png proguard-project.txt project.properties .settings assets bin Debug

/libs: javacpp.jar javacv.jar armeabi android-support-v4.jar

/libs/armeabi: libjniavfilter.so libjniavformat.so libjniavutil.so libjnicvkernels.so libjniopencv_calib3d.so libjniopencv_contrib.so libjniopencv_core.so libjniopencv_features2d.so libjniopencv_flann.so libjniopencv_highgui.so libjniopencv_imgproc.so libjniopencv_legacy.so libjniopencv_ml.so libjniopencv_nonfree.so libjniopencv_objdetect.so libjniopencv_photo.so libjniopencv_stitching.so libjniopencv_video.so libjniopencv_videostab.so libjnipostproc.so libjniswresample.so libjniswscale.so libopencv_calib3d.so libopencv_contrib.so libopencv_core.so libopencv_features2d.so libopencv_flann.so libopencv_gpu.so libopencv_highgui.so libopencv_imgproc.so libopencv_info.so libopencv_legacy.so libopencv_ml.so libopencv_nonfree.so libopencv_objdetect.so libopencv_photo.so libopencv_stitching.so libopencv_video.so libopencv_videostab.so libtbb.so libjniARToolKitPlus.so libjniavcodec.so libjniavdevice.so

error log:

04-17 22:33:16.001: E/AndroidRuntime(12577): FATAL EXCEPTION: main 04-17 22:33:16.001: E/AndroidRuntime(12577): java.lang.ExceptionInInitializerError 04-17 22:33:16.001: E/AndroidRuntime(12577): at com.example.myapp.Opencvpart.generatePanorama(Opencvpart.java:133) 04-17 22:33:16.001: E/AndroidRuntime(12577): at com.example.myapp.Opencvpart.onOptionsItemSelected(Opencvpart.java:118) 04-17 22:33:16.001: E/AndroidRuntime(12577): at android.app.Activity.onMenuItemSelected(Activity.java:2534) 04-17 22:33:16.001: E/AndroidRuntime(12577): at com.android.internal.policy.impl.PhoneWindow.onMenuItemSelected(PhoneWindow.java:962) 04-17 22:33:16.001: E/AndroidRuntime(12577): at com.android.internal.view.menu.MenuBuilder.dispatchMenuItemSelected(MenuBuilder.java:735) 04-17 22:33:16.001: E/AndroidRuntime(12577): at com.android.internal.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:149) 04-17 22:33:16.001: E/AndroidRuntime(12577): at com.android.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:874) 04-17 22:33:16.001: E/AndroidRuntime(12577): at com.android.internal.view.menu.ActionMenuView.invokeItem(ActionMenuView.java:514) 04-17 22:33:16.001: E/AndroidRuntime(12577): at com.android.internal.view.menu.ActionMenuItemView.onClick(ActionMenuItemView.java:99) 04-17 22:33:16.001: E/AndroidRuntime(12577): at android.view.View.performClick(View.java:4084) 04-17 22:33:16.001: E/AndroidRuntime(12577): at android.view.View$PerformClick.run(View.java:16987) 04-17 22:33:16.001: E/AndroidRuntime(12577): at android.os.Handler.handleCallback(Handler.java:615) 04-17 22:33:16.001: E/AndroidRuntime(12577): at android.os.Handler.dispatchMessage(Handler.java:92) 04-17 22:33:16.001: E/AndroidRuntime(12577): at android.os.Looper.loop(Looper.java:137) 04-17 22:33:16.001: E/AndroidRuntime(12577): at android.app.ActivityThread.main(ActivityThread.java:4794) 04-17 22:33:16.001: E/AndroidRuntime(12577): at java.lang.reflect.Method.invokeNative(Native Method) 04-17 22:33:16.001: E/AndroidRuntime(12577): at java.lang.reflect.Method.invoke(Method.java:511) 04-17 22:33:16.001: E/AndroidRuntime(12577): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789) 04-17 22:33:16.001: E ... (more)

2014-03-28 11:05:00 -0600 received badge  Editor (source)
2014-03-28 10:26:29 -0600 asked a question adding rotation axis to CvCameraViewListener2

Hi there,

i've question related to usage of CvCameraViewListener2.

I would like to add two axis (x and y) to showed camera preview. To ilustrate it should look like this: image description

Is it possible? How i can do it? Ofcourse axis are dynamically generated

[EDIT]

public Mat onCameraFrame(CvCameraViewFrame inputFrame) {
    mRgba = inputFrame.rgba();

    lx = new Point(0.0, (float)mRgba.rows()/2);
    rx = new Point((float)mRgba.cols(), (float)mRgba.rows()/2);
    ty = new Point((float)mRgba.cols()/2, 0.0);
    by = new Point((float)mRgba.cols()/2, (float)mRgba.rows());

    Core.line(mRgba, lx, rx, new Scalar(0, 0, 255, 255));
    Core.line(mRgba, ty, by, new Scalar(255, 0, 0, 255));
    return mRgba;
}

Code posted above gives horizontal line (lx, rx) but no vertical (ty, by).

[EDIT 2]

And here is the answear: thickness

    Core.line(mRgba, lx, rx, new Scalar(0, 0, 255, 255), **3**);
    Core.line(mRgba, ty, by, new Scalar(255, 0, 0, 255), **3**);

makes it visible.

Sometimes it's really helpful to ask the question :-)