当前位置:网站首页>Matlab底层源代码实现Halcon scale_image_range(可用于背景分割)
Matlab底层源代码实现Halcon scale_image_range(可用于背景分割)
2022-07-15 10:15:00 【手写不期而遇】
matlab源代码实现halcon中scale_image_range算子,此算子常见于图像的预处理功能,可用于将图像的背景与前景的对比度增加,有利于下一步图像阈值分割。
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%scale_image_range
%Author:Zhu
%时间:2022.6
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clc;
image = imread("F:\\fabrik.png");
image_matrix=image(:,:,1);
image_matrix=double(image_matrix);
[height,width,channels]=size(image);
image_out = zeros(height,width);
lowValue = 10;
highValue = 70;
for i=1:height
for j=1:width
if(image_matrix(i,j)<lowValue)
image_out(i,j) = 0;
elseif(image_matrix(i,j)>highValue)
image_out(i,j) = 255;
else
image_out(i,j)=(image_matrix(i,j)-lowValue)*255/(highValue-lowValue);
end
end
end
%显示图像
image_out = uint8(image_out);
subplot(1,2,1);
imshow(image);
subplot(1,2,2);
imshow(image_out);
Halcon算子
scale_image_range (Image, ImageScaled, 10, 70)
实现效果
Matlab效果
Halcon实现效果
边栏推荐
- [source code] what is the difference between ArrayList and vector, and the difference of expansion multiple
- 018. A shielding sensitive vocabulary made by proxy mode knot and filter
- 【C语言】进阶指针night
- Q3 qmainwindow menu bar and toolbar
- 001一个内部类的实例拿到所在外部类的实例(反射)
- [Huang ah code] Introduction to MySQL - 3. I use select *, and the boss directly rushed me home by train, but I still bought a station ticket
- Full link voltage testing experience of software testing technology (Part 2)
- MFC file reading and writing based on a single document
- This is the most detailed arrangement of the basic knowledge of network workers in the whole network, and there is no one
- Room:又要写业务代码了?看看我吧,给你飞一般的感觉!
猜你喜欢

029.文件的复制和移动

分布式概率SLAM图中的增量抽象

034. Code rollback reset current branch to here

002 descendant selector

Technical implementation details of SAP e-commerce cloud Spartacus UI sitecontextrouteshandler
![[source code] implementation principle of HashSet](/img/6e/4cc6e4fffd0d6802a8338286a558d5.png)
[source code] implementation principle of HashSet
![[JMeter] win10 download and install JMeter 5.5](/img/92/9654d32eada08f33db43f7c45e8be1.png)
[JMeter] win10 download and install JMeter 5.5

kali安装Nessus

浅谈 Slack Channel 支持的一些提高工作效率的特性

这可是全网网工基础知识最详细的整理,没有之一
随机推荐
C language family tree management system
Full link voltage testing experience of software testing technology (Part 2)
[step on the pit column] solve the problem that the idea plug-in cannot be found
[source code] what is the difference between ArrayList and vector, and the difference of expansion multiple
Mark art data collection platform is heavily launched!
LeetCode - 两数相加
001 an instance of an internal class gets an instance of its external class (reflection)
[leetcode] day100 color classification
大家有没有遇到过flink-oracle-cdc 获取最新的日志 卡住的情况?怎么解决?
C language Beijing Winter Olympics competition ranking system
I want to open a futures account. Where is it convenient and safe to open an account?
C语言家族树管理系统
Working sql: it is required that the average number of awards cannot be displayed by ranking
There are certificates and directories! | Haitai password service platform
Guys, the capture delay of flick CDC Oracle is particularly high. Is there any optimization method
[MySQL - Basic] multi table query
The first day of three daily questions in Luogu
不同类型的印刷机作用
[kapok] Summer Challenge # Hongmeng small game project Sudoku
Room:又要写业务代码了?看看我吧,给你飞一般的感觉!