煤矸双能X射线透射图像物质属性R值计算方法

R值图像的计算表达为:

Snipaste_2024-04-16_20-06-36.png

式中:fl0(x,y)为空皮带低能区图像;fl(x,y)为物料在皮带上低能区图像;fh0(x,y)为空皮带高能区图像;fh(x,y)为物料在皮带上高能区图像;R(x,y)为计算得到的R值图像。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
clc 
clear all;
%读取高低能图像
High_im = imread('C:\Users\雷子\Desktop\桌面文件\SVMDW\2020_8_20_9_46_22_303_H.bmp');
Low_im = imread('C:\Users\雷子\Desktop\桌面文件\SVMDW\2020_8_20_9_46_22_303_L.bmp');

High_im = High_im(1:1000,50:1000);
Low_im = Low_im(1:1000,50:1000);
figure(1),subplot(1,2,1),imshow(High_im);
subplot(1,2,2),imshow(Low_im);
%计算二值化图像
thersh_H = graythresh(High_im);
thersh_L = graythresh(Low_im);
High_im_bw = im2bw(High_im,thersh_H);
Low_im_bw = im2bw(Low_im,thersh_L);

High_im_bw = ~High_im_bw;
Low_im_bw = ~Low_im_bw ;
High_im_bw = bwareaopen(High_im_bw,50);
Low_im_bw = bwareaopen(Low_im_bw,50);
figure(2),subplot(1,2,1),imshow(High_im_bw);
subplot(1,2,2),imshow(Low_im_bw);

Low_im_nobord = imclearborder(High_im_bw,4);
seD = strel('diamond',1);
BWfinal = imerode(Low_im_nobord,seD);

BWfinal= bwareaopen(BWfinal,50);
figure(3),imshow(BWfinal);
%无背景灰度图像
HD= High_im .* uint8(BWfinal);
[m,n] = size(High_im);
for i = 1:m
for j=1:n
if HD(i,j)==0
HD(i,j)=255;
end
end
end
figure,imshow(HD,[0,255]);
% 空皮带高低能图像矩阵的构建
em_H = double(High_im.*(0)) +mean(mean(High_im(100:200,50:100)));
em_L = double(Low_im.*(0)) +mean(mean(Low_im(100:200,50:100)));
% em_H = double(High_im.*(0)) +194.8929;
% em_L = double(Low_im.*(0)) +194.7365;
figure,imshow(High_im(100:200,50:100));

R_im=(log(double(em_L) ./ double(Low_im)) ) ./ (log(double(em_H) ./ double(High_im)));

%掩膜处理提取目标区域R值图像
R_im_f = R_im .* BWfinal;
% figure(5),imshow(R_im_f,[1,1.2]);
for i = 1:m
for j=1:n
if R_im_f(i,j)==0
R_im_f(i,j)=255;
end
end
end
figure,imshow(R_im_f,[0,2]);
%未穿透区域R值置10
R_im_f(find(isnan(R_im_f)==1)) = 10;
R_im_f(find(isinf(R_im_f)==1)) = 10;

figure,imagesc(uint8(R_im_f),[0,2]);colorbar
colormap jet ;

原图像:

Snipaste_2024-04-16_20-08-50.png

OTSU阈值分割后图像:

Snipaste_2024-04-16_20-09-16.png

无背景的灰度图像:

Snipaste_2024-04-16_20-20-15.png

两图像相除结果:

Snipaste_2024-04-16_20-23-59.png

删除背景:

Snipaste_2024-04-16_20-25-20.png

矸石中间区域存在无法穿透区域,呈现出白色。