Ask Your Question

s4eed's profile - activity

2019-06-06 07:13:25 -0600 received badge  Famous Question (source)
2019-05-01 06:28:30 -0600 received badge  Famous Question (source)
2018-04-25 09:02:50 -0600 received badge  Famous Question (source)
2017-01-20 11:26:30 -0600 received badge  Notable Question (source)
2016-04-26 08:49:50 -0600 received badge  Popular Question (source)
2016-01-30 12:44:57 -0600 received badge  Famous Question (source)
2015-11-23 02:20:04 -0600 received badge  Notable Question (source)
2015-04-17 05:01:25 -0600 received badge  Notable Question (source)
2015-02-28 08:10:21 -0600 received badge  Notable Question (source)
2015-02-25 12:48:22 -0600 received badge  Popular Question (source)
2015-02-09 13:58:52 -0600 received badge  Notable Question (source)
2014-09-19 07:03:29 -0600 received badge  Popular Question (source)
2014-04-21 15:11:41 -0600 received badge  Popular Question (source)
2014-03-19 07:34:35 -0600 received badge  Popular Question (source)
2013-09-11 05:53:21 -0600 commented answer Creating a Mat object from a YV12 image buffer

OK.Thank you!

2013-09-11 05:37:40 -0600 commented answer Creating a Mat object from a YV12 image buffer

Nothing changed ! :-| :-(

2013-09-11 05:28:35 -0600 commented answer Creating a Mat object from a YV12 image buffer

No I saved it.

2013-09-11 05:13:30 -0600 commented answer Creating a Mat object from a YV12 image buffer

thank you. I used your way I updated my question. I got a picture but it wasn't the right one yet.

2013-09-11 03:05:12 -0600 asked a question Creating a Mat object from a YV12 image buffer

Hi ! I have a buffer which contains an image in YV12 format. Now I want to either convert this buffer to rbg or create a Mat object from it directly! Can someone help me? I tried moster's way :

cv::Mat input(rows, cols, CV_8UC1, buffer);
cv::Mat converted;
cv::cvtColor(input, converted, CV_YUV2RGB_YV12);

Now images look like this : image description

2013-08-24 01:26:37 -0600 commented question [solved] Opencv loads an AVI movie frames but they are all black?

@berak -> Thank you ! I had installed NvClient for my SDVR. I removed it and problem went away!

2013-08-24 01:13:54 -0600 asked a question [solved] Opencv loads an AVI movie frames but they are all black?

I could open AVI files using Opencv until 3 days ago. Now when I try to open the same movie with Opencv, VideoCapture can open the AVI movie but frames are all black !

VideoCapture cap("path to movie);
while(1){
    Mat m;
    cap >>m;
    //display m
}

I'm using OpenCV 2.4.6

2013-06-27 10:37:06 -0600 commented question How to wrap/deform image?

@any solution ? I need it for my project.

2013-06-22 01:38:04 -0600 asked a question How to read an AVI file in OpenCV for Android

I need to read an AVI file in android and process its frames. I know its C++ way but not the android one! Can someone help me and give a start point. I'm using opencv 2.4.5

2013-04-30 03:55:07 -0600 asked a question CascadeClassifier::load function always returns false

Hi. My CascadeClassifier::load function returns false even with an absolute path to the xml file :

face_cascade.load( "D:/tmp/haarcascade_frontalface_alt2.xml" );

I'm using opencv 2.4.5

2013-04-29 03:46:44 -0600 received badge  Student (source)
2013-04-29 02:19:28 -0600 asked a question Is it possible to switch between Front camera and Back camera at runtime?

I've created a Native camera view like this :

<org.opencv.android.NativeCameraView
            android:id="@+id/tutorial1_activity_native_surface_view"
            android:layout_width="350px"
            android:layout_height="350px"
            android:layout_marginLeft="5dp"
            android:layout_marginTop="5dp"
            opencv:camera_id="front" />

Now I have 2 questions.

  1. How can I switch from front camera to back camera at run time?
  2. How can I turn off and on the camera at run time ?
2013-04-24 08:38:05 -0600 received badge  Critic (source)
2013-04-24 03:00:18 -0600 asked a question How to display a Mat in ImageView?

I'm going to display a mat object in ImageView in Android. I tried this code :

public Mat onCameraFrame(CvCameraViewFrame inputFrame) {
    Mat mRgb = inputFrame.rgba();
    Mat mGray = inputFrame.gray();
    Bitmap img = Bitmap.createBitmap(mRgb.cols(), mRgb.rows(),Bitmap.Config.ARGB_8888);
    Utils.matToBitmap(mRgb, img);
    if( mGrayImageView != null )
       mGrayImageView.setImageBitmap(img);// <---- this is my ImageView 
    return inputFrame.rgba();

}

but nothing displayed in ImageView!

2013-04-23 04:36:54 -0600 asked a question OpenCV 2.4.5 front camera preview is upside down?!

I tried to use my device front camera with this code :

<org.opencv.android.JavaCameraView
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:visibility="gone"
        android:id="@+id/tutorial1_activity_java_surface_view"
        opencv:show_fps="true"
        opencv:camera_id="front" />

It worked but the preview is upside down! How to fix it? I use OpenCV 2.4.5.
Here is my user interface file :

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:opencv="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:orientation="horizontal"
    android:layout_height="match_parent" >

    <org.opencv.android.JavaCameraView
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:visibility="gone"
        android:id="@+id/tutorial1_activity_java_surface_view"
        opencv:show_fps="true"
        opencv:camera_id="front" />

    <org.opencv.android.NativeCameraView
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:visibility="gone"
        android:id="@+id/tutorial1_activity_native_surface_view"
        opencv:show_fps="true"
        opencv:camera_id="front" />

</LinearLayout>

Both of native camera and java camera have this problem.

2013-04-23 04:26:53 -0600 received badge  Supporter (source)
2013-04-22 02:35:43 -0600 asked a question How to resize a Mat in Opnecv4Android

I need to resize a Mat inside Java. I know that I can use Resize function in c++. But how to resize it in Java?

2013-04-20 06:39:34 -0600 asked a question How to return a Rect object from native code to Java

I have a native function in my android application that gets a frame and tries to find faces in the frame. Now I want to return face Rect from native code to Java :

JNIEXPORT jobject JNICALL Java_ir_qtips_opencvcamerasettings_MainActivity_00024FaceDetectionTask_fdetect
  (JNIEnv *pEnv, jobject, jlong addrGray)
{
    Mat& mGr  = *(Mat*)addrGray;
    std::vector<Rect> faces;

    face_cascade.detectMultiScale( mGr, faces, 1.1, 2, CV_HAAR_FIND_BIGGEST_OBJECT|CV_HAAR_DO_ROUGH_SEARCH, Size(100,100) );

    Rect r;
    if(faces.size())
        r = faces.at(0);

    return r;
}

Java code :

r = fdetect(m.getNativeObjAddr());

But this code doesn't work. How can I return r from c++ to Java?

2013-03-09 07:26:38 -0600 asked a question What are some camera parameters to set for better face detection

I'm going to write a face detection application using Opencv for Android. Now I want to know what are some parameters that are better to set for better face detection?

2013-03-03 04:46:06 -0600 received badge  Editor (source)
2013-03-03 04:43:32 -0600 asked a question OpenCV JavaCameraView is not full screen

I defined a camera view in .xml user interface file using opencv Camera view like this :

 <org.opencv.android.JavaCameraView
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:visibility="visible"
        android:id="@+id/tutorial1_activity_java_surface_view"
         />

Although I set width and height to be as large as parent and parent is full-screen but my captured frame is really small, some thing like 150*200 pixel. How can I get bigger frame?

2013-02-21 02:23:55 -0600 marked best answer Errors when import OpenCV4Android SDK to Eclipse

I'm new to Android world and going to use OpenCV library in it. I downloaded Opencv4Android-SDK from source-forge and tried to import it in eclipse using package explorer using this tutorial. Every thing went OK but I encountered this error :

Unable to resolve target 'android-9'    OpenCV Library - 2.4.2      Unknown Android Target Problem  

The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files    Video.java  /OpenCV Library - 2.4.2/src/org/opencv/video    line 1  Java Problem  

The project cannot be built until build path errors are resolved    OpenCV Sample - 15-puzzle       Unknown Java Problem

The container 'Android Dependencies' references non existing library 'C:\andcv\OpenCV-2.4.2-android-sdk\sdk\java\bin\opencv library - 2.4.2.jar'    OpenCV Sample - 15-puzzle       Build path  Build Path Problem

Unable to resolve target 'android-11'   OpenCV Sample - 15-puzzle       Unknown Android Target Problem

The project was not built since its build path is incomplete. Cannot find the class file for java.lang.Object. Fix the build path then try building this project    OpenCV Library - 2.4.2      Unknown Java Problem

Im using latest Android SDK that includes the essential Android SDK components and a version of the Eclipse IDE with built-in ADT.
How can I fix this error? thanks.

2013-02-19 06:18:48 -0600 received badge  Scholar (source)