• Making a Chessboard Pattern for Camera Calibration
    The following code can be used to make a chessboard image given the number of rows and columns of the chessboard, square size in pixel, and two colors. The default size of the square is 100 pixels and default colors are black and white. Use an image viewer like Irfanview to […]
  • Converting images from RGB to HSV
    Here is a code snippet we can use for converting an image from RGB colour space to HSV colour space. OpenCV uses BGR format instead of RGB. Therefore, we have to use the CV_BGR2HSV flag to convert the image to HSV space and then the “split” method to separate the […]
  • OpenCV “cv::Mat” Data Types
    These are the data types we can use with OpenCV Matrices. DATA TYPE RANGE IPL IMAGES CV::MAT Unsigned 8bits uchar 0 ~ 255 IPL_DEPTH_8U CV_8UC1CV_8UC2CV_8UC3CV_8UC4 Signed 8bits char -128 ~ 127 IPL_DEPTH_8S CV_8SC1CV_8SC2CV_8SC3CV_8SC4 Unsigned 16bits ushort 0 ~ 65535 IPL_DEPTH_16U CV_16UC1CV_16UC2CV_16UC3CV_16UC4 Signed 16bits short -32768 ~ 32767 IPL_DEPTH_16S CV_16SC1CV_16SC2CV_16SC3CV_16SC4 Signed […]