Click here to Skip to main content
14,932,407 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
QuestionStrong vs static typing Pin
elelont25-Jun-12 9:37
Memberelelont25-Jun-12 9:37 
AnswerRe: Strong vs static typing Pin
Paul Conrad5-Jun-12 10:37
professionalPaul Conrad5-Jun-12 10:37 
GeneralRe: Strong vs static typing Pin
Luc Pattyn5-Jun-12 11:13
sitebuilderLuc Pattyn5-Jun-12 11:13 
GeneralRe: Strong vs static typing Pin
Paul Conrad5-Jun-12 12:10
professionalPaul Conrad5-Jun-12 12:10 
AnswerRe: Strong vs static typing Pin
Richard MacCutchan5-Jun-12 21:08
mveRichard MacCutchan5-Jun-12 21:08 
GeneralRe: Strong vs static typing Pin
elelont26-Jun-12 5:09
Memberelelont26-Jun-12 5:09 
GeneralRe: Strong vs static typing Pin
Richard MacCutchan6-Jun-12 5:21
mveRichard MacCutchan6-Jun-12 5:21 
QuestionImage Integral Pin
MUJIS29-May-12 4:40
MemberMUJIS29-May-12 4:40 
Hello All
I am using this code to calculate Image Integral
This code is working properly.
(I am working under Ubuntu with code::block)

but I want to change this, for calculate Image integral in parallel.
can you help me ?




///////////////////////////////////////////
// name : IntegralImage.c
// programme squentiel
// for display with opencv
///////////////////////////////////////////

#include <stdlib.h>
#include <stdio.h>

#include "opencv/highgui.h"


#define IMAGE_WIDTH 384
#define IMAGE_HEIGHT 286
#define S (IMAGE_WIDTH/8)
#define T (0.15f)

void adaptiveThreshold(unsigned char* input, unsigned char* bin)
{
unsigned long* integralImg = 0;
int i, j;
long sum=0;
int count=0;
int index;
int x1, y1, x2, y2;
int s2 = S/2;

// ============ integral image ================
integralImg = (unsigned long*)malloc(IMAGE_WIDTH*IMAGE_HEIGHT*sizeof(unsigned long*));

for (i=0; i<image_width; i++)
="" {
="" =="====reset" this="" column="" sum="====
" for="" (j="0;" j<image_height;="" j++)
="" index="j*IMAGE_WIDTH+i;

" +="input[index];
" if="" (i="=0)
" integralimg[index]="sum;
" else
="" sum;
="" }
="" }

="" thresholding="===============
" i<image_width;="" seting="" region="" sxs="==========
" x1="i-s2;" x2="i+s2;
" y1="j-s2;" y2="j+s2;

" ckeck="" border="=========
" (x1="" <="" 0)="" (x2="">= IMAGE_WIDTH) x2 = IMAGE_WIDTH-1;
if (y1 < 0) y1 = 0;
if (y2 >= IMAGE_HEIGHT) y2 = IMAGE_HEIGHT-1;

count = (x2-x1)*(y2-y1);

// ===== I(x,y)=s(x2,y2)-s(x1,y2)-s(x2,y1)+s(x1,x1) ===

sum = integralImg[y2*IMAGE_WIDTH+x2] -
integralImg[y1*IMAGE_WIDTH+x2] -
integralImg[y2*IMAGE_WIDTH+x1] +
integralImg[y1*IMAGE_WIDTH+x1];

if ((long)(input[index]*count) < (long)(sum*(1.0-T)))
bin[index] = 0;
else
bin[index] = 255;
}
}

free (integralImg);
}


//////...test avec opencv...

int main (int argc, char** argv)
{
IplImage* cvFrame;
IplImage* binImg;
int key;

cvFrame = cvLoadImage("b.bmp", -1);
binImg = cvCreateImage(cvSize(IMAGE_WIDTH, IMAGE_HEIGHT), 8, 1);

cvNamedWindow("Input", 1);
cvNamedWindow("Output", 1);

adaptiveThreshold((unsigned char*)cvFrame->imageData, (unsigned char*)binImg->imageData);

cvShowImage("Input", cvFrame);
cvShowImage("Output", binImg);

key = cvWaitKey(0);

return 0;
}
QuestionHow to get the total length of elements in ##__VA_ARGS__ Pin
elelont222-May-12 3:10
Memberelelont222-May-12 3:10 
AnswerRe: How to get the total length of elements in ##__VA_ARGS__ Pin
jschell28-May-12 7:57
Memberjschell28-May-12 7:57 
QuestionA calendar look like iCal of MacOsX Pin
XRay221-May-12 4:30
MemberXRay221-May-12 4:30 
Questionc++ A Cessna Skyhawk Skeleton for Further Development in OpenGL (GLUT) Pin
ody kurniawan18-May-12 11:55
Memberody kurniawan18-May-12 11:55 
QuestionType casting Pin
givinisha17-May-12 6:50
Membergivinisha17-May-12 6:50 
AnswerRe: Type casting Pin
John Schroedl17-May-12 8:01
professionalJohn Schroedl17-May-12 8:01 
QuestionVideo Display hangs in Windows after unlocking Pin
Faez Shingeri16-May-12 21:37
MemberFaez Shingeri16-May-12 21:37 
AnswerRe: Video Display hangs in Windows after unlocking - Repost ... Pin
Richard MacCutchan16-May-12 23:12
mveRichard MacCutchan16-May-12 23:12 
GeneralRe: Video Display hangs in Windows after unlocking - Repost ... Pin
Faez Shingeri16-May-12 23:16
MemberFaez Shingeri16-May-12 23:16 
GeneralRe: Video Display hangs in Windows after unlocking - Repost ... Pin
John Schroedl17-May-12 3:28
professionalJohn Schroedl17-May-12 3:28 
AnswerRe: Video Display hangs in Windows after unlocking Pin
jschell17-May-12 11:26
Memberjschell17-May-12 11:26 
QuestionFinding a pointer from a list of pointers Pin
elelont226-Apr-12 20:21
Memberelelont226-Apr-12 20:21 
AnswerRe: Finding a pointer from a list of pointers Pin
Richard MacCutchan26-Apr-12 22:28
mveRichard MacCutchan26-Apr-12 22:28 
AnswerRe: Finding a pointer from a list of pointers Pin
linhlevan3-May-12 5:35
Memberlinhlevan3-May-12 5:35 
QuestionDll Dependency issue Pin
givinisha23-Apr-12 4:42
Membergivinisha23-Apr-12 4:42 
AnswerRe: Dll Dependency issue Pin
Pete O'Hanlon23-Apr-12 4:57
mvePete O'Hanlon23-Apr-12 4:57 
AnswerRe: Dll Dependency issue Pin
Albert Holguin23-Apr-12 11:53
professionalAlbert Holguin23-Apr-12 11:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.