change links from samples/python2 to samples/python
This commit is contained in:
@@ -16,8 +16,7 @@ intensity value of the pixel. But in two-dimensional histograms, you consider tw
|
||||
it is used for finding color histograms where two features are Hue & Saturation values of every
|
||||
pixel.
|
||||
|
||||
There is a [python sample in the official
|
||||
samples](https://github.com/Itseez/opencv/blob/master/samples/python2/color_histogram.py) already
|
||||
There is a python sample (samples/python/color_histogram.py) already
|
||||
for finding color histograms. We will try to understand how to create such a color histogram, and it
|
||||
will be useful in understanding further topics like Histogram Back-Projection.
|
||||
|
||||
@@ -106,10 +105,11 @@ You can verify it with any image editing tools like GIMP.
|
||||
|
||||
### Method 3 : OpenCV sample style !!
|
||||
|
||||
There is a [sample code for color-histogram in OpenCV-Python2
|
||||
samples](https://github.com/Itseez/opencv/blob/master/samples/python2/color_histogram.py). If you
|
||||
run the code, you can see the histogram shows the corresponding color also. Or simply it outputs a
|
||||
color coded histogram. Its result is very good (although you need to add extra bunch of lines).
|
||||
There is a sample code for color-histogram in OpenCV-Python2 samples
|
||||
(samples/python/color_histogram.py).
|
||||
If you run the code, you can see the histogram shows the corresponding color also.
|
||||
Or simply it outputs a color coded histogram.
|
||||
Its result is very good (although you need to add extra bunch of lines).
|
||||
|
||||
In that code, the author created a color map in HSV. Then converted it into BGR. The resulting
|
||||
histogram image is multiplied with this color map. He also uses some preprocessing steps to remove
|
||||
|
@@ -155,8 +155,8 @@ should be due to the sky)
|
||||
|
||||
Well, here you adjust the values of histograms along with its bin values to look like x,y
|
||||
coordinates so that you can draw it using cv2.line() or cv2.polyline() function to generate same
|
||||
image as above. This is already available with OpenCV-Python2 official samples. [Check the
|
||||
Code](https://github.com/Itseez/opencv/raw/master/samples/python2/hist.py)
|
||||
image as above. This is already available with OpenCV-Python2 official samples. Check the
|
||||
code at samples/python/hist.py.
|
||||
|
||||
Application of Mask
|
||||
-------------------
|
||||
|
@@ -13,7 +13,7 @@ OCR of Hand-written Digits
|
||||
|
||||
Our goal is to build an application which can read the handwritten digits. For this we need some
|
||||
train_data and test_data. OpenCV comes with an image digits.png (in the folder
|
||||
opencv/samples/python2/data/) which has 5000 handwritten digits (500 for each digit). Each digit is
|
||||
opencv/samples/data/) which has 5000 handwritten digits (500 for each digit). Each digit is
|
||||
a 20x20 image. So our first step is to split this image into 5000 different digits. For each digit,
|
||||
we flatten it into a single row with 400 pixels. That is our feature set, ie intensity values of all
|
||||
pixels. It is the simplest feature set we can create. We use first 250 samples of each digit as
|
||||
|
@@ -81,7 +81,7 @@ Additional Resources
|
||||
Exercises
|
||||
---------
|
||||
|
||||
-# OpenCV comes with an interactive sample on inpainting, samples/python2/inpaint.py, try it.
|
||||
-# OpenCV comes with an interactive sample on inpainting, samples/python/inpaint.py, try it.
|
||||
2. A few months ago, I watched a video on [Content-Aware
|
||||
Fill](http://www.youtube.com/watch?v=ZtoUiplKa2A), an advanced inpainting technique used in
|
||||
Adobe Photoshop. On further search, I was able to find that same technique is already there in
|
||||
|
@@ -156,7 +156,7 @@ in image, there is a chance that optical flow finds the next point which may loo
|
||||
actually for a robust tracking, corner points should be detected in particular intervals. OpenCV
|
||||
samples comes up with such a sample which finds the feature points at every 5 frames. It also run a
|
||||
backward-check of the optical flow points got to select only good ones. Check
|
||||
samples/python2/lk_track.py).
|
||||
samples/python/lk_track.py).
|
||||
|
||||
See the results we got:
|
||||
|
||||
@@ -213,7 +213,7 @@ See the result below:
|
||||

|
||||
|
||||
OpenCV comes with a more advanced sample on dense optical flow, please see
|
||||
samples/python2/opt_flow.py.
|
||||
samples/python/opt_flow.py.
|
||||
|
||||
Additional Resources
|
||||
--------------------
|
||||
@@ -221,5 +221,5 @@ Additional Resources
|
||||
Exercises
|
||||
---------
|
||||
|
||||
-# Check the code in samples/python2/lk_track.py. Try to understand the code.
|
||||
2. Check the code in samples/python2/opt_flow.py. Try to understand the code.
|
||||
-# Check the code in samples/python/lk_track.py. Try to understand the code.
|
||||
2. Check the code in samples/python/opt_flow.py. Try to understand the code.
|
||||
|
Reference in New Issue
Block a user