OpenCV on your MAC – Easy to install and Configure
OpenCV (Open Source Computer Vision Library) is a library of programming functions mainly aimed at real-time computer vision, developed by Intel, and now supported by Willow Garage and Itseez. It is free for use under the open source BSD license. The library is cross-platform. It focuses mainly on real-time image processing. If the library finds Intel’s Integrated Performance Primitives on the system, it will use these proprietary optimized routines to accelerate itself.
Here in this BlogPost I will explain you to install OpenCV(version 2.3, 2.4) on your MAC
There are two way to build openCV on your MAC.
1. You can use MacPorts
For this first you have to install MacPorts. The easiest way to install MacPorts on a Mac OS X system is by downloading the dmg for Mountain Lion, Lion, Snow Leopard orLeopard and running the system’s Installer by double-clicking on the pkg contained therein, following the on-screen instructions until completion. Installation package is here.
After installing MacPort you have to update it to latest version.
$ sudo port selfupdate
Now you can install OpenCV by running following command
$ sudo port install opencv
If you want to install python building
$ sudo port install opencv +python27
or with python 2.6
$ sudo port install opencv +python26
or with QT
$ sudo port install opencv +qt4
So by this way you can install OpenCV in your MAC OS.
2. You can use CMake
By using CMAKE you can also install OpenCV on your mac. For that first you should have to install CMake, which thankfully comes with Mac binaries – so that was easy. You can download .dmg file here.
After installing CMake you have to download the OpenSource Package that you can download by clicking here. Now you have OpenCV-2.4.3 ter.bz2 and unzip to folder. Now open terminal and go to that folder and write following commands in Terminal.
$ mkdir build $ cd build $ cmake -G "Unix Makefiles" .. $ make -j8 $ sudo make install
Now You have done. Congrats you have installed OpenCV on your MAC
Now you can check by doing following thing.
GO to TerminalType Python
Now type
>>> import cv
Now if it run without any error then \m/ but if you encountered with following error
>>> import cv Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named cv
Then close python by pressing ctrl + D key and now you have to run following command
$ export PYTHONPATH=/usr/local/lib/python2.7/site-packages/
after running this command restart the Terminal and then open python and import cv this will work
If you have any doubt or problem then you can comment here. Thanks.
CoffeeScript – The Awesome way to write JavaScript
Do you struggle with Braces and semicolon in writing code of JavaScript. There is a solution of this problem and that is – CoffeeScript. In this post I’ll explore CoffeeScript - a minimalistic language that compiles to JavaScript.
CoffeeScript – The Awesome way to write JavaScript
CoffeeScript is a little language that compiles into JavaScript. Underneath all those awkward braces and semicolons, JavaScript has always had a gorgeous object model at its heart. CoffeeScript is an attempt to expose the good parts of JavaScript in a simple way.
The golden rule of CoffeeScript is: “It’s just JavaScript“. The code compiles one-to-one into the equivalent JS, and there is no interpretation at runtime. You can use any existing JavaScript library seamlessly from CoffeeScript (and vice-versa). The compiled output is readable and pretty-printed, passes through JavaScript Lint without warnings, will work in every JavaScript runtime, and tends to run as fast or faster than the equivalent handwritten JavaScript.
The language adds syntactic sugar inspired by Ruby,Python and Haskell. NO braces and semicolons. Since March 16, 2011, CoffeeScript has been on GitHub‘s list of most-watched projects, and as of 29 August 2012 is the eleventh most popular language on GitHub. CoffeeScript compiles predictably to JavaScript and programs can be written with less code, typically 1/3 fewer lines, with no effect on runtime performance
Syntax of CoffeeScript – Easy to use – Easy to Read
Here I am showing some example.
1. Assignment
str = "CoffeeScript"
2. Function
square = (x) -> x * x
3. Condition
string = "Passed" if condition
4. Multiply numbers with 2
[1..10].map (i) -> i*2
5. Object
math =
root: Math.sqrt
square: square
cube: (x) -> x * square x
6. Loop
eat food for food in ['toast', 'cheese', 'wine']
Installation
The CoffeeScript compiler is itself written in CoffeeScript, using the Jison parser generator. The command-line version of coffee is available as a Node.js utility. The core compiler however, does not depend on Node, and can be run in any JavaScript environment, or in the browser.
To install, first make sure you have a working copy of the latest stable version of Node.js, and npm(the Node Package Manager). You can then install CoffeeScript with npm:
npm install -g coffee-script
(Leave off the -g if you don’t wish to install globally.)
If you’d prefer to install the latest master version of CoffeeScript, you can clone the CoffeeScriptsource repository from GitHub, or download the source directly. To install the lastest master CoffeeScript compiler with npm:
npm install -g http://github.com/jashkenas/coffee-script/tarball/master
Or, if you want to install to /usr/local, and don’t want to use npm to manage it, open the coffee-script directory and run:
sudo bin/cake install
For More Information and learning
1.http://coffeescript.org
2.http://jashkenas.github.com/coffee-script/documentation/docs/grammar.html
What makes C++ so good?
Answer by Harsh Kothari:
1: Stronger Type Checking – the use of classes, inheritance & automatic type conversions mostly eliminates the need for the abominable void* of C.
2: Type safe linkage – you can’t accidentally call a routine from another
module with the wrong type and/or number of arguments – even if your header files get out of date.
3: A complex data type is provided. It includes all the standard arithmetic operations, implemented as operators, not function calls.
4: User-defined operators and function overloading are supported. When you design a data type you can specify which operators & functions are provided.
5: You can use class libraries to provide robust new data types which can be made exceptionally easy to use.
For example, the Rogue Wave ‘math.h++’ class library implements general multi-dimensional arrays which can be manipulated with high-level operations
and an intuitive syntax:
DComplexArray a(10,10); // Construct a 10×10 complex array
cin >> a; // read it in from standard input
DComplexArray b = inverse(a); // Calculate the inverse
cout << b; // write out the inverse
cout << variance(b.diagonal()); // write out the variance of the diagonal
elements of b
6: You can define automatic type conversions to convert between data types.
For example, the Rogue Wave library provides a conversion from a double array
to a complex array.
DoubleVec a(10, 0.0, 1.0); // Construct a double vector in initialised to
{0,1,2,3,4…
DComplexVec z = a; // Construct a complex vector initialised to
{(0,0),(1,0),(2,0),…
cout << a; // write them out
cout << z;
cout << cos(z)*exp(DComplex(0,1)*a);
7: Provides inline functions which combine the efficiency of using macros
with the safety of using functions – simply prepend the word ‘inline’ in
front of the function – if the compiler can inline it, it will.
inline Double
SumOfPositiveElements
(const DoubleVec& v)
{
Double theSum = 0;
for (int i = 0; i < v.length(); i++) {
if (v[i] > 0) {
theSum += v[i];
}
}
return theSum;
}
8: C++ Compiles most ANSI C code directly and can call compiled C code
directly, so you don’t even have to learn anything new at all!
9: You don’t have to put all of your declarations at the top of each block
in C++.
This means
that you can organise your code into logically related ‘paragraphs’ complete
with their necessary declarations. This makes code much more maintainable -
you can easily move sections of code around, taking the necessary
declarations along at the same time. If you use the const modifier you can
also ensure that variables whose value should not change after it is first
calculated do not do so.
Double x,y; // Declare two variables
cin >> x >> y; // read in their values
const Double sqrtX = sqrt(x); // Calculate the square roots
const Double sqrtY = sqrt(y);
cout << sqrt(sqrtX+sqrtY);
sqrtX = 42; // Will give an error…
10: Classes provide extensible types, promoting code reuse. This can
result in major savings in the amount of code written. I saw a recent
article which stated that the new Taligent operating system, which is written
in C++, consists of 250,000 lines of code, whereas WindowsNT, written in C,
was said to consist of 4,000,000 lines of code.
Wiki Loves Monument Competition kicks off – Participate, Upload Pics and Win Prize
Competition : 1st of September to 31st of September
Wiki Loves Monuments is an international photo contest around cultural heritage monuments in September. Starting from the Netherlands in 2010 and organized on a European level in 2011, we go global in 2012!
Everybody can participate and improve Wikipedia in their local and regional neigbourhood. Cultural heritage is everywhere around you, you just need to look and learn!
In every participating country you can win awards, and the best photos in each country continues to the international jury – which will select the best monument photos in 2012.
List of monuments in India is now ready, which qualifies for the contest.
Rules
There are a few rules for photos to participate in the international contest. Most of these rules are also adopted as rules for participation on a national level. Every submission should be:
- Self taken and self uploaded;
- Uploaded in September 2012 and before 30 september;
- Freely licensed;
- The default license will be CC-BY-SA 3.0;
- Contain an identified monument;
- Nominated through a national contest
Next to that, there are a few practical rules:
- The participant should have an activated e-mail address on the upload platform;
- The first winner will get to choose the first prize etc.
If necessary, the rules can be adapted via the international coordinators.
Special categories
Besides the regular contest, there are may be special categories – with their own award and jury. Besides that, the normal rules apply.
Get Started Here for the competition
Get started!
You Can also Download Android app here
Awards
National awards
| First Prize | 20,000 INR |
| Second Prize | 15,000 INR |
| Third Prize | 10,000 INR |
| 4th and 5th Prize | 10,000 (5,000 INR each ) |
| 6th to 10th Prize | 15,000 (3,000 INR each) |
| Trophies | 15,000 |
International awards
The national juries will nominate photos for the international contest, which has its own jury and awards. The main prize will be a photo trip to Hong Kong, connected to a visit to Wikimania, the annual meeting where Wikimedians from all over the world meet each other, with a maximum value of 2000 euro! Besides that there will be a number of photography-related vouchers, ranging from 400 euro worth (second prize) to 50 euro worth (tenth prize).
The distribution of these awards is determined by the principle that the first prize winner will have the first choice from the prizes, and so on – to ensure that every prize winner gets the prize he or she would like the most. Prizes are not exchangeable for money.
Special awards
This year, there will be also a special award for the best photo of a gallery, library, archive or a museum building (the GLAM category), awarded and sponsored by Europeana), the European federation of organisations active in the field of European heritage.
- For More Info visit website
www.wikilovesmonument.in - All the images should be uploaded under a different upload campaign created for WLM in India.
http://commons.wikimedia.org/w/index.php?title=Special:UploadWizard&campaign=wlm-in - Stay Connect on Facebook group Wiki Loves Monument
https://www.facebook.com/groups/wikilovesmonumentsindia/ - and Facebook Page
https://www.facebook.com/WikiLovesMonumentsIndia








