org.opencv.core
public class Range extends java.lang.Object
Template class specifying a continuous subsequence (slice) of a sequence.
class CV_EXPORTS Range
// C++ code:
public:
Range();
Range(int _start, int _end);
Range(const CvSlice& slice);
int size() const;
bool empty() const;
static Range all();
operator CvSlice() const;
int start, end;
};
The class is used to specify a row or a column span in a matrix (
"Mat") and for many other purposes. Range(a,b) is basically the
same as a:b in Matlab or a..b in Python. As in
Python, start is an inclusive left boundary of the range and
end is an exclusive right boundary of the range. Such a
half-opened interval is usually denoted as [start,end).
The static method Range.all() returns a special variable that
means "the whole sequence" or "the whole range", just like " : "
in Matlab or " ... " in Python. All the methods and functions in
OpenCV that take Range support this special Range.all()
value. But, of course, in case of your own custom processing, you will
probably have to check and handle it explicitly:
// C++ code:
void my_function(..., const Range& r,....)
if(r == Range.all()) {
// process all the data
else {
// process [r.start, r.end)
| Constructor and Description |
|---|
Range() |
Range(double[] vals) |
Range(int s,
int e) |
public Range()
public Range(double[] vals)
public Range(int s,
int e)
public static Range all()
public Range clone()
clone in class java.lang.Objectpublic boolean empty()
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic void set(double[] vals)
public Range shift(int delta)
public int size()
public java.lang.String toString()
toString in class java.lang.Object