Ask Your Question

Pascal66's profile - activity

2021-05-13 04:04:45 -0600 received badge  Enthusiast
2020-11-05 14:04:47 -0600 received badge  Popular Question (source)
2019-01-11 02:38:35 -0600 edited question H264 without ffmeg

H264 without ffmeg In order to get an h264 stream, I'm using a simple android library (wich is working well enough) I s

2019-01-11 02:38:33 -0600 edited question H264 without ffmeg

H264 without ffmeg In order to get an h264 stream, I'm using a simple android library (wich is working well enough) I s

2019-01-11 02:16:26 -0600 edited question H264 without ffmeg

H264 without ffmeg In order to get an h264 stream, I'm using a simple android library (wich is working well enough) I s

2019-01-10 04:26:12 -0600 edited question H264 without ffmeg

H264 without ffmeg In order to get an h264 stream, I'm using a simple android library (wich is working well enough) I s

2019-01-10 04:24:57 -0600 asked a question H264 without ffmeg

H264 without ffmeg In order to get an h264 stream, I'm using a simple android library (wich is working well enough) I s

2018-10-21 16:23:17 -0600 received badge  Notable Question (source)
2016-07-18 12:28:19 -0600 received badge  Famous Question (source)
2016-06-14 06:12:12 -0600 received badge  Popular Question (source)
2015-05-17 15:15:07 -0600 received badge  Notable Question (source)
2014-12-09 13:55:43 -0600 marked best answer Best way to access pixel value from a single channel ? Transform to an array or use existing code ?

This one

Core.extractChannel(mRgba, mR, 0); // for R channel
imageSrc.convertTo(mR, CvType.CV_64FC1);
int size = (int) (mG.total());
double[] dR = new double[size];
mR.get(0, 0, dR);

for (int i = size; i-- > 0;) {
dR[i] = /** do the work */
}

Or accessing pixel value with for x and for y ? ".At" is not possible in java version of OpenCv 2.4.6 Other way (Moster)

width = mR.width(); height  = mR.height(); 
        byte[] bR = new byte{size]; 
        for (y= height , y-- >0;) for (x =with, y-- >0;) //Best to work with row 2 Best to decrease  counter  
    bR.get(y, x).val[0} = /** do the work */ } }
2014-11-14 11:43:35 -0600 received badge  Popular Question (source)
2014-02-25 06:54:02 -0600 commented answer RGB to c1c2c3 color space conversion

Well .. Python is certainly usefull to test idea, bur not really to make Android Java app... But i'll try thi sway, thank you

2013-11-07 08:57:16 -0600 commented question Problem finding constant arclength of contour

"It depend on how "stable" mean for you. If one pixel is added or removed from the contour, arclength or area never give a "stable" result +- one pixel... wich example contradict that ?

2013-10-04 06:54:13 -0600 commented question Is this kernel work like a map function ?

If I want myF(val(x,y)) ?

2013-10-03 04:47:56 -0600 commented question Is this kernel work like a map function ?

Not myF * val(x, y) + val(x, y) ????

2013-10-03 03:44:50 -0600 asked a question Is this kernel work like a map function ?

if I apply this kernel with filter2D is it working like I think ?

0  0  0
0 myF 0
0  0  0

myF is the result of a custom function

I think 0 mean : val(x,y) * 0 + val(x, y) so the same value

but how i can do val(x, y) * myF + 0 ?

2013-10-01 09:51:19 -0600 answered a question Apply a function to a Mat (like filter2D or map in other language)

10x faster than rgb.get(j,i):

for (int j = 0; j <= rgb.cols() ; j ++) {
    for (int i = 0; i <= rgb.rows(); i ++) {
    Rect rect = new Rect(j, i, 1, 1); 
    Mat roi = rgb.submat(rect);
    My_func(Core.mean(roi));
}}
2013-10-01 08:46:35 -0600 commented answer Apply a function to a Mat (like filter2D or map in other language)

I've made double because it's the worst, most of opencv use 32F so float

i agree with you to use seperation inside the function

I dont need to split (split doesnt work in my java version), so i use extractchannel), tu as raison, I can use rgb.get(x, y) that give me a double[] with the number of channel

I'm not agree, filter2d give a result like 'multiply then add" i need : point(x, y) = F(point(x, y))

for the moment, i've resolved that by made the mean of a rectangle of (1x1), and apply my_function to this rectangle.

PS :I just need an "map" function to apply a function to each pixel of a Mat(), C++ allow it, not Java.

2013-09-29 19:03:21 -0600 asked a question Apply a function to a Mat (like filter2D or map in other language)

Is there a more efficient way than :

Mat mR = new Mat();
    Mat mG = new Mat();
    Mat mB = new Mat(); 
    Core.extractChannel(rgb, mR, 0); mR.convertTo(mR, CvType.CV_64FC1);
    Core.extractChannel(rgb, mG, 1); mG.convertTo(mG, CvType.CV_64FC1);
    Core.extractChannel(rgb, mB, 2); mB.convertTo(mB, CvType.CV_64FC1);
    int size = (int) (mG.total());
    double[] dR = new double[size]; mR.get(0, 0, dR);
    double[] dG = new double[size]; mG.get(0, 0, dG);
    double[] dB = new double[size]; mB.get(0, 0, dB);

    for (int i = size; i-- > 0;) {
        my_function(new Scalar(dR[i],dG[i],dB[i]));     
    }
    mR.put(0, 0, dR);
    mG.put(0, 0, dG);
    mB.put(0, 0, dB);

    mR.convertTo(mR, CvType.CV_8UC1); Core.insertChannel(mR, rgb, 0);
    mG.convertTo(mG, CvType.CV_8UC1); Core.insertChannel(mG, rgb, 1);
    mB.convertTo(mB, CvType.CV_8UC1); Core.insertChannel(mB, rgb, 2);
2013-09-27 16:01:17 -0600 commented answer Train from color, not from object.

Ok Mostafa, so I can train the classifier with the histogram of the floodfilled images, and calcBackProject the predicted histogram ? BTW, after some test, I dont know how to setup the response Mat for svm training

2013-09-27 06:36:46 -0600 answered a question Separating sharp portions from blurred portions in an image
2013-09-27 06:22:11 -0600 asked a question Train from color, not from object.

Is it possible to train an LM with an images folder, using a defined start color for each image ?

I mean :

  1. Start with know color hsv/rgb
  2. On each picture saved, learn modification
  3. Next start(1 month, 1 day, 1 year) use this learned range to predict the new color range
  4. and so on
2013-09-26 16:40:09 -0600 edited question Get the median, added to mean and std value

I'm using : Core.meanStdDev(hist, mean, stdev);

Is there a possibility to have median in the result of meanStdDev ?

2013-09-26 16:17:56 -0600 asked a question Perspective of a square with pitch roll

I can't found a simple approach to make the perspective of a simple rectangle

assuming the rectangle is on the floor how i can have 4 lines on screen following picth/roll ?

2013-09-26 01:38:39 -0600 received badge  Citizen Patrol (source)
2013-09-24 06:53:03 -0600 commented question Exif with Highgui.imwrite(filename, myMat); ?

Sure. Even if you can do many things, I think you cant do that. And a library that can read / write metadata IPTC/EXIF from a buffer will be the best.

2013-09-24 06:36:35 -0600 commented question Exif with Highgui.imwrite(filename, myMat); ?

I use Java because I use it an android platform development. libexif exist for java as library. I can use Highguy.imencode to have a Buffer, but how i can handle it with libexif ?

2013-09-24 04:07:01 -0600 commented question Exif with Highgui.imwrite(filename, myMat); ?

I already tried libexif before, but that need to much step :

1) opencv write the mat to jpeg 2) java read this new jpeg 3) libexif apply exif 4) finally write a second time the jpeg.

Source code is native and cant modifiy it for #java#opencv

2013-09-23 09:40:47 -0600 asked a question Exif with Highgui.imwrite(filename, myMat); ?

In need to insert some exif tag in a jpg image.

I can't find an easy way to do that.

2013-09-23 06:28:49 -0600 answered a question Get the median, added to mean and std value

I found a simple way to answer :

double getMedian(Mat hist) {
    // binapprox algorithm

    long n = hist.total();
    int[] histBuff = new int[(int) n];
    hist.get(0, 0, histBuff);
    // Compute the mean and standard deviation
    // int n = x.length;
    double sum = 0;
    // int i;
    for (int i = 0; i < n; i++) {
        sum += histBuff[i];
    }
    double mu = sum / n;

    sum = 0;
    for (int i = 0; i < n; i++) {
        sum += (histBuff[i] - mu) * (histBuff[i] - mu);
    }
    double sigma = Math.sqrt(sum / n);

    // Bin x across the interval [mu-sigma, mu+sigma]
    int bottomcount = 0;
    int[] bincounts = new int[1001];
    for (int i = 0; i < 1001; i++) {
        bincounts[i] = 0;
    }
    double scalefactor = 1000 / (2 * sigma);
    double leftend = mu - sigma;
    double rightend = mu + sigma;
    int bin;

    for (int i = 0; i < n; i++) {
        if (histBuff[i] < leftend) {
        bottomcount++;
        } else if (histBuff[i] < rightend) {
        bin = (int) ((histBuff[i] - leftend) * scalefactor);
        bincounts[bin]++;
        }
    }

    double median = 0;
    // If n is odd
    if ((n % 2) != 0) {
        // Find the bin that contains the median
        int k = (int) ((n + 1) / 2);
        int count = bottomcount;

        for (int i = 0; i < 1001; i++) {
        count += bincounts[i];

        if (count >= k) {
            median = (i + 0.5) / scalefactor + leftend;
        }
        }
    }

    // If n is even
    else {
        // Find the bins that contains the medians
        int k = (int) (n / 2);
        int count = bottomcount;

        for (int i = 0; i < 1001; i++) {
        count += bincounts[i];

        if (count >= k) {
            int j = i;
            while (count == k) {
            j++;
            count += bincounts[j];
            }
            median = (i + j + 1) / (2 * scalefactor) + leftend;
        }
        }
    }
    return median;
    }
2013-09-21 20:42:02 -0600 received badge  Organizer (source)
2013-09-21 20:31:04 -0600 asked a question Color Probability of water

We have two masks : One for the hull corresponding to a contour of hsv & rgb mask And one for the bounding rectangle of hull

If we make a division of the two histogram( hull and bouding box ), we ve a probability to have a roi with better accuracy of the good color.

Forgot the two shadows ( natural and reflexion ), is there a better way than Morphology/close to avoid reflexion of sun and waves ?

Forgot the shadows, how the best way to have two blobs, one for shadow and one for surface color ? Camshift, meanshift backprojection avoided (One shot only)

2013-09-21 19:53:02 -0600 asked a question A better way to access channel directly ?
Instead of using Core.extractChannel(img_roi, Channel_I_Want , 0);
Each time i need a channel to work on it,
Can it be better to do Channel_I_Want = Roi.getChannel(0); // ?
2013-09-21 18:37:30 -0600 commented answer OpenCV app doesnt work since Manager Update

Worked again with new install of eclipse, new install of 2.4.6r2 sdk and a manual install of manager 2.9 I'm stupid to havent used r2. I'ts really fast.

2013-09-21 02:11:59 -0600 commented answer OpenCV app doesnt work since Manager Update

I can't start OpenCV Manager (2.11) Sony Xperia with Android 4.0.4. Desinstalled and reinstalled. still freeze with just the title. When i lauchn an app, eclipse say : OpenCV Library - 2.4.6] Could not find OpenCV Library - 2.4.6.apk!