[][src]Function opencv::core::hconcat2

pub fn hconcat2(
    src1: &dyn ToInputArray,
    src2: &dyn ToInputArray,
    dst: &mut dyn ToOutputArray
) -> Result<()>

Applies horizontal concatenation to given matrices.

The function horizontally concatenates two or more cv::Mat matrices (with the same number of rows).

   cv::Mat matArray[] = { cv::Mat(4, 1, CV_8UC1, cv::Scalar(1)),
                           cv::Mat(4, 1, CV_8UC1, cv::Scalar(2)),
                           cv::Mat(4, 1, CV_8UC1, cv::Scalar(3)),};
 
   cv::Mat out;
   cv::hconcat( matArray, 3, out );
   //out:
   //[1, 2, 3;
   // 1, 2, 3;
   // 1, 2, 3;
   // 1, 2, 3]

Parameters

  • src: input array or vector of matrices. all of the matrices must have the same number of rows and the same depth.
  • nsrc: number of matrices in src.
  • dst: output array. It has the same number of rows and depth as the src, and the sum of cols of the src.

See also

cv::vconcat(const Mat*, size_t, OutputArray), cv::vconcat(InputArrayOfArrays, OutputArray) and cv::vconcat(InputArray, InputArray, OutputArray)

Overloaded parameters

  cv::Mat_<float> A = (cv::Mat_<float>(3, 2) << 1, 4,
                                                 2, 5,
                                                 3, 6);
  cv::Mat_<float> B = (cv::Mat_<float>(3, 2) << 7, 10,
                                                 8, 11,
                                                 9, 12);

  cv::Mat C;
  cv::hconcat(A, B, C);
  //C:
  //[1, 4, 7, 10;
  // 2, 5, 8, 11;
  // 3, 6, 9, 12]
  • src1: first input array to be considered for horizontal concatenation.
  • src2: second input array to be considered for horizontal concatenation.
  • dst: output array. It has the same number of rows and depth as the src1 and src2, and the sum of cols of the src1 and src2.