Opencv.h¶
Go to the source code of this file.
Shows an example of processing images using the OpenCV library and inspecting them.
This is an explanation of the ExampleClsRuntimeOpencv.cpp file, which is excluded from the build in the Examples project. This source file is the OpenCV version of ExampleClsRuntime.cpp. The Examples project provided does not include the OpenCV library. Therefore, it is excluded from the build and does not cover how to load the OpenCV library in the project settings.
Load Image¶
You can load images using the imread function of OpenCV. Check the height, width, and channel information of the image.
201 202 203 204 205 206 207 208 209 210 | |
Next, set the image flag value to input to the Infer function.
- First, the channel order of OpenCV is BGR.
- If the number of channels is 3, add the SAIGE_IMAGE_COLOR flag.
- If the number of channels is 4, add the SAIGE_IMAGE_COLOR and SAIGE_IMAGE_ALPHA flags.
- If it is a 16-bit image, add the SAIGE_IMAGE_16BIT flag.
211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 | |
Call Infer Function¶
Use the data member of cv::Mat to input the image data. After that, everything is the same, and you can visualize the result using OpenCV functions instead of the visualization function of the utility function.
236 237 238 239 240 241 242 243 | |