4/07/2012

Projected Glaxy

I found this beautiful picture. It is the panorama of the Milky Way.

Credit: ESO/S. Brunier

Yes, it is very beautiful. In addition, I found its projection is equirectangular or plate carree. So I can change this image into equidistant projection using my application!


I felt as if I were in space!

Demo of Azimuthal Projection using Javascript

I said I made the program of azimuthal projection working on the computer several months.
I also made javascript version. Actually, this kind of programming language was new to me. Although I have been using C/C++ which needs compiling, I have never touched any script language.

There were some points I was surprised at. I thought javascript was written in Java, but it is like C language. It also looks like VB because it supports variant type. However, these were not significant for me. The biggest problem was Same Origin Policy or SOP. This policy is for a browser to restrict the work of javascript. If a script is stored at the specific domain, it cannot load any image or files stored at the different domain. Your browser would provide error code like 'Security error" code: "1000'. Finally, I directly wrote the image data in the script. The web service to change image into script was very useful.

Now, here is the script I wrote.
Here is the demo.
http://sites.google.com/site/somedayuniverse/contents/azimap_js

There might be a problem for IE because it does not support canvas. If you get the trouble, you can try a program running on your PC.
http://sites.google.com/site/somedayuniverse/contents/azimuthal-projection

3/10/2012

Azimuthal Equidistant Projection and Program

I finally finished writing. I updated the page related to azimuthal equidistant projection and uploaded the program I made.


Here is the page on my website.
http://sites.google.com/site/somedayuniverse/contents/azimuthal-projection

3/01/2012

Network Programming with .Net

I tried to write a code working in the network. Windows API is necessary to build a system related to the network. But I did not want to use APIs. There was no practical reason. I just wanted not to be confused with them, and wanted to use mainly C++/CLI, which I was familiar with.

I found an interesting page related to this problem. (although it is mentioning C#.)

So what I had to do was to write my own code in C++/CLI. It was just to put proper notations. But I found this page was a kind of old documents because some functions were obsolete.

At last, I wrote a new C++/CLI version after reading the page.

===============================================
#include "stdafx.h"

using namespace System;
using namespace System::Net;

int main(array ^args)
{
String^ name = (args->Length < 1) ? Dns::GetHostName() : args[0];
try{
array^ addrs = Dns::GetHostEntry(name)->AddressList;
int i = 0;
while(i < addrs->Length){
Console::WriteLine("{0}/{1}",name,addrs[i]);
i++;
}
}catch(Exception^ e){
Console::WriteLine(e->Message);
}

Console::ReadLine(); //waiting for pushing Enter
return 0;
}
===============================================

It is just the beginning. I will start for higher levels.

2/23/2012

OpenCV...

When I was an undergraduate student, I tried to use OpenCV for some purposes. But I gave up because it required a high level of programming skills in order to understand how the library works. Especially Visual C++ needs specific settings, such as /clr:pure to /clr in the option of common language runtime. OpenCV is written in C++. On the other hand, the default settings of Visual C++ accepts only C++/CLI, which is a kind of managed language looking like C++.

In addition to my poor skills, some functions has been apparently replaced with new ones when its version was changed to 2.x. For example, "imread" is used to load an image file while "cvLoadImage" has been used previously. I am afraid that it may be easy for other people to understand and use it, but I was actually confused.

However, I recently started to read the tutorial for ver 2.3. I feel that I will be finally able to understand its structure.
http://opencv.itseez.com/

One of the points I was surprised is that "IplImage" structure is no longer needed in the new version because "Mat" structure treats both images and matrices. I think Mat makes it easy to treat images. Actually, I can use openCV on Visual C++ now although I had many troubles with the old structures before using the new features.

2/07/2012

New program making azimuthal maps

I have been in work for applications to graduate schools. So I am considerably nervous!
While I was busy, I was also making a program projecting azimuthal maps.
I made a previous version a few years ago, but it was not good because it took SEVERAL MINUTES to project a map.

In the last month, I hit upon a good idea to make it fast and gathered related necessary techniques.
The new program takes only 100 milliseconds! (but I think that this implementation actually owes to Marshal class of .Net rather than my idea...)
I will upload my program and explain the calculation in my web site.


The world (azimuthal equidistant projection)

Around Japan (azimuthal equidistant projection)

The pacific ocean (azimuthal equidistant projection)

The world (azimuthal equal-area projection)

5/29/2011

GRE words

I am now trying to memorize GRE words.
There are thousands of words including long difficult and complex words such as hyperventilation. It is hard for a non-native speaker to master them.
I might have already forgot many words I tried to memorize although I finished more than 90 % of the word list.

I have to retry it...