当前位置:网站首页>[image detection] image target size measurement system based on morphology with matlab code
[image detection] image target size measurement system based on morphology with matlab code
2022-06-26 06:54:00 【Matlab scientific research studio】
1 brief introduction
This paper introduces a kind of object appearance dimension detection system based on machine vision technology ., The longitudinal diameter of grapefruit was obtained by digital image processing technology , Transverse diameter , Surface area and other appearance dimension parameters .
2 Part of the code
coin_width=1.1000;coin_height=1.1000;I=imread('666.jpg');figure(1),imshow(I);title(' Original image ');% Convert to grayscale imageI1=rgb2gray(I);%figure(2);imshow(I1);title(' Grayscale image ');sigma = 1;gausFilter=fspecial('gaussian',[5 5],sigma);I2= imfilter(I1, gausFilter, 'replicate');%figure(2);imshow(I2);title(' Gaussian filtered image ');ength/coin_height;pixels_width_rate=width/coin_width;:num[r c]=find(labelpic==v);[rectx,recty,area,perimeter]=minboundrect(c,r,'p');[length width] = minboxing(rectx(1:end-1),recty(1:end-1));% Draw the target detection boxline(rectx,recty,'color','y','linewidth',2);midpointx(1)=(rectx(1)+rectx(2))/2;midpointx(2)=(rectx(3)+rectx(4))/2;midpointx(3)=(rectx(2)+rectx(3))/2;midpointx(4)=(rectx(4)+rectx(1))/2;midpointy(1)=(recty(1)+recty(2))/2;midpointy(2)=(recty(3)+recty(4))/2;midpointy(3)=(recty(2)+recty(3))/2;midpointy(4)=(recty(4)+recty(1))/2;% Draw the line between the midpoint of the length and width of the targetline(midpointx,midpointy,'color','m','linewidth',2);target_float_length=length/pixels_length_rate;target_length=num2str(target_float_length);target_float_width=width/pixels_width_rate;target_width=num2str(target_float_width);% Display the length and width information of the target objectif((rectx(2)-rectx(1))<=(recty(2)-recty(1)))text(midpointx(1),midpointy(1)-10,target_length,'Color','white');text(midpointx(3)+10,midpointy(3),target_width,'Color','white');elsetext(midpointx(1),midpointy(1)-10,target_width,'Color','white');text(midpointx(3)+10,midpointy(3),target_length,'Color','white');endend
3 Simulation results

4 reference
[1] Wang Juan , Zhoujinzhi . be based on Matlab Research on morphological image processing based on [J]. Modern communication : The second half of the month , 2010.
About bloggers : Good at intelligent optimization algorithms 、 Neural networks predict 、 signal processing 、 Cellular automata 、 The image processing 、 Path planning 、 UAV and other fields Matlab Simulation , relevant matlab Code problems can be exchanged by private letter .
Some theories cite network literature , If there is infringement, contact the blogger to delete .
边栏推荐
- SQL基础
- NumPy学习挑战第四关-NumPy数组属性
- vs code 使用 prettier 格式化 js 的时候, 函数定义的名称和括号之间有一个空格, 而 eslit 又不允许这个空格.
- China imported wine circulation and investment market survey and Future Development Trend Outlook report 2022-2027
- js-下载图片
- Unsatisfied dependency expressed through field ‘baseMapper‘; nested exceptio
- Vulnerability discovery - API interface service vulnerability probe type utilization and repair
- PyTorch搭建CNN-LSTM混合模型实现多变量多步长时间序列预测(负荷预测)
- LabVIEW Arduino TCP/IP远程智能家居系统(项目篇—5)
- What is data mining?
猜你喜欢

【路径规划】基于改进人工势场实现机器人路径规划附matlab代码

I have been testing at Tencent for several years

Open source demo| you draw and I guess -- make your life more interesting

Mysql操作数据库
![[micro service series] protocol buffer dynamic analysis](/img/86/357d55c77cc67d6413af2de59bf395.png)
[micro service series] protocol buffer dynamic analysis

二叉树中和为某一值的路径(一)(二)(三)(剑指offer)

Mysql delete in 不走索引的

Load balancer does not have available server for client: userService问题解决

海量日志采集工具——Flume

Bugku练习题---MISC---富强民主
随机推荐
Simple use of enum type in TS
STM 32 uses cube to generate Tim to trigger ADC and transmit through DMA
What is deadlock
“试用期避免被辞退“ 指南攻略
Get the first and last days of the current month, and the first and last days of the previous month
On a classical problem
Operation mode and investment planning report of China's financial warehousing industry during the "14th five year plan" period 2022-2027
Go language learning notes 1.2- variables
解决新版谷歌Chrome浏览器Cookie跨域失效问题
[golang] time related
LabVIEW Arduino TCP/IP遠程智能家居系統(項目篇—5)
OCA安全联盟(CyberSecurity Mesh)
Promise API for getting started with the web
Bugku exercise ---misc--- prosperity, strength and democracy
Live broadcast Preview - fire safety instructor training "cloud class" is about to start!
SecureCRT运行SparkShell 删除键出现乱码的解法
Kotlin Compose 状态恢复 rememberSaveable 与 remember
How to choose securities companies for stock speculation? Is it safe to open a mobile account?
Spark3.3.0 source code compilation supplement - Crazy certificate problem
Differences, advantages and disadvantages between synchronous communication and asynchronous communication