当前位置:网站首页>Code of "digital image processing principle and Practice (matlab version)" part2[easy to understand]
Code of "digital image processing principle and Practice (matlab version)" part2[easy to understand]
2022-07-07 21:25:00 【Full stack programmer webmaster】
Hello everyone , I meet you again , I'm the king of the whole stack .
Department of literature 《 Principle and practice of digital image processing (MATLAB edition )》 A Book of code series of Part2(P43~80), Please refer to the diagram of the original book for the code running results , It is recommended to read the following before downloading the code :
About 《 Principle and practice of digital image processing (MATLAB edition )》 A description of code publication
http://blog.csdn.net/baimafujinji/article/details/40987807
P44
i = imread(‘theatre.jpg’); i = rgb2gray(i); i = double(i);
out1 = log(1+i)/0.065; out2 = log(1+i)/0.035; out1(find(out1>255)) = 255; out2(find(out2>255)) = 255; out1 = uint8(out1); out2 = uint8(out2);
subplot(221), imshow(out1), title(‘image, p = 0.065’); subplot(222), imhist(out1), title(‘histgram, p = 0.065’); subplot(223), imshow(out2), title(‘image, p = 0.035’); subplot(224), imhist(out2), title(‘histgram, p = 0.035’);
P47
i = rgb2gray(imread(‘theatre.jpg’)); i = double(i); y1 = 255*(i/255).^2.5; y2 = 255*(i/255).^0.4; y1 = uint8(y1); y2 = uint8(y2); subplot(221), imshow(y1), title(‘p =2.5’); subplot(222), imhist(y1), title(‘p =2.5’); subplot(223), imshow(y2), title(‘p =0.4’); subplot(224), imhist(y2), title(‘p =0.4’);
P48
i = rgb2gray(imread(‘theatre.jpg’)); y1 = double(i); y1 = 255*(y1/255).^2.5; y2 = uint8(y1); y3 = imadjust(y2, [ ], [ ], 0.4); subplot(131), imshow(i), title(‘original image’); subplot(132), imshow(y2),title(‘power = 2.5’); subplot(133), imshow(y3),title(‘gamma = 0.4’);
P49
i = imread(‘theatre.jpg’); i = rgb2gray(i); i = double(i);
y1 = 1.5.^(i*0.070)-1; y2 = 1.5.^(i*0.050)-1; y1(find(y1>255)) = 255; y2(find(y2>255)) = 255; y1 = uint8(y1); y2 = uint8(y2);
subplot(221), imshow(y1), title(‘c=0.070’); subplot(222), imhist(y1), title(‘c=0.070’); subplot(223), imshow(y2), title(‘c=0.050’); subplot(224), imhist(y2), title(‘c=0.050’);
P52
i = imread(‘theatre.jpg’); i = rgb2gray(i); L = imadjust(i,[ ],[50/255;150/255]); J = imadjust(L,[50/255;150/255 ],[20/255;230/255]); subplot(221), imshow(L), title(‘low contrast’); subplot(222), imhist(L), title(‘low contrast’); subplot(223), imshow(J), title(‘gray stretch’); subplot(224), imhist(J), title(‘gray stretch’);
P54
i = rgb2gray(imread(‘theatre.jpg’)); LC = imadjust(i,[ ],[50/255;150/255]); figure(1), subplot(221), imshow(LC); title(‘low contrast’); figure(1),subplot(222), imhist(LC); title(‘low contrast’); HE1 = histeq(LC); figure(1), subplot(223), imshow(HE1); title(‘histogram equalization’); figure(1),subplot(224), imhist(HE1); title(‘histogram equalization’);
P56
img = rgb2gray(imread(‘theatre.jpg’)); img_ref = rgb2gray(imread(‘rpic.jpg’)); [hgram, x] = imhist(img_ref); J = histeq(img, hgram); subplot(2,3,1), imshow(img), title(‘original image’); subplot(2,3,4), imhist(img), title(‘original image’); subplot(2,3,2), imshow(img_ref), title(‘reference image’); subplot(2,3,5), imhist(img_ref), title(‘reference image’); subplot(2,3,3), imshow(J), title(‘output image’); subplot(2,3,6), imhist(J), title(‘output image’);
P64-1
I = imread(‘apostles.jpg’); I = double(I); B = zeros(size(I)); H = size(I); move_x = 100; move_y = 150; B(move_y + 1:H(1), move_x+1:H(2), 1:H(3))=… I(1:H(1)-move_y, 1:H(2) – move_x, 1:H(3)); subplot(1,2,1),subimage(uint8(I)) title(‘ Original image ’) subplot(1,2,2),subimage(uint8(B)) title(‘ Translation transformation ’);
P64-2
I = imread(‘apostles.jpg’); se=translate(strel(1),[150 100]); B = imdilate(I,se); figure; subplot(1,2,1),subimage(I); title(‘ Original image ’); subplot(1,2,2),subimage(B); title(‘ Translation transformation ’);
P66
I = imread(‘apostles.jpg’); [height, width, dim]=size(I); % Horizontal mirror transform tform = maketform(‘affine’,[-1 0 0;0 1 0; width 0 1]); B=imtransform(I, tform, ‘nearest’); % Vertical mirror transformation tform2 = maketform(‘affine’, [1 0 0; 0 -1 0; 0 height 1]); C=imtransform(I, tform2, ‘nearest’); subplot(1,3,1),imshow(I); title(‘ Original image ’); subplot(1,3,2),imshow(B); title(‘ Horizontal image ’); subplot(1,3,3),imshow(C); title(‘ Vertical image ’);
P67
A = imread(‘apostles.jpg’); A = double(A); figure(1), imshow(uint8(A)); H = size(A); figure(2),B(1:H(1),1:H(2),1:H(3))=A(H(1):-1:1,1:H(2),1:H(3));% Vertical mirror imshow(uint8(B)); figure(3),C(1:H(1),1:H(2),1:H(3))=A(1:H(1),H(2):-1:1,1:H(3));% Horizontal mirror imshow(uint8(C));
P69
I = imread(‘apostles.jpg’); tform = maketform(‘affine’,[0 1 0; 1 0 0; 0 0 1]);% Define transpose matrix B = imtransform(I, tform, ‘nearest’); subplot(1,2,1),imshow(I) title(‘ Original image ’); subplot(1,2,2),imshow(B) title(‘ Transpose the image ’);
P74
I = imread(‘C:\apostles.jpg’); A = imresize(I, 1.5, ‘nearest’); B = imresize(I, 1.5, ‘bilinear’); C = imresize(I, 1.5, ‘bicubic’); subplot(2,2,1), imshow(I), title(‘original’); subplot(2,2,2), imshow(A), title(‘nearest’); subplot(2,2,3), imshow(B), title(‘bilinear’); subplot(2,2,4), imshow(C), title(‘bicubic’);
P80
I = imread(‘apostles.jpg’); A = imrotate(I, 30, ‘nearest’);% rotate 30 degree , Nearest neighbor interpolation figure(1),imshow(A) B = imrotate(I, 45, ‘bilinear’,’loose’);% rotate 45 degree , Quadratic linear interpolation figure(2),imshow(B)
( Code release is not complete , Please wait …)
Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/116517.html Link to the original text :https://javaforall.cn
边栏推荐
- Codeforces Round #296 (Div. 2) A. Playing with Paper[通俗易懂]
- 私募基金在中國合法嗎?安全嗎?
- Alibaba cloud award winning experience: how to mount NAS file system through ECS
- Do you have to make money in the account to open an account? Is the fund safe?
- The new version of onespin 360 DV has been released, refreshing the experience of FPGA formal verification function
- What are the official stock trading apps in the country? Is it safe to use
- Arlo's troubles
- FTP steps for downloading files from Huawei CE switches
- HOJ 2245 浮游三角胞(数学啊 )
- Use camunda to do workflow design and reject operations
猜你喜欢

Intelligent software analysis platform embold
![[200 opencv routines] 223 Polygon fitting for feature extraction (cv.approxpolydp)](/img/1e/055df228853d9b464fc4bcbde0a7ee.png)
[200 opencv routines] 223 Polygon fitting for feature extraction (cv.approxpolydp)

Solve the problem of using uni app mediaerror mediaerror errorcode -5

An overview of the latest research progress of "efficient deep segmentation of labels" at Shanghai Jiaotong University, which comprehensively expounds the deep segmentation methods of unsupervised, ro

Codesonar Webinar
SQL injection error report injection function graphic explanation

Using enumeration to realize English to braille

Small guide for rapid formation of manipulator (12): inverse kinematics analysis

Magic weapon - sensitive file discovery tool

Demon daddy B3 read extensively in a small amount, and completed 20000 vocabulary+
随机推荐
Description of the difference between character varying and character in PostgreSQL database
2022年在启牛开中银股票的账户安全吗?
Focusing on safety in 1995, Volvo will focus on safety in the field of intelligent driving and electrification in the future
Differences and connections between MinGW, mingw-w64, tdm-gcc and other tool chains "suggestions collection"
MinGW MinGW-w64 TDM-GCC等工具链之间的差别与联系「建议收藏」
Intelligent transportation is full of vitality. What will happen in the future? [easy to understand]
Is it safe to open an account of BOC shares in kainiu in 2022?
特征生成
Demon daddy B2 breaks through grammar and completes orthodox oral practice
Make this crmeb single merchant wechat mall system popular, so easy to use!
恶魔奶爸 B3 少量泛读,完成两万词汇量+
margin 等高布局
Cocos2d-x game archive [easy to understand]
How to meet the dual needs of security and confidentiality of medical devices?
[paper reading] maps: Multi-Agent Reinforcement Learning Based Portfolio Management System
解决使用uni-app MediaError MediaError ErrorCode -5
Micro service remote debug, nocalhost + rainbow micro service development second bullet
Magic weapon - sensitive file discovery tool
Demon daddy B3 read extensively in a small amount, and completed 20000 vocabulary+
阿洛的烦恼