CN117710511B - Blade imaging method of blade area measuring instrument based on photoelectric detection method and application of blade imaging method - Google Patents

Blade imaging method of blade area measuring instrument based on photoelectric detection method and application of blade imaging method Download PDF

Info

Publication number
CN117710511B
CN117710511B CN202410161455.5A CN202410161455A CN117710511B CN 117710511 B CN117710511 B CN 117710511B CN 202410161455 A CN202410161455 A CN 202410161455A CN 117710511 B CN117710511 B CN 117710511B
Authority
CN
China
Prior art keywords
blade
leaf
area
data
bit
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
CN202410161455.5A
Other languages
Chinese (zh)
Other versions
CN117710511A (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.)
Zhejiang Top Cloud Agri Technology Co ltd
Original Assignee
Zhejiang Top Cloud Agri Technology Co ltd
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 Zhejiang Top Cloud Agri Technology Co ltd filed Critical Zhejiang Top Cloud Agri Technology Co ltd
Priority to CN202410161455.5A priority Critical patent/CN117710511B/en
Publication of CN117710511A publication Critical patent/CN117710511A/en
Application granted granted Critical
Publication of CN117710511B publication Critical patent/CN117710511B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Image Processing (AREA)

Abstract

The application provides a blade imaging method of a blade area measuring instrument based on a photoelectric detection method and application thereof, comprising the steps of converting photoelectric data acquired by scanning a blade of the blade area measuring instrument into blade profile information and generating data in a bit array form to represent the shape of the blade; according to the shape of the blade handle part or the blade shape, compensating the area, which is close to the blade handle and cannot be clamped by the blade area measuring instrument, of the part so as to obtain the blade area of the complete blade, thereby complementing the blade profile information; compressing and storing the generated data in the form of bit groups; converting the blade profile information into visualizable data and scaling to a scale suitable for the size of the display device to enable display on the display device; compressing and storing the original or scaled blade image; and calculating the leaf area according to the complemented leaf profile information and outputting the leaf area. The application can reduce the occupied storage space and the consumption of the memory, and improve the measurement accuracy.

Description

Blade imaging method of blade area measuring instrument based on photoelectric detection method and application of blade imaging method
Technical Field
The application relates to the technical field of plant leaf area measurement, in particular to a leaf imaging method of a leaf area measuring instrument based on a photoelectric detection method and application thereof.
Background
The photoelectric leaf area collecting system is one automatic instrument for measuring plant leaf area with photoelectric technology. The area of the blade is measured by the photoelectric effect by placing the blade between two photoelectric sensors, and the photoelectric sensors generally consist of a luminous LED and a phototriode. The traditional photoelectric leaf area acquisition system generally uses keys and dot matrix liquid crystal to complete a man-machine interaction function, and the dot matrix liquid crystal can only display pure data parameters such as leaf area and the like, and has no function of drawing leaf images.
The storage capacity and memory capacity of embedded systems are typically small compared to general purpose computer systems. The photoelectric leaf area acquisition system is generally realized by an embedded system. Therefore, when the photo leaf area acquisition system is used for generating and processing the picture, the problems of memory consumption and storage space occupation are required to be considered during the picture storage.
Typically, the length of the petiole is between a few centimeters and tens of centimeters. Some plants have very short petioles, nearly no petioles. For the leaves with shorter petioles, the gap between the petioles and the plant stems is smaller, and when the living leaves are clamped by the leaf area measuring instrument based on the photoelectric detection method, the leaf area measuring instrument is easily blocked by the plant stems and can not measure the leaf area near the petioles, so that the leaf area is lost. Compared with a measuring method for taking off whole leaves for measurement, such as a method based on a digital photo analysis method or a square method, the measuring accuracy of the leaf area measuring instrument based on a photoelectric detection method can be influenced under the condition that the measured leaf stems are short or blocked by stems and cannot clamp and take the whole leaves.
Therefore, a blade imaging method of a blade area measuring instrument based on a photoelectric detection method and an application thereof are needed to solve the problems existing in the prior art.
Disclosure of Invention
The embodiment of the application provides a blade imaging method of a blade area measuring instrument based on a photoelectric detection method and application thereof, aiming at the problems of storage space, memory consumption, measurement precision and the like existing in the prior art.
The core technology of the invention mainly uses a blade bit array generation algorithm to convert photoelectric data into a bit array form, uses a polygon compensation algorithm to compensate the area of the blade which cannot be clamped near the blade handle, uses a blade bit array compression algorithm to compress the bit array, uses a blade image scaling algorithm to display the blade image on a display screen, and converts the image format to compress the size of the occupied space of the image.
In a first aspect, the present application provides a blade imaging method for a blade area measurement instrument based on a photodetection method, the method comprising the steps of:
S00, converting photoelectric data acquired by scanning the blade by the blade area measuring instrument into blade profile information, and generating data in a bit array form to represent the shape of the blade;
s10, compensating the area, which is close to the blade handle and cannot be clamped by the blade area measuring instrument, according to the shape of the blade handle part or the blade shape of the blade so as to obtain the blade area of the complete blade, thereby complementing the blade profile information;
S20, compressing and storing the generated data in the form of bit groups;
s30, converting the blade profile information into visual data, and scaling to a scale suitable for the size of the display equipment so as to be capable of being displayed on the display equipment;
s40, compressing and storing the original or scaled blade image;
S50, calculating the leaf area according to the complemented leaf profile information and outputting the leaf area.
Further, in the step S00, the leaf area measuring apparatus uses the bit array of the 1bit storage unit to store the collected photoelectric data, and a set of bit arrays is obtained every time it scans. The adoption of a 1-bit digital group storage mode means that each pixel point is only represented by 1-bit information quantity, so that the storage space is greatly saved. For high resolution scan results, this approach can significantly reduce the amount of data compared to using multi-bit (e.g., 8bit or 16 bit) color image formats. The use of a 1bit array to store the optoelectronic data enables efficient capture and recording of critical information of the blade profile, which is a very practical and efficient solution for the specific task of blade area measurement.
Further, in step S10, the compensation mode includes triangle compensation and rectangle compensation, the triangle compensation approaches to the triangle blade for the blade surface part blocked by the blade area measuring instrument shell, and the rectangle compensation approaches to the rectangle blade for the blade surface part blocked by the blade area measuring instrument shell. Due to the physical structural limitations of the blade area measuring instrument, it may be that portions of the blade edge, particularly certain areas near the blade shank or specially shaped blades, may not be completely scanned. By simulating the shape (e.g., triangle or rectangle) of these occlusion parts by the compensation algorithm, the actual leaf area of the part can be estimated more accurately, thereby improving the accuracy of the overall leaf area calculation. Different plant leaf shapes may exhibit various irregular shapes, particularly near the petioles. Specific compensation is carried out on the part approaching to the triangle or rectangle, so that various leaf-shaped characteristics can be flexibly dealt with, and the measurement result is ensured to be closer to the true value. Although the blade edge in nature may be very complex, by simplifying the simulation of the common occlusion shape, the complexity of algorithm implementation can be reduced while ensuring a certain accuracy, so that the instrument can rapidly and stably complete data processing in a real-time measurement environment. The compensation mode enhances the practical application range of the leaf area measuring instrument, is not only suitable for measuring picked leaves in a laboratory environment, but also is effective for on-site measurement of living plants, and can meet more diversified research requirements.
Further, in step S20, the data in the form of bit arrays is compressed by the bi_rle8 compression algorithm. BI_RLE8 (Bitmap Run-Length Encoding 8-bit) is a lossless image data compression method, particularly for image data comprising a large number of pixels of the same color value in succession. For blade profile information, especially where the blade edges are smooth or there are large areas of continuous black (background) and white (blade) areas, the algorithm can effectively reduce redundant data, thereby significantly reducing storage space requirements. The RLE compression algorithm is relatively simple, the decompression process is also relatively convenient, the method is suitable for environments with limited resources such as an embedded system, and the like, and the pressure of hardware calculation and memory resources is reduced while the accuracy of a measurement result is not influenced. The BI_RLE8 is a lossless compression algorithm, no information is lost in the compression and decompression processes, the leaf area calculated based on compressed data is ensured to be consistent with the result obtained by calculating uncompressed data, and the measurement accuracy is ensured.
Further, in the step S20, the compressing step of the data in the form of the bit array includes:
S21, using an integer pair [ C, L ] to store a color value C of one pixel and the number of pixels with the same color, wherein the number of pixels with the same color is the color length L;
S22, based on the number n of LEDs of a single-column LED array in the LED arrays used for scanning in the leaf area measuring instrument, obtaining the bit number n of the bit array, and compressing the bit number n into a plurality of integer pairs [ C1, L1], [ C2, L2], [ Cn, ln ], wherein L1+L2+ & Ln=n;
S23, taking a bit array obtained by one-time scanning during compression, and replacing the original data string with the color value and the repetition number of the color value when a string of the same color is encountered, so as to obtain a compression result;
And S24, after the blade scanning is completed, recording the number of effective scanning times of the blade area as M, and setting the total number of the bit arrays as M.
Further, the specific steps of S30 include:
S31, calculating a scaling ratio r=l_leaf/w_canvas;
where L_leaf is the blade length and W_canvas is the canvas length of the display device;
s32, calculating a pixel L_Pix required to be occupied by the length of the blade, and calculating a starting point (StartL, startW) of blade drawing:
L_Pix=L_leaf/L_unit/R;
StartL=(W_canvas-L_Pix)/2;
StartW= (H_canvas-N_LED/R)/2;
Wherein, L_unit is the length of the blade corresponding to a single pixel, H_canvas is the canvas height of the display device, and N_LED is the length of the bit array obtained by the leaf area measuring instrument once;
S33, calculating a length pixel dL_Pix to be drawn in two adjacent scans:
dL_Pix = dL/(L_LED*R);
wherein, L_LED is the physical length corresponding to one color value in the bit array, dL is the distance of blade movement between two adjacent bit arrays A m-1 and A m obtained by two scans;
S34, drawing blade pixel points at the positions (StartL +F m +i and StartW +N/R), and circulating for M times in total;
Wherein i < dL_Pix m > is more than or equal to 0, N < N_LED is more than or equal to 0, and StartW+N/R represents the position of each color value in the bit array in the vertical drawing direction of the canvas; i represents the count of drawing point movements in the length direction with StartL +F m as the drawing starting point when drawing a bit array; dL_Pix m represents the number of length pixels to be drawn in two adjacent scans when drawing the mth bit array, F m represents the number of pixels with the drawing starting point of the length direction shifted backwards after drawing one bit array, F m =Fm-1+ dL_Pixm-1, N represents the position movement count in the vertical drawing direction when drawing one bit array; m is the total number of the digit groups;
S35, filling empty pixels between two pixels in the vertical drawing direction of the canvas by using a simulation nearest neighbor interpolation method, filling (StartW + (N+1)/R) - (StartW +N/R) -1 pixel points between pixel points (StartL +F m +i, startW +N/R) and pixel points (StartL +F m +i, startW + (N+1)/R) if (StartW + (N+1)/R) - (StartW +N/R) is greater than 1, and filling 1 pixel point at pixel points (StartL +F m +i, startW + (N+1)/R) if 0< (StartW + (N+1)/R) - (StartW +N/R) is less than or equal to 1.
Further, in step S40, BMP format of the original or scaled leaf image is converted into PNG format by a picture format conversion function. PNG is a lossless compressed bitmap format that can provide a better compression ratio than BMP format. This means that PNG format files are typically much smaller than BMP format, keeping the image quality unchanged, thus saving storage space. PNG format is widely applied to Internet and various operating systems and software, has good cross-platform compatibility, and ensures that images can be normally displayed and processed in various devices and environments.
In a second aspect, the present application provides a blade imaging system for a photodetection-based blade area measurement instrument, comprising:
The photoelectric leaf area acquisition module is used for acquiring photoelectric data obtained by scanning the leaf and converting the photoelectric data into leaf profile information;
The blade bit array generating module is used for generating data in the form of bit arrays for representing the shape of the blade according to the blade profile information;
The polygon compensation module is used for compensating the area, which is close to the blade handle and cannot be clamped by the blade area measuring instrument, according to the shape of the blade handle part or the blade shape, so as to obtain the blade area of the complete blade, and thus the blade profile information is complemented;
The blade bit array compression module is used for compressing and storing the generated bit array data;
The blade image scaling module is used for converting the blade profile information into visualized data and scaling the visualized data to a scale suitable for the size of the display equipment so as to be capable of being displayed on the display equipment;
the blade format conversion and storage module compresses and stores an original or scaled blade image;
And the output module is used for calculating the leaf area according to the complemented leaf profile information and outputting the leaf area.
In a third aspect, the application provides an electronic device comprising a memory in which a computer program is stored and a processor arranged to run the computer program to perform the above-described method of blade imaging for a photodetection-based blade area measuring device.
In a fourth aspect, the present application provides a readable storage medium having stored therein a computer program comprising program code for controlling a process to perform a process comprising a blade imaging method according to the above-described photodetection-based blade area measuring device.
The main contributions and innovation points of the application are as follows: 1. compared with the prior art, the application adopts the leaf area measuring instrument of the photoelectric detection method, acquires photoelectric data by scanning the leaf, converts the photoelectric data into leaf profile information with high precision, and represents the precise shape of the leaf in the form of a bit array, thus ensuring the precise capture of the leaf form;
2. Compared with the prior art, the application provides an area compensation algorithm based on the shape of a blade stem part or an integral blade, which can effectively estimate and supplement the missing area of the part, thereby obtaining the actual blade area of the integral blade and improving the measurement accuracy.
3. Compared with the prior art, the method and the device have the advantages that the generated blade profile information is subjected to efficient compression processing in the form of the bit array, so that the storage space requirement is reduced, and the follow-up data transmission and quick reading are facilitated.
4. Compared with the prior art, the method and the device have the advantages that the blade profile information is converted into the visual data format, and scaling is carried out according to the sizes suitable for different display devices, so that blade images can be clearly displayed on various displays, and user experience and data analysis efficiency are improved.
5. Compared with the prior art, the application compresses and stores the blade images, whether the blade images are original or scaled, so that the storage resources are further saved. Meanwhile, the leaf area calculated according to the complemented accurate leaf profile information can be output as a final result, and the requirements of the fields of scientific research, agricultural production, plant physiological research and the like on the accurate measurement of the leaf size are met.
The details of one or more embodiments of the application are set forth in the accompanying drawings and the description below to provide a more thorough understanding of the other features, objects, and advantages of the application.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this specification, illustrate embodiments of the application and together with the description serve to explain the application and do not constitute a limitation on the application. In the drawings:
FIG. 1 is a flow chart of a blade imaging method of a photodetection-based blade area meter in accordance with an embodiment of the present application;
FIG. 2 is a diagram of one embodiment of bit array generation;
FIG. 3 is a diagram of an embodiment of blade image scaling;
FIG. 4 is a blade scaling effect diagram;
FIG. 5 is a schematic illustration without compensation;
FIG. 6 is a schematic diagram of triangle compensation;
FIG. 7 is a schematic diagram of rectangular compensation;
FIG. 8 is a schematic view of the use of a leaf area gauge;
fig. 9 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present application.
Detailed Description
Reference will now be made in detail to exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with one or more embodiments of the present specification. Rather, they are merely examples of apparatus and methods consistent with aspects of one or more embodiments of the present description as detailed in the accompanying claims.
It should be noted that: in other embodiments, the steps of the corresponding method are not necessarily performed in the order shown and described in this specification. In some other embodiments, the method may include more or fewer steps than described in this specification. Furthermore, individual steps described in this specification, in other embodiments, may be described as being split into multiple steps; while various steps described in this specification may be combined into a single step in other embodiments.
Example 1
The application aims to provide a blade imaging method of a blade area measuring instrument based on a photoelectric detection method, and particularly relates to a blade imaging method of a blade area measuring instrument based on a photoelectric detection method, which comprises the following steps of:
S00, converting photoelectric data acquired by scanning the blade by the blade area measuring instrument into blade profile information, and generating data in a bit array form to represent the shape of the blade;
In this embodiment, as shown in fig. 2 and 8, the leaf area measuring apparatus stores the collected photoelectric data using the bit arrays of the 1-bit storage unit, and obtains a set of bit arrays every time it scans. The bit array is a structure for storing data, and each element of the bit array only contains two values of 0 or 1. In the bit array, each bit of the integer represents an object. The bit array has the advantages of reducing storage space and improving search efficiency. When the photoelectric sensor of the leaf area measuring instrument scans the leaf, the light emitted by each LED can only obtain a result of 0 or 1 after being received and processed, so that the storage and searching efficiency of the data acquired by each acquisition module can be optimized by storing the digit group.
The leaf area measuring instrument comprises a single-row LED array, the single-row photodiode array scans a leaf, a result received by the single-row photodiode array corresponding to each LED lamp in the single-row LED array is stored in a 1-bit space, meanwhile, the length difference between the current scanning and the last scanning is recorded through a length acquisition module, so that a group of bit numbers in the width direction and a length difference in the length direction are obtained, and after the leaf scanning is completed, the bit numbers of the leaf are obtained, as shown in figure 2.
S10, compensating the area, which is close to the blade handle and cannot be clamped by the blade area measuring instrument, according to the shape of the blade handle part or the blade shape of the blade so as to obtain the blade area of the complete blade, thereby complementing the blade profile information;
In this embodiment, the blade area compensation is performed by a polygon compensation algorithm, wherein the polygon compensation algorithm is one of 3 compensation methods, which are not compensated, triangular and rectangular, manually or automatically according to the shape of the blade stem portion of the blade, so that the area of the part, which is close to the blade stem and cannot be clamped by the blade area measuring instrument based on the photoelectric detection method, is compensated, the blade area measured by the blade area measuring instrument based on the photoelectric detection method is close to the blade area of the complete blade, and the area loss caused by the fact that the blade area measuring instrument based on the photoelectric detection method cannot be clamped completely to measure the living blade is reduced.
Wherein, fig. 5 is a schematic diagram of a compensation-free algorithm, and for longer blades of a blade handle, a photoelectric measurement module of a blade area measuring instrument based on a photoelectric detection method can completely scan the whole blade without blade area loss, so that the compensation-free algorithm can be selected;
for the blade with the shorter petiole, the shell of the leaf area measuring instrument based on the photoelectric detection method is blocked by the petiole, the lost leaf area approaches to the shadow triangle area in the figure, W0 is the width of the blade obtained by the first scanning, L0 is the width of the center of the photoelectric scanning module of the leaf area measuring instrument based on the photoelectric detection method from the left shell edge, and the calculating method of the compensation area S' is as follows:
S' = W0*L0/2
Fig. 7 is a schematic diagram of a rectangular compensation algorithm, for an elongated blade, if a blade area measuring instrument shell based on a photoelectric detection method is blocked by a blade handle, a lost blade area part approaches to a shadow rectangular area in the figure, W1 is a blade width obtained by first scanning, L1 is a width of a center distance between a photoelectric scanning module of the blade area measuring instrument based on the photoelectric detection method and the left shell edge, and then a calculation method of a compensation area S' is as follows:
S' = W1* L1;
Defining the area of the blade as S, and scanning to obtain the area of the blade as S '', then
S = S' + S";
S20, compressing and storing the generated data in the form of bit groups;
In this embodiment, the compression of the blade bit array by the simulated BI_RLE8 compression algorithm includes the following specific steps:
s21: storing the color value C of a pixel and the number of pixels with the same color, namely the color length L, by using an integer pair [ C, L ];
The number of LEDs of a single-column LED array is n, one bit array can be obtained at a time by scanning, and the number of elements of the bit array is n, and then the bit array can be compressed into a plurality of integer pairs [ C1, L1], [ C2, L2], [ C3, L3],.[ Cn, ln ], wherein l1+l2+l3..+ln=n.
S22: taking one bit array obtained by one scanning in compression, and replacing the original data string by the color value and the repetition number of the color value every time a string of the same color is encountered:
The raw data are:
000000000000110000000000000000 scan 1 to obtain a bit array;
000000000000110000000000000000 scan number 2 to obtain bit array;
000000000111111111000000000000 scan 3 to obtain a bit array;
000000001111111111111000000000 scan 4 to obtain bit array;
000000011111111111111100000000 th scan to obtain a bit array;
The compressed data are:
[0,12], [1,2], [0,16], scan 1 to obtain the compression result of the bit array;
[0,12], [1,2], [0,16], scan 2 to obtain the compression result of the bit array;
[0,9], [1,9], [0,12], scan 3 to obtain the compression result of the bit array;
[0,8], [1,13], [0,9], scan 4 to obtain the compression result of the bit array;
scanning for the 5 th time of [0,7], [1,15], [0,8] to obtain a compression result of the bit array;
Among them, bi_rle8 is selected because it is an image compression Encoding, also called rle8 bpp (Run-Length Encoding), which uses 8-bit pixel depth for compression. This coding scheme allows to specify successive rows of pixels of the same color in a single code. The code consists of two bytes, the first one specifying the number of consecutive pixels and the second one specifying the color index. Furthermore, the specific value (0, 1, 2) of the second byte may represent a different meaning: when the value is 0, the end of the line is indicated; when the value is 1, the end of the image is indicated; at a value of 2, the offset of the next pixel from the horizontal and vertical positions of the current start is indicated. This coding scheme can be used in a staggered manner anywhere in the same figure and can be compressed using either coding mode or absolute mode. Since the bit array contains only 0 and 1 values, compression using BI_RLE8 can achieve excellent compression rate. The nearest neighbor interpolation method is a simple gray value interpolation method, and the basic idea is to directly assign the gray value of the newly generated pixel point in the image scaling process to the gray value of the adjacent original pixel point. Because the blade image is a monochromatic picture, the nearest neighbor interpolation method can be simulated to carry out enlarged abbreviation on the picture so as to adapt to the display of the size of the screen.
S30, converting the blade profile information into visual data, and scaling to a scale suitable for the size of the display equipment so as to be capable of being displayed on the display equipment;
In this embodiment, as shown in fig. 3 and fig. 4, specifically, according to the canvas size of the capacitive touch liquid crystal display (display device), a blade image is drawn according to the correct aspect ratio of the blade, the blade image is a monochrome picture, and meanwhile, the data of the length, width and area of the blade are displayed on the liquid crystal display.
The step of drawing the blade image is as follows:
s31: calculating a scaling r=l_leaf/w_canvas;
where L_leaf is the blade length and W_canvas is the canvas length of the display device;
S32: the pixel l_pix that needs to be occupied by the blade length is calculated, and the starting point (StartL, startW) of the blade drawing is calculated:
L_Pix=L_leaf/L_unit/R;
StartL=(W_canvas-L_Pix)/2;
StartW= (H_canvas-N_LED/R)/2;
Wherein, L_unit is the length of the blade corresponding to a single pixel, H_canvas is the canvas height of the display device, and N_LED is the length of the bit array obtained by the leaf area measuring instrument once;
s33: calculating the length pixel dL_Pix to be drawn in two adjacent scans:
dL_Pix = dL/(L_LED*R);
wherein, L_LED is the physical length corresponding to one color value in the bit array, dL is the distance of blade movement between two adjacent bit arrays A m-1 and A m obtained by two scans;
S34, drawing blade pixel points at the positions (StartL +F m +i and StartW +N/R), and circulating for M times in total;
Wherein i < dL_Pix m > is more than or equal to 0, N < N_LED is more than or equal to 0, and StartW+N/R represents the position of each color value in the bit array in the vertical drawing direction of the canvas; i represents the count of drawing point movements in the length direction with StartL +F m as the drawing starting point when drawing a bit array; dL_Pix m represents the number of length pixels to be drawn in two adjacent scans when drawing the mth bit array, F m represents the number of pixels with the drawing starting point of the length direction shifted backwards after drawing one bit array, F m =Fm-1+ dL_Pixm-1, N represents the position movement count in the vertical drawing direction when drawing one bit array; m is the total number of the digit groups;
S35, filling empty pixels between two pixels in the vertical drawing direction of the canvas by using a simulation nearest neighbor interpolation method, filling (StartW + (N+1)/R) - (StartW +N/R) -1 pixel points between pixel points (StartL +F m +i, startW +N/R) and pixel points (StartL +F m +i, startW + (N+1)/R) if (StartW + (N+1)/R) - (StartW +N/R) is greater than 1, and filling 1 pixel point at pixel points (StartL +F m +i, startW + (N+1)/R) if 0< (StartW + (N+1)/R) - (StartW +N/R) is less than or equal to 1.
Preferably, the canvas of the capacitive touch liquid crystal screen can be clicked to zoom in and out the blade image so as to observe the whole outline and detail parts of the blade;
s40, compressing and storing the original or scaled blade image;
in this embodiment, the final picture is in PNG format, which is a bitmap format using lossless compression algorithm, and has a high compression ratio, and the generated file has a small volume, so that the storage and transmission are more convenient. The original BMP is an uncompressed image file format which supports images of 1,4, 8, 16, 24 and 32 bits pixel depth, so that the BMP format file occupies a lot of space when storing data. The BMP is a bitmap file and is hardly compressed, so that the BMP is more suitable for embedded execution of generating, drawing and scaling operations. In contrast, PNG is a compressed image file format that supports images of 1,4, 8, and 16 bit pixel depths, stores data in a lossless compression manner, and thus can effectively reduce file size and storage space. Meanwhile, PNG is suitable for storing and transmitting large-sized images.
There are preferably several other common image formats that may be more efficient in different application scenarios:
JPEG (Joint Photographic Experts Group): JPEG is a lossy compression format particularly suited for storing images containing a large number of continuous tones (e.g., photographs). It can provide a higher compression rate, significantly reducing file size, but sacrificing some image quality. JPEG may also be a more efficient storage option for leaf area measurement applications that do not require preservation of full transparency and for which the detail requirements are not particularly stringent.
WebP: a modern image format developed by Google provides better lossless and lossy compression, typically with smaller file sizes than conventional formats such as JPEG, PNG, etc., and supports transparency. If the device or software supports WebP formats, use may be considered to improve efficiency.
JPEG 2000: JPEG 2000 provides higher compression efficiency and more flexible coding hierarchy than conventional JPEG formats, supports lossless and lossy compression, and allows progressive display.
HEIF/HEIC (HIGH EFFICIENCY IMAGE FILE Format/HIGH EFFICIENCY IMAGE Coding): this is a newer standard, particularly becoming increasingly popular on mobile devices. It is based on an HEVC encoder, capable of achieving higher compression efficiency than JPEG, while maintaining good image quality.
S50, calculating the leaf area according to the complemented leaf profile information and outputting the leaf area.
In this embodiment, the calculation manner of the leaf area is the prior art, and will not be described here again.
Example two
Based on the same conception, the application also provides a blade imaging system of the blade area measuring instrument based on the photoelectric detection method, which comprises the following steps:
The photoelectric leaf area acquisition module is used for acquiring photoelectric data obtained by scanning the leaf and converting the photoelectric data into leaf profile information;
In this embodiment, the photovoltaic leaf area acquisition module includes an STM32 microprocessor, an acquisition module, a display module, and a memory module; the blade bit array generation algorithm comprises blade scanning data obtained through an acquisition module and uses 1bit as bit array storage of a storage unit, and a group of bit arrays are obtained once in each scanning. The STM32 microprocessor is connected with the acquisition module, the display module and the storage module through a circuit; the acquisition module comprises a single-column LED array, a single-column photodiode array and a length acquisition module; when the blades are pulled to pass through the acquisition module, a group of blade width data can be obtained after each single-row LED array scans, and whether the blades exist at the position can be known by judging the position of the single-row photodiode array where the LED light is shielded; the length acquisition module consists of an encoder and a roller, and when the blade is pulled, the roller drives the encoder to move so as to obtain the length data of the blade; the display module comprises an LCD liquid crystal screen, is used for displaying data, displaying blade images, setting parameters and controlling equipment; the memory module comprises SDRM chips used for caching blade scanning data and caching pictures.
The blade bit array generating module is used for generating data in the form of bit arrays for representing the shape of the blade according to the blade profile information;
The polygon compensation module is used for compensating the area, which is close to the blade handle and cannot be clamped by the blade area measuring instrument, according to the shape of the blade handle part or the blade shape, so as to obtain the blade area of the complete blade, and thus the blade profile information is complemented;
The blade bit array compression module is used for compressing and storing the generated bit array data;
The blade image scaling module is used for converting the blade profile information into visualized data and scaling the visualized data to a scale suitable for the size of the display equipment so as to be capable of being displayed on the display equipment;
the blade format conversion and storage module compresses and stores an original or scaled blade image;
And the output module is used for calculating the leaf area according to the complemented leaf profile information and outputting the leaf area.
In this embodiment, the output content may be displayed on a display module or to other devices.
Example III
This embodiment also provides an electronic device, referring to fig. 9, comprising a memory 404 and a processor 402, the memory 404 having stored therein a computer program, the processor 402 being arranged to run the computer program to perform the steps of any of the method embodiments described above.
In particular, the processor 402 may include a Central Processing Unit (CPU), or an application specific integrated circuit (ApplicationSpecificIntegratedCircuit, abbreviated as ASIC), or may be configured as one or more integrated circuits that implement embodiments of the present application.
The memory 404 may include, among other things, mass storage 404 for data or instructions. By way of example, and not limitation, memory 404 may comprise a hard disk drive (HARDDISKDRIVE, abbreviated HDD), a floppy disk drive, a solid state drive (SolidStateDrive, abbreviated SSD), flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a Universal Serial Bus (USB) drive, or a combination of two or more of these. Memory 404 may include removable or non-removable (or fixed) media, where appropriate. Memory 404 may be internal or external to the data processing apparatus, where appropriate. In a particular embodiment, the memory 404 is a Non-Volatile (Non-Volatile) memory. In particular embodiments, memory 404 includes Read-only memory (ROM) and Random Access Memory (RAM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable ROM (ProgrammableRead-only memory, abbreviated PROM), an erasable PROM (ErasableProgrammableRead-only memory, abbreviated EPROM), an electrically erasable PROM (ElectricallyErasableProgrammableRead-only memory, abbreviated EEPROM), an electrically rewritable ROM (ElectricallyAlterableRead-only memory, abbreviated EAROM) or a FLASH memory (FLASH), or a combination of two or more of these. The RAM may be a static random access memory (StaticRandom-access memory, abbreviated SRAM) or a dynamic random access memory (DynamicRandomAccessMemory, abbreviated DRAM) where the DRAM may be a fast page mode dynamic random access memory 404 (FastPageModeDynamicRandomAccessMemory, abbreviated FPMDRAM), an extended data output dynamic random access memory (ExtendedDateOutDynamicRandomAccessMemory, abbreviated EDODRAM), a synchronous dynamic random access memory (SynchronousDynamicRandom-access memory, abbreviated SDRAM), or the like, where appropriate.
Memory 404 may be used to store or cache various data files that need to be processed and/or used for communication, as well as possible computer program instructions for execution by processor 402.
The processor 402 reads and executes the computer program instructions stored in the memory 404 to implement any of the photodetection-based blade imaging methods of the blade area meter in the above embodiments.
Optionally, the electronic apparatus may further include a transmission device 406 and an input/output device 408, where the transmission device 406 is connected to the processor 402 and the input/output device 408 is connected to the processor 402.
The transmission device 406 may be used to receive or transmit data via a network. Specific examples of the network described above may include a wired or wireless network provided by a communication provider of the electronic device. In one example, the transmission device includes a network adapter (Network Interface Controller, simply referred to as a NIC) that can connect to other network devices through the base station to communicate with the internet. In one example, the transmission device 406 may be a Radio Frequency (RF) module, which is configured to communicate with the internet wirelessly.
The input-output device 408 is used to input or output information.
Example IV
The present embodiment also provides a readable storage medium having stored therein a computer program comprising program code for controlling a process to execute the process comprising the blade imaging method of the photodetection method based blade area meter according to the first embodiment.
It should be noted that, specific examples in this embodiment may refer to examples described in the foregoing embodiments and alternative implementations, and this embodiment is not repeated herein.
In general, the various embodiments may be implemented in hardware or special purpose circuits, software, logic or any combination thereof. Some aspects of the invention may be implemented in hardware, while other aspects may be implemented in firmware or software which may be executed by a controller, microprocessor or other computing device, although the invention is not limited thereto. While various aspects of the invention may be illustrated and described as block diagrams, flow charts, or using some other pictorial representation, it is well understood that these blocks, apparatus, systems, techniques or methods described herein may be implemented in, as non-limiting examples, hardware, software, firmware, special purpose circuits or logic, general purpose hardware or controller or other computing devices, or some combination thereof.
Embodiments of the invention may be implemented by computer software executable by a data processor of a mobile device, such as in a processor entity, or by hardware, or by a combination of software and hardware. Computer software or programs (also referred to as program products) including software routines, applets, and/or macros can be stored in any apparatus-readable data storage medium and they include program instructions for performing particular tasks. The computer program product may include one or more computer-executable components configured to perform embodiments when the program is run. The one or more computer-executable components may be at least one software code or a portion thereof. In addition, in this regard, it should be noted that any blocks of the logic flows as illustrated may represent program steps, or interconnected logic circuits, blocks and functions, or a combination of program steps and logic circuits, blocks and functions. The software may be stored on physical media such as memory chips or memory blocks implemented within the processor, magnetic media such as hard or floppy disks, and optical media such as, for example, DVDs and data variants thereof, CDs, etc. The physical medium is a non-transitory medium.
It should be understood by those skilled in the art that the technical features of the above embodiments may be combined in any manner, and for brevity, all of the possible combinations of the technical features of the above embodiments are not described, however, they should be considered as being within the scope of the description provided herein, as long as there is no contradiction between the combinations of the technical features.
The foregoing examples illustrate only a few embodiments of the application, which are described in greater detail and are not to be construed as limiting the scope of the application. It should be noted that it will be apparent to those skilled in the art that various modifications and improvements can be made without departing from the spirit of the application, which are within the scope of the application. Accordingly, the scope of the application should be assessed as that of the appended claims.

Claims (9)

1. The blade imaging method of the blade area measuring instrument based on the photoelectric detection method is characterized by comprising the following steps of:
s00, converting photoelectric data acquired by scanning the blade by the blade area measuring instrument into blade profile information, and generating data in a bit array form to represent the shape of the blade;
S10, estimating and supplementing the blade area which is not effectively collected near the blade handle due to the clamping limitation of the blade area measuring instrument by adopting a preset geometric model according to the actual shape of the blade handle part or the shape of the whole blade, wherein the specific compensation mode comprises the following steps: for the missing part with the shape close to the triangle, constructing the triangle according to the boundary line of the adjacent scanned areas and calculating the area of the triangle; calculating the corresponding rectangular area for the missing part with the shape close to the rectangle; thereby ensuring that the actual profile information of the complete blade is obtained;
S20, compressing and storing the generated data in the form of bit groups;
s30, converting the blade profile information into visual data, and scaling to a scale suitable for the size of the display equipment so as to be capable of being displayed on the display equipment;
s40, compressing and storing the original or scaled blade image;
s50, calculating the leaf area according to the complemented leaf profile information and outputting the leaf area.
2. The method of claim 1, wherein in step S00, the leaf area measuring apparatus stores the collected photoelectric data using the bit arrays of the 1bit storage unit, and a set of bit arrays is obtained every time the scan.
3. The method for imaging a leaf of a leaf area measuring instrument based on a photodetection method according to claim 1, wherein in step S20, data in the form of a bit array is compressed by a bi_rle8 compression algorithm.
4. The blade imaging method of a blade area measuring instrument based on a photodetection method according to claim 3, wherein in the step S20, the compression step of the data in the form of the number of bits includes:
S21, using an integer pair [ C, L ] to store a color value C of one pixel and the number of pixels with the same color, wherein the number of pixels with the same color is the color length L;
S22, based on the number n of LEDs of a single-column LED array in the LED arrays used for scanning in the leaf area measuring instrument, obtaining the bit number n of a bit array, and compressing the bit number n into a plurality of integer pairs [ C1, L1], [ C2, L2], [ Cn, ln ], wherein L1+L2+ & Ln=n;
S23, taking a bit array obtained by one-time scanning during compression, and replacing the original data string with the color value and the repetition number of the color value when a string of the same color is encountered, so as to obtain a compression result;
And S24, after the blade scanning is completed, recording the number of effective scanning times of the blade area as M, and setting the total number of the bit arrays as M.
5. The method for imaging a leaf of a leaf area measuring instrument based on a photodetection method according to claim 4, wherein the specific step of S30 comprises:
S31, calculating a scaling ratio r=l_leaf/w_canvas;
where L_leaf is the blade length and W_canvas is the canvas length of the display device;
s32, calculating a pixel L_Pix required to be occupied by the length of the blade, and calculating a starting point (StartL, startW) of blade drawing:
L_Pix=L_leaf/L_unit/R;
StartL=(W_canvas-L_Pix)/2;
StartW= (H_canvas-N_LED/R)/2;
Wherein L_unit is the length of a blade corresponding to a single pixel, H_canvas is the canvas height of the display device, and N_LED is the length of a bit array obtained by the blade area measuring instrument once;
S33, calculating a length pixel dL_Pix to be drawn in two adjacent scans:
dL_Pix = dL/(L_LED*R);
wherein, L_LED is the physical length corresponding to one color value in the bit array, dL is the distance between two adjacent bit arrays Am-1 obtained by two scans and Am blades;
S34, drawing blade pixel points at the positions (StartL +Fm+i, startW +N/R), and circulating for M times in total;
Wherein i < dL_ Pixm > 0 < N < N_LED > 0 < N_LED, and StartW+N/R represents the position of each color value in the bit array in the vertical drawing direction of the canvas; i represents the count of drawing point movements in the length direction by taking StartL +Fm as a drawing starting point when drawing a bit array; dL_ Pixm represents the number of length pixels required to be drawn by two adjacent scans when drawing the mth bit array, fm represents the number of pixels with the drawing starting point of the length direction shifted backwards after drawing one bit array, fm=Fm-1+dL_ Pixm-1, N represents the position movement count in the vertical drawing direction when drawing one bit array; m is the total number of the digit groups;
s35, filling empty pixels between two pixels in the vertical drawing direction of the canvas by using a simulation nearest neighbor interpolation method, filling (StartW + (N+1)/R) - (StartW +N/R) -1 pixel points between pixel points (StartL +Fm+i, startW +N/R) and pixel points (StartL +Fm+i, startW + (N+1)/R) if (StartW + (N+1)/R) - (StartW +N/R) is larger than or equal to 1, and filling 1 pixel point at pixel points (StartL +Fm+i, startW + (N+1)/R) if 0< (StartW + (N+1)/R) - (StartW +N/R) is smaller than or equal to 1.
6. The blade imaging method of a photodetection method-based blade area measurement instrument according to any one of claims 1-5, wherein in step S40, BMP format of the original or scaled blade image is converted into PNG format by a picture format conversion function.
7. A blade imaging system for a blade area measurement instrument based on a photodetection method, comprising:
The photoelectric leaf area acquisition module is used for acquiring photoelectric data obtained by scanning the leaf and converting the photoelectric data into leaf profile information;
The blade bit array generating module is used for generating data in the form of bit arrays for representing the shape of the blade according to the blade profile information;
the polygon compensation module is configured to estimate and supplement, according to an actual shape of a blade shank portion or an overall blade shape, a blade area that is not effectively collected near the blade shank due to a clamping limitation of a blade area measurement instrument by using a preset geometric model, where the specific compensation mode includes: for the missing part with the shape close to the triangle, constructing the triangle according to the boundary line of the adjacent scanned areas and calculating the area of the triangle; for the missing part with the shape close to the rectangle, calculating the corresponding rectangular area according to the instrument size and the geometric characteristics of the blade; thereby ensuring that the actual profile information of the complete blade is obtained;
The blade bit array compression module is used for compressing and storing the generated bit array data;
The blade image scaling module is used for converting the blade profile information into visualized data and scaling the visualized data to a scale suitable for the size of the display equipment so as to be capable of being displayed on the display equipment;
the blade format conversion and storage module compresses and stores an original or scaled blade image;
And the output module is used for calculating the leaf area according to the complemented leaf profile information and outputting the leaf area.
8. An electronic device comprising a memory and a processor, wherein the memory has stored therein a computer program, the processor being arranged to run the computer program to perform the method of blade imaging of a photodetection based blade area measuring device according to any of claims 1 to 6.
9. A readable storage medium, characterized in that the readable storage medium has stored therein a computer program comprising program code for controlling a process to execute a process comprising a blade imaging method of a photodetection based blade area measuring instrument according to any one of claims 1 to 6.
CN202410161455.5A 2024-02-05 2024-02-05 Blade imaging method of blade area measuring instrument based on photoelectric detection method and application of blade imaging method Active CN117710511B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410161455.5A CN117710511B (en) 2024-02-05 2024-02-05 Blade imaging method of blade area measuring instrument based on photoelectric detection method and application of blade imaging method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410161455.5A CN117710511B (en) 2024-02-05 2024-02-05 Blade imaging method of blade area measuring instrument based on photoelectric detection method and application of blade imaging method

Publications (2)

Publication Number Publication Date
CN117710511A CN117710511A (en) 2024-03-15
CN117710511B true CN117710511B (en) 2024-04-30

Family

ID=90153838

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410161455.5A Active CN117710511B (en) 2024-02-05 2024-02-05 Blade imaging method of blade area measuring instrument based on photoelectric detection method and application of blade imaging method

Country Status (1)

Country Link
CN (1) CN117710511B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104778693A (en) * 2015-04-08 2015-07-15 云挺 Leaf area index calculation method based on projection algorithm and active contour model
WO2019113998A1 (en) * 2017-12-11 2019-06-20 江苏大学 Method and device for monitoring comprehensive growth of potted lettuce
CN116105691A (en) * 2022-12-29 2023-05-12 浙江农林大学 Method for batch determination of leaf phenotypic traits and related equipment
EP4239576A1 (en) * 2022-03-04 2023-09-06 Esaote S.p.A. Method and system for registering images acquired with different modalities for generating fusion images from registered images acquired with different modalities
KR102582588B1 (en) * 2022-06-09 2023-09-25 그리트 주식회사 Measuring system the leaf growth index of crops using AI
CN116824273A (en) * 2023-08-28 2023-09-29 成都飞机工业(集团)有限责任公司 Method for judging attributes of two-dimensional projection image patches of aviation manufacturing piece at any view angle

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7821687B2 (en) * 2007-10-04 2010-10-26 Lexmark International, Inc. Method for dynamically compensating for a faulty pixel in a scan line generated by a scanner

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104778693A (en) * 2015-04-08 2015-07-15 云挺 Leaf area index calculation method based on projection algorithm and active contour model
WO2019113998A1 (en) * 2017-12-11 2019-06-20 江苏大学 Method and device for monitoring comprehensive growth of potted lettuce
EP4239576A1 (en) * 2022-03-04 2023-09-06 Esaote S.p.A. Method and system for registering images acquired with different modalities for generating fusion images from registered images acquired with different modalities
KR102582588B1 (en) * 2022-06-09 2023-09-25 그리트 주식회사 Measuring system the leaf growth index of crops using AI
CN116105691A (en) * 2022-12-29 2023-05-12 浙江农林大学 Method for batch determination of leaf phenotypic traits and related equipment
CN116824273A (en) * 2023-08-28 2023-09-29 成都飞机工业(集团)有限责任公司 Method for judging attributes of two-dimensional projection image patches of aviation manufacturing piece at any view angle

Also Published As

Publication number Publication date
CN117710511A (en) 2024-03-15

Similar Documents

Publication Publication Date Title
CN102523367B (en) Real time imaging based on many palettes compresses and method of reducing
US20080080778A1 (en) Image data compression method and apparatuses, image display method and apparatuses
EP3035683A1 (en) Method and device for image compression, having enhanced matching of fixed-width, variable-length pixel sample strings
US20150312593A1 (en) Compression of light field images
US9819964B2 (en) Limited error raster compression
CN105282548B (en) Ram ratio selects
WO2009022048A1 (en) A method and apparatuses for encoding and decoding an image
CN105933708B (en) A kind of method and apparatus of data compression and decompression
CN108805942B (en) Infrared image wide dynamic compression method
US20150382004A1 (en) Limited error raster compression
JP3618833B2 (en) Image processing apparatus and method
EP3343445A1 (en) Method and apparatus for encoding and decoding lists of pixels
JP2017005456A (en) Image compression method, image compression device and imaging apparatus
CN117710511B (en) Blade imaging method of blade area measuring instrument based on photoelectric detection method and application of blade imaging method
CN102323192B (en) Cloud particle measuring system and method
CN106548223A (en) Image bar code encoding method, decoding method, encoding device and decoding device
CN112991412B (en) Liquid crystal instrument sequence frame animation performance optimization method and liquid crystal instrument
CN110853109A (en) Compression storage method of infrared chart data
CN111651630B (en) Method for improving storage efficiency of acquisition dynamic infrared thermal map by adopting key data frame
CN116256025B (en) Aeration data monitoring system of ultra-filtration water device
JP5811879B2 (en) Image processing apparatus and image processing method
CN111243046B (en) Image quality detection method, device, electronic equipment and storage medium
CN111639214B (en) Method for improving storage efficiency of robot during acquisition of dynamic infrared heat map
US20080055319A1 (en) Apparatus and Method of Conversing Data
CN107124613B (en) Method for recoding second-class product data of Doppler weather radar

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