I want to implement a similar function as shown below using the opencv.
image=double(imread('mask.jpg'));
I have implemented something like this.How to convert this into double.
cv::Mat image= imread(arg[1]);
where arg[1]
contains my image which is to be stored in Mat
image as double. How to implement this.
OpenCV-Python uses the addWeighted() function to blend images. The function and its parameters are as follows. src1- first input array. alpha- weight of the first array elements.
OpenCV offers support for the image formats Windows bitmap (bmp), portable image formats (pbm, pgm, ppm) and Sun raster (sr, ras).
The addWeighted function is a function that helps in adding two images and also blending those by passing the alpha, beta and gamma values. In order to analyse images, this helps in adjusting the gradients and in the processing of the image.
Vec3b is the abbreviation for "vector with 3 byte entries" Here those byte entries are unsigned char values to represent values between 0 .. 255.
You're looking for Mat::convertTo()
.
For gray-scale image:
image.convertTo(image, CV_64FC1);
For color image:
image.convertTo(image, CV_64FC3); // or CV_64FC4 for 4-channel image
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With