http://www.umiacs.umd.edu/~ramani/cmsc426/

Posted by Cat.IanKang
,

Phase & Magnitude analysis in Fourier Transform


  The purpose of this post is to observe differences between textures which are quite similar but have slight differences. Here shows the texture samples. 


 Five samples are used for the experiment. The first sample is a grass texture, and we call it as an original sample. Rest four samples are variation of the original one. Long black rectangular is used for making variations. If it lies on top of the original sample, we call it as a 'Top'. In the same manner, 'Cen', 'Bot', and 'Right' are generated. 


 Now let's convert spatial data into frequency data using Fourier Transform. (For the convenience, we only examine R channel of samples - presented textures have three channels, RGB.) In the frequency domain, we can observe texture characteristics from two major components: magnitude and phase. Therefore, plotting those components is helpful to investigate differences  between those samples. Let's plot original one first. 



  then, let's plot rest four samples. 

  


 In terms of magnitude spectrum, we can find obvious differences. 'Top', 'Cen', 'Bot', and 'Right' samples have long huge white line at the center. 'Top', 'Cen', and 'Bot' have long vertical white line and 'right' sample has long white horizontal line. It represents the long black rectangle in the spatial domain. We can also observe that the white line lies on the same position in 'Top', 'Cen,' and 'Bot'. Since the frequency domain represents the data into signals, it is natural. 


 On the other hand, we cannot observe any significant differences from phase spectrum. They still seem mere random. MAYBE, since the phase have no locality (the data have similar phase distribution in all coordinates), we cannot find the obvious changes in the phase spectrum. Following graph shows the phase data is spread widely. 





(For the visualization purpose, we used log function to plot magnitude spectrum. Mat2gray normalization was also used for both magnitude and phase spectrum. Magnitude spectrum is the result of abs() function and phase spectrum is the result of angle() function of MATLAB) 

'Cat.Storage > SubCat.Research' 카테고리의 다른 글

Classification of Eye Movements based on their functions  (0) 2018.01.19
Comparison method for two groups  (0) 2017.01.10
DirectX Tessellation Strategy  (0) 2016.09.02
Likert Scale  (0) 2016.08.16
Two-alternative forced choice  (0) 2016.08.16
Posted by Cat.IanKang
,

%Define Cartesian Coordinates

radiusSZ = floor(imSize/2);

[X, Y] = meshgrid(-radiusSZ:radiusSZ, -radiusSZ:radiusSZ);

[theta, rho] = cart2pol(X, Y);

rho = round(rho);


%2d sinc function

sincFrq = 1;

sincFilter= sin(rho*sincFrq+0.00001)./(rho*sincFrq+0.00001);

sincFilter_clamped = sincFilter; %init





%If you want to clamp the kernel,

clampDist = 4; %variable

cen = ceil(imSize/2); %variable


sincFilter_clamped = sincFilter_clamped(cen-clampDist:cen+clampDist,cen-clampDist:cen+clampDist);

Posted by Cat.IanKang
,

https://fgiesen.wordpress.com/2011/09/06/a-trip-through-the-graphics-pipeline-2011-part-12/

'Cat.Storage > SubCat.Research' 카테고리의 다른 글

Comparison method for two groups  (0) 2017.01.10
Phase & Magnitude analysis in Fourier Transform  (0) 2016.10.17
Likert Scale  (0) 2016.08.16
Two-alternative forced choice  (0) 2016.08.16
Depp Learning Surveys  (0) 2016.06.04
Posted by Cat.IanKang
,

 Likert developed the principle of measuring attitudes by asking people to respond to a series of statements about a topic, in terms of the extent to which they agree with them, and so tapping into the cognitive and affective components of attitudes. A Likert scale assumes that the strength/intensity of experience is linear, i.e. on a continuum from strongly agree to strongly disagree, and makes the assumption that attitudes can be measured. 


 A scale can be created as the simple sum of questionnaire responses over the full range of the scale. In so doing, following characteristics should be considered. 


 - Symmetry: They contain equal numbers of positive and negative positions whose respective distances apart are bilaterally symmetric about the "neutral" value


- Balance: The distance between each candidate value is the same, allowing for quantitative comparisons such as averaging to be valid across items containing more than two candidate values. The format of a typical five-level Likert item could be

   

   strongly disagree / disagree / neutral / agree / strongly agree




Likert scaling is a bipolar scaling method, measuring either positive or negative response to a statement. Sometimes an even-point scale is used, where the middle option of "neutral" is not available. This is sometimes called a "forced choice" method, since the neutral option is removed. 




 In illustration, the diverging stacked bar charts is highly recommended [Plotting Likert and Other Rating Scales - 2011]. Diverging stacked bar charts make it easier to compare the attitudes of respondents in different demographic categories or who differ on the importance of increasing professional recognition than do any other figures discussed. 

'Cat.Storage > SubCat.Research' 카테고리의 다른 글

Phase & Magnitude analysis in Fourier Transform  (0) 2016.10.17
DirectX Tessellation Strategy  (0) 2016.09.02
Two-alternative forced choice  (0) 2016.08.16
Depp Learning Surveys  (0) 2016.06.04
Nearest Neighbor Search  (0) 2016.02.16
Posted by Cat.IanKang
,

Two-alternative forced choice


  The two-alternative forced choice (2AFC) method is a ubiquitous choice for measuring detection or discrimination thresholds. During one trial of a 2AFC experiment, a subject is asked to make a decision about two stimuli with regard to a particular stimulus parameter of interest (it is also called primary parameter). For example, a subject is instructed to indicate which one of two terrain images shows an more realistic scenes. See following figures.



Figure 1. Two terrain images. Left terrain data is 1/64 down-sampled version of right terrain data. 


 Over repeated trials with stimulus pairs of varying difference in sample rates, a psychometric function can be calculated that reflects the empirical probability of the subject's choice as a function of stimulus difference. The slope of this sigmoidal function is a direct measure of the subject's discrimination threshold. There are many benefits in using the 2AFC method. It requires subjects to perform a simple decision task. It provides a threshold measure in physical units unlike scaling methods. Also, by restricting a subject’s response to a binary decision, it avoids any contamination of the measured perceptual thresholds with motor noise unlike methods of adjustment. Furthermore, it generally provides a large number of data points, thus allowing a statistically sound analysis and robust fits of the data. Finally, with signal detection theory (SDT), there exists a well-accepted and simple observer model framework that links the psychometric functions to an internal sensory representation of the stimulus parameter of interest. For all these reasons, the 2AFC method has been popular in many areas. 


  It is possible to introduce biases in decision making in the 2AFC task. For example, if one stimulus occurs more frequently than the other, then the frequency of exposure to the stimuli may influence the participant's beliefs about the probability of the occurrence of the alternatives. 

'Cat.Storage > SubCat.Research' 카테고리의 다른 글

DirectX Tessellation Strategy  (0) 2016.09.02
Likert Scale  (0) 2016.08.16
Depp Learning Surveys  (0) 2016.06.04
Nearest Neighbor Search  (0) 2016.02.16
ISO preference curves  (1) 2015.10.27
Posted by Cat.IanKang
,

In order to solve this problem, I've tried so many things :(


I hope this post help you to save your time.



- Just downgrade your gdal version. 


In my case, every solutions I tried including altering the 32bit to 64bit and changing the python version, 

presented by anonymous user, have not been effective. 


The problem has been solved when I change the gdal version 2.1.0 to 2.0.3


good luck :)


(* Now, my python version is 3.4.4 and gdal version is 2.0.3.)







Posted by Cat.IanKang
,

The first step is to set up the environment. 


Following sites provide kind instruction what you have to do. 



http://cartometric.com/blog/2011/10/17/install-gdal-on-windows/


https://pythongisandstuff.wordpress.com/2011/07/07/installing-gdal-and-ogr-for-python-on-windows/


These sites are helpful



http://www.gisinternals.com/release.php 

* download site



------------------------------------------------------------

* Make sure the environment is established properly. 



The next step is to install the 'ptvs' which helps you to use python into the visual studio. (In my case, the version is  visual studio 2013)


Enter a keyword either 'python for visual studio' or 'ptvs'. 


Then you can find certain website to help you :)


Choose the correct version of ptvs and install it. 


Make new project and enter the following code.


"from osgeo import gdal"


If it works, you are ready to use gdal on visual studio. 


Unless, please check  followings.


- Does your project use proper python version that you set up the gdal environment?


- Does your ptvs version corresponds to your visual studio version?


- Does your python library DB updated? (if not you can do manually by clicking the "completion DB" button)


If you have any problem just leave some comments :)



------------------------------------------------------------------


I'm using gdal to convert IMG data into png data. 


below is code example of it.




import gdal

import numpy as np

import matplotlib.pyplot as plt

from osgeo import gdal

from matplotlib import cm



gdal.UseExceptions()




geo_n = gdal.Open(r'D:\ChromeDownload\USGS_NED_one_meter_x24y459_IL_12_County_HenryCO_2009_IMG_2015\USGS_NED_one_meter_x24y459_IL_12_County_HenryCO_2009_IMG_2015.img')

geo_s = gdal.Open(r'D:\ChromeDownload\USGS_NED_one_meter_x24y460_IL_12_County_HenryCO_2009_IMG_2015\USGS_NED_one_meter_x24y460_IL_12_County_HenryCO_2009_IMG_2015.img')

drv = geo_n.GetDriver()

print(drv.GetMetadataItem('DMD_LONGNAME'))

north = geo_n.ReadAsArray()

south = geo_s.ReadAsArray()


#topo = np.vstack((north,south))

topo = np.vstack(south)

i,j = np.where(topo>0)

topo = topo[min(i):max(i)+1, min(j):max(j)+1]

topo[topo==0] = np.nan

print(topo.shape)


fig = plt.figure(frameon = False)

plt.imshow(topo, cmap=cm.BrBG_r)

plt.axis('off')

cbar = plt.colorbar(shrink=0.75)

cbar.set_label('meters')

plt.savefig('kauai.png', dpi=300, bbox_inches='tight')

plt.show()




Posted by Cat.IanKang
,