A method for intelligent evaluation of musk-poop freshness based on color and texture features
Patent Information
- Application Number
- CN202610972688.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-01
- Publication Date
- 2026-10-23
AI Technical Summary
[0003]但是,麝类固定排便地往往会被反复使用,同一粪堆区域内可能同时存在陈旧粪粒和近期新增粪粒
本发明通过对麝类固定排便地的原始图像进行光照校正、颜色校正、图像去噪和尺度归一化,先将不同采集时间、不同光照条件和不同拍摄状态下的粪堆图像调整到可比较状态,再利用目标掩膜限定粪堆区域,并在目标掩膜范围内划分子区域进行独立分析。该处理方式能够减少林下阴影、雨后返潮、落叶遮挡、泥土背景以及拍摄角度变化对判断结果的影响,避免仅凭整堆颜色深浅作出粗略判断,使麝类粪堆新鲜度评估具有更稳定的图像基础。
Smart Images

Figure CN122967013A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of ecological monitoring technology, and more specifically, to an intelligent assessment method for the freshness of musk deer dung piles based on color and texture characteristics. Background Technology
[0002] In musk deer monitoring in the field, fixed defecation sites and the condition of dung heaps are often used to determine whether musk deer have been active in the area recently. Current patrol methods typically involve patrol personnel combining infrared camera records, footprint records, historical dung heap records, and on-site surveys to determine fixed defecation sites. Images of dung heaps are then taken using patrol terminals, fixed cameras, or site-level data acquisition terminals. The freshness of the dung heap is then manually assessed based on the color, surface condition, edge morphology, and degree of dryness / cracking of the dung particles. This method meets the needs of general patrol recording and facilitates the creation of historical monitoring archives for fixed defecation sites.
[0003] However, musk deer's designated defecation sites are often repeatedly used, and the same defecation pile area may contain both old and recently added feces. Existing methods for determining the freshness of musk defecation piles rely heavily on the overall appearance of the pile or human experience, which is easily affected by factors such as forest shadows, post-rain dampness, fallen leaves, soil background, and changes in the shooting angle. When the number of recently added feces is small, or when they are mixed with old feces, it is difficult to reliably determine the presence of new defecation evidence in the designated defecation site based solely on the overall color and on-site observation, which can easily lead to missed or incorrect assessments of recent musk deer activity. Therefore, it is still necessary to provide a technical solution that can reliably assess the freshness of musk deer defecation piles based on images. Summary of the Invention
[0004] To overcome the aforementioned deficiencies of the prior art, embodiments of the present invention provide an intelligent assessment method for the freshness of musk deer manure piles based on color and texture features to solve the problems mentioned in the background art.
[0005] To achieve the above objectives, the present invention provides the following technical solution: A smart method for assessing the freshness of musk deer dung heaps based on color and texture features includes the following steps: Acquire a standardized image corresponding to the fixed defecation site of musk deer, and generate a target mask based on the standardized image. Divide the target mask area into a set of sub-regions, the set of sub-regions including multiple sub-regions and the area and spatial relationship of each sub-region; Effective sub-regions are determined from the set of sub-regions, and the local fresh grain value of each effective sub-region is determined based on the color depth preservation parameter, edge integrity parameter, and surface crack parameter of each effective sub-region. Based on the local fresh grain value, the sub-region freshness result of each effective sub-region is generated, and the sub-regions with the sub-region freshness result as fresh sub-regions and relatively fresh sub-regions are combined to form a fresh grain region set. The distribution value of newly added fecal particles is determined based on the area ratio of the fresh particle region set in the effective sub-region set, the number of sub-regions, and the spatial aggregation state; wherein, the spatial aggregation state is determined based on the aggregation region formed by fresh particle regions that are adjacent to each other or whose distance is less than a preset distance threshold in the fresh particle region set. Based on the newly added fecal particle distribution value and the sub-region freshness results of each effective sub-region, it is determined whether there is evidence of new defecation in the fixed defecation site of the musk deer, and an overall fecal pile freshness level is generated.
[0006] In a preferred embodiment, the standardized image is obtained by standardizing an original image containing a musk deer dung heap and its surrounding ground background. The original image is bound to the acquisition point number, acquisition time, and image number and stored accordingly. The standardization process includes illumination correction, color correction, image denoising, and scale normalization. Original images lacking acquisition point numbers, acquisition times, or image numbers are not used as valid input for assessing the freshness of the current dung heap. Original images with insufficient image clarity, severely missing dung heap areas, or significantly deviated field of view from the acquisition point are marked as invalid acquisition images.
[0007] In a preferred embodiment, the target mask is generated based on the color range, particle shape, edge contour, and local texture state in a standardized image. The standardized image is converted to the HSV color space or the Lab color space. A color reference range for the manure pile is determined based on manually labeled samples or historical valid images from the same acquisition point. Pixel regions whose color depth, saturation, and brightness distribution fall within the color reference range for the manure pile and whose local texture state meets the surface texture matching conditions of manure particles are determined as candidate regions. Connected regions are filtered based on their connected region area, outer contour, roundness, aspect ratio, and average edge response. Connected regions whose area reaches the fragment removal threshold, whose roundness is not lower than a preset roundness threshold, whose aspect ratio is not greater than a preset aspect ratio threshold, and whose average edge response is higher than the average edge response of the surrounding background are retained as part of the target mask.
[0008] In a preferred embodiment, when dividing the target mask into sub-region sets, suspected fecal particle regions are first determined based on the connected components in the target mask; for suspected fecal particle regions whose contour boundaries can be closed independently and which do not have obvious adhesion to surrounding fecal particles, they are taken as a sub-region; for suspected fecal particle regions that have contact, overlap, or discontinuous boundaries, candidate segmentation positions are determined by combining concave boundaries, color abrupt change positions, texture direction change positions, and edge response intensity, and multiple sub-regions are formed when each part still meets the fecal particle region area requirements after segmentation; for regions where fecal particles are dense and cannot be stably segmented particle by particle, they are divided into multiple local sub-regions according to the consistency of local color state and texture state, and the position, area, boundary contour, adjacency relationship, and validity mark of each sub-region are recorded.
[0009] In a preferred embodiment, the validity marker is used to distinguish between valid sub-regions, invalid sub-regions, and sub-regions to be confirmed. A sub-region is defined as valid if its valid pixel area is 60% or more of its total area, its valid boundary length is 40% or more of its total outer contour length, and its occlusion area does not exceed 60%. A sub-region is defined as invalid if its valid pixel area is less than 40% of its total area, its valid boundary length is less than 25% of its total outer contour length, or its occlusion area exceeds 60%. Sub-regions other than the aforementioned valid and invalid sub-regions are defined as sub-regions to be confirmed. The image position and boundary information of these sub-regions are retained, but they are not used as the primary basis for generating the overall freshness level of the manure pile.
[0010] In a preferred embodiment, when determining the local fresh grain value, the color information, outer contour information, and internal texture information of the effective sub-region are read respectively; the color depth preservation parameter is determined based on the color depth, saturation, and brightness distribution of pixels within the effective sub-region; the edge integrity parameter is determined based on the continuity of the outer contour of the effective sub-region, the edge response intensity, and the adhesion between the effective sub-region and adjacent old feces or the background; the surface crack parameter is determined based on the elongated edge segments, grayscale abrupt changes, local roughness, and texture unevenness within the effective sub-region; after normalizing the color depth preservation parameter, edge integrity parameter, and surface crack parameter and unifying their value directions, the local fresh grain value of the corresponding effective sub-region is determined according to a preset weighting relationship. The larger the local fresh grain value, the closer the effective sub-region is to the state of recently formed fresh feces grains.
[0011] In a preferred embodiment, when generating sub-region freshness results based on the local fresh grain values, a first fresh grain threshold, a second fresh grain threshold, and a third fresh grain threshold are set, wherein the first fresh grain threshold is higher than the second fresh grain threshold, and the second fresh grain threshold is higher than the third fresh grain threshold; effective sub-regions with local fresh grain values reaching the first fresh grain threshold are determined as fresh sub-regions; effective sub-regions with local fresh grain values lower than the first fresh grain threshold but reaching the second fresh grain threshold are determined as relatively fresh sub-regions; effective sub-regions with local fresh grain values lower than the second fresh grain threshold but reaching the third fresh grain threshold are determined as relatively old sub-regions; and effective sub-regions with local fresh grain values lower than the third fresh grain threshold are determined as old sub-regions. The freshness results of the aforementioned sub-regions are then saved along with the positions and areas of the corresponding effective sub-regions.
[0012] In a preferred embodiment, for sub-regions where the absolute value of the difference between the local fresh grain value and the first fresh grain threshold, the second fresh grain threshold, or the third fresh grain threshold is less than 0.03, confirmation is made by combining the freshness results, validity markers, and spatial locations of their adjacent sub-regions. If the sub-region is adjacent to two or more fresh or relatively fresh sub-regions, its original sub-region freshness result is retained. If the aforementioned retention conditions are not met, if the proportion of relatively old, stale, or invalid sub-regions among the sub-regions adjacent to the sub-region is not less than 50%, it is recorded as a sub-region to be confirmed due to the threshold boundary. For sub-regions that do not meet the above two conditions, their original sub-region freshness result is retained, and a threshold boundary marker is added.
[0013] In a preferred embodiment, the newly added fecal particle distribution value is determined based on the fresh particle area parameter, the fresh particle quantity parameter, and the fresh particle aggregation parameter. Fresh sub-regions and relatively fresh sub-regions are combined to form a fresh particle region set. Fresh sub-regions, relatively fresh sub-regions, relatively old sub-regions, and old sub-regions that can participate in the judgment are combined to form an effective sub-region set. The fresh particle area parameter is determined based on the relationship between the sum of the areas of the fresh particle region set and the sum of the areas of the effective sub-region set. The fresh particle quantity parameter is determined based on the relationship between the number of sub-regions in the fresh particle region set and a preset quantity benchmark value. Adjacent fresh particle regions or those with a distance less than a preset distance threshold are merged into the same aggregation region. The fresh particle aggregation parameter is determined based on the relationship between the area of the largest fresh particle aggregation region and the sum of the areas of the fresh particle region set. Finally, the newly added fecal particle distribution value is determined based on the fresh particle area parameter, the fresh particle quantity parameter, and the fresh particle aggregation parameter, according to a preset weighted relationship.
[0014] In a preferred embodiment, the overall freshness level of the manure pile is determined based on a preset new addition threshold, a preset suspected addition threshold, a preset freshness percentage threshold, a preset high freshness particle threshold, and a preset oldness percentage threshold, wherein the preset new addition threshold is higher than the preset suspected addition threshold. When the distribution value of new manure particles is not lower than the preset new addition threshold, it is determined that there is evidence of new defecation at the fixed defecation site. If the area ratio of fresh sub-regions in the fresh particle region set is not lower than the preset freshness percentage threshold, or the average local freshness particle value of the fresh particle region set is not lower than the preset high freshness particle threshold, then the overall freshness level of the manure pile is determined to be a fresh manure pile. Otherwise, the overall freshness level of the manure pile is determined to be a relatively fresh manure pile; when the distribution value of newly added fecal particles is lower than the preset new determination threshold but not lower than the preset suspected threshold, it is determined that there is a suspected state of newly added defecation in the fixed defecation site, and the overall freshness level of the manure pile is determined to be a mixed new and old manure pile; when the distribution value of newly added fecal particles is lower than the preset suspected threshold, it is determined that there is no obvious evidence of newly added defecation in the fixed defecation site. If the area ratio of the old sub-region in the effective sub-region set is not lower than the preset old ratio threshold, the overall freshness level of the manure pile is determined to be an old manure pile, otherwise the overall freshness level of the manure pile is determined to be a relatively old manure pile.
[0015] The technical effects and advantages of this invention are as follows: This invention performs illumination correction, color correction, image denoising, and scale normalization on raw images of musk deer's fixed defecation sites. First, images of defecation piles from different acquisition times, lighting conditions, and shooting states are adjusted to a comparable state. Then, a target mask is used to define the defecation pile area, and sub-regions within the target mask area are divided for independent analysis. This processing method reduces the influence of forest shadows, post-rain dampness, fallen leaves, soil background, and changes in shooting angle on the judgment results, avoiding rough judgments based solely on the overall color intensity of the pile, and providing a more stable image basis for assessing the freshness of musk deer defecation piles.
[0016] This invention does not treat the entire manure pile as a single object for averaging. Instead, it calculates the color depth preservation parameter, edge integrity parameter, and surface crack parameter for each effective sub-region, and determines the local fresh particle value and the freshness result of the sub-region based on these parameters. Then, based on the area ratio of fresh and relatively fresh sub-regions in the effective sub-regions, the number of sub-regions, and the spatial aggregation state, it determines the distribution value of newly added manure particles and outputs the overall freshness level of the manure pile. This enables the identification of evidence of locally added defecation in fixed defecation sites where old and recently added manure particles are mixed, reducing the risk of a small number of newly added manure particles being masked by the overall average characteristics. This provides a clearer and more traceable basis for patrol review, sampling arrangements, and the judgment of recent musk deer activity. Attached Figure Description
[0017] To facilitate understanding by those skilled in the art, the present invention will be further described below with reference to the accompanying drawings; Figure 1 This is a flowchart illustrating an intelligent assessment method for the freshness of musk deer droppings based on color and texture features. Figure 2 This is a schematic diagram of the original image standardization process; Figure 3 A schematic diagram of target mask generation and sub-region division; Figure 4 This diagram illustrates the assessment of local fresh grain values, newly added manure grain distribution values, and the overall freshness level of the manure pile. Detailed Implementation
[0018] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0019] Example 1: This invention provides an intelligent assessment method for the freshness of musk deer droppings based on color and texture features, such as... Figure 1 As shown, it includes the following steps: Step 1: Determine the fixed defecation site of musk deer as the collection point, acquire the original image containing the musk defecation pile and the surrounding ground background, and perform illumination correction, color correction, image denoising and scale normalization on the original image to obtain the standardized image corresponding to the fixed defecation site of musk deer. Step 2: Based on the standardized image, identify the musk deer dung heap area and generate a target mask. Divide the area of the target mask into a set of sub-regions, record the area and spatial relationship of each sub-region, and determine the effective sub-regions from the set of sub-regions according to the effective pixel area, effective boundary length and occlusion area ratio of each sub-region. Step 3: Read the color information, outer contour information and internal texture information of each effective sub-region respectively, determine the color depth preservation parameter, edge integrity parameter and surface crack parameter of each effective sub-region, and determine the local fresh grain value of the corresponding effective sub-region based on the color depth preservation parameter, edge integrity parameter and surface crack parameter, and then generate the sub-region freshness result of each effective sub-region based on the local fresh grain value; Step four: Subregions with fresh and relatively fresh subregions as their freshness results are combined into a fresh particle region set. The distribution value of newly added feces particles is determined based on the area ratio of the fresh particle region set in the effective subregion set, the number of subregions, and the spatial aggregation state. Based on the distribution value of newly added feces particles and the freshness results of each effective subregion, it is determined whether there is evidence of newly added defecation in the fixed defecation site of the musk deer, and the overall feces pile freshness level is generated.
[0020] Specifically: Step one: Within the target monitoring area, based on patrol records, infrared camera records, footprint records, historical dung pile records, and manual survey results, determine the musk deer's fixed defecation sites as collection points. Each collection point corresponds to a dung pile monitoring task, which includes at least the collection point number, geographical coordinates, collection time, altitude, slope aspect, vegetation obstruction status, and historical dung pile discovery records. The historical dung pile discovery records include at least the time when dung piles were previously discovered at that collection point, the location of the dung pile, the freshness of the manually recorded information, and the corresponding image number, used for subsequent continuous analysis of dung pile changes within the same fixed defecation site.
[0021] Original images containing musk deer droppings and the surrounding ground background are acquired at the designated collection points. These original images are obtained using a patrol terminal, a fixed camera, or a site-level acquisition terminal. During acquisition, the image capture area is designed to cover the area containing the droppings and a certain range of the surrounding ground background to facilitate subsequent differentiation between the droppings area and non-droppings. For acquisition methods using fixed cameras or site-level acquisition terminals, the shooting direction and distance of the acquisition terminal are fixed during installation, ensuring that original images obtained from the same collection point at different times have similar fields of view. For acquisition methods using patrol terminals, patrol personnel acquire images according to preset shooting distances and angles, and bind and save the collection point number, collection time, and image number to the original image.
[0022] The system archives raw images according to the acquisition point number and acquisition time, forming an image sequence for the same acquisition point. Raw images lacking acquisition point number, acquisition time, or image number are not considered valid input for the current manure pile freshness assessment. Raw images with insufficient clarity, severely missing manure pile areas, or significantly deviated field of view from the acquisition point are marked as invalid acquisition images, prompting the system to re-acquire or proceed to manual review.
[0023] Insufficient image sharpness can be determined based on the edge response of the target candidate area and its surrounding ground background area. The system calculates the grayscale gradient change value or Laplacian response variance of the original image after standardization. If this value is lower than 50% of the average value of the corresponding historical valid images from the same acquisition terminal, or lower than the preset sharpness threshold, the original image is marked as an invalid acquisition image. Severely missing manure pile areas refer to situations where the area of the suspected manure pile area is less than 30% of the average area of historical manure pile areas at the same acquisition point, or where the obstructed area in the suspected manure pile area exceeds 60%. Significant deviation of the shooting field of view from the acquisition point refers to situations where the overlap ratio between the stable background reference area in the standardized image and the corresponding background reference area in the historical image is less than 70%, or the offset distance of the center position of the manure pile area relative to the center position of the historical manure pile area exceeds 20% of the width of the standardized image.
[0024] After obtaining the original image, the system performs standardization processing on the original image to obtain a standardized image, such as... Figure 2 As shown. Standardization processing includes illumination correction, color correction, image denoising, and scale normalization. Illumination correction is mainly used to reduce the impact of forest shadows, differences in morning and evening light, canopy occlusion, and changes in supplemental light intensity on the color judgment of manure piles; color correction is used to make the color representation of images obtained at different acquisition times comparable; image denoising is used to reduce the interference of low light, rain and fog environments, or noise from the acquisition terminal on subsequent texture analysis; scale normalization is used to unify the scale of manure particles in images before and after the same acquisition point, avoiding the influence of changes in shooting distance or field of view on the determination of edge integrity parameters and surface crack parameters.
[0025] In specific processing, the system can first select a neutral background region or a preset reference region from the original image to perform white balance correction on the entire image. The so-called neutral background region is the ground area in the image that is less affected by the color of the manure pile and has relatively stable brightness changes. Then, the color of the image is corrected according to the calibration parameters provided by the acquisition terminal, so that the color depth, saturation, and brightness distribution of the manure pile area can be compared between different acquisition times. After the color correction is completed, some random noise is removed using edge-preserving denoising, while also retaining information that needs to be considered in subsequent analysis, such as manure particle boundaries, surface cracks, and rough textures. Finally, according to the fixed field of view of the acquisition point or based on the existence of a stable background reference region in the image, cropping, rotation correction, and scale unification processing are performed so that the manure pile area in the current standardized image has a similar spatial location and analysis scale to the corresponding area in the historical image.
[0026] Step two: The system uses the standardized image obtained in step one as input, identifies the musk deer dung heap region in the standardized image, and generates a target mask corresponding to the dung heap region, such as... Figure 3 As shown.
[0027] The target mask is used to limit the extraction range of subsequent color and texture features. The effective area in the target mask corresponds to the suspected manure pile area, and the non-effective area corresponds to the soil or other ground background area.
[0028] When generating the target mask, the system considers the color range, particle shape, edge contour, and local texture of the manure pile area. The system first filters candidate regions in the standardized image that are similar in color and local texture to the manure pile, and then refines these candidate regions based on their connectivity and morphological features. Regions that are too small, have a distinctly elongated shape, or whose edge texture matches that of withered leaf veins or branches are removed from the candidate regions. Dark soil clumps, stone shadows, or tree branch shadows that are similar in color but do not conform to the manure particle contour are excluded based on their boundary continuity, local rough texture, and connection to the surrounding background.
[0029] To prevent small noise points from entering subsequent analysis, the system performs connected component filtering on the initial identification results. This filtering involves treating interconnected pixel regions in the initial identification results as independent connected components and retaining or deleting them based on their area, outer contour, roundness, and distance from adjacent regions. The area threshold can be determined based on the minimum projected area of a single musk deer feces particle at the current acquisition scale; for example, 0.2 to 0.4 times this minimum projected area can be used as the fragment removal threshold. Connected components below this threshold and not adjacent to other suspected feces particle regions are removed as noise regions. For connected components with the required area and a shape close to the feces particle outline, the system retains them as part of the target mask.
[0030] When generating the target mask, the system converts the standardized image to the HSV or Lab color space and determines the color reference range of the manure pile based on manually labeled samples or historical valid images from the same acquisition point. The system identifies pixel regions whose color depth, saturation, and brightness distribution fall within the manure pile color reference range and whose local texture meets the surface texture matching conditions of manure particles as candidate regions. For each candidate region's corresponding connected component, the system calculates the connected component area, outer contour, roundness, aspect ratio, and average edge response. If the connected component area is lower than the fragment removal threshold, or the aspect ratio is greater than 4 and the edge direction is unidirectional, the connected component is removed as a branch, leaf vein, or strip-shaped shadow region. If the connected component color falls within the manure pile color reference range, but the roundness is lower than the preset roundness threshold and there is no obvious edge response between it and the surrounding ground background, it is removed as a dark soil block, stone shadow, or background dark spot. If the roundness of the connected region is not lower than the preset roundness threshold, the area reaches the fragment removal threshold, the aspect ratio is not greater than the preset aspect ratio threshold, and the average edge response is higher than the average edge response of the surrounding background, then it is retained as part of the target mask.
[0031] The fecal particle surface texture matching conditions can be determined based on the contrast of the gray-level co-occurrence matrix, local binary pattern features, and edge direction dispersion within the candidate region. For a candidate region, if the feature distance between its local texture and the fecal particle surface texture in manually labeled samples or historical valid images of the same acquisition point is not higher than a preset texture distance threshold, the candidate region is determined to meet the fecal particle surface texture matching conditions. When the texture direction of the candidate region is a single elongated strip, or its texture direction is consistent with the direction of leaf veins or branch edges, and its aspect ratio exceeds a preset aspect ratio threshold, the candidate region is not included as part of the target mask. The preset rounding threshold can be taken from 0.30 to 0.45, and the preset aspect ratio threshold can be taken from 3 to 5, and adjusted according to the projection shape of musk deer fecal particles at the current acquisition scale.
[0032] After obtaining the target mask, the system does not directly perform color and texture analysis on the entire target mask as a whole. Instead, it divides the target mask area into multiple sub-regions. For a single fecal particle with clear boundaries and not adhering to other fecal particles, the system determines the connected component corresponding to that single fecal particle as a sub-region. For regions where multiple fecal particles are in contact, partially overlapping, or have unclear boundaries, the system divides the region into multiple sub-regions based on the concave boundaries between fecal particles, the locations of local color abrupt changes, the locations of texture direction changes, and the edge response intensity. For regions with dense fecal particles that are difficult to segment individually, the system divides them into multiple local sub-regions based on the consistency of local color and texture, with each local sub-region serving as an independent analysis unit for subsequent analysis.
[0033] For regions where multiple fecal particles are in contact, partially overlapping, or have unclear boundaries, the system extracts boundary depressions and distance transformation peaks within these regions. Gray-level valleys, color abrupt change lines, or edge response lines between adjacent distance transformation peaks are used as candidate segmentation lines. If the difference in the mean color across a candidate segmentation line is greater than 0.8 times the standard deviation of the region's color, or the difference in texture direction between the two sides is not less than 30 degrees, and the area of each sub-region obtained after segmentation is not less than the fragment removal threshold, then the system performs segmentation along that candidate segmentation line. If the candidate segmentation line does not meet the above conditions, it does not force segmentation on a particle-by-particle basis, but instead divides the region into multiple local sub-regions based on the consistency of local color and texture. Each individual fecal particle region or local sub-region obtained in this way serves as an independent analysis unit for subsequent calculations of color depth preservation parameters, edge integrity parameters, and surface crack parameters.
[0034] When dividing the area into sub-regions, the system preserves the spatial relationships between them. For adjacent sub-regions with similar color and texture, the system records their adjacency. For adjacent sub-regions with significant differences in color depth, edge condition, or crack condition, the system saves them separately as candidate regions for different formation states. This process preserves the local differences between fresh and old fecal particles in the same fixed defecation area, avoiding the masking of newly added fecal particles after merging new and old particles into an average area.
[0035] For sub-regions affected by fallen leaves, soil, or shadows, the system records a validity label for each sub-region. The validity label is determined based on the effective pixel area, effective boundary length, and occlusion area percentage within the sub-region that can be used for color and texture feature extraction. A sub-region is retained as valid if its effective pixel area is not less than 60% of its area, its effective boundary length is not less than 40% of its outer contour length, and its occlusion area percentage does not exceed 60%. A valid sub-region is defined as one located within the target mask area, where its color, boundary contour, and surface texture can still be stably identified. A sub-region is marked as invalid if its effective pixel area is less than 40% of its area, its effective boundary length is less than 25% of its outer contour length, or its occlusion area percentage exceeds 60%. Other sub-regions falling within the above ranges are marked as unconfirmed sub-regions; among these, unconfirmed sub-regions formed because their effective pixel area, effective boundary length, or occlusion area percentage falls within the boundary range can also be referred to as valid unconfirmed sub-regions. The sub-region to be confirmed retains its image location, boundary outline, and validity markers, but it is not used as the main basis for judging the overall freshness level of the manure pile; when a review is required, it will be submitted to manual confirmation.
[0036] Step 3: Using the sub-region set obtained in Step 2 as the analysis object, read the pixel information of each valid sub-region in the standardized image, and extract the corresponding color and texture states, such as... Figure 4 As shown. For the i-th valid sub-region, the system determines the color depth preservation parameters based on the pixel distribution, outer contour state, and internal texture changes within that sub-region. Edge integrity parameters and surface crack parameters .
[0037] Among them, color depth preservation parameters This is used to reflect whether the color of the effective sub-region is close to the state of recently formed fecal particles; the system can convert the pixels in the effective sub-region to the HSV color space or the Lab color space, and make a judgment based on color depth, saturation, and brightness distribution; if the overall color of the effective sub-region is relatively dark, the saturation is high, and the brightness distribution is relatively concentrated, then the color depth preservation parameter is used to reflect whether the effective sub-region is close to the state of recently formed fecal particles. The value should be relatively large; if the color of the effective sub-region is grayish, lightened, or has a discrete brightness distribution, then the color depth preservation parameter should be adjusted. The value is reduced accordingly; in specific calculations, the color depth preservation parameter... It can be determined by combining the median value of brightness, the mean value of saturation, and the brightness percentile difference of pixels within the effective sub-region.
[0038] Edge integrity parameters This parameter characterizes whether the corresponding fecal particle shape remains intact within a sub-region. The system determines the edge integrity parameter based on the sub-region's boundary contour, edge response intensity, contour continuity, and degree of adhesion to adjacent old feces or the background. For sub-regions with clear boundaries, continuous contours, few edge breaks, and significant separation from the surrounding area, the edge integrity parameter... Larger; for subregions with fragmented boundaries, missing outlines, and obvious adhesion to the surrounding old manure particles or soil background, the edge integrity parameter is relatively large. It is relatively small. This parameter can be obtained from the sub-region boundary information output in step two and the edge response results in the normalized image.
[0039] Surface crack parameters This system is used to characterize whether the surface of a sub-region has developed an aged, dry cracking state. The system determines the crack state based on elongated edge segments, abrupt changes in grayscale, local roughness, and textural inhomogeneity within the sub-region. Fresh fecal particles typically have a more intact surface with fewer elongated cracks and gentler local texture variations; aged fecal particles are prone to dry cracking, porosity, broken edges, and higher roughness. Therefore, in determining surface crack parameters... At that time, the system reverses the direction of crack number, crack length, and roughness, so that when there are fewer cracks and the surface is smoother, the surface crack parameters are optimized. The larger the surface crack parameter, the more cracks and the rougher the surface. The smaller.
[0040] Color depth retention parameters Edge integrity parameters and surface crack parameters All parameters are processed to a uniform scale within the range of 0 to 1. The values of the three parameters are kept consistent; the larger the value, the closer the corresponding effective sub-region is to the state of recently formed fresh fecal particles.
[0041] When determining the specific color depth preservation parameters, the system first reads the median luminance, mean saturation, and luminance percentile of pixels within the i-th valid sub-region. Then, it combines this data with historical valid images from the same acquisition point or manually labeled samples to determine the normalized range of these values. Generally, a lower median luminance indicates a darker color in the valid sub-region; a higher mean saturation indicates better color preservation; and a smaller luminance percentile indicates more concentrated luminance variations within the region. Based on this, the system determines whether the valid sub-region still conforms to the color depth state of recently formed fecal particles and determines the corresponding color depth preservation parameters. .
[0042] For the edge integrity parameter, the system calculates the contour continuity rate, mean edge response, and adhesion area ratio of the i-th effective sub-region. The contour continuity rate is the ratio of the length of the outer contour with continuous edge response to the total length of the outer contour of the effective sub-region; the adhesion area ratio is the ratio of the area of the effective sub-region adhered to by adjacent old manure or background to the area of the effective sub-region. The higher the contour continuity rate, the higher the mean edge response, and the lower the adhesion area ratio, the larger the edge integrity parameter.
[0043] For surface crack parameters The system identifies slender edge segments within the i-th effective sub-region and determines the surface cracking condition by combining crack segment density, cumulative crack length, and local roughness. Crack segment density represents the number of slender edge segments per unit area; cumulative crack length represents the total length of all slender edge segments within the effective sub-region; local roughness is determined based on the magnitude of grayscale abrupt changes and the degree of texture unevenness within the region. Generally, fewer crack segments, shorter cumulative lengths, and smoother changes in surface grayscale and texture indicate that the surface state of the effective sub-region is closer to that of recently formed fecal particles, and the surface crack parameters are... The larger value should be selected accordingly; otherwise, the surface crack parameter should be selected. reduce.
[0044] The aforementioned median brightness, mean saturation, brightness quantile difference, contour continuity, mean edge response, adhesion area ratio, crack segment density, cumulative crack length, and local roughness are all normalized to between 0 and 1. For intermediate values that are inversely related to freshness, the system performs a directional reversal after normalization, ensuring that the color depth preservation parameter, edge integrity parameter, and surface crack parameter all satisfy the condition that the larger the value, the closer it is to the state of recently formed fresh fecal particles. This avoids old fecal particles after rain being separately judged as fresh sub-regions simply because their color has darkened.
[0045] When normalizing intermediate values, the system uses historical samples from the same sampling point as a reference, selecting the maximum and minimum values of the corresponding intermediate values as normalization boundaries; alternatively, it can determine the normalization boundaries based on the value range formed in manually labeled samples. If the current intermediate value falls within the specified value range, it is converted to a value between 0 and 1; if the current intermediate value is higher than the upper limit or lower than the lower limit, it is treated as 1 or 0 respectively. This processing reduces the interference of individual abnormal pixels, local strong shadows, or reflective areas on local grain values.
[0046] The manually labeled samples are categorized into fresh fecal pellet samples, relatively fresh fecal pellet samples, relatively old fecal pellet samples, and old fecal pellet samples based on their freshness as recorded manually. Fresh fecal pellet samples correspond to areas of fecal pellets that are considered to have formed recently, are darker in color, have relatively intact edges, and have fewer surface cracks, according to manual verification. Relatively fresh fecal pellet samples correspond to areas of fecal pellets that are still darker in color but have shown slight changes in edge or surface condition. Relatively old fecal pellet samples correspond to areas of fecal pellets that have become lighter in color, have decreased edge integrity, or have increased surface cracks. Old fecal pellet samples correspond to areas of fecal pellets that have become noticeably grayish and lighter in color, have broken edges, or have obvious surface cracks. The system statistically analyzes the distribution of values for the median brightness, mean saturation, brightness quantile difference, contour continuity, mean edge response, adhesion area ratio, crack segment density, cumulative crack length, and local roughness from the above samples, and determines the normalized range of the color depth preservation parameter, edge integrity parameter, and surface crack parameter accordingly.
[0047] The system uses the color depth preservation parameter of the i-th effective sub-region. Edge integrity parameters and surface crack parameters Determine the local fresh grain value of this sub-region. The local fresh grain value The subregion is used to characterize the likelihood of it being a region of recently formed fecal particles, and its calculation method is as follows: ; in, This represents the local fresh grain value of the i-th valid sub-region; This represents the color depth preservation parameter for the i-th valid sub-region; This represents the edge completeness parameter of the i-th valid sub-region; This represents the surface crack parameters of the i-th effective sub-region; , , These are the weighting coefficients for the color depth preservation parameter, edge integrity parameter, and surface crack parameter, respectively, and they satisfy the following: ; For example, α can be 0.35, β can be 0.35, and γ can be 0.30. The above weights are not fixed and can be adjusted based on manually labeled fresh fecal samples, relatively fresh fecal samples, relatively old fecal samples, and old fecal samples.
[0048] Obtain local fresh grain value Then, based on this value, the freshness result of the corresponding effective sub-region is determined. A first fresh grain threshold, a second fresh grain threshold, and a third fresh grain threshold are set, where the first fresh grain threshold is higher than the second fresh grain threshold, and the second fresh grain threshold is higher than the third fresh grain threshold. When the local fresh grain value... When the value reaches or exceeds the first fresh grain threshold, the effective sub-region is defined as a fresh sub-region; when the local fresh grain value... When the grain size is below the first fresh grain threshold but not below the second fresh grain threshold, the effective sub-region is defined as a relatively fresh sub-region; when the local fresh grain value... When the fresh grain value is below the second fresh grain threshold but not below the third fresh grain threshold, the effective sub-region is identified as a relatively old sub-region; when the local fresh grain value... When the value falls below the third fresh grain threshold, the effective sub-region is identified as an old sub-region. In one specific embodiment, the first fresh grain threshold can be set to 0.75 to 0.85, the second fresh grain threshold to 0.55 to 0.65, and the third fresh grain threshold to 0.35 to 0.45. These thresholds can be calibrated using manually verified samples from different monitoring areas and kept relatively stable within a continuous monitoring period in the same monitoring area or at the same collection point.
[0049] When calibrating the first, second, and third fresh grain thresholds, the system uses the local fresh grain values corresponding to manually verified samples as the basic data, and statistically analyzes the local fresh grain value distributions for fresh, relatively fresh, relatively old, and old fecal grain samples, respectively. The first fresh grain threshold is set within the boundary between fresh and relatively fresh fecal grain samples, the second fresh grain threshold is set within the boundary between relatively fresh and relatively old fecal grain samples, and the third fresh grain threshold is set within the boundary between relatively old and old fecal grain samples. If the local fresh grain values of different categories of samples overlap, the system prioritizes ensuring that fresh and relatively fresh sub-regions are not significantly missed, and records sub-regions with local fresh grain values near the threshold boundaries as sub-regions to be confirmed. Once the above thresholds are determined, they remain consistent within the continuous monitoring period of the same monitoring area or the same collection point; recalibration is then performed when the manually verified samples show continuous changes in lighting conditions, ground background, or fecal grain surface condition.
[0050] For areas severely obscured by fallen leaves, soil, or shadows, resulting in reduced color depth retention parameters Edge integrity parameters Or surface crack parameters Subregions that cannot be reliably obtained are identified as invalid subregions and are not used as the primary basis for calculating subsequent fecal particle distribution values. For subregions where parameters are obtainable but local fresh particle values are near the threshold boundary, the system retains their local fresh particle values and corresponding image locations as the basis for subsequent manual verification or sample updates.
[0051] A local fresh grain value near the threshold boundary refers to a local fresh grain value whose absolute difference from the first, second, or third fresh grain threshold is less than 0.03. For this type of sub-region, the system confirms its freshness by combining the freshness results, validity markers, and spatial location of its adjacent sub-regions. If the sub-region is adjacent to two or more fresh or relatively fresh sub-regions, its original freshness result is retained. If the aforementioned retention conditions are not met, and the proportion of relatively old, stale, or invalid sub-regions among the adjacent sub-regions is not less than 50%, the sub-region is recorded as a sub-region to be confirmed due to the threshold boundary, and its corresponding image location is attached when outputting the overall manure pile freshness assessment result. For sub-regions that do not meet the above two conditions, the system retains its original freshness result and adds a threshold boundary marker as the basis for subsequent manual review or sample updates.
[0052] Through this step, the system outputs the color depth preservation parameters, edge integrity parameters, surface crack parameters, local fresh particle values, and sub-region freshness results for each effective sub-region. This step first determines the freshness of fecal particles at the sub-region level, enabling the individual identification of locally fresh fecal particles within the same musk defecation area, thus providing a basis for determining the distribution value of newly added fecal particles in step four.
[0053] Step four: The system receives the local fresh particle value and freshness result of each effective sub-region from Step three, and determines whether there are recently added fecal particles in the fixed defecation site. In this embodiment, evidence of newly added defecation refers to the evidence of recent activity formed when the set of fresh particle regions formed by fresh and relatively fresh sub-regions in the standardized image at the current acquisition time meets the preset judgment requirements in terms of area ratio, number of sub-regions, and spatial aggregation state. The evidence of newly added defecation does not require pixel-level difference between the current standardized image and the image at the previous acquisition time before it can be generated; when there is a mixed distribution of old fecal particles and recently added fecal particles in the same fixed defecation site, the system judges whether there are fecal particle regions with recently formed characteristics in the current image by the local fresh particle value and the distribution value of newly added fecal particles, and outputs the judgment result as evidence of newly added defecation or suspected state of newly added defecation.
[0054] To avoid misinterpreting localized reflections, post-rain dampness, deepened shadows, or segmentation errors as evidence of new defecation, the system determines the distribution value of new fecal particles based on the area, quantity, and spatial aggregation support of the fresh particle region set. New fecal particle distribution value is considered evidence of new defecation only when it is not lower than a preset threshold. If only a few scattered sub-regions are identified as fresh or relatively fresh, but their area proportion is low, their quantity does not reach the preset quantity benchmark, or they do not form a stable aggregation area, these sub-regions are recorded only as locally suspicious areas and are not directly output as evidence of new defecation. If the fresh particle region set is close to but does not meet the criteria for new defecation evidence in terms of area, quantity, or spatial aggregation, a suspected new defecation status is output, along with the corresponding fresh sub-region location, for patrol verification.
[0055] Since both old and recently added feces may exist in the same musk defecation site, the system does not directly average the color or texture features of all sub-regions. Instead, it first selects sub-regions that can represent the recent formation state based on the local fresh grain value, and then determines the distribution value of newly added feces based on the area, quantity, and spatial distribution of these sub-regions in the entire feces pile area.
[0056] Specifically, the system groups the sub-regions identified as fresh and relatively fresh in step three into a fresh particle region set F, and the fresh, relatively fresh, relatively old, and old sub-regions that can participate in the judgment in step three into a valid sub-region set V. Regions identified as invalid sub-regions are not included in the main calculation of the newly added fecal particle distribution value because their color and texture cannot stably reflect the fecal particle state. Let the area of the i-th valid sub-region be... The system first determines the fresh particle area parameter A based on the sum of the areas of the fresh particle region set F and the sum of the areas of the effective sub-region set V. The calculation formula is as follows: ; Where A represents the fresh grain area parameter, which is used to represent the area ratio of fresh sub-regions and relatively fresh sub-regions in all effective sub-regions; F represents the set of fresh grain regions; V represents the set of effective sub-regions; This represents the area of the i-th valid sub-region. The larger the fresh grain area parameter A, the higher the proportion of sub-regions with recently formed characteristics within the fixed defecation area; the smaller the fresh grain area parameter A, the smaller the proportion of recently formed characteristics, or the absence of areas with significant new fecal particles.
[0057] The system further determines the fresh grain quantity parameter N based on the number of sub-regions in the fresh grain region set F. Let... Let F be the number of subregions in the set of fresh particle regions. To establish a preset baseline value, the fresh grain quantity parameter N is determined according to the following formula: ; Wherein, N represents the fresh grain quantity parameter, which is used to indicate whether the fresh sub-region and the relatively fresh sub-region have stable support in terms of quantity; This represents the number of subregions in the set of fresh particle regions F; This represents a preset baseline quantity, which can be determined based on the number of common fecal particles in a single defecation of musk deer at the same collection scale or through manual verification of samples. The range is 5 to 30, with 8 to 15 being preferred. For fixed defecation sites with a small number of sparsely distributed fecal particles, a preset baseline value is established. Take a value of 5 to 8; for fixed defecation sites with a large number of fecal particles and relatively stable historical fecal pile records, a preset baseline value is used. Take 10 to 15; for fixed defecation sites with dense fecal particles that are difficult to separate into individual particles, the system determines a preset baseline value based on the number of local sub-regions and manually verified samples. Preset quantity baseline value Once determined, the system maintains consistency throughout the continuous monitoring period at the same sampling point; when manual verification of the samples shows a continuous change in the density of fecal particles at that sampling point, the system recalibrates the preset quantity baseline value. By setting the fresh grain quantity parameter, we can avoid using a single local reflective spot, segmentation error, or a small number of abnormal pixels as direct evidence of new defecation.
[0058] The system also determines the fresh particle aggregation parameter K based on the spatial relationships between the sub-regions in the fresh particle region set F. In one specific implementation, the system merges adjacent fresh particle regions or those with a distance less than a preset distance threshold into the same aggregation region, and selects the aggregation region with the largest area from all aggregation regions as the largest fresh particle aggregation region, denoted as its area. The preset distance threshold is determined based on the average minor axis length of a single fecal particle after scale normalization, and is taken as 0.5 to 2 times the average minor axis length of a single fecal particle. If a single fecal particle can be stably identified in the current standardized image, the system calculates the average minor axis length based on single fecal particles with clear boundaries in the fresh and relatively fresh sub-regions; if the fecal particles are dense or significantly adhered in the current standardized image, causing the average minor axis length of a single fecal particle to be unstable, the system determines the preset distance threshold based on the average minor axis length of single fecal particles in historical valid images of the same acquisition point. The preset distance threshold is used to determine whether fresh particle regions belong to the same aggregation region and is used to subsequently determine the fresh particle aggregation parameter K.
[0059] The fresh grain aggregation parameter K is determined according to the following formula: ; Wherein, K represents the fresh grain aggregation parameter, which is used to indicate whether the fresh sub-regions and the relatively fresh sub-regions form a concentrated distribution in space; This represents the area of the region with the largest concentration of fresh grains. K represents the sum of the areas of all sub-regions in the set of fresh particle regions F. If the fresh particle regions are concentrated, K is larger, indicating that these fresh particle regions are more likely to correspond to newly added fecal particles formed from the same or recent consecutive defecation. If the fresh particle regions are scattered, K is smaller, indicating that they are more likely to originate from local reflection, occlusion error, soil background interference, or segmentation error. If the set of fresh particle regions F is empty, the system sets the fresh particle area parameter A, the fresh particle quantity parameter N, and the fresh particle aggregation parameter K to 0.
[0060] After determining the fresh grain area parameter A, the fresh grain quantity parameter N, and the fresh grain aggregation parameter K, the system determines the newly added fecal grain distribution value D according to the following formula: ; Where D represents the newly added fecal particle distribution value, which is used to characterize the degree of significance of the distribution of recently added fecal particles in a fixed defecation area; A represents the fresh particle area parameter; N represents the fresh particle quantity parameter; and K represents the fresh particle aggregation parameter. , , These are the weighting coefficients for the fresh grain area parameter, fresh grain number parameter, and fresh grain aggregation parameter, respectively, and they satisfy the following: ; In one specific implementation, Take a value between 0.35 and 0.45. Take a value between 0.20 and 0.30. The value should be between 0.30 and 0.40. This value ensures that the newly added fecal particle distribution value considers both the proportion of fresh sub-regions in terms of area and whether the fresh sub-regions have sufficient quantity and a concentrated distribution. The specific weight can be determined based on manually verified samples from different monitoring areas.
[0061] The system generates an overall fecal pile freshness assessment result based on the newly added fecal particle distribution value D. Specifically, the system sets a preset threshold for determining new fecal particles and a preset threshold for suspected fecal particles, with the preset threshold for determining new fecal particles being higher than the preset threshold for suspected fecal particles. When the newly added fecal particle distribution value D is not lower than the preset threshold for determining new fecal particles, it is determined that there is evidence of new fecal matter in the fixed defecation site. If there is evidence of new fecal matter, and the area ratio of fresh sub-regions in the set of fresh particle regions F is not lower than a preset freshness ratio threshold, or the average local fresh particle value of the set of fresh particle regions F is not lower than a preset high freshness threshold, then the overall fecal pile freshness level is determined to be a fresh fecal pile; otherwise, the overall fecal pile freshness level is determined to be a relatively fresh fecal pile.
[0062] When the newly added fecal particle distribution value D is lower than the preset new determination threshold but not lower than the preset suspected threshold, the system determines that there is a suspected new defecation state in the fixed defecation site and determines the overall freshness level of the fecal pile as a mixed new and old fecal pile. When the newly added fecal particle distribution value D is lower than the preset suspected threshold, the system determines that there is no obvious evidence of new defecation in the fixed defecation site; in the absence of obvious evidence of new defecation, if the area ratio of the old sub-region in the effective sub-region set V is not lower than the preset old ratio threshold, the overall freshness level of the fecal pile is determined as an old fecal pile; otherwise, the overall freshness level of the fecal pile is determined as a relatively old fecal pile.
[0063] In one specific implementation, the preset threshold for determining new feces is set to 0.65 to 0.75, the preset threshold for suspected feces is set to 0.45 to 0.55, the preset threshold for the proportion of fresh feces is set to 0.50 to 0.60, the preset threshold for high-freshness feces is set to 0.75 to 0.85, and the preset threshold for the proportion of old feces is set to 0.60 to 0.70. These thresholds can be adjusted based on manually reviewed samples, fecal particle distribution density at collection points, and actual monitoring objectives. When determining the preset thresholds for determining new feces, suspected feces, freshness, high-freshness feces, and old feces, the system selects historical monitoring images that have undergone manual review as calibration samples. The calibration samples include at least samples with evidence of new fecal matter, samples without obvious evidence of new fecal matter, and samples of mixed new and old fecal matter.
[0064] The system calculates the distribution value of newly added fecal particles, the area ratio of fresh sub-regions in the set of fresh particle regions, the average local fresh particle value of the set of fresh particle regions, and the area ratio of old sub-regions in the set of effective sub-regions for the above-mentioned calibrated samples. The range of values for each threshold is then determined based on manual verification results. For patrol scenarios aiming to detect recent activity early, the preset suspected threshold can be set to a lower value within the specified range. For long-term automatic monitoring scenarios aiming to reduce false alarms, the preset new judgment threshold can be set to a higher value within the specified range. After the thresholds are determined, the system binds and saves the threshold version, applicable collection points, and calibrated sample number for subsequent verification of the overall fecal pile freshness level formation process.
[0065] When outputting the overall fecal pile freshness assessment results, the system simultaneously outputs the overall fecal pile freshness level, the marker for a mixed old and new fecal pile, the distribution value of newly added fecal particles, a notification of newly added defecation evidence, and the location of the corresponding fresh sub-area. If new defecation evidence exists, the system sends the collection point number, collection time, overall fecal pile freshness level, location of the sub-area with higher local fresh particle values, the distribution value of newly added fecal particles, and an image thumbnail to the management platform, and prompts patrol personnel to prioritize verification or sampling; if there is no obvious new defecation evidence, the system writes the assessment results into the historical monitoring archive for subsequent analysis of the frequency of use of fixed defecation sites and changes in musk deer activity.
[0066] In this step, the system further aggregates the local fresh particle values obtained in step three into newly added fecal particle distribution values. This allows the overall freshness assessment of the manure pile to no longer rely on the average color or texture of the entire pile, but rather to determine whether recently added fecal particles exist within a fixed defecation area based on the area, quantity, and aggregation status of the fresh sub-regions. Local fresh particle values are the basis for calculating the newly added fecal particle distribution values; without local fresh particle values, the system cannot determine the set of fresh particle regions F, and therefore cannot calculate the fresh particle area parameters, fresh particle quantity parameters, and fresh particle aggregation parameters.
[0067] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0068] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0069] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0070] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0071] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for intelligently assessing the freshness of musk deer droppings based on color and texture features, characterized in that, Includes the following steps: Acquire a standardized image corresponding to the fixed defecation site of musk deer, and generate a target mask based on the standardized image. Divide the target mask area into a set of sub-regions, the set of sub-regions including multiple sub-regions and the area and spatial relationship of each sub-region; Effective sub-regions are determined from the set of sub-regions, and the local fresh grain value of each effective sub-region is determined based on the color depth preservation parameter, edge integrity parameter, and surface crack parameter of each effective sub-region. Based on the local fresh grain value, the sub-region freshness result of each effective sub-region is generated, and the sub-regions with the sub-region freshness result as fresh sub-regions and relatively fresh sub-regions are combined to form a fresh grain region set. The distribution value of newly added fecal particles is determined based on the area ratio of the fresh particle region set in the effective sub-region set, the number of sub-regions, and the spatial aggregation state; wherein, the spatial aggregation state is determined based on the aggregation region formed by fresh particle regions that are adjacent to each other or whose distance is less than a preset distance threshold in the fresh particle region set. Based on the newly added fecal particle distribution value and the sub-region freshness results of each effective sub-region, it is determined whether there is evidence of new defecation in the fixed defecation site of the musk deer, and an overall fecal pile freshness level is generated.
2. The intelligent assessment method for the freshness of musk deer droppings based on color and texture features according to claim 1, characterized in that: The standardized image is obtained by standardizing the original image containing the musk deer dung heap and its surrounding ground background. The original image is bound to the acquisition point number, acquisition time, and image number and stored accordingly. The standardization process includes illumination correction, color correction, image denoising, and scale normalization. Original images that lack acquisition point numbers, acquisition times, or image numbers are not used as valid input for the current freshness assessment of the dung heap. Original images with insufficient image clarity, severely missing dung heap areas, or whose field of view is significantly deviated from the acquisition point are marked as invalid acquisition images.
3. The intelligent assessment method for the freshness of musk deer droppings based on color and texture features according to claim 1, characterized in that: The target mask is generated based on the color range, particle shape, edge contour, and local texture state in the standardized image. The standardized image is converted to the HSV color space or Lab color space. The color reference range of the manure pile is determined based on manually labeled samples or historical valid images of the same acquisition point. Pixel regions whose color depth, saturation, and brightness distribution fall within the color reference range of the manure pile and whose local texture state meets the surface texture matching conditions of manure particles are determined as candidate regions. Connected regions are filtered based on the area of connected components, outer contour, roundness, aspect ratio, and average edge response of the candidate regions. Connected regions whose area reaches the fragment removal threshold, whose roundness is not lower than the preset roundness threshold, whose aspect ratio is not greater than the preset aspect ratio threshold, and whose average edge response is higher than the average edge response of the surrounding background are retained as part of the target mask.
4. The intelligent assessment method for the freshness of musk deer droppings based on color and texture features according to claim 1, characterized in that: When dividing the target mask into sub-region sets, firstly, suspected fecal particle regions are determined based on the connected components in the target mask; for suspected fecal particle regions whose contour boundaries can be closed independently and which do not have obvious adhesion to surrounding fecal particles, they are treated as a sub-region; for suspected fecal particle regions that have contact, overlap, or discontinuous boundaries, candidate segmentation positions are determined by combining concave boundaries, color abrupt change positions, texture direction change positions, and edge response intensity, and multiple sub-regions are formed when each part still meets the area requirements of the fecal particle region after segmentation; for regions where fecal particles are dense and cannot be stably segmented one by one, they are divided into multiple local sub-regions according to the consistency of local color state and texture state, and the position, area, boundary contour, adjacency relationship, and validity mark of each sub-region are recorded.
5. The intelligent assessment method for the freshness of musk deer droppings based on color and texture features according to claim 4, characterized in that: The validity marker is used to distinguish between valid sub-regions, invalid sub-regions, and sub-regions to be confirmed. A sub-region is defined as valid if its valid pixel area is 60% or more of its total area, its valid boundary length is 40% or more of its total outer contour length, and its occlusion area does not exceed 60%. A sub-region is defined as invalid if its valid pixel area is less than 40% of its total area, its valid boundary length is less than 25% of its total outer contour length, or its occlusion area exceeds 60%. Sub-regions other than the aforementioned valid and invalid sub-regions are defined as sub-regions to be confirmed. The image position and boundary information of these sub-regions are retained, but they are not used as the primary basis for generating the overall freshness level of the manure pile.
6. The intelligent assessment method for the freshness of musk deer droppings based on color and texture features according to claim 1, characterized in that: When determining the local fresh grain value, the color information, outer contour information, and internal texture information of the effective sub-region are read respectively; the color depth preservation parameter is determined based on the color depth, saturation, and brightness distribution of pixels within the effective sub-region; the edge integrity parameter is determined based on the continuity of the outer contour of the effective sub-region, the edge response intensity, and the adhesion between the effective sub-region and adjacent old feces or the background; the surface crack parameter is determined based on the thin edge segments, grayscale abrupt changes, local roughness, and texture unevenness within the effective sub-region; after normalizing the color depth preservation parameter, edge integrity parameter, and surface crack parameter and unifying their value directions, the local fresh grain value of the corresponding effective sub-region is determined according to a preset weighting relationship. The larger the local fresh grain value, the closer the effective sub-region is to the state of recently formed fresh feces grains.
7. The intelligent assessment method for the freshness of musk deer droppings based on color and texture features according to claim 6, characterized in that: When generating sub-region freshness results based on the local fresh grain values, a first fresh grain threshold, a second fresh grain threshold, and a third fresh grain threshold are set, where the first fresh grain threshold is higher than the second fresh grain threshold, and the second fresh grain threshold is higher than the third fresh grain threshold. Valid sub-regions with local fresh grain values reaching the first fresh grain threshold are defined as fresh sub-regions; valid sub-regions with local fresh grain values lower than the first fresh grain threshold but reaching the second fresh grain threshold are defined as relatively fresh sub-regions; valid sub-regions with local fresh grain values lower than the second fresh grain threshold but reaching the third fresh grain threshold are defined as relatively old sub-regions; and valid sub-regions with local fresh grain values lower than the third fresh grain threshold are defined as old sub-regions. The freshness results of the above sub-regions are then saved along with the positions and areas of the corresponding valid sub-regions.
8. The intelligent assessment method for the freshness of musk deer droppings based on color and texture features according to claim 7, characterized in that: For sub-regions where the absolute value of the difference between the local fresh grain value and the first, second, or third fresh grain threshold is less than 0.03, confirmation is made by combining the freshness results, validity markers, and spatial locations of their adjacent sub-regions. If the sub-region is adjacent to two or more fresh or relatively fresh sub-regions, its original sub-region freshness result is retained. If the aforementioned retention conditions are not met, and the proportion of relatively old, stale, or invalid sub-regions among the sub-regions adjacent to the sub-region is not less than 50%, it is recorded as a sub-region to be confirmed due to threshold boundaries. For sub-regions that do not meet the above two conditions, their original sub-region freshness result is retained, and a threshold boundary marker is added.
9. The intelligent assessment method for the freshness of musk deer droppings based on color and texture features according to claim 7, characterized in that: The newly added fecal particle distribution value is determined based on the fresh particle area parameter, the fresh particle quantity parameter, and the fresh particle aggregation parameter. Fresh sub-regions and relatively fresh sub-regions are combined to form a fresh particle region set. Fresh sub-regions, relatively fresh sub-regions, relatively old sub-regions, and old sub-regions that can participate in the judgment are combined to form an effective sub-region set. The fresh particle area parameter is determined based on the relationship between the sum of the areas of the fresh particle region set and the sum of the areas of the effective sub-region set. The fresh particle quantity parameter is determined based on the relationship between the number of sub-regions in the fresh particle region set and a preset quantity benchmark value. Adjacent fresh particle regions or those with a distance less than a preset distance threshold are merged into the same aggregation region. The fresh particle aggregation parameter is determined based on the relationship between the area of the largest fresh particle aggregation region and the sum of the areas of the fresh particle region set. Finally, the newly added fecal particle distribution value is determined according to the fresh particle area parameter, fresh particle quantity parameter, and fresh particle aggregation parameter, based on a preset weighted relationship.
10. The intelligent assessment method for the freshness of musk deer droppings based on color and texture features according to claim 9, characterized in that: The overall freshness level of the manure pile is determined based on preset thresholds for new additions, suspected additions, freshness percentage, high freshness particle count, and oldness percentage, with the preset threshold for new additions being higher than the preset suspected additions threshold. When the distribution value of new manure particles is not lower than the preset threshold for new additions, it is determined that there is evidence of new defecation at the fixed defecation site. If the area ratio of fresh sub-regions in the fresh particle region set is not lower than the preset freshness percentage threshold, or the average local freshness particle value of the fresh particle region set is not lower than the preset high freshness particle count threshold, then the overall freshness level of the manure pile is determined to be a fresh manure pile; otherwise, the overall freshness level is determined to be a fresh manure pile. The freshness level of the manure pile is determined to be relatively fresh. When the distribution value of newly added fecal particles is lower than the preset threshold for determining new additions but not lower than the preset threshold for suspected additions, it is determined that there is a suspected state of new defecation in the fixed defecation site, and the overall freshness level of the manure pile is determined to be a mixed new and old manure pile. When the distribution value of newly added fecal particles is lower than the preset threshold for suspected additions, it is determined that there is no obvious evidence of new defecation in the fixed defecation site. If the area ratio of the old sub-region in the set of effective sub-regions is not lower than the preset old ratio threshold, the overall freshness level of the manure pile is determined to be an old manure pile; otherwise, the overall freshness level of the manure pile is determined to be a relatively old manure pile.