Tuesday, September 27, 2011

Query AD using sql

declare @index int
declare @query nvarchar(2000)
declare @query_intreg nvarchar(2000)
declare @word varchar(1)

set @index = 65

while @index<91
begin
    set @word = char(@index)
    set @query = '''  select  mail,telephonenumber,cn,physicalDeliveryOfficeName,sAMAccountName,manager,adspath,Company,ipphone
                  from  ''''LDAP://AD.local/DC=AD,DC=local''''
                  WHERE sAMAccountName ='''''+@word+'*'''' AND Company = ''''*''''  ''  '


    set @query_intreg = 'select  mail,telephonenumber,cn,physicalDeliveryOfficeName,Company,0,sAMAccountName,adspath,manager,ipphone from  openquery(ADSI, '+@query+')'
   
    insert into #temp
    EXEC  sp_executesql @query_intreg
   
    set @index = @index +1
end

select * from #temp
drop table #temp

Wednesday, September 21, 2011

links BoW and Feature Descriptors

http://public.cranfield.ac.uk/c5354/teaching/dip/opencv/lecture_demos/c++/surf_feature_matching.cpp
http://www.morethantechnical.com/2011/08/25/a-simple-object-classifier-with-bag-of-words-using-opencv-2-3-w-code/

https://code.ros.org/trac/opencv/browser/trunk/opencv/samples/c/detectors_sample.cpp?rev=3052

http://opencv.itseez.com/doc/user_guide/ug_features2d.html
http://app-solut.com/2011/07/the-bag-of-words-model-in-opencv-2-2/

Wednesday, September 14, 2011

Install opencv 2.31

http://www.arunkumarr.co.in/site/index.php/articles/10-configuring-opencv-23-in-visual-studio-2008



Download OpenCV-2.3.0-win-superpack.exe from http://sourceforge.net/projects/opencvlibrary/files/opencv-win/2.3/
Run OpenCV-2.3.0-win-superpack.exe and copy the generated folder OpenCV2.3 to C drive
Open Microsoft Visual Studio 2008 and click Tools->Options
alt
Select Projects and Solutions and then VC++ Directories. Select Include files in Show directories for: drop down menu. Add the following paths. 
C:\OpenCV2.3\opencv\include\opencv
C:\OpenCV2.3\build\include
alt
Select Library files in Show directories for: drop down menu. Add the following path.
C:\OpenCV2.3\build\x86\vc9\lib
Now we have added include and library file paths and this need to be done only for the first time.
Create an new project in Visual Studio 2008
Click Project->Properties. Select Configuration Properties -> Linker -> Input. Make sure you select Debug in 'Configuration:' drop down menu and then add the following to the Additional Dependencies.
opencv_features2d230d.lib opencv_highgui230d.lib opencv_core230d.lib opencv_imgproc230d.lib opencv_ml230d.lib opencv_objdetect230d.lib opencv_video230d.lib opencv_contrib230d.lib opencv_calib3d230d.lib
Now select Release in 'Configuration:' drop down menu and then add the following to the Additional Dependencies  and click OK
opencv_features2d230.lib opencv_highgui230.lib opencv_core230.lib opencv_imgproc230.lib opencv_ml230.lib opencv_objdetect230.lib opencv_video230.lib opencv_contrib230.lib opencv_calib3d230.lib
alt
alt
Add C:\OpenCV2.3\build\x86\vc9\bin to the environment path as shown in screenshot below. You may need to restart the system after setting this.
alt
To test whether the OpenCV is working, add a C++ file under Source files as shown in screen shots below.
alt
 alt
Copy the sample program given below and build it and run. An image will be displayed in a window.
01.#include
02. 
03.#include
04. 
05.using namespace cv;
06. 
07.int main()
08. 
09.{
10. 
11.namedWindow("wnd");
12. 
13.Mat img;
14. 
15.img= imread("C://Users//Public//Pictures//Sample Pictures//Desert.JPG"); //image path
16. 
17.imshow("wnd",img);
18. 
19.cvWaitKey();
20. 
21.return 0;
22. 
23.}