Dec 05 2009

Edge orientation

Category: OpenCVKristou Mehrez @ 7:31 pm

This is a sample code for getting the edges orientation in an image.

CvMat *filter_x=cvCreateMat(1,3,CV_32FC1); filter_x->data.fl[0]=-1;
filter_x->data.fl[1]=0; filter_x->data.fl[2]=1;
CvMat *filter_y=cvCreateMat(3,1,CV_32FC1); filter_y->data.fl[0]=-1;
filter_y->data.fl[1]=0; filter_y->data.fl[2]=1;

IplImage *img_src=cvLoadImage("name",0);

IplImage *img_diff_x=cvCreateImage(cvGetSize(img_src),IPL_DEPTH_32F,1);
IplImage *img_diff_y=cvCreateImage(cvGetSize(img_src),IPL_DEPTH_32F,1);

IplImage *img_32f=cvCreateImage(cvGetSize(img_src),IPL_DEPTH_32F,1);

cvConvert(img_src,img_32f);

cvFilter2D(img_32f,filter_x,img_diff_x);
cvFilter2D(img_32f,filter_y,img_diff_y);

IplImage *magnitude=cvCreateImage(cvGetSize(img_src),IPL_DEPTH_32F,1);
IplImage *orientation=cvCreateImage(cvGetSize(img_src),IPL_DEPTH_32F,1);

cvCartToPolar(img_diff_x, img_diff_y, magnitude, orientation, 1);


Dec 05 2009

Online service to convert files type

Category: Online serviceKristou Mehrez @ 5:57 pm

youconvertit

Convert any media file format (Documents, Images, Audio, Video & Archives) without buying or installing anything on your PC


Nov 29 2009

Hirai Ken, Pop star

Category: JapanKristou Mehrez @ 2:17 pm

I like this song because of many reasons. First it is easy to understand. Also it is very moving. I leave the appreciation for you to judge about it. Please share with me your comments.

Continue reading “Hirai Ken, Pop star”


Nov 28 2009

Tsukuba Mountain Hike

Category: JapanKristou Mehrez @ 5:47 pm

Today I had a trip to Mountain Tsukuba with TWMC Club.
I did not catch them in the beginning. I reached つつじヶ丘(Tsutsujigaoka) station. I got the rope way. It is really scaring view.

As you may know, Tsukuba mountain has two picks: One pick is associated with a girl. The second is associated with boy. There is a myth that this mountain bring love and bring couple together.

May be it is true. I met my wife there and I am living a romantic love story.

Here are some of my pictures I took there.


Nov 28 2009

Remove items from deque, list or vector in a loop

Category: C++Kristou Mehrez @ 12:42 am

Recently I needed to delete items from a sequence like a deque , list or vector from a for loop, I figured out that I have to do something like this:

for(iter = list.begin(); iter != list.end(); ++iter)
{
// your code
iter = list.erase(iter);
--iter;
// your code
}

It looks basic but it took me a while to figure it out so I wanted to share in case somebody need it.

Tags: , , , , , ,


Next Page »