Installing OpenCV 3 on my mac (MacOS) without config an Virtual Env

Hello Hello people,

First of all, sorry to don’t be here so often. I hope that I will be back with more frequence now (and with interesting content as well).

This post is about how to install OpenCV in a Mac (specifically a Macbook but I think that works in any Mac (MacOS)) without create the virtual env.

The idea to create this post was because all the tutorials that I fould on the Internet was installing OpenCV using the concept of Virual Env. On my case, I would like to have the OpenCV on my main list of libraries, so this is why I would like to install without use the Virtual Env approach.

If you are not familiar with Virtual env, please have a look on this link. This is definitely a long (an interesting) topic that could be transformed in a post (Why not?! Maybe latter I will write about that).

Ok! So, to start the things let’s answer this question: What is OpenCV?

OpenCV (Open Source Computer Vision Library) “is an open source computer vision and machine learning software library” (OpenCV.org, not available).

As you could see I have something in mind to use computer vision + machine learning 8)

No worries, I will make sure that I will create a post when the project is done 🙂

So…. let’s stop chat and let’s show the step-by-step:

Ps: I already have installed Anaconda 5.0 on my machine (and I’m using Python 3.6).

Step 0: Install XCode from App Store (if you don’t have already installed).

Step 1: Install the Homebrew (more details about homebrew you could find here)

Open the terminal and run:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master
brew update
Step 2: Compile & Install OpenCV
Now, it is time to install the OpenCV using brew:
brew install opencv
Step 3: Update you conda and your numpy
conda update anaconda
conda update numpy 
(note that the numpy version required is 1.14)
Step 4: Add OpenCV’s to the site-package path to global site-packages
echo /usr/local/opt/opencv/lib/python3.6/site-packages >> 
/usr/local/lib/python3.6/site-packages/opencv3.pth
Step 5: Make OpenCV 3 Python symlink
cd anaconda/lib/python3.6/site-packages/
ln -s /usr/local/opt/opencv@3/lib//python3.6/site-packages/cv2.cpython-36m-darwin.so
Step 6: Test!
Basically let’s run python from the terminal and then import cv2 and
 
python
import cv2
print(cv2.__version__)
If everything wenet you, you have your OpenCV up and running 🙂
Ps: All the steps were based on the Chandel tutorial (Chandel, 2017).

References:

Chandel, S., V., 2017. Install OpenCV 3 on MacOS [ONLINE]. Available at https://www.learnopencv.com/install-opencv3-on-macos/ (Accessed 03/jun/2018).

OpenCV.org, About [ONLINE]. Available at: https://opencv.org/about.html (Accessed 03/jun/2018).

[Introduction] Data Science Knowledge (DSK)

Hello everyone!

As part of the idea to exchange knowledge and discuss more about Data Science, I’m starting a series of posts speaking about the (what I think are) the most important and relevant concepts that any data scientist shoud know. I hope that you will like it!

The posts about that will be tagged at “Data Science > General Knowledge”.

See you around then!

[TUTORIAL 01] Exploring French employment, salaries, population per town – INTRODUCTION

Hello hello!

This is the “quick-off” post for a series of posts that I pretend to do about Data Science (Exploratory Data Analysis, Data Visualization and Machine Learning).

I will try to index/associate these “tutorials” by number on the beginning of the post name. For example, this one is the “TUTORIAL 01”. This will help to follow the next posts that will speak about the same topic/dataset.

Explanations a part, let’s go to speak about what this introductory post will covers:

  1. Which dataset?
  2. How to get/dowload the dataset?
  3. Brief explanation about the file(s) that you will find on the Dataset

So… Let’s start!

First of all, the dataset that we will work on this first tutorial is a dataset from INSEE (Institut National de la Statistique et des Etudes Economiques).

INSEE was created in 1946 and it is a “Directorate-General of the Ministries for the Economy and for Finances” (INSEE.fr, n.d.)

The data site is available to download on Kaggle.com and you could find here.

Basically this dataset content 6 files, 4 “.csv” and 2 “.geojson”: (ps.: These descriptions came from Kaggle.com)

  • (.csv) base_etablissement_par_tranche_effectif: information on the number of firms in every french town, categorized by size.
  • (.csv) name_geographic_information: geographic data on french town (mainly latitude and longitude, but also region / department codes and names).
  • (.csv) net_salary_per_town_per_category: salaries around french town per job categories, age and sex.
  • (.csv) population : demographic information in France per town, age, sex and living mode.
  • (.geojson) communes: geografic data structure for “communes” (equivalent to civil townships)
  • (.geojson) departements: geografic data structure for “departements” (administrative district in France).

You could learn more about geoJSON here and here.

Next post, we will start the to play a bit with these files.
I will use Python + jupyterNotebooks as my main tools to “explore the data”!

See you soon!

References:

INSEE.fr, n.d. Getting to know INSEE [ONLINE]. Available at: https://www.insee.fr/en/information/2381925 (Accessed 02 February 2018).

Kaggle.com, 2017. French employment, salaries, population per town [ONLINE]. Available at: https://www.kaggle.com/etiennelq/french-employment-by-town/data (Accessed 02 February 2018).

Converting a photo into a 8-bits commodore c64 style

Hello fellas!

This is my first post! Yeah!!
So, I would like to share one nice site that I found on the Internet! I was looking for some webpage that convert my photo for something “8-bits” I found this amazing one: http://c64.superdefault.com/

It is very simple to use, you just need to “drag-and-drop” the image that you want to convert and then, BINGO! You have your 8-bits commodore c64 style image!! Check on “About me” and you will see the resut!

Have fun!