template<int ROWS, int COLS, int SRC_T, typename P_T, int DST_T>
void hls::CmpS( hls::Mat<ROWS, COLS, SRC1_T>& src,
                P_T value,
                hls::Mat<ROWS, COLS, DST_T>& dst,
                int cmp_op );


  • src – the input image.
  • value – the input scalar value.
  • dst – the output8-bit single channel image.
  • cmp_op – the flag that specifying the relation between the elements to be checked.
    • HLS_CMP_EQ “equal to”
    • HLS_CMP_GT “greater than”
    • HLS_CMP_GE “greater or equal”
    • HLS_CMP_LT “less than”
    • HLS_CMP_LE “less or equal”
    • HLS_CMP_NE “not equal”


Performs the comparison between the elements of input images src and the input value and save the result indst.
If the comparison result is true, the corresponding element of dst is set to 255; else it is set to 0.
Image data must be stored in src, the image data of dst must be empty before invocations. Invoking this function will consume the data in src, and filling the image data of dst.
src and dstmust have the same size and number of channels.

OpenCV reference

cvCmpS, cv::compare