Pages

Wednesday, 9 March 2011

GUI for Linking figures in MATLAB

It's been a while that I haven't written anything for my blog. Here I come, with a new post. This post is related to linking figure in MATLAB. I worked with MATLAB with mainly for image processing and often, I was annoyed with MATLAB that it does not have function to link figures which would facilitate the comparison between two figures. In ENVI, there a way to link open figures with help of coordinate information based georeferencing. But in MATLAB, all we have is rows and columns information. So the problem was, when I want to compare Lidar First Pulse data with Lidar Second Pulse data there is no way to link those two figures which have same number of rows and same number of columns.

Therefore, I have decided to build a GUI which would allow me to open linked figures, if they have same numbers of rows and columns. The main functionality, I wanted to have is that if I zoom into a certain area in Figure 1, the same is area is also zoomed into the Figure 2. Same applies when I am panning in either of the figures. If I pan in Figure 2, the Figure 1 also should be panned automatically displaying exact spatial extent as being displayed in Figure 2.

So, here is the GUI that I have come up with. The GUI has a button which can be useful to update list in the GUI with variables that are in the base workspace. This is handy in the situation for example, I opened the GUI and perform some operation in the command window and now I want to update my variable list in GUI and populate it with variables that are in the base workspace. Once the variables are there, just click one of the variables and click Plot first figure. Afterwards click other variable which is of same size with variable first selected, and click Plot second figure. Now the figures are linked with each other. You can zoom around and pan around in one figure and instantly other figure will be updated to match the new extent.

[youtube http://www.youtube.com/watch?v=Ce8C17dx2iY&w=640&h=390]

GUI for Linking figures in MATLAB

It's been a while that I haven't written anything for my blog. Here I come, with a new post. This post is related to linking figure in MATLAB. I worked with MATLAB with mainly for image processing and often, I was annoyed with MATLAB that it does not have function to link figures which would facilitate the comparison between two figures. In ENVI, there a way to link open figures with help of coordinate information based georeferencing. But in MATLAB, all we have is rows and columns information. So the problem was, when I want to compare Lidar First Pulse data with Lidar Second Pulse data there is no way to link those two figures which have same number of rows and same number of columns.

Therefore, I have decided to build a GUI which would allow me to open linked figures, if they have same numbers of rows and columns. The main functionality, I wanted to have is that if I zoom into a certain area in Figure 1, the same is area is also zoomed into the Figure 2. Same applies when I am panning in either of the figures. If I pan in Figure 2, the Figure 1 also should be panned automatically displaying exact spatial extent as being displayed in Figure 2.

So, here is the GUI that I have come up with. The GUI has a button which can be useful to update list in the GUI with variables that are in the base workspace. This is handy in the situation for example, I opened the GUI and perform some operation in the command window and now I want to update my variable list in GUI and populate it with variables that are in the base workspace. Once the variables are there, just click one of the variables and click Plot first figure. Afterwards click other variable which is of same size with variable first selected, and click Plot second figure. Now the figures are linked with each other. You can zoom around and pan around in one figure and instantly other figure will be updated to match the new extent.

Wednesday, 23 February 2011

MATLAB GUI for 3D point generation from SR 4000 images

Nowadays visualizations with a three dimensional impression are getting more and more interesting. This work of mine that I have carried out during my study concentrates on the construction of a 3D model of point clouds, by distance measurement with a time-of-flight (TOF) range camera, called SR 4000 which operates based on measurement of time of flight of Near infrared (NIR) beam. The task is to develop a tool for the collection of 3D point clouds achieving by this camera. The tool uses the collected 3D point coordinates from different scanning locations. This local coordinates from different camera positions according to the object should be transformed into a common coordinate system.

With the camera SR 4000 it is possible to capture point clouds with a maximum distance of 5 meters. Typical measuring accuracy is ± 1.5 m away from the structure. Pictures from different position around an object were taken in a day light sun. For resulting image coordinates, corrections have been applied for distortions such as radial distortions (symmetric distortion attributable to variation in refraction at each individual components lens) and tangential or decentring distortion (asymmetric distortion attributable to decentring and misalignment of individual lens elements within the objective).

Additionally a Matlab based GUI is implemented which processes and visualizes the MATLAB code of the tool on a graphical user interface. Graphical user interface was created such that it would guide any end user to go through all those process mentioned above without actually having deal with text based command interface. Also they don’t have to care about what input parameters has to supply for any functions. Users are guided through all the process with the help of graphical buttons and visual container and are aided with the help tip tools and message box.

[youtube http://www.youtube.com/watch?v=bipueUV01X8&w=700&h=400]

MATLAB GUI for 3D point generation from SR 4000 images

Nowadays visualizations with a three dimensional impression are getting more and more interesting. This work of mine that I have carried out during my study concentrates on the construction of a 3D model of point clouds, by distance measurement with a time-of-flight (TOF) range camera, called SR 4000 which operates based on measurement of time of flight of Near infrared (NIR) beam. The task is to develop a tool for the collection of 3D point clouds achieving by this camera. The tool uses the collected 3D point coordinates from different scanning locations. This local coordinates from different camera positions according to the object should be transformed into a common coordinate system.

With the camera SR 4000 it is possible to capture point clouds with a maximum distance of 5 meters. Typical measuring accuracy is ± 1.5 m away from the structure. Pictures from different position around an object were taken in a day light sun. For resulting image coordinates, corrections have been applied for distortions such as radial distortions (symmetric distortion attributable to variation in refraction at each individual components lens) and tangential or decentring distortion (asymmetric distortion attributable to decentring and misalignment of individual lens elements within the objective).

Additionally a Matlab based GUI is implemented which processes and visualizes the MATLAB code of the tool on a graphical user interface. Graphical user interface was created such that it would guide any end user to go through all those process mentioned above without actually having deal with text based command interface. Also they don’t have to care about what input parameters has to supply for any functions. Users are guided through all the process with the help of graphical buttons and visual container and are aided with the help tip tools and message box.

Thursday, 3 February 2011

Real time satellite position around the Earth

Back in 2006 when i was studying about Keplers law which governs the orbital postion of satellite, i wondered how many satellite are orbiting around the Earth  and is there any way we could visualize those satellites. I surfed the internet yesterday with a hope that i find something which shows positions of different satellites. Luckily, i found  a kml file which is quite compelling ! The  file was developed by  a  guy named Matt who is associated with a company called Analytic Graphics Inc. It shows the real- time position of 13,0000 satellites around the Earth ! The position of the satellites are updated in every 30 seconds.

On clicking on a satellite, one can get the various information about the satellite. In addtion, if you are interested how that particular satellite revolves around the earth you can see the trajectory of that satellite by clicking the satellite and clicking on Display Trajectory in Fixed Term.

I am quite suprised to see how crowded our space is. If you think your job is tough, just imagine how satellite engineers manage to put new satellite on orbit and decide its orbital path so that there is no collisions of satellite. I am glad, I am just an engineer but not an satellite engineer. Phew !!

Real time satellite position around the Earth

Back in 2006 when i was studying about Keplers law which governs the orbital postion of satellite, i wondered how many satellite are orbiting around the Earth  and is there any way we could visualize those satellites. I surfed the internet yesterday with a hope that i find something which shows positions of different satellites. Luckily, i found  a kml file which is quite compelling ! The  file was developed by  a  guy named Matt who is associated with a company called Analytic Graphics Inc. It shows the real- time position of 13,0000 satellites around the Earth ! The position of the satellites are updated in every 30 seconds.

On clicking on a satellite, one can get the various information about the satellite. In addtion, if you are interested how that particular satellite revolves around the earth you can see the trajectory of that satellite by clicking the satellite and clicking on Display Trajectory in Fixed Term.

I am quite suprised to see how crowded our space is. If you think your job is tough, just imagine how satellite engineers manage to put new satellite on orbit and decide its orbital path so that there is no collisions of satellite. I am glad, I am just an engineer but not an satellite engineer. Phew !!

Sunday, 30 January 2011

Converting raster dataset to XYZ in ARCGIS !!


It is most probable that you might have to convert from XYZ data to raster image and vice versa because there are applications which can only read XYZ data for visualizing and analyzing. In my case, I always use MATLAB for such case where I can process numbers of images in a loop. One of reader send me an email asking to show a way to do such tasks in ArcGIS. So, here I will show how to convert raster dataset to XYZ. Of course, the way I show can be executed for numbers of images by using python. If someone interested in that, shoot me an email. I will duly oblige.

Steps:
1) Open your raster image in  ArcMap.
2) Open the Sample tool from ArcToolbox>Spatial Analyst Tools >Extraction.
3) Select the raster dataset as the Input Raster and select the raster dataset again in the 'Input location raster or point feature'. Choose ' Resampling technique' is set to Nearest.
4) Specifiy an output table.
5) The output table is in the format: Object ID, Z, X, Y and Z. The sample file would look like in the following figure.


6) Open the table. Right click a field that you are not interested in and choose 'Turn Field Off'. Do this of for all of fields that is not of interest.
7) Right click the table and  choose Data >Export and give an appropriate name and you are done.