Computer vision paint using color tracking

This is an assignment of my multimedia course. I tried to code a small application that allows people to draw on computer by moving 2 pieces of color paper. This application is based on the idea of color tracking.

Continue reading

Advertisements

CS422 project

It’s a project for Software analyst and design, but we were too lazy to do it as the summer vacation has already begun when the project was announced.

So 3 days working including more than 2 days for documentation and 3 or 4 hours of coding and we have this application.
It’s can resize/rotate/gray-scale multi-image.

It’s really a shame but I want to post it here anyway.
I was responsible for Designing the solution and coding (which take about 5 or 6 hours in total!), Quoc did the GUI and Nam did the document based on my design.


Download

Car retail website project

It’s been a long time since I last updated this blog.

This is my new project for course cs424 about developing web applications. We were asked to develop a website to sell cars, also allowing user to customize a car using ASP.NET.

I’ve developed a few website using PHP but this is only the 2nd time I am asked to use ASP.NET

Our group has 6 members but 1 of them doesn’t seem to be cooperating at all. He hasn’t replied any of my emails since the beginning of the project. Kien is a busy man too, but he shows his respect to other members of the group. At least Kien replied my email and did his job. Quoc is abroad as the represent of Vietnam for the Tiger Preserve meeting at Russia, that makes us having only 3 people who would be able of work at 100%.
Anyway, it’s the risk of the project that we have to handle.

Back to the project, we have just finished the very basic of requirement phase, creating the specification of the requirement after meeting with the TA, who is also the customer.
We also learned a little bit more technical things such as Paypal sandbox, Localization in ASP.NET,… which will be applied to this project. And we are going to apply MVC model of ASP.NET to this project too.

Thao has made a little modification to a free template that she found on http://www.freecsstemplates.org based on the layout given by MyHieu, and we decided to use it as the GUI for the website.

Template for the website

More to be updated later!

SDL first step

Our team for CS422 has decided to develop a small game for the final project, so I asked my cousin who has already developed a similar one in the past. He told me to try SDL, so I spent few hours with it.
Now I can load images, set transparent, load text with external font, detect event, and few small things. There’re still a lot ahead :-<
SDL library first demo

Back to the Winform things

An assignment from cs422, I have to create a simple form to view/insert/edit/delete some information of few students. It’s quite boring, but it’s an assignment :-<
It took me about 2 hours to code, but the I had to spend the same amount of time to install SQL Server, and solve the problems relating to M$'s stuff ๐Ÿ˜ฆ
The only thing to worry is, if the TAs be able to run the program correctly with the database connection as it is different on each computer. I put the connection string into a text file, and created a "user guide" telling him that he has to edit the file with his connection string, but not sure if it would work ๐Ÿ˜ฆ
Here it is if you're interested (but I'm quite sure you don't). I used VS2010 and SQL Server 2005. (I hope no one will steal my code again like in cs162!)
My program

http://www.mediafire.com/?ygwjfyzakij

MCI?

After doing some searching with Google about the method to play an audio file on Windows, most of the returned result are about the Microsoft’s Multimedia Control Interface, calling the function PlaySound() of that library.
But it’s just playing, and there are still a lot to handle, including volume control, fast forward, fast backward, … So I look a closer look to the MCI and found something interesting about reading a wav file in it. So I’ll try to do something with it, like reverse the file, fasten it,… to get acquainted with the library. The PlaySound() is for later, hehe
A lot of troubles happen when start working with the Visual Studio. Its linker is kind of a mess ๐Ÿ˜ฆ Lot of configurations to make it work with the library ๐Ÿ˜ฆ

Update:
I’ve just written few lines of code, well, it can run but there’s still one thing I still cannot get:

UCHAR * buffer = new UCHAR[child.cksize];
unsigned long n = sizeof(buffer);
mmioRead(handle, (char*)buffer, child.cksize);
n = sizeof(buffer);

The value of child.cksize is really big, greater than 20k, but when I allocate the buffer and check for the value of n, before and after the mmioRead funtion call, it is always 4 ๐Ÿ˜ฆ
The things I get confuse is that, after those code, I call a function to write down the buffer to another file, it works perfectly with the buffer I pass on ๐Ÿ˜ฆ The write function:

bool song::write(unsigned long size, UCHAR* buffer) {
// Get a new file name
char outwav[MAX_PATH];
ZeroMemory(&outwav[0],sizeof(outwav));
strcpy(&outwav[0],”hieu.wav”);
outwav[strlen(&outwav[0])-3] = ‘p’;
outwav[strlen(&outwav[0])-2] = ‘c’;
outwav[strlen(&outwav[0])-1] = ‘m’;
// Write the data
LPWSTR temp = strToLPWSTR(&outwav[0]);
HANDLE hpcm = CreateFile((LPCWSTR)temp,GENERIC_WRITE,NULL,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL);
DWORD written;
WriteFile(hpcm,&buffer[0],size,&written,NULL);
CloseHandle(hpcm);

return true;
}

Gotta figure out what the heck is this soon ๐Ÿ˜ฆ