首頁 > 行業資訊

【水果識別】基于計算機視覺實現橙子數量識別含Matlab源碼

專題網友投稿2023-01-09A+A-

【水果識別】基于計算機視覺實現橙子數量識別含Matlab源碼

天天Matlab 天天Matlab
天天Matlab

TT_Matlab

博主簡介:擅長智能優化算法、神經網絡預測、信號處理、元胞自動機、圖像處理、路徑規劃、無人機等多種領域的Matlab仿真,完整matlab代碼或者程序定制加qq1575304183。

收錄于合集 #圖像處理matlab源碼 913個

1 簡介

在現實生活中成人識別水果是十分簡易的但對于幼兒來說在沒有實物之前是無法識別水果的,因此本文設計了一個簡易水果識別系統為幼兒在電子設備上識別水果提供可能.本文通過matlab GUI設計了一個水果識別系統界面并通過對水果圖像進行二值化處理,邊緣處理最后實現了橙子數量識別.

2 部分代碼

function [t,em] = otsuthresh(counts) %#codegen % OTSUTHRESH Global histogram threshold using Otsu ’s method - M-to-C codegen. % Copyright 2015 The MathWorks, Inc. % Syntax % ------ % % [t,em] = otsuthresh(counts) % % Input Specs % ----------- % % counts: % numeric % vector % real % finite % non-sparse % non-negative % % Output Specs % ------------ % % t: % scalar % double % in [0,1] % % em: % scalar % double % in [0,1] % % Validate counts validateattributes(counts,{’numeric’}, ... {’vector’,’real’,’finite’,’nonsparse’,’nonnegative’},mfilename,’COUNTS’); % Number of bins num_bins = numel(counts); % Number of elements num_elems = 0; for k = 1:num_bins num_elems = num_elems + double(counts(k)); end % CDF of the histogram omega = coder.nullcopy(zeros(num_bins,1)); omega(1) = double(counts(1))/num_elems; mu = coder.nullcopy(zeros(num_bins,1)); mu(1) = omega(1); for k = 2:num_bins % PDF p = double(counts(k))/num_elems; % CDF omega(k) = omega(k-1) + p; % "weighted" CDF mu(k) = mu(k-1) + p*k; end mu_t = mu(end); % Equation 18 in the paper sigma_b_squared = coder.nullcopy(zeros(num_bins,1)); maxval = -coder.internal.inf; for k = 1:num_bins sigma_b_squared(k) = (mu_t*omega(k) - mu(k))^2 / (omega(k)*(1-omega(k))); maxval = max(maxval,sigma_b_squared(k)); end % Find the location of the maximum value of sigma_b_squared. % If maxval is NaN, meaning that sigma_b_squared % is all NaN, then return 0. isfinite_maxval = isfinite(maxval); if isfinite_maxval % The maximum may extend over several bins, % so average together the locations. idx = double(0); num_maxval = double(0); for k = 1:num_bins idx = idx + k * double(sigma_b_squared(k) == maxval); num_maxval = num_maxval + 1 * double(sigma_b_squared(k) == maxval); end idx = idx / num_maxval; % Normalize the threshold to the range [0,1] t = (idx - 1) / (num_bins - 1); else t = 0; end % Compute the effectiveness metric if nargout > 1 if isfinite_maxval d = 0; for k = 1:num_bins d = d + double(counts(k))/num_elems * k^2; end em = maxval/(d - mu_t^2); else em = 0; end end

3 仿真結果

4 參考文獻

[1]陽江平. 基于計算機視覺的果蔬識別方法研究[D]. 大連理工大學.

博主簡介:擅長智能優化算法、神經網絡預測、信號處理、元胞自動機、圖像處理、路徑規劃、無人機等多種領域的Matlab仿真,相關matlab代碼問題可私信交流。

部分理論引用網絡文獻,若有侵權聯系博主刪除。

版權申明 以上內容由網友或網絡信息收集整理呈現,不代表本站立場和觀點!如對內容有疑問,請聯系cnmhg168@163.com,謝謝!下載內容僅供研究和學習使用,務必24小時刪除。

相關內容

相關內容

能化大數據平臺 ©2010-2022 All Rights Reserved.  
滬ICP備14007155號-3 網站地圖 化工熱詞舊版本
關于我們| 會員說明| 廣告合作| 聯系我們| 免責聲明| 投稿須知|

能源化工大數據平臺二維碼
在線客服
服務郵箱

服務郵箱

cnmhg168@163.com

微信咨詢
微信
返回頂部
X我的網站名稱

截屏,微信識別二維碼

微信號:anquanhun

(點擊微信號復制,添加好友)

  打開微信

微信號已復制,請打開微信添加咨詢詳情!
亚洲美女对大黑_久久夜色撩人精品国产_精品一区二区在线播放_香蕉久久人人97超碰CAOPROEN