Skip to content

Commit 3d192bf

Browse files
authored
Fix passing parameters to cv::imencode for OpenCV 4.7 (#207)
1 parent 5dfab6a commit 3d192bf

File tree

1 file changed

+1
-1
lines changed
  • compressed_depth_image_transport/src

1 file changed

+1
-1
lines changed

compressed_depth_image_transport/src/codec.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,6 @@ sensor_msgs::msg::CompressedImage::SharedPtr encodeCompressedDepthImage(
219219

220220
// Compression settings
221221
std::vector<int> params;
222-
params.resize(3, 0);
223222

224223
// Bit depth of image encoding
225224
int bitDepth = enc::bitDepth(message.encoding);
@@ -236,6 +235,7 @@ sensor_msgs::msg::CompressedImage::SharedPtr encodeCompressedDepthImage(
236235
compressed->format += "; compressedDepth " + format;
237236

238237
// Check input format
238+
params.reserve(2);
239239
params[0] = cv::IMWRITE_PNG_COMPRESSION;
240240
params[1] = png_level;
241241

0 commit comments

Comments
 (0)