Upload Code
loading-left
loading loading loading
loading-right

Loading

Profile
No self-introduction
codes (8)
digital image processing
4.0
#Include # include # include # include using namespace STD; using namespace CV; int main() {/ / image reading mat image = imread & quot; D / PS/ meiyuan.png" ;); / / judge whether there is a problem in image reading, if (! image.data ){cout & lt; & lt; & quot; image read is error! & quot; & lt; & lt; endl; return 0;} / / output cout & lt; & lt; & lt; & quot; image basic information Info:Height :" < < image.size ().height << " Width:" << image.size (). Width & lt; & lt; endl; / / the original image displays namedwindow (& quot; original image & quot;); imshow (& quot; original image & quot;, image); imwrite (& quot; original image & quot;); original.jpg" ;, image); / / process image mat image_ tmp = image.clone ();int nl = image.rows ;int nc = image.cols * image.channels (); / / actual column if( image.isContinuous ()){nc = nc * nl;nl = 1;}
wei...
2019-03-21
2
1
Digital image processing and filtering
no vote
#Include # include # including namespace STD; using namespace CV; mat image; / / input image matrix mat fimagefft; / / fast Fourier transform of image point maxloc; / / coordinates of maximum Fourier spectrum int radius = 50; / / truncation frequency const int Max_ Radius = 100; int Bandwid = 40; / / bandwidth const int Max_ Bandwid = 50; / / max bandwidth mat bpfilter; / / band pass filter int bptype = 0; / / band pass filter type const int Max_ BPTYPE = 2;Mat fImageFFT_ Bpfilter; / / band pass Fourier transform mat fimagefft_ bpFilter_ Spectrum; / / Fourier spectrum of bandpass Fourier transform
wei...
2018-05-31
1
1
Handwritten pattern recognition based on template matching
no vote
Based on template matching, Euclidean distance is used to recognize the written numbers 0 to 9
wei...
2018-05-31
1
1
Digital image processing Fourier transform
no vote
#Include & nbsp;? Including using namespace CV; using namespace STD; / / fast Fourier transform void FFT 2image (inputarray_ src, OutputArray _ DST) {/ / get mat type mat SRC =_ src.getMat (); / / get matrix / / judge bit depth CV_ Assert( src.type () == CV_ 32FC1 || src.type () == CV_ 64FC1);CV_ Assert( src.channels () == 1 || src.channels () == 2);
wei...
2018-05-03
1
1
Image fusion in digital image processing
no vote
#include#includeusing namespace cv;using namespace std;int main() {Mat src1, src2, dst;src1 = imread("D:/ps/ one.jpg" ;);if (!src1.data) {cout << "could not found the image" << endl;return -1;}src2 = imread("D:/ps/ two.jpg" ;);if (!src2.data) {cout << "could not found the image" << endl; return -1;}double alpha = 0.39;
wei...
2018-04-06
0
1
Digital image color inversion
no vote
#include  #include  using namespace std;using namespace cv;int main(){Mat image, gray,dst;      image = imread("D:/ps/fly_ .jpg"); if (! image.data ){& nbsp; cout & lt; & lt; & quot; could not find & quot; & lt; & lt; endl; & nbsp; return - 1; & nbsp;} & nbsp; namedwindow (& quot; original picture & quot;); & nbsp; imshow (& quot; original picture & quot;, image); & nbsp; cvtcolor (image, gray, CV)_ Bgr2gray); & nbsp; namedwindow (& quot; grayscale & quot;); & nbsp; imshow (& quot; grayscale & quot;, gray); & nbsp; int rows= gray.rows ; int cols = gray.cols ;// int channel = image.channels ();//   dst.create ( image.size (), image.type ());
wei...
2018-04-05
1
1
Digital image processing increases brightness and contrast
no vote
#include#includeusing namespace cv;int main() {Mat src,dst;src = imread("D:/ps/ circle.png" ;);int rows = src.rows ;int cols = src.cols ;float alpht = 1.8;float bea = 50;dst = Mat::zeros( src.size (), src.type ());for (int row = 0; row < rows; row++) {for (int col = 0; col < cols; col++) {int b = src.at (row, col)[0];int g = src.at (row, col)[1];int r = src.at (row, col)[2]; dst.at (row, col)[0] = saturate_ cast(alpht*b + bea); dst.at (row, col)[1] = saturate_ cast(alpht*g + bea); dst.at (row, col)[2] = saturate_ cast(alpht*r + bea);}}namedWindow("s", CV_ WINDOW_ AUTOSIZE);namedWindow("d", CV_ WINDOW_ AUTOSIZE);imshow("s", src);imshow("d", dst);waitKey(0);r
wei...
2018-04-05
0
1
digital image processing
no vote
#Include # include using namespace CV; using namespace STD; int main() {mat image, SRT, DST; / / original image, global equalization, local equalization image = imread & quot; D / PS / a.tif & quot;); / / load original image if (! image.data ){STD:: cout & lt; & lt; & quot; please make sure there is a picture under the path & quot;; return - 1;} cvtcolor (image, image, color_ Bgr2gray); / / convert the original image to 8-bit gray image equalizehist (image, SRT); ptrclahe = creaeclahe (2.0, size (8,8)); CLAHE - & gt; apply (image, DST); namedwindow & quot; original image & quot;, CV_ WINDOW_ Autosize; & namedwindow; global equalization & quot;, CV_ WINDOW_ Autosize; & namedwindow; local equalization & quot;, CV_ WINDOW_ Autosize); & quot; imshow (& quot; original & quot;, image); imshow (& quot; global equalization & quot;, SRT); / * vector BGR; split (image, BGR); PTR CLAHE = creaeclahe(); CLAHE - & gt; apply (BGR [0], BGR [0]); / / color CLAHE - & gt; apply (BGR [1], BGR [1]); CLAHE - & gt; apply (BGR [2], BGR [2]); matris;
wei...
2018-04-02
0
1
No more~