Skip to main content

Posts

Cross-compiling windows applications under linux with wine and DevC++

This post has the same title as this , from Violin Iliev because it is almost a "repost". I had an old post on compiling win32 binaries on linux , but the technique I had shown lack the windows resource file compiling. Violin had written his wrapper to the windres resource compiler, but one good "emergency option" if one couldn't, or don't want, or hasn't time to, write a wrapper or compile Violin'd wrapper, is to follow what was commented on Violin's blog by someone who signed as Andy. Andy said: "I had the same problems with windres and mingw32-make under wine 1.0.1 I solved the problems by putting an original copy of msvcrt.dll in the bin subfolder of mingw32 and telling wine to load it first instead of its own msvcrt emulation. hope it can be useful Andy"

All my avatars until now

These are the avatars I use for instant messaging. They were all made with inkscape

Quadrilateral Centroid Algorithm

Oh men... This time google wasn't helping much... I was looking for an algorithm to find the centroid from a quadrilateral polygon. It wasn't necessary to be a general, any polygon, centroid algorithm... just one which give me the centroid of a regular convex quadrilateral. It was hard to find something that simple. But finally, here is. The following code is a C example on how to compute the area and the centroid from a regular convex quadrilateral polygon: #include<stdio.h> int main(void){ float verticesX[5]; float verticesY[5]; float centroidX = 0; float centroidY = 0; verticesX[0] = 3.58; verticesY[0] = 1.90; verticesX[1] = 4.48; verticesY[1] = 1.88; verticesX[2] = 4.56; verticesY[2] = 2.71; verticesX[3] = 3.64; verticesY[3] = 2.74; verticesX[4] = 3.58; verticesY[4] = 1.90; // Repeat the first vertex int i, k; float area = 0.0f; float tmp = 0.0f; for (i = 0; i k = (i + 1) % (4 + 1); tmp = verticesX[i] * verticesY[k] - vert...

Experiences with OpenCV

OpenCV has really lots of useful classes and features. The square detection for my virtual reality class work is being made with it. Unfortunately, on my tests, I was detecting squares which I didn't want the software to detect. Like on the image below: It would be much better if I could do the image analysis only inside the laptop screen. "Googling" on "OpenCV image crop" I had reached the nashruddin.com ( OpenCV Region of Interest - ROI ). This blog has a good explanation on how to crop (extract the region of interest) from a image. With those informations I got the following result for the same frame: Now I have to check the area of the detected squares. At the web archives of the c omputer geometry class mailing list , from the Illinois University, google had shown me one algorithm to calculate the area of a closed polygon, as follows: Let 'vertices' be an array of N pairs (x,y), indexed from 0 Let 'area' = 0.0 for i = 0 to N-1, do Let j = (...

Becoming father...

After 4 years of marriage we will finally have our first kid. My wife is writing a blog with more details (in Portuguese). But which is letting me more exited about this near future is the new excuse to buy toys. The chart below from graphjam illustrates well: see more Funny Graphs And here is one echo scan image made when we were with 12 weeks of pregnancy: