September 2010
M T W T F S S
« Aug    
 12345
6789101112
13141516171819
20212223242526
27282930  

Statistik Pengguna

joomla counter
Sejak Januari 2010

3D matrik on Delphi

unit WinForm;

interface

uses
System.Drawing, System.Collections, System.ComponentModel,
System.Windows.Forms, System.Data, Borland.Vcl.SysUtils;

type
TWinForm = class(System.Windows.Forms.Form)
{$REGION ‘Designer Managed Code’}
strict private
///
/// Required designer variable.
///
Components: System.ComponentModel.Container;
Button1: System.Windows.Forms.Button;
Button2: System.Windows.Forms.Button;
[...]

Code Tesis v 23 Feb 2009

setelah penat memikirkan tesis, akhirnya ganti arah. berikut kira2 psudocode untuk tesis kali ini : note belum di periksa apakah berjalan dengan benar atau tidak.
convert image to grayscale
/* load image */
IplImage *src = cvLoadImage( argv[1], CV_LOAD_IMAGE_COLOR );
/* get image properties */
width = src->width;
height = src->height;
/* create new image for the grayscale version */
IplImage [...]

C++ fprintf & fscanf to read and write from/to csv file

this is an example to read or write file to/from csv file from/into a memory
#include “stdafx.h”
#include <stdio.h>
int main(void)
{
//Create a file to write to
FILE *OutFile = fopen(“test.txt”,”w”);
//Send data to file
float arr[10];
for(int i=0; i<10; i++)
{
arr[i] = i * 0.7523234234;
}
for(int i=0; i<9; i++)
{
fprintf(OutFile,”%f,%f\n”,arr[i],arr[i+1]);
i++;
}
//Close the file
fclose(OutFile);
// open file for read
FILE *readFile = fopen(“test.txt”,”r”);
// set to zero, the array data [...]

Thinning using OpenCV

1 week I’m looking for thinning algorithm using OpenCV, and found one implementation that have good result.
you can find the algorithm in this link http://www.eml.ele.cst.nihon-u.ac.jp/~momma/wiki/wiki.cgi?edit=OpenCV%2F%E7%B4%B0%E7%B7%9A%E5%8C%96&section=7
one weekness from the algorithm is time complexity. i modified the code with some rule, and some weekness. the modification can be seen as below.
#include “stdafx.h”
#include <cv.h>
#include <highgui.h>
#include <stdio.h>
// taken from [...]

fungsi derective #define pada c++

selang mengerjakan tesis dengan c++, banyak sekali kesulitan yang dihadapi. maklum dari awal tidak ada yang mengjarkan bahasa ini dengan baik. berkali2 mengcompile, dan error dengan error redeclaration. T-T.
setelah merenung-renung, melihat code orang lain, kini baru sadar bahwa directive #define sangat berguna. berikut contoh penggunaannya :
pada file 1 kita save dengan cPointCloud.h
kita tambahkan directive
#define CPOINTCLOUD
hal [...]

OpenCV ImageData

////////////////////////////////////////////////////////////////////////
//
// hello-world.cpp
//
// This is a simple, introductory OpenCV program. The program reads an
// image from a file, inverts it, and displays the result.
//
////////////////////////////////////////////////////////////////////////
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <cv.h>
#include <highgui.h>

int main(int argc, char *argv[])
{
IplImage* img = 0;
int height,width,step,channels;
uchar *data;
int i,j,k;

if(argc<2){
printf(“Usage: main <image-file-name>\n\7″);
[...]