CN110310274B - Plant flower number detection method - Google Patents

Plant flower number detection method Download PDF

Info

Publication number
CN110310274B
CN110310274B CN201910588019.5A CN201910588019A CN110310274B CN 110310274 B CN110310274 B CN 110310274B CN 201910588019 A CN201910588019 A CN 201910588019A CN 110310274 B CN110310274 B CN 110310274B
Authority
CN
China
Prior art keywords
image
threshold
component
standard deviation
calculating
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910588019.5A
Other languages
Chinese (zh)
Other versions
CN110310274A (en
Inventor
袁洪波
程曼
蔡振江
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hebei Agricultural University
Original Assignee
Hebei Agricultural University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hebei Agricultural University filed Critical Hebei Agricultural University
Priority to CN201910588019.5A priority Critical patent/CN110310274B/en
Publication of CN110310274A publication Critical patent/CN110310274A/en
Application granted granted Critical
Publication of CN110310274B publication Critical patent/CN110310274B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10024Color image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20024Filtering details
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20048Transform domain processing
    • G06T2207/20056Discrete and fast Fourier transform, [DFT, FFT]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20112Image segmentation details
    • G06T2207/20132Image cropping
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30242Counting objects in image

Abstract

The invention discloses a method for detecting the number of plant flowers, which comprises the following steps: A. extracting a red component R and a blue component B from the RGB image, then carrying out enhancement processing on the image components, and subtracting the enhanced red component R and the enhanced blue component B to obtain a gray level image R-B; B. calculating the mean value and standard deviation of all non-0 elements in the grayscale image R-B and a Threshold value Threshold; C. the R-B image is transformed according to a transformation Threshold, the elements smaller than the Threshold are assigned to 0, and the values of the elements larger than the Threshold are unchanged. Then, performing opening and closing operation on the transformed image, and calculating the average area meanArea of a connected region of the transformed image; D. and carrying out filtering processing according to the meanArea, wherein the number of the residual connected areas after the filtering processing is the number of the flowers. The invention can improve the defects of the prior art, has higher identification precision and can realize online real-time detection.

Description

Plant flower number detection method
Technical Field
The invention relates to the technical field of image processing, in particular to a method for detecting the number of plant flowers.
Background
The detection of the number of plant flowers in an actual environment is complex, and currently, two main methods are used: one is a detection method based on image processing, such as flower recognition by color features of RGB images, or flower detection by morphological features. The identification of the flower by using the color and the morphological characteristics usually needs to set an extraction threshold, and the final identification effect is determined to a great extent by whether the threshold value is proper or not; this method is fast in detection but relatively low in accuracy. The other method is to detect the plant flowers by machine learning, which generally has high requirements on the configuration of a computer, and needs a large number of samples to train for a long time, so that real-time detection is difficult to achieve.
Disclosure of Invention
The invention aims to provide a method for detecting the number of plant flowers, which can overcome the defects of the prior art, has high identification precision and can realize online real-time detection.
In order to solve the technical problems, the technical scheme adopted by the invention is as follows.
A method for detecting the number of plant flowers comprises the following steps:
A. extracting a red component R and a blue component B from the RGB image, then carrying out enhancement processing on the image components, and subtracting the enhanced red component R and the enhanced blue component B to obtain a gray level image R-B;
B. calculating the mean value and standard deviation of all non-0 elements in the grayscale image R-B and a Threshold value Threshold;
C. converting the R-B image according to a conversion Threshold value Threshold, assigning the value of an element smaller than the Threshold value to be 0, and keeping the value of an element larger than the Threshold value unchanged; then, performing opening and closing operation on the transformed image, and calculating the average area meanArea of a connected region of the transformed image;
D. and carrying out filtering processing according to the meanArea, wherein the number of the residual connected areas after the filtering processing is the number of the flowers.
Preferably, in step a, the enhancement processing of the image component comprises the steps of,
a1, solving a histogram of the image component, establishing a mapping function of the histogram and the original image component, and calculating the mean value and standard deviation of the brightness and the color saturation;
a2, respectively calculating two groups of image segmentation points according to brightness and color saturation, and respectively shearing the histogram by using the two groups of image segmentation points;
a3, carrying out weighted average on the distribution functions of the overlapped parts of the histogram regions obtained by the two cuts;
and A4, recombining the histogram area, and then obtaining the enhanced image component according to the mapping function of the histogram and the original image component.
Preferably, in step a2, the image segmentation points are calculated by,
the luminance image is divided into a plurality of points,
Figure BDA0002115119030000041
a point of color saturation division is determined,
Figure BDA0002115119030000022
wherein μ is a brightness average, μ ' is a color saturation average, σ is a brightness standard deviation, σ ' is a color saturation standard deviation, and k ' are weight coefficients, respectively.
Preferably, in step B, the switching Threshold is calculated according to the following formula,
Figure BDA0002115119030000023
wherein μ and σ represent the non-0 element mean and standard deviation, pixel, of R _ B, respectivelyi,jRepresenting non-0 elements, i and j respectively representing the ith row and the jth column of the matrix corresponding to the image R _ B; size (R _ B,1) and size (R _ B,2) represent the number of rows and columns of the matrix corresponding to the image R _ B, respectively.
Preferably, in the step D, the filtering process includes the steps of,
d1, converting the pixel points of the connected region into corresponding frequency values, and carrying out Fourier transform on the frequency values;
d2, establishing intensity distribution functions of different frequency bands, and changing the intensity distribution functions into normal distribution through linear transformation;
d3, deleting the region outside the (mu-3 sigma, mu +3 sigma) interval; mu is the mean value of normal distribution, and sigma is the standard deviation of normal distribution;
and D4, obtaining the processed connected region image through inverse Fourier transform.
Preferably, the connected component image obtained in step D4 is subjected to a grayscale smoothing process.
Adopt the beneficial effect that above-mentioned technical scheme brought to lie in: the method provided by the invention has the advantages that the conversion threshold value is dynamically variable, and the detection and identification precision is higher; compared with a machine learning method, the method provided by the invention has higher calculation speed and can realize online real-time detection.
Drawings
Fig. 1 is a schematic diagram of the present invention.
Fig. 2 is an original image taken in the first set of experiments.
Fig. 3 is a first set of experimentally captured images after original image processing.
Fig. 4 is an original image of the second set of experimental shots.
Fig. 5 is an image of the second set of experimental shots after the original image processing.
Detailed Description
Referring to fig. 1, one embodiment of the present invention includes the steps of:
A. extracting a red component R and a blue component B from the RGB image, then carrying out enhancement processing on the image components, and subtracting the enhanced red component R and the enhanced blue component B to obtain a gray level image R-B;
B. calculating the mean value and standard deviation of all non-0 elements in the grayscale image R-B and a Threshold value Threshold;
C. converting the R-B image according to a conversion Threshold value Threshold, assigning the value of an element smaller than the Threshold value to be 0, and keeping the value of an element larger than the Threshold value unchanged; then, performing opening and closing operation on the transformed image, and calculating the average area meanArea of a connected region of the transformed image;
D. and carrying out filtering processing according to the meanArea, wherein the number of the residual connected areas after the filtering processing is the number of the flowers.
In step a, the enhancement processing of the image component includes the steps of,
a1, solving a histogram of the image component, establishing a mapping function of the histogram and the original image component, and calculating the mean value and standard deviation of the brightness and the color saturation;
a2, respectively calculating two groups of image segmentation points according to brightness and color saturation, and respectively shearing the histogram by using the two groups of image segmentation points;
a3, carrying out weighted average on the distribution functions of the overlapped parts of the histogram regions obtained by the two cuts;
and A4, recombining the histogram area, and then obtaining the enhanced image component according to the mapping function of the histogram and the original image component.
In step a2, the image segmentation points are calculated by,
the luminance image is divided into a plurality of points,
Figure BDA0002115119030000041
a point of color saturation division is determined,
Figure BDA0002115119030000042
wherein μ is a brightness average, μ ' is a color saturation average, σ is a brightness standard deviation, σ ' is a color saturation standard deviation, and k ' are weight coefficients, respectively.
In step B, a switching Threshold is calculated according to the following formula,
Figure BDA0002115119030000051
wherein μ and σ represent the non-0 element mean and standard deviation, pixel, of R _ B, respectivelyi,jRepresenting non-0 elements, i and j respectively representing the ith row and the jth column of the matrix corresponding to the image R _ B; size (R _ B,1) and size (R _ B,2) represent the number of rows and columns of the matrix corresponding to the image R _ B, respectively.
In step D, the filtering process includes the following steps,
d1, converting the pixel points of the connected region into corresponding frequency values, and carrying out Fourier transform on the frequency values;
d2, establishing intensity distribution functions of different frequency bands, and changing the intensity distribution functions into normal distribution through linear transformation;
d3, deleting the region outside the (mu-3 sigma, mu +3 sigma) interval; mu is the mean value of normal distribution, and sigma is the standard deviation of normal distribution;
and D4, obtaining the processed connected region image through inverse Fourier transform, and then performing gray level smoothing processing.
Referring to fig. 2-5, the present invention can rapidly and accurately identify the number of flowers of a plant.
In the description of the present invention, it is to be understood that the terms "longitudinal", "lateral", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", and the like, indicate orientations or positional relationships based on those shown in the drawings, are merely for convenience of description of the present invention, and do not indicate or imply that the referenced devices or elements must have a particular orientation, be constructed and operated in a particular orientation, and thus, are not to be construed as limiting the present invention.
The foregoing shows and describes the general principles and broad features of the present invention and advantages thereof. It will be understood by those skilled in the art that the present invention is not limited to the embodiments described above, which are described in the specification and illustrated only to illustrate the principle of the present invention, but that various changes and modifications may be made therein without departing from the spirit and scope of the present invention, which fall within the scope of the invention as claimed. The scope of the invention is defined by the appended claims and equivalents thereof.

Claims (2)

1. A method for detecting the number of plant flowers is characterized by comprising the following steps:
A. extracting a red component R and a blue component B from the RGB image, then carrying out enhancement processing on the image components, and subtracting the enhanced red component R and the enhanced blue component B to obtain a gray level image R-B;
the enhancement processing of the image component comprises the steps of,
a1, solving a histogram of the image component, establishing a mapping function of the histogram and the original image component, and calculating the mean value and standard deviation of the brightness and the color saturation;
a2, respectively calculating two groups of image segmentation points according to brightness and color saturation, and respectively shearing the histogram by using the two groups of image segmentation points;
the method for calculating the image segmentation points is that,
the luminance image is divided into a plurality of points,
Figure FDA0003218955280000011
a point of color saturation division is determined,
Figure FDA0003218955280000012
wherein mu is a brightness average value, mu ' is a color saturation average value, sigma is a brightness standard deviation, sigma ' is a color saturation standard deviation, and k ' are weight coefficients respectively;
a3, carrying out weighted average on the distribution functions of the overlapped parts of the histogram regions obtained by the two cuts;
a4, recombining the histogram area, and then obtaining an enhanced image component according to the mapping function of the histogram and the original image component;
B. calculating the mean value and standard deviation of all non-0 elements in the grayscale image R-B and a Threshold value Threshold;
C. converting the R-B image according to a conversion Threshold value Threshold, assigning the value of an element smaller than the Threshold value to be 0, and keeping the value of an element larger than the Threshold value unchanged; then, performing opening and closing operation on the transformed image, and calculating the average area meanArea of a connected region of the transformed image;
D. filtering according to the meanArea, wherein the number of the residual connected areas after filtering is the number of the flowers;
the filtering process includes the steps of performing a filtering process,
d1, converting the pixel points of the connected region into corresponding frequency values, and carrying out Fourier transform on the frequency values;
d2, establishing intensity distribution functions of different frequency bands, and changing the intensity distribution functions into normal distribution through linear transformation;
d3, deleting the region outside the (mu-3 sigma, mu +3 sigma) interval; mu is the mean value of normal distribution, and sigma is the standard deviation of normal distribution;
and D4, obtaining the processed connected region image through inverse Fourier transform, and performing gray level smoothing processing on the connected region image.
2. The method for detecting the number of plant flowers according to claim 1, wherein: in step B, a switching Threshold is calculated according to the following formula,
Figure FDA0003218955280000021
wherein μ and σ represent the non-0 element mean and standard deviation, pixel, of R _ B, respectivelyi,jRepresenting non-0 elements, i and j respectively representing the ith row and the jth column of the matrix corresponding to the image R _ B; size (R _ B,1) and size (R _ B,2) represent the number of rows and columns of the matrix corresponding to the image R _ B, respectively.
CN201910588019.5A 2019-07-02 2019-07-02 Plant flower number detection method Active CN110310274B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910588019.5A CN110310274B (en) 2019-07-02 2019-07-02 Plant flower number detection method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910588019.5A CN110310274B (en) 2019-07-02 2019-07-02 Plant flower number detection method

Publications (2)

Publication Number Publication Date
CN110310274A CN110310274A (en) 2019-10-08
CN110310274B true CN110310274B (en) 2021-12-17

Family

ID=68077984

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910588019.5A Active CN110310274B (en) 2019-07-02 2019-07-02 Plant flower number detection method

Country Status (1)

Country Link
CN (1) CN110310274B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117274812B (en) * 2023-10-08 2024-02-20 北京香田智能科技有限公司 Tobacco plant counting method

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103767698A (en) * 2014-01-22 2014-05-07 中国科学院合肥物质科学研究院 Vein dynamic characteristic analysis device based on near-infrared spectrum technique and analysis method thereof
CN104167004A (en) * 2013-05-16 2014-11-26 上海分维智能科技有限公司 Rapid moving vehicle detection method for embedded DSP platform
CN106338520A (en) * 2016-09-18 2017-01-18 南京林业大学 Recognition method of surface defects of multilayer solid wood composite floor with surface board being jointed board
CN106530237A (en) * 2016-09-19 2017-03-22 中山大学 Image enhancement method
CN106651872A (en) * 2016-11-23 2017-05-10 北京理工大学 Prewitt operator-based pavement crack recognition method and system
CN107067385A (en) * 2017-01-23 2017-08-18 上海兴芯微电子科技有限公司 A kind of image enchancing method and device
CN107403422A (en) * 2017-08-04 2017-11-28 上海兆芯集成电路有限公司 To strengthen the method for picture contrast and its system
CN107578383A (en) * 2017-08-29 2018-01-12 北京华易明新科技有限公司 A kind of low-light (level) image enhancement processing method
CN108986106A (en) * 2017-12-15 2018-12-11 浙江中医药大学 Retinal vessel automatic division method towards glaucoma clinical diagnosis
CN109146826A (en) * 2018-06-27 2019-01-04 华南理工大学 A kind of image enchancing method and device
CN109613023A (en) * 2019-01-28 2019-04-12 西南大学 A kind of fruit surface defect rapid detection method of regional luminance adaptively correcting

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104167004A (en) * 2013-05-16 2014-11-26 上海分维智能科技有限公司 Rapid moving vehicle detection method for embedded DSP platform
CN103767698A (en) * 2014-01-22 2014-05-07 中国科学院合肥物质科学研究院 Vein dynamic characteristic analysis device based on near-infrared spectrum technique and analysis method thereof
CN106338520A (en) * 2016-09-18 2017-01-18 南京林业大学 Recognition method of surface defects of multilayer solid wood composite floor with surface board being jointed board
CN106530237A (en) * 2016-09-19 2017-03-22 中山大学 Image enhancement method
CN106651872A (en) * 2016-11-23 2017-05-10 北京理工大学 Prewitt operator-based pavement crack recognition method and system
CN107067385A (en) * 2017-01-23 2017-08-18 上海兴芯微电子科技有限公司 A kind of image enchancing method and device
CN107403422A (en) * 2017-08-04 2017-11-28 上海兆芯集成电路有限公司 To strengthen the method for picture contrast and its system
CN107578383A (en) * 2017-08-29 2018-01-12 北京华易明新科技有限公司 A kind of low-light (level) image enhancement processing method
CN108986106A (en) * 2017-12-15 2018-12-11 浙江中医药大学 Retinal vessel automatic division method towards glaucoma clinical diagnosis
CN109146826A (en) * 2018-06-27 2019-01-04 华南理工大学 A kind of image enchancing method and device
CN109613023A (en) * 2019-01-28 2019-04-12 西南大学 A kind of fruit surface defect rapid detection method of regional luminance adaptively correcting

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
图像区域分割算法的研究与应用;党文静;《中国优秀硕士学位论文全文数据库信息科技辑》;20190115(第12期);第1-55页 *
基于颜色恒常性的彩色目标检测;徐一初;《中国优秀硕士学位论文全文数据库信息科技辑》;20130615(第6期);第1-57页 *

Also Published As

Publication number Publication date
CN110310274A (en) 2019-10-08

Similar Documents

Publication Publication Date Title
WO2020224458A1 (en) Method for detecting corona discharge employing image processing
CN104751142B (en) A kind of natural scene Method for text detection based on stroke feature
CN106097368B (en) A kind of recognition methods in veneer crack
CN109145872B (en) CFAR and Fast-RCNN fusion-based SAR image ship target detection method
CN106934418B (en) Insulator infrared diagnosis method based on convolution recursive network
CN107563379B (en) Method for positioning text in natural scene image
CN107038416B (en) Pedestrian detection method based on binary image improved HOG characteristics
CN110309806B (en) Gesture recognition system and method based on video image processing
CN112308854B (en) Automatic detection method and system for chip surface flaws and electronic equipment
CN108334879B (en) Region extraction method, system and terminal equipment
CN110119742B (en) Container number identification method and device and mobile terminal
CN110969046B (en) Face recognition method, face recognition device and computer-readable storage medium
CN116704516B (en) Visual inspection method for water-soluble fertilizer package
CN106780428B (en) Chip quantity detection method and system based on color recognition
CN106447673A (en) Chip pin extraction method under non-uniform illumination condition
CN111401364B (en) License plate positioning algorithm based on combination of color features and template matching
CN110569774B (en) Automatic line graph image digitalization method based on image processing and pattern recognition
CN109724988A (en) A kind of pcb board defect positioning method based on multi-template matching
CN110310274B (en) Plant flower number detection method
CN108877030B (en) Image processing method, device, terminal and computer readable storage medium
CN107886493A (en) A kind of wire share split defect inspection method of transmission line of electricity
Bairwa et al. Classification of Fruits Based on Shape, Color and Texture using Image Processing Techniques
CN111414938A (en) Target detection method for bubbles in plate heat exchanger
CN111191659A (en) Multi-shape clothes hanger identification method for garment production system
CN109086327A (en) A kind of method and device quickly generating webpage visual structure graph

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant