CN113112541A - Silkworm pupa body pose measuring and calculating method and system based on image processing - Google Patents

Silkworm pupa body pose measuring and calculating method and system based on image processing Download PDF

Info

Publication number
CN113112541A
CN113112541A CN202110466976.8A CN202110466976A CN113112541A CN 113112541 A CN113112541 A CN 113112541A CN 202110466976 A CN202110466976 A CN 202110466976A CN 113112541 A CN113112541 A CN 113112541A
Authority
CN
China
Prior art keywords
silkworm pupa
image
pupa body
silkworm
image processing
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.)
Pending
Application number
CN202110466976.8A
Other languages
Chinese (zh)
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.)
Southwest University
Original Assignee
Southwest 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 Southwest University filed Critical Southwest University
Priority to CN202110466976.8A priority Critical patent/CN113112541A/en
Publication of CN113112541A publication Critical patent/CN113112541A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras
    • 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/10Segmentation; Edge detection
    • G06T7/187Segmentation; Edge detection involving region growing; involving region merging; involving connected component labelling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/80Analysis of captured images to determine intrinsic or extrinsic camera parameters, i.e. camera calibration
    • 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/10004Still image; Photographic image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20092Interactive image processing based on input by user
    • G06T2207/20104Interactive definition of region of interest [ROI]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Investigating Or Analysing Materials By Optical Means (AREA)

Abstract

The invention discloses a method and a system for measuring and calculating the position and the pose of a silkworm pupa body based on image processing, wherein the method comprises the following steps: s1, calibrating a camera to obtain a calibration file; s2, collecting a silkworm pupa body image on the conveying platform; s3, processing the silkworm pupa body image to obtain a silkworm pupa body ROI image area; s4, calculating the gravity pixel coordinates of the ROI image area of the silkworm pupa body and the rotation angle of the silkworm pupa body; and S5, converting the gravity center pixel coordinate according to the calibration file to obtain the position and posture coordinate of the silkworm pupa body. The system comprises an image acquisition unit and an image processing unit; the invention can synchronously measure the pose of the silkworm pupa body in the pupa body transfer process, and has high accuracy and strong reliability.

Description

Silkworm pupa body pose measuring and calculating method and system based on image processing
Technical Field
The invention relates to the field of biological image processing, in particular to a silkworm pupa body pose measuring and calculating method and system based on image processing.
Background
Compared with a method for identifying male and female silkworm chrysalis by ray or spectrum, the method has the advantages that male and female silkworm chrysalis can be distinguished by identifying the characteristics of the gonad at the tail of the silkworm chrysalis through machine vision, and the method has better reliability and economic feasibility. Industrial cameras have limited depth of field and are expensive in manufacturing cost, so in order to realize the recognition task by using the least number of industrial cameras as far as possible, the silkworm pupa body pose (direction and position) consistency is higher in silkworm pupa gonad recognition; in the identification station, the head and tail directions of each silkworm chrysalis are kept consistent, and the position of the silkworm chrysalis is accurate, so that the accurate correction of the position and the posture of the silkworm chrysalis is synchronously realized in the transfer process of the silkworm chrysalis. Therefore, before picking up and transferring, the pupa body pose on the conveying platform is accurately measured, and the method has important significance.
Disclosure of Invention
In view of the above, the present invention aims to overcome the defects in the prior art, and provides a method and a system for measuring and calculating the position and pose of a pupa body of a silkworm chrysalis based on image processing.
The invention relates to a silkworm pupa body pose measuring and calculating method based on image processing, which comprises the following steps of:
s1, calibrating a camera to obtain a calibration file;
s2, collecting a silkworm pupa body image on the conveying platform;
s3, processing the silkworm pupa body image to obtain a silkworm pupa body ROI image area;
s4, calculating the gravity pixel coordinates of the ROI image area of the silkworm pupa body and the rotation angle of the silkworm pupa body;
and S5, converting the gravity center pixel coordinate according to the calibration file to obtain the position and posture coordinate of the silkworm pupa body.
Further, step S3 specifically includes:
s31, carrying out binarization and normalization processing on the silkworm pupa body image to obtain a processed silkworm pupa body image;
s32, opening the processed silkworm pupa body image to obtain a silkworm pupa body image without ROI image area adhesion;
s33, carrying out distance transformation on the silkworm pupa body images without the ROI image area adhesion, and setting a threshold value for separation treatment to obtain a separated silkworm pupa body ROI image area;
and S34, searching a communicated region of the separated silkworm pupa body ROI image region to obtain the independent communicated silkworm pupa body ROI image regions which are not adhered to each other.
Further, the distance transformation is performed according to the following formula:
Figure BDA0003044547770000021
wherein D ((x)1,y1),(x2,y2) Is an image coordinate point (x)1,y1) With image coordinate point (x)2,y2) The distance between them.
Further, the barycentric pixel coordinates of the ROI image area of the silkworm pupa body are determined according to the following formula:
Figure BDA0003044547770000022
wherein x ispiIs the horizontal coordinate of the gravity pixel of the ROI image area of the pupa body i of the silkworm pupa; y ispiIs the longitudinal coordinate of the gravity pixel of the ROI image area of the pupa i; f. ofi(x, y) is the gray value of the pupa i; f (x, y) is the gray value of any silkworm pupa body; i is the silkworm pupa body number; x is the abscissa; y is the ordinate.
Further, the silkworm pupa body rotation angle is determined according to the following formula:
θi=180-θni
wherein, thetaiThe rotation angle of the silkworm pupa body i relative to the positive direction of the x axis of the camera coordinate system; thetaniThe rotation angle of the silkworm pupa body i in the negative direction of the x axis of the camera coordinate system is shown; theta is describedniComprises the following steps:
Figure BDA0003044547770000031
a silkworm pupa body pose measuring and calculating system based on image processing comprises an image acquisition unit and an image processing unit;
the image acquisition unit is used for acquiring the silkworm pupa body image information on the conveying platform; the image acquisition unit comprises an industrial camera, an image acquisition card and a backlight light source generator; the industrial camera acquires silkworm pupa body image information and outputs the image information to the image acquisition card, and the image acquisition card is used for controlling the industrial camera to shoot and outputting the received silkworm pupa body image information to the image processing unit;
the image processing unit is used for receiving the silkworm pupa body image information acquired by the image acquisition unit, processing the silkworm pupa body image information and outputting a position and posture coordinate of the silkworm pupa body and a silkworm pupa body rotation angle; the image processing unit comprises a processor and a display; the processor receives the silkworm pupa image information output by the image acquisition card and processes the silkworm pupa image information to obtain a processing result; and the display displays the processing result.
Further, the image acquisition unit further comprises a backlight controller; the backlight controller is used for controlling the luminous intensity of the backlight light source generator.
The invention has the beneficial effects that: according to the method and the system for measuring and calculating the position and the pose of the silkworm pupa body based on image processing, disclosed by the invention, the position and the pose coordinate of the silkworm pupa body and the rotation angle of the silkworm pupa body are obtained by calculating and processing the silkworm pupa body image on the conveying platform, so that the position and the pose information of the silkworm pupa body can be accurately obtained before picking and transferring, and the accurate identification of the gonad of the silkworm pupa is facilitated.
Drawings
The invention is further described below with reference to the following figures and examples:
FIG. 1 is a schematic flow chart of a method for measuring and calculating the pose of pupa bodies of silkworm chrysalis according to the present invention;
FIG. 2 is a schematic diagram of the calculation principle of the pupa rotation angle and the pose coordinate according to the present invention;
fig. 3 is a schematic diagram of the silkworm pupa body pose measuring and calculating system.
Detailed Description
The invention is further described with reference to the drawings, as shown in fig. 1:
the invention relates to a silkworm pupa body pose measuring and calculating method based on image processing, which comprises the following steps of:
s1, calibrating a camera to obtain a calibration file; wherein the camera is an industrial camera; calibrating the industrial camera by using a calibration plate and adopting a Zhang Zhengyou calibration method to obtain a calibration file; the content of the calibration file comprises distortion correction parameter information of the industrial camera and actual physical length information corresponding to a unit pixel;
s2, collecting a silkworm pupa body image on the conveying platform;
s3, processing the silkworm pupa body image to obtain a silkworm pupa body ROI image area;
s4, calculating the gravity pixel coordinates of the ROI image area of the silkworm pupa body and the rotation angle of the silkworm pupa body;
and S5, converting the gravity center pixel coordinate according to the calibration file to obtain the position and posture coordinate of the silkworm pupa body. The conversion processing of the barycentric pixel coordinates according to the calibration file adopts the prior art, and is not described herein again.
In this embodiment, the step S3 specifically includes:
s31, carrying out binarization and normalization processing on the silkworm pupa body image to obtain a processed silkworm pupa body image; thereby eliminating noise caused by uneven illumination;
s32, opening the processed silkworm pupa body image to obtain a silkworm pupa body image without ROI image area adhesion;
s33, carrying out distance transformation on the silkworm pupa body images without the ROI image area adhesion, and setting a threshold value for separation treatment to obtain a separated silkworm pupa body ROI image area; wherein the threshold value is set according to the actual illumination condition;
and S34, searching a communicated region of the separated silkworm pupa body ROI image region to obtain the independent communicated silkworm pupa body ROI image regions which are not adhered to each other. Wherein the connected region retrieval adopts 4-connected region retrieval.
In this embodiment, the distance conversion is performed according to the following formula:
Figure BDA0003044547770000051
wherein D ((x)1,y1),(x2,y2) Is an image coordinate point (x)1,y1) With image coordinate point (x)2,y2) The distance between them.
In this embodiment, the barycentric pixel coordinates of the ROI image region of the pupa body of the silkworm pupa are determined according to the following formula:
Figure BDA0003044547770000052
wherein x ispiIs the horizontal coordinate of the gravity pixel of the ROI image area of the pupa body i of the silkworm pupa; y ispiIs the longitudinal coordinate of the gravity pixel of the ROI image area of the pupa i; f. ofi(x, y) is the gray value of the pupa i; f (x, y) is the gray value of any silkworm pupa body; i is the silkworm pupa body number; x is the abscissa; y is the ordinate.
In this embodiment, the rotation angle of the pupa body of the silkworm is determined according to the following formula:
θi=180-θni
wherein, thetaiThe rotation angle of the pupa i in the positive direction of the x-axis of the camera coordinate system is θ in the embodimentiThe included angle between the connecting line of the head and the tail of the silkworm pupa body i and the positive direction of the x axis of the camera coordinate system is formed; thetaniIs the angle of rotation of the pupa i in the negative direction with respect to the x-axis of the camera coordinate systemniThe included angle between the connecting line of the head and the tail of the silkworm pupa body i and the negative direction of the x axis of the camera coordinate system is formed; theta is describedniComprises the following steps:
Figure BDA0003044547770000053
a silkworm pupa body pose measuring and calculating system based on image processing is shown in figure 3 and comprises an image acquisition unit and an image processing unit;
the image acquisition unit is used for acquiring the silkworm pupa body image information on the conveying platform; the image acquisition unit comprises an industrial camera, an image acquisition card and a backlight light source generator; the industrial camera acquires silkworm pupa body image information and outputs the image information to the image acquisition card, and the image acquisition card is used for controlling the industrial camera to shoot and outputting the received silkworm pupa body image information to the image processing unit; the image acquisition card controls shooting of the industrial camera by turning on or off a switch of the industrial camera, and the industrial camera is used for imaging silkworm pupa bodies on the conveying platform; the backlight light source generator emits backlight, so that the silkworm pupa body imaging is not influenced by the silkworm pupa surface texture, and a clear pupa body image is obtained; the backlight light source generator adopts the existing backlight light source generating equipment, and the details are not repeated.
The image processing unit is used for receiving the silkworm pupa body image information acquired by the image acquisition unit, processing the silkworm pupa body image information and outputting a position and posture coordinate of the silkworm pupa body and a silkworm pupa body rotation angle; the image processing unit comprises a processor and a display; the processor receives the silkworm pupa image information output by the image acquisition card and processes the silkworm pupa image information to obtain a processing result; and the display displays the processing result.
It should be noted that the processor integrates the calculation or processing algorithms of image calibration, binarization, normalization, erosion expansion, connected region detection, distance transformation, ROI region marking, pupa body gravity center position and rotation angle; the processor carries out calibration, binaryzation, normalization, corrosion expansion and other preprocessing on the silkworm pupa image according to the algorithm, eliminates image distortion and noise, improves image quality, carries out communicated region detection and distance transformation to form separate independent silkworm pupa ROI image regions which are not mutually adhered, and finally calculates the pose coordinate of each silkworm pupa ROI and the rotation angle relative to the positive direction of the x axis of the camera coordinate system.
In this embodiment, the image acquisition unit further includes a backlight controller; the backlight controller is used for controlling the luminous intensity of the backlight light source generator; and then can set up required luminous intensity according to actual illumination condition in a flexible way.
Finally, the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting, although the present invention has been described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions may be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all of them should be covered in the claims of the present invention.

Claims (7)

1. A silkworm pupa body pose measuring and calculating method based on image processing is characterized by comprising the following steps: the method comprises the following steps:
s1, calibrating a camera to obtain a calibration file;
s2, collecting a silkworm pupa body image on the conveying platform;
s3, processing the silkworm pupa body image to obtain a silkworm pupa body ROI image area;
s4, calculating the gravity pixel coordinates of the ROI image area of the silkworm pupa body and the rotation angle of the silkworm pupa body;
and S5, converting the gravity center pixel coordinate according to the calibration file to obtain the position and posture coordinate of the silkworm pupa body.
2. The image processing-based silkworm pupa body pose measuring and calculating method according to claim 1, wherein the image processing-based silkworm pupa body pose measuring and calculating method comprises the following steps: the step S3 specifically includes:
s31, carrying out binarization and normalization processing on the silkworm pupa body image to obtain a processed silkworm pupa body image;
s32, opening the processed silkworm pupa body image to obtain a silkworm pupa body image without ROI image area adhesion;
s33, carrying out distance transformation on the silkworm pupa body images without the ROI image area adhesion, and setting a threshold value for separation treatment to obtain a separated silkworm pupa body ROI image area;
and S34, searching a communicated region of the separated silkworm pupa body ROI image region to obtain the independent communicated silkworm pupa body ROI image regions which are not adhered to each other.
3. The image processing-based silkworm pupa body pose measuring and calculating method according to claim 2, wherein the image processing-based silkworm pupa body pose measuring and calculating method comprises the following steps: the distance transformation is performed according to the following formula:
Figure FDA0003044547760000011
wherein D ((x)1,y1),(x2,y2) Is an image coordinate point (x)1,y1) With image coordinate point (x)2,y2) The distance between them.
4. The image processing-based silkworm pupa body pose measuring and calculating method according to claim 1, wherein the image processing-based silkworm pupa body pose measuring and calculating method comprises the following steps: the gravity center pixel coordinates of the ROI image area of the pupa body of the silkworm are determined according to the following formula:
Figure FDA0003044547760000021
wherein x ispiIs the horizontal coordinate of the gravity pixel of the ROI image area of the pupa body i of the silkworm pupa; y ispiIs the longitudinal coordinate of the gravity pixel of the ROI image area of the pupa i; f. ofi(x, y) is the gray value of the pupa i; f (x, y) is the gray value of any silkworm pupa body; i is the silkworm pupa body number; x is the abscissa; y is the ordinate.
5. The image processing-based silkworm pupa body pose measuring and calculating method according to claim 4, wherein the image processing-based silkworm pupa body pose measuring and calculating method comprises the following steps: determining the rotation angle of the pupa body of the silkworm according to the following formula:
θi=180-θni
wherein, thetaiThe rotation angle of the silkworm pupa body i relative to the positive direction of the x axis of the camera coordinate system; thetaniThe rotation angle of the silkworm pupa body i in the negative direction of the x axis of the camera coordinate system is shown; theta is describedniComprises the following steps:
Figure FDA0003044547760000022
6. the utility model provides a silkworm pupa body position and appearance system based on image processing which characterized in that: comprises an image acquisition unit and an image processing unit;
the image acquisition unit is used for acquiring the silkworm pupa body image information on the conveying platform; the image acquisition unit comprises an industrial camera, an image acquisition card and a backlight light source generator; the industrial camera acquires silkworm pupa body image information and outputs the image information to the image acquisition card, and the image acquisition card is used for controlling the industrial camera to shoot and outputting the received silkworm pupa body image information to the image processing unit;
the image processing unit is used for receiving the silkworm pupa body image information acquired by the image acquisition unit, processing the silkworm pupa body image information and outputting a position and posture coordinate of the silkworm pupa body and a silkworm pupa body rotation angle; the image processing unit comprises a processor and a display; the processor receives the silkworm pupa image information output by the image acquisition card and processes the silkworm pupa image information to obtain a processing result; and the display displays the processing result.
7. The image processing-based silkworm pupa body pose measuring and calculating system according to claim 6, wherein the image processing-based silkworm pupa body pose measuring and calculating system comprises: the image acquisition unit further comprises a backlight controller; the backlight controller is used for controlling the luminous intensity of the backlight light source generator.
CN202110466976.8A 2021-04-28 2021-04-28 Silkworm pupa body pose measuring and calculating method and system based on image processing Pending CN113112541A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110466976.8A CN113112541A (en) 2021-04-28 2021-04-28 Silkworm pupa body pose measuring and calculating method and system based on image processing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110466976.8A CN113112541A (en) 2021-04-28 2021-04-28 Silkworm pupa body pose measuring and calculating method and system based on image processing

Publications (1)

Publication Number Publication Date
CN113112541A true CN113112541A (en) 2021-07-13

Family

ID=76721067

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110466976.8A Pending CN113112541A (en) 2021-04-28 2021-04-28 Silkworm pupa body pose measuring and calculating method and system based on image processing

Country Status (1)

Country Link
CN (1) CN113112541A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113080155A (en) * 2021-05-20 2021-07-09 西南大学 Silkworm pupa body pickup device and method

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113080155A (en) * 2021-05-20 2021-07-09 西南大学 Silkworm pupa body pickup device and method
CN113080155B (en) * 2021-05-20 2024-06-14 西南大学 Silkworm chrysalis body pickup device and method

Similar Documents

Publication Publication Date Title
CN110497187B (en) Sun flower pattern assembly system based on visual guidance
CN109297413B (en) Visual measurement method for large-scale cylinder structure
CN111721259B (en) Underwater robot recovery positioning method based on binocular vision
CN110779928B (en) Defect detection device and method
CN108177143B (en) Robot positioning and grabbing method and system based on laser vision guidance
CN113137920B (en) Underwater measurement equipment and underwater measurement method
CN105674880B (en) Contact net geometric parameter measurement method and system based on binocular principle
CN110580725A (en) Box sorting method and system based on RGB-D camera
CN109739239B (en) Planning method for uninterrupted instrument recognition of inspection robot
CN110189375B (en) Image target identification method based on monocular vision measurement
CN111784655B (en) Underwater robot recycling and positioning method
CN110966956A (en) Binocular vision-based three-dimensional detection device and method
CN110260818B (en) Electronic connector robust detection method based on binocular vision
CN111743642B (en) Shell-shaped dental instrument cutting method, manufacturing method and electronic equipment
CN109801336B (en) Airborne target positioning system and method based on visible light and infrared light vision
CN113112541A (en) Silkworm pupa body pose measuring and calculating method and system based on image processing
CN111738971B (en) Circuit board stereoscopic scanning detection method based on line laser binocular stereoscopic vision
CN114257736A (en) Self-adaptive shooting method for workpieces
CN108180825A (en) A kind of identification of cuboid object dimensional and localization method based on line-structured light
CN116930187A (en) Visual detection method and visual detection system for vehicle body paint surface defects
CN116433604A (en) Chip identification method and pickup system
CN115388785A (en) Flexible wire harness measuring method and system based on vision
US11132579B2 (en) Contour recognition device, contour recognition system and contour recognition method
CN115546716A (en) Binocular vision-based method for positioning fire source around power transmission line
CN114104453A (en) Non-ferrous metal automatic labeling method and device based on image processing

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