I am wondering if someone can help advise on the following issue I have, although the question is specific to the opencv image processing crate. I have been trying for a few hours to save an image using the imwrite function below.
In C++ I can just pass in the destination file name e.g. "image.jpg" along with the Mat object. The 3rd argument for parameters is optional in C++ and I usually don't specify anything.
When I use this function in Rust the compiler tells me that I need to specify all 3 options. I don't need to specify any parameters for my program, but I am willing to do so to satisfy the Rust compiler. The trouble is I do not know how to specify a "VectorOfInt" or what format this would take.
I am hoping someone with good Rust coding knowledge can help out even if they are not familiar with OpenCV. The crate documentation does not seem to have any examples where an image is saved that I could learn from.
My code snip:
imgcodecs::imwrite(&filename, &frame, VectorOfint - not sure here )?;
pub fn imwrite(filename: &str, img: &Mat, params: &VectorOfint) -> Result<bool>
- filename: Name of the file.
- img: Image to be saved.
- params: Format-specific parameters encoded as pairs (paramId_1, paramValue_1, paramId_2, paramValue_2, ... .) see cv::ImwriteFlags