Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Relating flags and numbers for functions like imread or namedWindow.

I saw an example for the usage of namedWindow as shown below:

namedWindow("edges", 1)

I believe that the number 1 is related to a flag such as WINDOW_AUTOSIZE. However, I am not able to find any clear documentation which says what number relates to what flag. In the case of imread, the documentation states:

>0 Return a 3-channel color image.

=0 Return a grayscale image.

<0 Return the loaded image as is (with alpha channel)

For namedWindow, I found that this link has a section called Enumerations which had the following content:

enum    cv::WindowFlags { 
  cv::WINDOW_NORMAL = 0x00000000, 
  cv::WINDOW_AUTOSIZE = 0x00000001, 
  cv::WINDOW_OPENGL = 0x00001000, 
  cv::WINDOW_FULLSCREEN = 1, 
  cv::WINDOW_FREERATIO = 0x00000100, 
  cv::WINDOW_KEEPRATIO = 0x00000000, 
  cv::WINDOW_GUI_EXPANDED =0x00000000, 
  cv::WINDOW_GUI_NORMAL = 0x00000010 
}
    Flags for cv::namedWindow.

However, I am not sure if this is what I am looking for because some of the values on RHS are not unique. So, how do we differentiate between them (for example cv::WINDOW_NORMAL and cv::WINDOW_KEEPRATIO)? Is there any other place where I can this information for namedWindow and other functions?

Relating flags and numbers for functions like imread or namedWindow.

I saw an example for the usage of namedWindow as shown below:

namedWindow("edges", 1)

I believe that the number 1 is related to a flag such as WINDOW_AUTOSIZE. However, I am not able to find any clear documentation which says what number relates to what flag. In the case of imread, the documentation states:

>0 Return a 3-channel color image.

=0 Return a grayscale image.

<0 Return the loaded image as is (with alpha channel)

For namedWindow, I found that this link has a section called Enumerations which had the following content:

enum    cv::WindowFlags { 
  cv::WINDOW_NORMAL = 0x00000000, 
  cv::WINDOW_AUTOSIZE = 0x00000001, 
  cv::WINDOW_OPENGL = 0x00001000, 
  cv::WINDOW_FULLSCREEN = 1, 
  cv::WINDOW_FREERATIO = 0x00000100, 
  cv::WINDOW_KEEPRATIO = 0x00000000, 
  cv::WINDOW_GUI_EXPANDED =0x00000000, 
  cv::WINDOW_GUI_NORMAL = 0x00000010 
}
    Flags for cv::namedWindow.

However, I am not sure if this is what I am looking for because some of the values on RHS are not unique. So, how do we differentiate between them (for example cv::WINDOW_NORMAL and cv::WINDOW_KEEPRATIO)? Is there any other place where I can this information for namedWindow and other functions?