Ask Your Question

yassine's profile - activity

2014-08-23 05:02:48 -0600 received badge  Student (source)
2014-08-23 04:47:55 -0600 asked a question are there any java samples

Hello

Im new to to OpenCV and i was hoping to find some good java samples, like these ones for Delphi: https://github.com/Laex/Delphi-OpenCV/tree/master/samples

but i didnt find any. Where can i find samples like those?

Thanks.

2013-09-11 16:13:49 -0600 commented answer Get the color percentage

here is what i ve done: in core_c function cvSum(arr: pIplImage): TCvScalar; external 'opencv_core246.dll'; and when i use it i get : OpenCv Error: Bad argument <Unknown array type>

is there any other way to calculate the sum without using the CvSum

2013-09-11 06:38:39 -0600 commented answer Get the color percentage

i tried to add function cvSum(arr: pIplImage): TCvScalar; cdecl;but i get : Unsatisfied forward or external declaration: 'cvSum'

2013-09-11 05:48:43 -0600 received badge  Supporter (source)
2013-09-11 05:33:38 -0600 commented question Get the color percentage

yep, writeln(image.nChannels); gives me 3

2013-09-11 05:27:12 -0600 commented answer Get the color percentage

i dont have cvGetImageSize(i used cvGetSize intsead) nor cvSum, and im uing this https://github.com/Laex/Delphi-OpenCV

2013-09-10 19:14:49 -0600 asked a question Get the color percentage

Hello,

I'm using Delphi XE4 with openCV. I tried to get the color percentage of RGB(ex red 50%, green 25% and blue %25) in an image, so i tried with this:

var
    mat : TCvMat;
    res : TCvScalar;
begin
    object_filename := 'd:\1.bmp';
    image := cvLoadImage(pcvchar(@object_filename[1]), CV_LOAD_IMAGE_UNCHANGED);

    mat := cvMat(image.width, image.height, 0, image);
   for i := 0 to mat.rows - 1 do
     for j := 0 to mat.cols - 1 do
     begin
         res := cvGet2D(@mat, i, j);
         writeln('red: ', res.val[0]:2:2);
         writeln('green: ', res.val[1]:2:2);
         writeln('Blue: ', res.val[2]:2:2);
         writeln('Gray: ', res.val[3]:2:2);
         writeln;
    end;

    readln;
 end.

the problem is that only "red.val[0]" got a real value, the rest of the array is 0.

what am i doing wrong here.

Thank you.