CN108682000A - The long body width detecting method of pig body based on Kinect videos - Google Patents

The long body width detecting method of pig body based on Kinect videos Download PDF

Info

Publication number
CN108682000A
CN108682000A CN201810146212.9A CN201810146212A CN108682000A CN 108682000 A CN108682000 A CN 108682000A CN 201810146212 A CN201810146212 A CN 201810146212A CN 108682000 A CN108682000 A CN 108682000A
Authority
CN
China
Prior art keywords
image
pig
pig body
body portion
point
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.)
Granted
Application number
CN201810146212.9A
Other languages
Chinese (zh)
Other versions
CN108682000B (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.)
China Agricultural University
Original Assignee
China Agricultural University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Agricultural University filed Critical China Agricultural University
Priority to CN201810146212.9A priority Critical patent/CN108682000B/en
Publication of CN108682000A publication Critical patent/CN108682000A/en
Application granted granted Critical
Publication of CN108682000B publication Critical patent/CN108682000B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • AHUMAN NECESSITIES
    • A01AGRICULTURE; FORESTRY; ANIMAL HUSBANDRY; HUNTING; TRAPPING; FISHING
    • A01KANIMAL HUSBANDRY; CARE OF BIRDS, FISHES, INSECTS; FISHING; REARING OR BREEDING ANIMALS, NOT OTHERWISE PROVIDED FOR; NEW BREEDS OF ANIMALS
    • A01K29/00Other apparatus for animal husbandry
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/136Segmentation; Edge detection involving thresholding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • G06T7/62Analysis of geometric attributes of area, perimeter, diameter or volume
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • G06T7/66Analysis of geometric attributes of image moments or centre of gravity
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10016Video; Image sequence

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Geometry (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Environmental Sciences (AREA)
  • Quality & Reliability (AREA)
  • Animal Husbandry (AREA)
  • Biodiversity & Conservation Biology (AREA)
  • Image Analysis (AREA)

Abstract

The above embodiment of the present invention provides a kind of method of the wide detection of the long body of pig body based on Kinect videos, the present invention uses kinect sampling depth video datas, and video data is handled in real time, judge certain frame image whether suitable for the wide detection of the long body of body, the picture frame of the wide detection of the long body of body is filtered out from video flowing, and calculate and image in the long body of pig body it is wide, realize it is contactless, stress not and can realize accurately measurement the wide data of the long body of pig body.

Description

The long body width detecting method of pig body based on Kinect videos
Technical field
The present invention relates to technical field of image processing, more particularly, to the wide inspection of the long body of pig body based on Kinect videos Survey method.
Background technology
During swine rearing, the wide long body of pig body is an important parameter for judging pig growth conditions.The long body of pig body is wide It is also an important indicator in boar selection and breeding, evaluation of meat quality and feeding management etc..Growth Traits, body ruler as pig Character, weight character, appearance scoring and reproductive trait etc., breeder estimates individual breeding according to these phenotypic characters Value, and seed selection and selective pairing is carried out with this.Wherein the evaluation indexes such as body ruler, weight are mostly obtained by contact measurement method, than If the traditional measurement method of body ruler is to carry out hand dipping with tape measure, but this traditional measurement method is in direct contact pig body Heavy workload, there are inevitable human errors, it is also possible to so that pig is stimulated, influence its growth and development.Pass through machine Vision technique contactless can realize the wide measurement of the long body of pig body, reduction stress, improve efficiency.
The body ruler of animal is measured using machine vision technique and character has more research at present.It is surveyed in machine vision technique It measures in the wide most research of the long body of pig body, uses still image substantially.In the research of forefathers, mostly single head pig is research pair As, it is desirable that pig body posture is more satisfactory, and back is straight, no bending.In actual acquisition image process, because pig itself Habit has the actions such as bow and looks for food, and brings certain difficulty to Image Acquisition, causes measurement efficiency low, measurement error is larger.Profit Pig body profile is extracted with coloured image, is influenced by environment and light, the dirty and ground high object with pig can cause profile Extract mistake.
So, it would be highly desirable to propose it is a kind of it is contactless, stress not, the method for the accurate measurement wide data of the long body of pig body.
Invention content
To solve the above-mentioned problems, the embodiment of the present invention provides one kind and overcoming the above problem or solve at least partly State the long body width detecting method of the pig body based on Kinect videos of problem.
According to a first aspect of the embodiments of the present invention, a kind of wide detection side of the long body of pig body based on Kinect videos is provided Method, including:When pig is located in the fence channel of predetermined width, packet is acquired based on the Kniect cameras being placed in above fence channel Any frame image of the image of body portion containing pig;Wherein, it is wide, long less than pig body to be more than pig body for the predetermined width;
The region of interest image for including pig body portion image in any frame image is extracted, region of interest image is converted to two It is worth image;
It is the longitudinal axis by horizontal axis, broadside of the long side of bianry image, judges whether pig body portion image is horizontal in bianry image, If unhorizontal by pig body portion Image Adjusting in bianry image to level;
Based on the bianry image for including horizontal pig body portion image, confirm that any frame image is appropriate for pig body length and width Detection;
Obtain two basal part of the ear precise local fixes and two root of the tail precise local fixes in pig body portion image;Obtain two basal parts of the ear The distance at the line segment midpoint that the midpoint for the line segment that precise local fix is constituted is constituted to two root of the tail precise local fixes, as pig Body is long;The barycenter of pig body portion image is obtained, obtains barycenter to each basal part of the ear exact position spot projection maximum value, as pig body is wide.
Further, the step of including the region of interest image of pig body portion image in the extraction any frame image, packet It includes:From the image comprising pig body portion image extracted in any frame image between fence channel as region of interest image.
Further, the step for judging whether pig body is horizontal in bianry image, including:
The boundary that pig body portion image is extracted from bianry image, obtains the convex closure polygon of boundary point, and calculate convex closure Angle between each side of polygon and horizontal axis is denoted as the edge angle on each side;
Convex closure polygon is rotated clockwise p times, wherein p is the number of edge angle, by p rotation so that convex closure is polygon Angle of each side of shape all between horizontal axis is 0 ° of mistake, often rotates and obtains 1 group of each vertex of convex closure polygon 1 time and can be obtained most Small coordinate (Xnmin,Ynmin) and maximum coordinates (Xnmax,Ynmax), by four coordinate points (Xnmin, Ynmin), (Xnmin, Ynmax), (Xnmax, Ynmin) and (Xnmax, Ynmax) 1 rectangle is constituted, rotate p rectangle of p acquisition;Wherein n is the serial number of number of revolutions, 1≤n≤p;
The rectangle of area minimum is rotated counterclockwise into places, the number of degrees of rotation and while obtaining the rectangle of area minimum carry out The number of degrees rotated clockwise are consistent, and the rectangle obtained after rotation counterclockwise is the minimum enclosed rectangle of pig body in bianry image;
If angle absolute value≤1 ° between the long side and horizontal axis of minimum enclosed rectangle, pig body water in bianry image is confirmed It is flat.
Further, it is described if unhorizontal by pig body portion Image Adjusting in bianry image to horizontal step, including:
If 1 ° of angle absolute value > between the long side and horizontal axis of minimum enclosed rectangle, judges pig body portion in bianry image Partial image is not horizontal, adjusts the angle between minimum enclosed rectangle and horizontal axis to 0 °.
Further, based on the bianry image for including horizontal pig body portion image, confirm that any frame image is appropriate for The step of pig body length and width detect, including:
It is partitioned into pig head image from bianry image, extracts the profile of pig head image, pig's head is counted using labelling method The quantity of main peak in the profile of portion's image confirms that any frame image is appropriate for when the quantity of main peak meets preset condition Length and width detect.
Further, in the profile that pig head image is counted using labelling method main peak quantity, when the quantity of main peak is full The step of any frame image is appropriate for length and width detection is confirmed when sufficient preset condition, is further comprised:
The edge image of pig head image is obtained, calculates in pig head image neck line segment intermediate point to pig head image The distance of each pixel, takes given threshold on edge, obtains the square-wave curve of pig head image, and the square wave of pig head image is bent When three wave crest states being presented in line or two wave crests are presented, confirm that any frame image is appropriate for length and width detection.
Further, described to obtain two basal part of the ear precise local fixes and two root of the tail precise local fixes in pig body portion image Step further comprises:
It is partitioned into pig head image from bianry image, obtains the barycenter of pig head image, takes the edge of pig head image Pixel is to two points of the barycenter shortest distance of pig head image, as two basal part of the ear precise local fixes;
Obtain pig body portion image caudal end to pig body portion image centroid difference curves in the horizontal direction maximum value Locate, be the substantially x-axis coordinate of root of the tail at corresponding x-axis coordinate, make a vertical line at this x coordinate, is met at up and down with pig body profile Two intersection points, take the central point of two constituted straightways of intersection point, do a horizontal line by central point, take on this horizontal line therefrom Location point from heart point to pig's head direction default value pixel as origin, seek origin with it is each on the pig body profile in pigtail direction The distance of pixel, the interior point nearest to initial point distance of the second quadrant are the first root of the tail precise local fix, are arrived in third quadrant former Point is the second root of the tail precise local fix apart from nearest point.
Further, described the step of pig head image is partitioned into from bianry image, including:
The pixel value of bianry image is projected based on following formula in the horizontal direction:
Wherein, S (j) is the Gray scale projection curve of bianry image, and h is the width of bianry image vertical direction, and M is binary map As the width of horizontal direction, h and M units are pixel, and I (i, j) is the grey scale pixel value at (i, j) coordinate in image;
Difference is carried out to curve S (j) again, formula is:
Sd(j)=S (j+3)-S (j) j=1,2...M-3
Wherein, Sd (j) difference curves;From the barycenter of pig body portion image in bianry image to pig head image, take It is basal part of the ear approximate location point that difference curves, which are worth maximum two location points,;In two the constituted line segments of basal part of the ear approximate location point close to tail Portion side increases presetted pixel length, and segmentation obtains the head image of pig.
Further, it is partitioned into pig head image from bianry image, obtains the barycenter of pig head image, takes pig head image Edge pixel point to pig head image the barycenter shortest distance two points, the step of as two basal part of the ear precise local fixes into One step includes:
Using the barycenter of pig head image as origin, coordinate system horizontally and vertically is established for two reference axis, Second quadrant and third quadrant detect the nearest marginal point of initial point distance, respectively two basal part of the ear location points respectively.
The above embodiment of the present invention provides a kind of method of the wide detection of the long body of pig body based on Kinect videos, and the present invention makes With kinect sampling depth video datas, and video data is handled in real time, whether judge certain frame image suitable for the wide detection of the long body of body, The picture frame of the wide detection of the long body of body is filtered out from video flowing, and calculate and image in the long body of pig body it is wide, realize it is contactless, It stress not and can realize the accurate measurement wide data of the long body of pig body.
Description of the drawings
Fig. 1 is that a kind of overall flow of the long body width detecting method of pig body based on Kinect videos of the embodiment of the present invention is shown It is intended to;
Fig. 2 appoints for extraction in a kind of long body width detecting method of pig body based on Kinect videos of the embodiment of the present invention is described The schematic diagram of region of interest image in one frame image;
Fig. 3 is in bianry image in a kind of long body width detecting method of pig body based on Kinect videos of the embodiment of the present invention The unhorizontal schematic diagram of pig body;
Fig. 4 is in bianry image in a kind of long body width detecting method of pig body based on Kinect videos of the embodiment of the present invention The schematic diagram of pig body level;
Fig. 5 is bianry image in a kind of long body width detecting method of pig body based on Kinect videos of the embodiment of the present invention The schematic diagram of Gray scale projection curve and difference curves;
Fig. 6 is pig head image in a kind of long body width detecting method of pig body based on Kinect videos of the embodiment of the present invention In each pixel distance Curve and pig head image square-wave curve;
Fig. 7 obtains pig for segmentation in a kind of long body width detecting method of pig body based on Kinect videos of the embodiment of the present invention Head image schematic diagram;
Fig. 8 is two ears of acquisition in a kind of long body width detecting method of pig body based on Kinect videos of the embodiment of the present invention The schematic diagram of root location point;
Fig. 9 is long for pig body expanded letter in a kind of long body width detecting method of pig body based on Kinect videos of the embodiment of the present invention Instrumentation plan;
Figure 10 is acquisition two in a kind of long body width detecting method of pig body based on Kinect videos of the embodiment of the present invention The schematic diagram of root of the tail location point.
Specific implementation mode
With reference to the accompanying drawings and examples, the specific implementation mode of the present invention is described in further detail.Implement below Example is not limited to the scope of the present invention for illustrating the present invention.
Kinect cameras are a depth cameras that Microsoft releases.It can be effective using depth image extraction contour of object Display foreground and background are distinguished, the contours extract Problem-Error caused by background and foreground color are close is avoided.
The present invention by taking pig body as an example, design is contactless, stress not, the method for the accurate measurement wide data of the long body of pig body.It uses Whether kinect sampling depth video datas, and handle video data in real time, judge certain frame image suitable for the wide detection of the long body of body, from The picture frame of the wide detection of the long body of body is filtered out in video flowing, and it is wide to calculate the long body of pig body in simultaneously image.
Such as Fig. 1, the long body width detecting method of pig body of the embodiment of the present invention based on Kinect videos is shown, which is characterized in that Including:
S1 is adopted when pig is located in the fence channel of predetermined width based on the Kniect cameras being placed in above fence channel Collection includes any frame image of pig body portion image;Wherein, it is wide, long less than pig body to be more than pig body for the predetermined width;
Specifically, acquire pig volumetric video image, in farm appropriate location, such as rest area and feeding area or drinking area it Between, setting is slightly wider than the fence channel of pig width, and Kniect cameras are located above channel the vertical view video of acquisition pig in real time, choosing Any frame image in vertical view video is taken to proceed as follows.
S2 extracts the region of interest image for including pig body portion image in any frame image, region of interest image is converted For bianry image;
Specifically, determining according to institute the image collected and extract (the white square in such as Fig. 2 of the region of interest between fence channel Shown in shape region);Region of interest is converted into bianry image.Preferably, it can be detected based on difference shadow method and whether be contained in this frame image There is pig, if containing pig body, handles this frame, otherwise abandon this frame.
S3 is the longitudinal axis by horizontal axis, broadside of the long side of bianry image, judge in bianry image pig body portion image whether water It is flat, if unhorizontal by pig body portion Image Adjusting in bianry image to level;
S4 confirms that any frame image is appropriate for pig body based on the bianry image for including horizontal pig body portion image Length and width detect;
S5, as shown in figure 8, obtaining two basal part of the ear precise local fixes and two root of the tail exact positions in pig body portion image Point;In the line segment that the midpoint for the line segment that two basal part of the ear precise local fixes of acquisition are constituted is constituted to two root of the tail precise local fixes The distance of point, as pig body are long;The barycenter of pig body portion image is obtained, obtains barycenter to each basal part of the ear exact position spot projection maximum Value, as pig body are wide.
On the basis of above-mentioned specific embodiment of the invention, the wide detection side of the long body of pig body based on Kinect videos is provided The step of method includes the region of interest image of pig body portion image in the extraction any frame image, including:From described any The image comprising pig body portion image between fence channel is extracted in frame image as region of interest image.
On the basis of above-mentioned specific embodiment of the invention, the wide detection side of the long body of pig body based on Kinect videos is provided Method, the step for judging whether pig body is horizontal in bianry image, including:
The boundary that pig body portion image is extracted from bianry image, obtains the convex closure polygon of boundary point, and calculate convex closure Angle between each side of polygon and horizontal axis is denoted as the edge angle on each side;
Convex closure polygon is rotated clockwise p times, wherein p is the number of edge angle, by p rotation so that convex closure is polygon Angle of each side of shape all between horizontal axis is 0 ° of mistake, often rotates and obtains 1 group of each vertex of convex closure polygon 1 time and can be obtained most Small coordinate (Xnmin,Ynmin) and maximum coordinates (Xnmax,Ynmax), by four coordinate points (Xnmin, Ynmin), (Xnmin, Ynmax), (Xnmax, Ynmin) and (Xnmax, Ynmax) 1 rectangle is constituted, rotate p rectangle of p acquisition;Wherein n is the serial number of number of revolutions, 1≤n≤p;
The rectangle of area minimum is rotated counterclockwise into places, the number of degrees of rotation and while obtaining the rectangle of area minimum carry out The number of degrees rotated clockwise are consistent, and the rectangle obtained after rotation counterclockwise is the minimum enclosed rectangle of pig body in bianry image;
If angle absolute value≤1 ° between the long side and horizontal axis of minimum enclosed rectangle, pig body water in bianry image is confirmed It is flat, as shown in Figure 4.
Wherein, the determination of minimax coordinate is:Arbitrary point will not be also smaller than min coordinates in quadrangle, is sat than maximum Mark is also big.
On the basis of above-mentioned specific embodiment of the invention, the wide detection side of the long body of pig body based on Kinect videos is provided Method, it is described if unhorizontal by pig body portion Image Adjusting in bianry image to horizontal step, including:If minimum enclosed rectangle 1 ° of angle absolute value > between long side and horizontal axis then judges that pig body portion image is not horizontal in bianry image, adjusts minimum outer Connect the angle between rectangle and horizontal axis to 0 °, as shown in Figure 3.
On the basis of above-mentioned specific embodiment of the invention, the wide detection side of the long body of pig body based on Kinect videos is provided Method confirms that any frame image is appropriate for the detection of pig body length and width based on the bianry image for including horizontal pig body portion image The step of, including:
It is partitioned into pig head image from bianry image, extracts the profile of pig head image, pig's head is counted using labelling method The quantity of main peak in the profile of portion's image confirms that any frame image is appropriate for when the quantity of main peak meets preset condition Length and width detect.
On the basis of above-mentioned specific embodiment of the invention, the wide detection side of the long body of pig body based on Kinect videos is provided Method, it is described using labelling method count pig head image profile in main peak quantity, when main peak quantity meet preset item The step of any frame image is appropriate for length and width detection is confirmed when part, is further comprised:
The edge image of pig head image is obtained, calculates in pig head image neck line segment intermediate point to pig head image The distance of each pixel, takes given threshold on edge, obtains the square-wave curve of pig head image, and the square wave of pig head image is bent When three wave crest states being presented in line or two wave crests are presented, confirm that any frame image is appropriate for length and width detection.
Specifically, as shown in fig. 6, calculate pig head image in neck line segment intermediate point to pig head image edge graph The distance of each pixel, obtains distance Curve, takes specific threshold, high level is taken as higher than threshold value, less than taking for threshold value as in For low value, square-wave curve is obtained, three wave crest states are presented in head in the picture frame suitable for carrying out the wide detection of the long body of body.Or it is in two A wave crest, i.e., mouth is not picked up by when pig is bowed, but takes ear.Certain restrictions, three sides are carried out to the width of square wave When wave, two square widths of both sides should be greater than one fixed width, such as 40 pixels.When two square waves, the width of two square waves is all It should be greater than one fixed width, such as 40 pixels.
On the basis of above-mentioned specific embodiment of the invention, the wide detection side of the long body of pig body based on Kinect videos is provided Method, two basal part of the ear precise local fixes and the step of two root of the tail precise local fixes in the acquisition pig body portion image, further Including:
As shown in figure 8, being partitioned into pig head image from bianry image, the barycenter of pig head image is obtained, pig's head portion is taken The edge pixel point of image is to two points of the barycenter shortest distance of pig head image, as two basal part of the ear precise local fixes;
As shown in Figure 10, obtaining pig body portion image caudal end, difference is bent in the horizontal direction to pig body portion image centroid It is the substantially x-axis coordinate of root of the tail at the maximum value of line, at corresponding x-axis coordinate, makees a vertical line at this x coordinate, with pig body wheel It is wide to meet at two intersection points up and down, the central point of two constituted straightways of intersection point is taken, a horizontal line is done by central point, takes this water On horizontal line the pig of origin and pigtail direction is sought as origin from central point to the location point of pig's head direction default value pixel The distance of each pixel on body profile, the interior point nearest to initial point distance of the second quadrant, is the first root of the tail precise local fix, third It is the second root of the tail precise local fix to the point that initial point distance is nearest in quadrant.
On the basis of above-mentioned specific embodiment of the invention, the wide detection side of the long body of pig body based on Kinect videos is provided Method, described the step of pig head image is partitioned into from bianry image, including:
The pixel value of bianry image is projected based on following formula in the horizontal direction:
Wherein, as shown in figure 5, S (j) is the Gray scale projection curve (Grey curves in Fig. 5) of bianry image, h is binary map As the width of vertical direction, M is the width of bianry image horizontal direction, h and M units are pixel, and I (i, j) is in image (i, j) Grey scale pixel value at coordinate;
Difference is carried out to curve S (j) again, formula is:
Sd(j)=S (j+3)-S (j) j=1,2...M-3 wherein, as shown in figure 5, Sd (j) is that difference curves are (white in Fig. 5 Color curve);From the barycenter of pig body portion image in bianry image to pig head image, taking maximum two of difference curves value Location point is basal part of the ear approximate location point;As shown in fig. 7, increasing by caudad side in two the constituted line segments of basal part of the ear approximate location point Presetted pixel length (such as 15 or 20 pixels), segmentation obtain the head image of pig.
On the basis of above-mentioned specific embodiment of the invention, the wide detection side of the long body of pig body based on Kinect videos is provided Method is partitioned into pig head image from bianry image, obtains the barycenter of pig head image, takes the edge pixel point of pig head image To two points of the barycenter shortest distance of pig head image, as the step of two basal part of the ear precise local fixes, further comprises:
Using the barycenter of pig head image as origin, coordinate system horizontally and vertically is established for two reference axis, Second quadrant and third quadrant detect the nearest marginal point of initial point distance, respectively two basal part of the ear location points respectively.
Finally, the present processes are only preferable embodiment, are not intended to limit the protection model of the embodiment of the present invention It encloses.With within principle, any modification, equivalent replacement, improvement and so on should be included in all spirit in the embodiment of the present invention Within the protection domain of the embodiment of the present invention.

Claims (9)

1. a long width detecting method of boar body, which is characterized in that including:
Include pig based on the Kniect cameras acquisition being placed in above fence channel when pig is located in the fence channel of predetermined width Any frame image of body portion image;Wherein, it is wide, long less than pig body to be more than pig body for the predetermined width;
The region of interest image for including pig body portion image in any frame image is extracted, region of interest image is converted into binary map Picture;
It is the longitudinal axis by horizontal axis, broadside of the long side of bianry image, judges whether pig body portion image is horizontal in bianry image, if not Level is by pig body portion Image Adjusting in bianry image to level;
Based on the bianry image for including horizontal pig body portion image, confirm that any frame image is appropriate for the inspection of pig body length and width It surveys;
Obtain two basal part of the ear precise local fixes and two root of the tail precise local fixes in pig body portion image;It is accurate to obtain two basal parts of the ear The distance at the line segment midpoint that the midpoint for the line segment that location point is constituted is constituted to two root of the tail precise local fixes, as pig body It is long;The barycenter of pig body portion image is obtained, obtains barycenter to each basal part of the ear exact position spot projection maximum value, as pig body is wide.
2. according to the method described in claim 1, it is characterized in that, including pig body portion in the extraction any frame image The step of region of interest image of image, including:Include pig body portion between extraction fence channel in any frame image The image of image is as region of interest image.
3. according to the method described in claim 1, it is characterized in that, the step for judging whether pig body is horizontal in bianry image Suddenly, including:
The boundary that pig body portion image is extracted from bianry image, obtains the convex closure polygon of boundary point, and it is polygon to calculate convex closure Angle between each side of shape and horizontal axis is denoted as the edge angle on each side;
Convex closure polygon is rotated clockwise p times, wherein p is the number of edge angle, makes convex closure polygon by p rotation Angle of each side all between horizontal axis is 0 ° of mistake, often rotates and obtains 1 group of each vertex of convex closure polygon 1 time and can be obtained most sitting for a while Mark (Xnmin,Ynmin) and maximum coordinates (Xnmax,Ynmax), by four coordinate points (Xnmin, Ynmin), (Xnmin, Ynmax), (Xnmax, Ynmin) and (Xnmax, Ynmax) 1 rectangle is constituted, rotate p rectangle of p acquisition;Wherein n be number of revolutions serial number, 1≤n≤ p;
The rectangle of area minimum is rotated counterclockwise into places, the number of degrees of rotation and while obtaining the rectangle of area minimum carry out up time The number of degrees of needle rotation are consistent, and the rectangle obtained after rotation counterclockwise is the minimum enclosed rectangle of pig body in bianry image;
If angle absolute value≤1 ° between the long side and horizontal axis of minimum enclosed rectangle, confirm that pig body is horizontal in bianry image.
4. according to the method described in claim 3, it is characterized in that, it is described if unhorizontal by pig body portion image in bianry image It adjusts to horizontal step, including:
If 1 ° of angle absolute value > between the long side and horizontal axis of minimum enclosed rectangle, judges pig body portion figure in bianry image As unhorizontal, the angle between adjustment minimum enclosed rectangle and horizontal axis is to 0 °.
5. according to the method described in claim 1, it is characterized in that, based on the bianry image for including horizontal pig body portion image, Confirm the step of any frame image is appropriate for the detection of pig body length and width, including:
It is partitioned into pig head image from bianry image, extracts the profile of pig head image, utilizes labelling method statistics pig's head portion figure The quantity of main peak in the profile of picture confirms that any frame image is appropriate for length and width when the quantity of main peak meets preset condition Detection.
6. according to the method described in claim 5, it is characterized in that, in the profile for counting pig head image using labelling method The quantity of main peak confirms that any frame image is appropriate for the step of length and width detection when the quantity of main peak meets preset condition Suddenly, further comprise:
The edge image of pig head image is obtained, calculates in pig head image neck line segment intermediate point to the edge of pig head image The distance of upper each pixel, takes given threshold, obtains the square-wave curve of pig head image, in the square-wave curve of pig head image When three wave crest states are presented or two wave crests are presented, confirm that any frame image is appropriate for length and width detection.
7. according to the method described in claim 1, it is characterized in that, two accurate positions of the basal part of the ear in the acquisition pig body portion image The step of setting a little with two root of the tail precise local fixes, further comprises:
It is partitioned into pig head image from bianry image, obtains the barycenter of pig head image, takes the edge pixel of pig head image Point arrives two points of the barycenter shortest distance of pig head image, as two basal part of the ear precise local fixes;
Pig body portion image caudal end is obtained at pig body portion the image centroid in the horizontal direction maximum value of difference curves, it is right It is the substantially x-axis coordinate of root of the tail at the x-axis coordinate answered, makees a vertical line at this x coordinate, two friendships is met at up and down with pig body profile Point, takes the central point of two constituted straightways of intersection point, and a horizontal line is done by central point, take on this horizontal line from central point to The location point of pig's head direction default value pixel seeks origin and each pixel on the pig body profile in pigtail direction as origin Distance be the first root of the tail precise local fix, initial point distance arrived in third quadrant to the point that initial point distance is nearest in the second quadrant Nearest point is the second root of the tail precise local fix.
8. the method according to claim 5 or 7, which is characterized in that described to be partitioned into pig head image from bianry image The step of, including:
The pixel value of bianry image is projected based on following formula in the horizontal direction:
Wherein, S (j) is the Gray scale projection curve of bianry image, and h is the width of bianry image vertical direction, and M is bianry image water Square to width, h and M units are pixel, and I (i, j) is the grey scale pixel value at (i, j) coordinate in image;
Difference is carried out to curve S (j) again, formula is:
Sd(j)=S (j+3)-S (j) j=1,2...M-3
Wherein, Sd (j) difference curves;From the barycenter of pig body portion image in bianry image to pig head image, difference is taken Maximum two location points of curve values are basal part of the ear approximate location point;Caudad one is leaned in two the constituted line segments of basal part of the ear approximate location point Side increases presetted pixel length, and segmentation obtains the head image of pig.
9. the method according to the description of claim 7 is characterized in that being partitioned into pig head image from bianry image, pig is obtained The barycenter of head image takes the edge pixel point of pig head image to two points of the barycenter shortest distance of pig head image, i.e., Further comprise for the step of two basal part of the ear precise local fixes:
Using the barycenter of pig head image as origin, coordinate system horizontally and vertically is established for two reference axis, second Quadrant and third quadrant detect the nearest marginal point of initial point distance, respectively two basal part of the ear location points respectively.
CN201810146212.9A 2018-02-12 2018-02-12 Pig body length and body width detection method based on Kinect video Active CN108682000B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810146212.9A CN108682000B (en) 2018-02-12 2018-02-12 Pig body length and body width detection method based on Kinect video

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810146212.9A CN108682000B (en) 2018-02-12 2018-02-12 Pig body length and body width detection method based on Kinect video

Publications (2)

Publication Number Publication Date
CN108682000A true CN108682000A (en) 2018-10-19
CN108682000B CN108682000B (en) 2020-10-09

Family

ID=63800221

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810146212.9A Active CN108682000B (en) 2018-02-12 2018-02-12 Pig body length and body width detection method based on Kinect video

Country Status (1)

Country Link
CN (1) CN108682000B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109636779A (en) * 2018-11-22 2019-04-16 华南农业大学 Identify the method, apparatus and storage medium of poultry volume ruler
CN111166338A (en) * 2019-12-24 2020-05-19 天津农学院 Pregnant sow body size calculation method based on TOF depth data
CN113449638A (en) * 2021-06-29 2021-09-28 西藏新好科技有限公司 Pig image ideal frame screening method based on machine vision technology

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100778937B1 (en) * 2006-09-25 2007-12-11 대상 주식회사 Manufacturing method for concentration liquid of pig bone
CN101144705A (en) * 2007-07-25 2008-03-19 中国农业大学 Method for monitoring pig growth using binocular vision technology
CN101794372A (en) * 2009-11-30 2010-08-04 南京大学 Method for representing and recognizing gait characteristics based on frequency domain analysis
CN103884280A (en) * 2014-03-14 2014-06-25 中国农业大学 Mobile system for monitoring body sizes and weights of pigs in multiple pigsties
CN104794463A (en) * 2015-05-11 2015-07-22 华东理工大学 System and method for achieving indoor human body falling detection based on Kinect
CN106485248A (en) * 2016-10-20 2017-03-08 江苏商贸职业学院 A kind of slag-soil truck license plate sloped correcting method

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100778937B1 (en) * 2006-09-25 2007-12-11 대상 주식회사 Manufacturing method for concentration liquid of pig bone
CN101144705A (en) * 2007-07-25 2008-03-19 中国农业大学 Method for monitoring pig growth using binocular vision technology
CN101794372A (en) * 2009-11-30 2010-08-04 南京大学 Method for representing and recognizing gait characteristics based on frequency domain analysis
CN103884280A (en) * 2014-03-14 2014-06-25 中国农业大学 Mobile system for monitoring body sizes and weights of pigs in multiple pigsties
CN104794463A (en) * 2015-05-11 2015-07-22 华东理工大学 System and method for achieving indoor human body falling detection based on Kinect
CN106485248A (en) * 2016-10-20 2017-03-08 江苏商贸职业学院 A kind of slag-soil truck license plate sloped correcting method

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
WEIXING ZHU ET AL.: "Gait Abnormality Detected of Pigs Based on Machine Vision", 《APPLIED MECHANICS AND MATERIALS》 *
YONGSHENG SI ET AL.: "Potato Tuber Length-Width Ratio Assessment Using Image Analysis", 《THE POTATO ASSOCIATION OF AMERICA 2016》 *
刘同海 等: "基于及视觉的猪体体尺测点提取算法与应用", 《农业工程学报》 *
刘波 等: "基于深度图像和生猪骨架端点分析的生猪步频特征提取", 《农业工程学报》 *
李卓: "基于立体视觉技术的生猪体重估测研究", 《中国博士学位论文全文数据库 农业科技辑》 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109636779A (en) * 2018-11-22 2019-04-16 华南农业大学 Identify the method, apparatus and storage medium of poultry volume ruler
CN111166338A (en) * 2019-12-24 2020-05-19 天津农学院 Pregnant sow body size calculation method based on TOF depth data
CN111166338B (en) * 2019-12-24 2022-04-08 天津农学院 Pregnant sow body size calculation method based on TOF depth data
CN113449638A (en) * 2021-06-29 2021-09-28 西藏新好科技有限公司 Pig image ideal frame screening method based on machine vision technology
CN113449638B (en) * 2021-06-29 2023-04-21 北京新希望六和生物科技产业集团有限公司 Pig image ideal frame screening method based on machine vision technology

Also Published As

Publication number Publication date
CN108682000B (en) 2020-10-09

Similar Documents

Publication Publication Date Title
CN110986788B (en) Automatic measurement method based on three-dimensional point cloud livestock phenotype body size data
CN108682000A (en) The long body width detecting method of pig body based on Kinect videos
WO2019232247A1 (en) Biomass estimation in an aquaculture environment
CN101512551A (en) A method and a system for measuring an animal's height
ES2665583B1 (en) PROCEDURE FOR THE DETERMINATION OF TUNA BIOMASS IN A WATER AREA AND A CORRESPONDING SYSTEM
CN109141248A (en) Pig weight measuring method and system based on image
WO2019162180A1 (en) A method and device for the characterization of living specimens from a distance
CN109145808B (en) Tuna identification method based on self-adaptive fish body bending model
CN104732564B (en) A kind of Estimating Leaf Area In Maize dynamic nondestructive monitoring device and method
CN109636779B (en) Method, apparatus and storage medium for recognizing integrated ruler of poultry body
CN113033481B (en) Handheld stick detection method based on first-order full convolution target detection algorithm
CN111353416B (en) Gesture detection method, system and storage medium based on livestock three-dimensional measurement
RU2019114132A (en) FORECASTING THE YIELD OF THE GRAIN FIELD
CN112825791B (en) Milk cow body condition scoring method based on deep learning and point cloud convex hull characteristics
CN107506801A (en) A kind of fish character measurement apparatus and method
CN104881636B (en) Identify the method and device of pig lying behaviour
CN108230290A (en) Live pig body ruler detection method based on stereoscopic vision
CN109978937A (en) A kind of ox body measurement system detected based on deep learning and characteristic portion
CN108180825B (en) A kind of identification of cuboid object dimensional and localization method based on line-structured light
CN110181174B (en) Underwater scaled fish laser marking method based on machine vision
CN113706512B (en) Live pig weight measurement method based on deep learning and depth camera
CN110163253A (en) Fish floating head degree detecting method and system
CN111166338B (en) Pregnant sow body size calculation method based on TOF depth data
CN110728708B (en) Machine vision-based cattle body ruler measurement method
CN208740937U (en) A kind of scale for non-contact measurement corneal diameter

Legal Events

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