Python: How to calculate image perimeter orientation histogram?
I would like to find the perimeter orientation histogram of an object inside an image.
  The object is returned into an array but I don`t know how to find the orientation of its perimeter.


As far as the perimeter edge orientation histogram is concerned, this is a histogram of a set of integer numbers in the range $[0 \ldots 5]$. In section 3.3 it is explained that the orientation of the perimeter "edges" is quantised in 6 directions, each one represented by oriented Gaussian Filters. The orientation of the edge is taken as the "strongest" output of one of these filters.


  That is to return the perimeter pixels coordinates as a 2-D array of X and Y. What I found in Python is to just return the total number of pixels in the object perimeter but no information about the coordinates of perimeter. 


This has nothing to do with Python. Finding the perimeter is not a matter of "calling a function". It is a set of standard techniques and the key towards them is the phrase "Perimeter - total number of pixels on the segment perimeter, computed with morphological operations", again, from paragraph 3.3 of the paper cited.


  Can anyone help me find the perimeter coordinates of an object and then calculate the orientation of the perimeter pixels?


You first need to understand morphological operators. This is a great resource and so is this one, particularly section 3.6 which is exactly what you are trying to do here.

In brief, given a thresholded binary image where $1$ denotes a pixel in the Foreground and $0$ denotes a pixel in the Background, the perimeter of it is defined as the set of pixels that connect the Foreground with the Background regions. Obviously, here, Foreground, Background, 1,0 are interchangeable and depending on context. But for the purposes of this discussion we define Foreground as the pixels that the segmentation algorithm has determined to belong to some identifiable area, Background as the pixels that the segmentation algorithm has determined DO NOT belong to some identifiable area and 0,1 are just two numbers we use in place of Foreground and Background (It could be a different integer for each identifiable segmentation region).

The brute-force way to do this is to scan through the "patch", examining the 4 or 8 connectivity of each pixel and looking for pixels that are not fully surrounded by Foreground pixels. THOSE PIXELS are the ones that exist in the perimeter of a region identified by the segmentation algorithm.

OK, so the next question here is Where do i get these regions identified? and the answer is, from the dynamic texture modelling step that is described in section 3.1.

What is dynamic texture modelling?

It is a technique by which an image is modelled as a set of particles that tend to move in well defined patterns. From this perspective, a dynamic texture model is trying to discover the pattern of movement that these particles follow. Having discovered this, it is possible to "judge", if some particle's movement belongs or not to a specific model.

In other words, when you observe scenes of cars moving on a motorway, birds flying in the sky, particles flowing in some liquid, or even...pedestrians moving along predetermined paths through a park, then these particles tend to follow well defined routes. For more information, please see this piece of work

This is how the authors are discovering those grayscale blobs on Figure 3. 

Specifically: 

"We adopt the mixture of dynamic textures [18] to segment
the crowds moving in different directions. The video
is represented as collection of spatio-temporal patches (7 ×
7 × 20 patches in all experiments reported in the paper),
which are modeled as independent samples from a mixture
of dynamic texture models [19]. The mixture model is
learned with the expectation-maximization (EM) algorithm
[18]. Video locations are then scanned sequentially, a patch
is extracted at each location, and assigned to the mixture
component of largest posterior probability."

So, having:


Segmented the crowd on each frame by first having learned the pattern of movement of the pedestrians.
Discovered the pixels that lie on the perimeter of those patches


You then take the position of each pixel on the perimeter of the region, center six differently oriented Gaussians on top of it and select the "strongest" direction from these six.

In the end of this process, you will have the set of directions required to construct the histogram.

In terms of Python implementations of these techniques, please see this link and this link.

Hope this helps.