WO2021035687A1 - Open-field experiment data analysis method and system and terminal device - Google Patents

Open-field experiment data analysis method and system and terminal device Download PDF

Info

Publication number
WO2021035687A1
WO2021035687A1 PCT/CN2019/103707 CN2019103707W WO2021035687A1 WO 2021035687 A1 WO2021035687 A1 WO 2021035687A1 CN 2019103707 W CN2019103707 W CN 2019103707W WO 2021035687 A1 WO2021035687 A1 WO 2021035687A1
Authority
WO
WIPO (PCT)
Prior art keywords
open field
video
experimental
image
target
Prior art date
Application number
PCT/CN2019/103707
Other languages
French (fr)
Chinese (zh)
Inventor
陈高伟
朱英杰
周魁魁
姜少磊
Original Assignee
深圳先进技术研究院
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 深圳先进技术研究院 filed Critical 深圳先进技术研究院
Priority to PCT/CN2019/103707 priority Critical patent/WO2021035687A1/en
Publication of WO2021035687A1 publication Critical patent/WO2021035687A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/20Analysis of motion
    • 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

Definitions

  • This application belongs to the field of data processing technology, and in particular relates to an open field experiment data analysis method, system and terminal equipment.
  • the embodiments of the present application provide an open field experimental data analysis method, system and terminal equipment, which can solve the problem of low efficiency and accuracy of open field experimental data analysis in the prior art.
  • an embodiment of the present application provides an open field experiment data analysis method, including:
  • a coordinate system is established according to the contour boundary of the target open field in the regional image, and the motion track of the experimental animal is drawn in the coordinate system according to the second coordinates corresponding to each of the centroids.
  • the converting each of the video frames into corresponding binary images includes:
  • each initial binary image satisfies the preset condition, determining each initial binary image as a binary image corresponding to each video frame;
  • the intercepting the region image corresponding to the target open field from each of the binary images includes:
  • the region image corresponding to the open field of the target is intercepted from each of the binary images according to the contour boundary.
  • the method after determining the second coordinate corresponding to the centroid of the experimental animal in each of the regional images according to the first coordinate corresponding to each pixel point, the method includes:
  • the determining the moving distance of the experimental animal according to the second coordinates corresponding to each of the centroids includes:
  • the moving distance of the experimental animal is determined based on each of the centroid distances.
  • the establishing a coordinate system according to the contour boundary of the target open field in the area image includes:
  • the coordinate system is established by taking the left contour boundary of the target open field in the area image as the vertical axis, and taking the lower contour boundary of the target open field as the horizontal axis.
  • the method includes:
  • the activity time of the experimental animal in the target area is determined according to the video duration, the first quantity and the second quantity.
  • the acquiring the experimental video including the target open field includes:
  • an embodiment of the present application provides an open field experiment data analysis system, including:
  • the video frame extraction module is used to obtain the experimental video containing the target open field, and extract each video frame corresponding to the experimental video;
  • An area image interception module configured to convert each of the video frames into a corresponding binary image, and intercept the area image corresponding to the target open field from each of the binary images;
  • the centroid coordinate determination module is used to obtain the first coordinate corresponding to each pixel of the experimental animal in each of the regional images, and determine the first coordinate of the experimental animal in each of the regional images according to the first coordinate corresponding to each pixel.
  • the motion trajectory drawing module is used to establish a coordinate system according to the outline boundary of the target open field in the regional image, and draw the motion trajectory of the experimental animal in the coordinate system according to the second coordinates corresponding to each of the centroids .
  • an embodiment of the present application provides a terminal device, including a memory, a processor, and a computer program stored in the memory and running on the processor.
  • the processor executes the computer program, The open field experiment data analysis method as described in any one of the above-mentioned first aspects is realized.
  • an embodiment of the present application provides a computer-readable storage medium, the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the implementation is as described in any of the above-mentioned first aspects.
  • the embodiments of the present application provide a computer program product that, when the computer program product runs on a terminal device, causes the terminal device to execute the open-field experiment data analysis method described in any one of the above-mentioned first aspects.
  • the video frame of the experimental video can be extracted directly without video playback, and the extracted video frames can be binarized
  • the binary image corresponding to each video frame is obtained, and then the regional image corresponding to the target open field can be intercepted from each binary image, and the coordinate system corresponding to the target open field can be established by analyzing the regional image and the experimental animal
  • the coordinates corresponding to the centroids in the images of each area can be quickly and accurately drawn in the coordinate system according to the coordinates corresponding to the centroids, which greatly reduces the time cost in the open field experimental data analysis and effectively improves The analysis efficiency and accuracy of open field experiment data analysis are improved.
  • FIG. 1 is a schematic flowchart of an open field experiment data analysis method provided by an embodiment of the present application
  • FIG. 2 is a schematic flowchart of a binary image obtained in an application scenario by the open field experimental data analysis method provided by an embodiment of the present application;
  • FIG. 3 is a schematic diagram of a grayscale image obtained in an application scenario according to an embodiment of the present application.
  • FIG. 4 is a schematic diagram of contour boundaries set in an application scenario according to an embodiment of the present application.
  • FIG. 5 is a schematic diagram of a motion trajectory diagram obtained in an application scenario according to an embodiment of the present application.
  • FIG. 6 is a schematic flow chart of determining the activity time of an experimental animal in a target area in an application scenario according to an open field experimental data analysis method provided by an embodiment of the present application;
  • FIG. 7 is a schematic structural diagram of an open field experiment data analysis system provided by an embodiment of the present application.
  • Fig. 8 is a schematic structural diagram of a terminal device provided by an embodiment of the present application.
  • the term “if” can be construed as “when” or “once” or “in response to determination” or “in response to detecting “.
  • the phrase “if determined” or “if detected [described condition or event]” can be interpreted as meaning “once determined” or “in response to determination” or “once detected [described condition or event]” depending on the context ]” or “in response to detection of [condition or event described]”.
  • An open field experiment refers to an experiment in which animals are placed in an open field experimental device and their activities in the open field experimental device are recorded to analyze and obtain animal behavior data.
  • the existing open-field experimental data analysis methods generally need to play the recorded video to obtain animal behavior data by manual observation and analysis during the playback process, which not only takes a lot of time for the experimenter, but also easily reduces the amount of open-field experimental data analysis. Analysis efficiency and analysis accuracy.
  • the embodiments of the present application provide an open field experiment data analysis method, system, and terminal equipment, which can directly extract video frames from the experimental video in the open field experiment without video playback.
  • the extracted video frames can be binarized to obtain the binary image corresponding to each video frame, and then the regional image corresponding to the target open field can be intercepted from each binary image, and the regional image can be analyzed
  • Establish the coordinate system corresponding to the target open field that is, the area corresponding to the open field experimental device in the image
  • the coordinate corresponding to the centroid of the experimental animal in the image of each area so that the coordinate corresponding to each centroid can be quickly and quickly in the coordinate system.
  • the open-field experimental data analysis method in the embodiments of the present application can be applied to scenarios where there is a color difference between the open-field experimental device and the experimental animal, for example, it can be applied to the open-field experimental device being white and the experimental animal being black. In the scene, or can be applied to the scene where the open field experimental device is black, the experimental animal is white, and so on.
  • the open field experimental data analysis method provided in the embodiments of the present application will be described in detail below with a scene where the open field experimental device is white and the experimental animal is black.
  • FIG. 1 shows a schematic flowchart of an open field experimental data analysis method provided by an embodiment of the present application, and the open field experimental data analysis method may include:
  • Step S101 Obtain an experimental video containing the target open field, and extract each video frame corresponding to the experimental video;
  • the execution subject of the embodiments of the application may be an open field experimental data analysis system based on the Matlab language.
  • the open field experimental analysis system is constructed using the open source Matlab language, which can ensure the convenience and lightness of the constructed system and make all The construction system can be used simply and quickly, reducing the experimental cost of open field experiments.
  • the open field experiment data analysis system can be installed in any terminal device to run and use, and the terminal device includes, but is not limited to, computing devices such as desktop computers, notebooks, and palm computers.
  • the experimental video can be recorded video in various formats, for example, can be recorded video in wmv (Windows Media Video) format, or can be recorded video in rmvb (Real Media Variable Bitrate) format, or can be mkv (Matroska Video) format recording video, or it can be avi (Audio Video Interleaved) format recording video, etc.
  • the recorded experimental video containing the target open field can be stored in the storage device of the terminal device or stored in the storage device connected to the terminal device.
  • the experimental video including the open field of the target refers to the video that is recorded when the open field of the target can be completely captured.
  • the experimental video containing the target open field may be obtained from the storage device or from the cloud server.
  • the user can input the video path and video name corresponding to the experimental video containing the target open field into the open field experimental data analysis system, and the open field experimental data analysis
  • the system can obtain the experimental video by interpreting the video path and the video name.
  • the open field experiment data analysis system may interpret the video path and the video name to obtain the experiment video in the following manner:
  • tit_fn sprintf('%s',datafile(1:end-4));
  • the video frames corresponding to the experimental video can be extracted in sequence according to the video sequence.
  • the open-field experimental data analysis system when it reads the experimental video, it can also obtain the video duration and frame rate of the experimental video, and can determine the extracted data according to the video duration and the frame rate.
  • Step S102 Convert each of the video frames into a corresponding binary image, and intercept an area image corresponding to the target open field from each of the binary images;
  • the converting each of the video frames into corresponding binary images may include:
  • Step S201 Convert each of the video frames into corresponding gray-scale images
  • each of the frequency frames may be first converted into a grayscale image with a grayscale range of 0 to 1, that is, the grayscale value of each pixel in each grayscale image is 0.
  • any existing gray-scale conversion method may be used to convert each of the video frames into corresponding gray-scale images, which is not limited in the embodiment of the present application.
  • Step S202 Obtain an initial segmentation threshold, and convert each of the grayscale images into corresponding initial binary images according to the initial segmentation threshold;
  • the initial segmentation threshold can be determined through experimental tests, and the range of the initial segmentation threshold is between 0 and 1.
  • the initial segmentation threshold can be set to 0.3 according to experimental tests.
  • the grayscale value of each pixel in the grayscale image can be obtained first, and then the grayscale value can be greater than the initial segmentation threshold.
  • the gray value of the pixel is reset to 1 (that is, the pixel value of the pixel corresponding to the experimental animal is set to 1), and the gray value of the pixel whose gray value is less than or equal to the initial segmentation threshold can be reset Set it to 0 (that is, set the pixel value of the pixel corresponding to the open field experimental device to 0), so as to obtain the initial binary image with the pixel gray value of 0 or 1.
  • the initial segmentation threshold is 0.3
  • the gray values of pixels with gray values greater than 0.3 can be set to 1
  • the gray values of pixels with gray values less than or equal to 0.3 can be set to average.
  • Step S203 Determine whether the initial binary image meets a preset condition
  • Step S204 If the initial binary image satisfies the preset condition, determine each initial binary image as a binary image corresponding to each video frame;
  • Step S205 If the initial binarized image does not meet the preset condition, adjust the initial segmentation threshold, and return to execute converting each grayscale image into a corresponding initial binary image according to the initial segmentation threshold Steps and subsequent steps.
  • the open field experimental data analysis system can display the initial binary image on the display interface after obtaining the initial binary image of any grayscale image according to the initial segmentation threshold. Instruct the user to determine whether the displayed initial binary image satisfies a preset condition, that is, instruct the user to determine whether the experimental animal in the initial binary image and the target open field are segmented correctly, and feed back corresponding response information, such as Feed back the correct response information between the experimental animal and the target open field, or feedback the incorrect response information between the experimental animal and the target open field.
  • a preset condition that is, instruct the user to determine whether the experimental animal in the initial binary image and the target open field are segmented correctly
  • feed back corresponding response information such as Feed back the correct response information between the experimental animal and the target open field, or feedback the incorrect response information between the experimental animal and the target open field.
  • the open field experimental data analysis system may determine whether the initial binary image satisfies a preset condition according to the response information, and if it is determined that the initial binary image satisfies the preset condition, each of the initial binary images may be The binary image is determined to be the binary image corresponding to each of the video frames; if it is determined that the initial binary image does not meet the preset condition, the initial segmentation threshold may be adjusted.
  • the response information When segmenting incorrect response information between the experimental animal and the target open field, the response information can also carry the adjusted segmentation threshold input by the user, and the open field experimental data analysis system can be based on the
  • the initial segmentation threshold is adjusted by the segmentation threshold carried in the response information, and the initial segmentation threshold can be adjusted to the segmentation threshold carried in the response information, and the grayscale can be continuously executed according to the initial segmentation threshold.
  • the adjustment of the initial segmentation threshold according to the segmentation threshold input by the user is only for schematic explanation, and should not be construed as a limitation of the embodiment of the present application.
  • the embodiment of the present application can also automatically perform the initial segmentation threshold according to image recognition technology. Adjustment.
  • the open field experimental device corresponding to the target open field is always at a fixed position during the video recording process, so that the target open field has the same area in all video frames, that is, the target open field is in all two areas. The areas in the value image are also the same. Therefore, in a possible implementation, the open-field experimental data analysis system can display any gray-scale image on the display interface after obtaining the gray-scale image corresponding to each video frame (as shown in Figure 3). To instruct the user to set the contour boundary corresponding to the target open field according to the displayed gray image (for example, the gray image shown in Fig. 3 can be the rectangular in the open field experimental device). The frame is set as the contour boundary corresponding to the target open field as shown in Fig.
  • the open field experimental data analysis system can receive the contour boundary set by the user, and can use the contour boundary from each of the binary values
  • the area image corresponding to the open field of the target is intercepted in the image to perform subsequent data analysis by intercepting the image of the area corresponding to the open field of the target, which can greatly reduce the analysis workload in the data analysis, thereby improving the data analysis of the open field experiment Analysis efficiency.
  • the outline boundary of the target open field set by the user is only for schematic explanation, and should not be construed as a limitation to the embodiment of the present application.
  • the embodiment of the present application can also automatically determine the corresponding target open field based on image recognition technology. Contour boundary.
  • the interception operation of the area image first, and then perform the conversion operation of the binary image, that is, the area image corresponding to the target open field may be intercepted first from each video frame, and then The binarization conversion process can be performed on each region image, and the centroid of the region image after the binarization conversion process can be determined later, so that the region image can be intercepted first and then the region image binarization process. Reduce the processing workload in the binarization process, thereby improving the analysis efficiency of open field experimental data analysis.
  • Step S103 Obtain the first coordinates corresponding to each pixel of the experimental animal in each of the regional images, and determine the first coordinate corresponding to the centroid of the experimental animal in each of the regional images according to the first coordinate corresponding to each pixel. Two coordinates
  • the open field experimental data analysis system can obtain the first coordinates corresponding to each pixel of the experimental animal in each of the regional images after intercepting the images of each area corresponding to the target open field, that is, obtain each The first coordinate corresponding to the pixel with the gray value of 1 in the regional image, and the centroid of the experimental animal in each regional image can be determined according to the first coordinate corresponding to each pixel in each regional image
  • the corresponding second coordinate for example, the second coordinate corresponding to the centroid A of the experimental animal in the first frame of regional image can be calculated according to the first coordinate corresponding to the pixel with the gray value of 1 in the first frame of regional image
  • the second coordinate corresponding to the centroid B of the experimental animal in the second frame area image is calculated according to the first coordinate corresponding to the pixel with the gray value of 1 in the second frame area image, and so on, until according to the last frame
  • the first coordinate corresponding to the pixel with the gray value of 1 in the area image is calculated until the second coordinate corresponding to the centroid of the experimental animal in
  • BW3 double(BW_adjust);
  • the method may further include:
  • Step a Determine the moving distance of the experimental animal according to the second coordinates corresponding to each of the centroids
  • the determining the moving distance of the experimental animal according to the second coordinates corresponding to each of the centroids may include: step a1, respectively, calculating all the images in the two adjacent frames of area images according to the second coordinates corresponding to each of the centroids.
  • step a2 the moving distance of the experimental animals is determined based on each of the centroid distances.
  • the final moving distance of the experimental animal can be determined according to the centroid distance between the centroids of the experimental animal in two consecutive frames of regional images, that is, the centroid distance of the experimental animal in every two consecutive frames of regional images can be calculated first , And then the centroid distances can be added together to obtain the final moving distance of the experimental animal.
  • Step b Obtain the video duration of the experimental video, and determine the moving speed of the experimental animal according to the moving distance and the video duration.
  • the open field experimental data analysis system when the open field experimental data analysis system reads the experimental video, it can also acquire the video duration of the experimental video. Therefore, after determining the final moving distance of the experimental animal, it can be based on The movement distance and the video duration determine the movement rate of the experimental animal. For example, the movement distance/video duration may be used to obtain the movement rate.
  • Step S104 Establish a coordinate system according to the outline boundary of the target open field in the area image, and draw the motion track of the experimental animal in the coordinate system according to the second coordinates corresponding to each of the centroids;
  • the establishing a coordinate system according to the contour boundary of the target open field in the regional image may include: taking the left contour boundary of the target open field in the regional image as the vertical axis, and taking the target open field as the vertical axis.
  • the lower contour boundary of is the horizontal axis to establish the coordinate system.
  • the motion trajectory of the experimental animal can be drawn in the coordinate system according to the second coordinates corresponding to each centroid, that is, the centroid is used to characterize the experimental animal's movement at the target.
  • the position in the open field so as to reflect the movement of the experimental animal in the target open field according to the coordinate change of the center of mass.
  • the centroids in two consecutive frames of regional images may be connected to obtain the motion trajectory of the experimental animal in the open field of the target.
  • the contour boundary of the motion trajectory can also be drawn according to the contour boundary of the target open field.
  • the target open field can be drawn The contour boundary of is drawn as the contour boundary of the motion trajectory, so that the motion trajectory diagram shown in FIG. 5 is obtained.
  • a save path can be set to save the motion path diagram, so as to facilitate subsequent viewing and analysis of open field experimental data.
  • Step S601 Determine a target area in the coordinate system, and determine a first number of centroids located in the target area according to the second coordinates corresponding to each of the centroids and the coordinate range corresponding to the target area;
  • Step S602 Determine a second number of the centroids, where the second number is the total number of the centroids included in the motion trajectory;
  • Step S603 Obtain the video duration of the experimental video
  • Step S604 Determine the activity time of the experimental animal in the target area according to the video duration, the first quantity and the second quantity.
  • the user can also be instructed to set the coordinate range of the target area in the coordinate system, and the open field experimental data analysis system can be based on
  • the coordinate range set by the user determines the target area in the coordinate system, for example, the target area as shown in FIG. 5 (that is, the small rectangular area in the motion trajectory diagram in FIG. 5) is determined.
  • the open field experimental data analysis system can first determine the second coordinate of the center of mass located in the target area according to the second coordinate corresponding to each of the center of mass and the coordinate range corresponding to the target area. A number, and a second number of the centroids can be obtained.
  • the second number is the total number of the centroids in the experimental video.
  • the total number of the centroids can be determined according to the drawn motion trajectory.
  • each video frame in the experimental video can include the experimental animal, in the embodiment of this application, of course, the experimental video can also be determined according to the number of video frames corresponding to the experimental video.
  • the experimental video containing the target open field is obtained, and each video frame corresponding to the experimental video is directly extracted; then, each of the video frames is converted into a corresponding binary image, and each of the two The area image corresponding to the target open field is intercepted from the value image; then the first coordinates corresponding to each pixel of the experimental animal in each of the area images are obtained, and each of the pixels is determined according to the first coordinates corresponding to the pixels.
  • the second coordinate corresponding to the centroid of the experimental animal in the regional image finally a coordinate system is established according to the contour boundary of the target open field in the regional image, and the second coordinate corresponding to each centroid is in the coordinate system Draw the motion trajectory of the experimental animal in.
  • the video frame of the experimental video can be extracted directly without video playback, and the extracted video frames can be binarized to obtain each
  • the binary image corresponding to the video frame can be intercepted from each binary image and the area image corresponding to the open field of the target can be intercepted, and the coordinate system corresponding to the open field of the target can be established by analyzing the regional image and the experimental animal in each area image
  • the coordinates corresponding to the center of mass of each center of mass can quickly and accurately draw the motion trajectory of the experimental animal in the coordinate system according to the coordinate corresponding to each center of mass, which greatly reduces the time cost in the data analysis of the open field experiment, and effectively improves the open field experiment Analysis efficiency and accuracy of data analysis.
  • FIG. 7 shows a structural block diagram of the open field experimental data analysis system provided in an embodiment of the present application. The relevant part.
  • the open field experiment data analysis system includes:
  • the video frame extraction module 701 is configured to obtain an experimental video containing a target open field, and extract each video frame corresponding to the experimental video;
  • An area image interception module 702 configured to convert each of the video frames into a corresponding binary image, and intercept the area image corresponding to the target open field from each of the binary images;
  • the centroid coordinate determination module 703 is used to obtain the first coordinates corresponding to each pixel of the experimental animal in each of the regional images, and determine the experimental animal in each of the regional images according to the first coordinates corresponding to each of the pixel points The second coordinate corresponding to the centroid of;
  • the motion trajectory drawing module 704 is configured to establish a coordinate system according to the outline boundary of the target open field in the area image, and draw the motion of the experimental animal in the coordinate system according to the second coordinates corresponding to each of the centroids Trajectory.
  • the regional image capturing module 702 may include:
  • An area image conversion unit for converting each of the area images into corresponding grayscale images
  • a segmentation threshold acquisition unit configured to acquire an initial segmentation threshold, and convert each of the grayscale images into a corresponding initial binary image according to the initial segmentation threshold;
  • a binary image judging unit configured to determine whether the initial binary image satisfies a preset condition
  • a binary image determining unit configured to determine each initial binary image as a binary image corresponding to each video frame if the initial binary image satisfies the preset condition
  • the segmentation threshold adjustment unit is configured to adjust the initial segmentation threshold if the initial binarized image does not meet the preset condition, and return to execute converting each of the grayscale images into corresponding ones according to the initial segmentation threshold The initial binary image steps and subsequent steps.
  • the regional image capturing module 702 may further include:
  • a grayscale image display unit for displaying any one of the grayscale images to instruct the user to set the contour boundary corresponding to the target open field according to the displayed grayscale image
  • the area image interception unit is configured to intercept the area image corresponding to the target open field from each of the binary images according to the contour boundary.
  • the open field experiment data analysis system may further include:
  • a moving distance determining module configured to determine the moving distance of the experimental animal according to the second coordinates corresponding to each of the centroids
  • the moving rate determining module is used to obtain the video duration of the experimental video, and determine the moving rate of the experimental animal according to the moving distance and the video duration.
  • the moving distance determining module may include:
  • a centroid distance calculation unit configured to calculate the centroid distance between the centroids of the experimental animals in two adjacent frames of regional images according to the second coordinates corresponding to each centroid;
  • the moving distance determining unit is configured to determine the moving distance of the experimental animal based on each of the centroid distances.
  • the motion trajectory drawing module 704 is specifically configured to use the left contour boundary of the target open field in the area image as the vertical axis, and the lower contour boundary of the target open field as the horizontal axis to establish the coordinates system.
  • the open field experiment data analysis system may further include:
  • the target area determination module is configured to determine a target area in the coordinate system, and determine the first number of centroids located in the target area according to the second coordinates corresponding to each of the centroids and the coordinate range corresponding to the target area ;
  • a centroid quantity determination module configured to determine a second quantity of the centroid, where the second quantity is the total quantity of centroids included in the motion trajectory;
  • the video duration acquisition module is used to acquire the video duration of the experimental video
  • the activity time determination module is configured to determine the activity time of the experimental animal in the target area according to the video duration, the first quantity and the second quantity.
  • the video frame extraction module 701 may include:
  • the path name obtaining unit is used to obtain the video path and video name corresponding to the experimental video containing the target open field;
  • the experimental video acquisition unit is configured to acquire the experimental video containing the target mine according to the video path and the video name.
  • FIG. 8 is a schematic structural diagram of a terminal device provided by an embodiment of this application.
  • the terminal device 8 of this embodiment includes: at least one processor 80 (only one is shown in FIG. 8), a processor, a memory 81, and a processor that is stored in the memory 81 and can be processed in the at least one processor.
  • a computer program 82 running on the processor 80 when the processor 80 executes the computer program 82, the steps in any of the above-mentioned open field experimental data analysis method embodiments are implemented.
  • the terminal device 8 may be a computing device such as a desktop computer, a notebook, a palmtop computer, and a cloud server.
  • the terminal device may include, but is not limited to, a processor 80 and a memory 81.
  • FIG. 8 is only an example of the terminal device 8 and does not constitute a limitation on the terminal device 8. It may include more or less components than those shown in the figure, or a combination of certain components, or different components. , For example, can also include input and output devices, network access devices, and so on.
  • the so-called processor 80 may be a central processing unit (Central Processing Unit, CPU), the processor 80 may also be other general-purpose processors or digital signal processors (Digital Signal Processor, DSP), Application Specific Integrated Circuit (ASIC), ready-made programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc.
  • the general-purpose processor may be a microprocessor or the processor may also be any conventional processor or the like.
  • the memory 81 may be an internal storage unit of the terminal device 8 in some embodiments, such as a hard disk or memory of the terminal device 8. In other embodiments, the memory 81 may also be an external storage device of the terminal device 8, such as a plug-in hard disk equipped on the terminal device 8, a smart memory card (Smart Media Card, SMC), and a secure digital (Secure Digital, SD) card, flash memory card (Flash Card) and so on. Further, the memory 81 may also include both an internal storage unit of the terminal device 8 and an external storage device.
  • the memory 81 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as the program code of the computer program. The memory 81 can also be used to temporarily store data that has been output or will be output.
  • the embodiments of the present application also provide a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in each of the foregoing method embodiments can be realized.
  • the embodiments of the present application provide a computer program product.
  • the computer program product runs on a terminal device, the terminal device can realize the steps in the foregoing method embodiments when executed.
  • the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium.
  • the computer program can be stored in a computer-readable storage medium. When executed by the processor, the steps of the foregoing method embodiments can be implemented.
  • the computer program includes computer program code, and the computer program code may be in the form of source code, object code, executable file, or some intermediate forms.
  • the computer-readable medium may at least include: any entity or device capable of carrying the computer program code to the photographing device/terminal device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electrical carrier signals, telecommunications signals, and software distribution media.
  • ROM read-only memory
  • RAM random access memory
  • electrical carrier signals telecommunications signals
  • software distribution media For example, U disk, mobile hard disk, floppy disk or CD-ROM, etc.
  • computer-readable media cannot be electrical carrier signals and telecommunication signals.
  • the disclosed apparatus/equipment and method may be implemented in other ways.
  • the device/equipment embodiments described above are only illustrative.
  • the division of the modules or units is only a logical function division, and there may be other divisions in actual implementation, such as multiple units or Components can be combined or integrated into another system, or some features can be omitted or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • Geometry (AREA)
  • Image Analysis (AREA)

Abstract

An open-field experiment data analysis method, comprising: obtaining an experiment video comprising a target open field, and extracting each video frame corresponding to the experiment video; converting each video frame into a corresponding binary image, and capturing a region image corresponding to the target open field from each binary image; obtaining a first coordinate corresponding to each pixel of an experimental animal in each region image, and determining a second coordinate corresponding to the centroid of the experimental animal in each region image according to the first coordinate corresponding to each pixel; and establishing a coordinate system according to the contour boundary of the target open field in the region image, and drawing a motion trajectory of the experimental animal in the coordinate system according to the second coordinate corresponding to each centroid, so as to reduce the time cost in open-field experimental data analysis and improve the analysis efficiency and accuracy of open-field experimental data analysis. Also provided are a system and a terminal device.

Description

一种旷场实验数据分析方法、系统及终端设备An open field experiment data analysis method, system and terminal equipment 技术领域Technical field
本申请属于数据处理技术领域,尤其涉及一种旷场实验数据分析方法、系统及终端设备。This application belongs to the field of data processing technology, and in particular relates to an open field experiment data analysis method, system and terminal equipment.
背景技术Background technique
目前的动物行为学实验-旷场实验数据分析方法中,通常是先对旷场内的动物行为进行视频录制,然后播放所录制的视频,并通过人工对所播放的视频进行观察分析来得到动物的行为数据,不仅需耗费大量的时间成本,而且数据分析效率和准确性也较低。In the current animal behavior experiment-open field experiment data analysis method, it is usually to record the animal behavior in the open field first, then play the recorded video, and manually observe and analyze the played video to obtain the animal The behavioral data not only consumes a lot of time and cost, but also the efficiency and accuracy of data analysis is low.
技术问题technical problem
本申请实施例提供了一种旷场实验数据分析方法、系统及终端设备,可以解决现有技术中旷场实验数据分析效率和准确性低的问题。The embodiments of the present application provide an open field experimental data analysis method, system and terminal equipment, which can solve the problem of low efficiency and accuracy of open field experimental data analysis in the prior art.
技术解决方案Technical solutions
第一方面,本申请实施例提供了一种旷场实验数据分析方法,包括:In the first aspect, an embodiment of the present application provides an open field experiment data analysis method, including:
获取包含目标旷场的实验视频,并提取所述实验视频对应的各视频帧;Acquiring an experimental video containing the target open field, and extracting each video frame corresponding to the experimental video;
将各所述视频帧转换为对应的二值图像,并从各所述二值图像中截取所述目标旷场对应的区域图像;Converting each of the video frames into a corresponding binary image, and intercepting an area image corresponding to the target open field from each of the binary images;
获取各所述区域图像中实验动物的各像素点对应的第一坐标,并根据各所述像素点对应的第一坐标确定各所述区域图像中所述实验动物的质心对应的第二坐标;Acquiring the first coordinates corresponding to each pixel of the experimental animal in each of the regional images, and determining the second coordinate corresponding to the centroid of the experimental animal in each of the regional images according to the first coordinate corresponding to each of the pixel;
根据所述区域图像中所述目标旷场的轮廓边界建立坐标系,并根据各所述质心对应的第二坐标在所述坐标系中绘制所述实验动物的运动轨迹。A coordinate system is established according to the contour boundary of the target open field in the regional image, and the motion track of the experimental animal is drawn in the coordinate system according to the second coordinates corresponding to each of the centroids.
在第一方面的一种可能的实现方式中,所述将各所述视频帧转换为对应的二值图像,包括:In a possible implementation manner of the first aspect, the converting each of the video frames into corresponding binary images includes:
将各所述视频帧转换为对应的灰度图像;Converting each of the video frames into corresponding gray-scale images;
获取初始分割阈值,根据所述初始分割阈值将各所述灰度图像转换为对应的初始二值图像;Acquiring an initial segmentation threshold, and converting each of the grayscale images into a corresponding initial binary image according to the initial segmentation threshold;
确定所述初始二值图像是否满足预设条件;Determining whether the initial binary image meets a preset condition;
若所述初始二值图像满足所述预设条件,则将各所述初始二值图像确定为各所述视频帧对应的二值图像;If the initial binary image satisfies the preset condition, determining each initial binary image as a binary image corresponding to each video frame;
若所述初始二值化图像不满足所述预设条件,调整所述初始分割阈值,并返回执行根据所述初始分割阈值将各所述灰度图像转换为对应的初始二值图像的步骤以及后续步骤。If the initial binary image does not meet the preset condition, adjust the initial segmentation threshold, and return to execute the step of converting each of the grayscale images into the corresponding initial binary image according to the initial segmentation threshold; and Next steps.
可选地,所述从各所述二值图像中截取所述目标旷场对应的区域图像,包括:Optionally, the intercepting the region image corresponding to the target open field from each of the binary images includes:
显示任一所述灰度图像,以指示用户根据所显示的灰度图像设定所述目标旷场对应的所述轮廓边界;Displaying any one of the grayscale images to instruct the user to set the contour boundary corresponding to the target open field according to the displayed grayscale image;
根据所述轮廓边界从各所述二值图像中截取所述目标旷场对应的区域图像。The region image corresponding to the open field of the target is intercepted from each of the binary images according to the contour boundary.
在第一方面的一种可能的实现方式中,在根据各所述像素点对应的第一坐标确定各所述区域图像中所述实验动物的质心对应的第二坐标之后,包括:In a possible implementation of the first aspect, after determining the second coordinate corresponding to the centroid of the experimental animal in each of the regional images according to the first coordinate corresponding to each pixel point, the method includes:
根据各所述质心对应的第二坐标确定所述实验动物的移动距离;Determining the moving distance of the experimental animal according to the second coordinates corresponding to each of the centroids;
获取所述实验视频的视频时长,并根据所述移动距离和所述视频时长确定所述实验动物的移动速率。Obtain the video duration of the experimental video, and determine the moving speed of the experimental animal according to the moving distance and the video duration.
可选地,所述根据各所述质心对应的第二坐标确定所述实验动物的移动距离,包括:Optionally, the determining the moving distance of the experimental animal according to the second coordinates corresponding to each of the centroids includes:
根据各所述质心对应的第二坐标分别计算相邻两帧区域图像中所述实验动物的质心之间的质心距离;Respectively calculating the centroid distance between the centroids of the experimental animals in two adjacent frames of regional images according to the second coordinates corresponding to the centroids;
基于各所述质心距离确定所述实验动物的移动距离。The moving distance of the experimental animal is determined based on each of the centroid distances.
具体地,所述根据所述区域图像中所述目标旷场的轮廓边界建立坐标系,包括:Specifically, the establishing a coordinate system according to the contour boundary of the target open field in the area image includes:
以所述区域图像中所述目标旷场的左边轮廓边界为纵轴,以所述目标旷场的下边轮廓边界为横轴建立所述坐标系。The coordinate system is established by taking the left contour boundary of the target open field in the area image as the vertical axis, and taking the lower contour boundary of the target open field as the horizontal axis.
在第一方面的一种可能的实现方式中,在根据所述区域图像中所述目标旷场的轮廓边界建立坐标系之后,包括:In a possible implementation manner of the first aspect, after establishing a coordinate system according to the contour boundary of the target open field in the area image, the method includes:
在所述坐标系中确定目标区域,并根据各所述质心对应的第二坐标与所述目标区域对应的坐标范围确定位于所述目标区域内的质心的第一数量;Determining a target area in the coordinate system, and determining a first number of centroids located in the target area according to the second coordinates corresponding to each of the centroids and the coordinate range corresponding to the target area;
确定所述质心的第二数量,所述第二数量为所述运动轨迹所包括的质心的总数量;Determining a second number of the centroids, where the second number is the total number of centroids included in the motion track;
获取所述实验视频的视频时长;Obtain the video duration of the experimental video;
根据所述视频时长、所述第一数量和所述第二数量确定所述实验动物在所述目标区域内的活动时间。The activity time of the experimental animal in the target area is determined according to the video duration, the first quantity and the second quantity.
可选地,所述获取包含目标旷场的实验视频,包括:Optionally, the acquiring the experimental video including the target open field includes:
获取包含目标旷场的实验视频所对应的视频路径和视频名称;Obtain the video path and video name corresponding to the experimental video containing the target open field;
根据所述视频路径和所述视频名称获取所述包含目标矿场的实验视频。Obtain the experimental video containing the target mine according to the video path and the video name.
第二方面,本申请实施例提供了一种旷场实验数据分析系统,包括:In the second aspect, an embodiment of the present application provides an open field experiment data analysis system, including:
视频帧提取模块,用于获取包含目标旷场的实验视频,并提取所述实验视频对应的各视频帧;The video frame extraction module is used to obtain the experimental video containing the target open field, and extract each video frame corresponding to the experimental video;
区域图像截取模块,用于将各所述视频帧转换为对应的二值图像,并从各所述二值图像中截取所述目标旷场对应的区域图像;An area image interception module, configured to convert each of the video frames into a corresponding binary image, and intercept the area image corresponding to the target open field from each of the binary images;
质心坐标确定模块,用于获取各所述区域图像中实验动物的各像素点对应的第一坐标,并根据各所述像素点对应的第一坐标确定各所述区域图像中所述实验动物的质心对应的第二坐标;The centroid coordinate determination module is used to obtain the first coordinate corresponding to each pixel of the experimental animal in each of the regional images, and determine the first coordinate of the experimental animal in each of the regional images according to the first coordinate corresponding to each pixel. The second coordinate corresponding to the centroid;
运动轨迹绘制模块,用于根据所述区域图像中所述目标旷场的轮廓边界建立坐标系,并根据各所述质心对应的第二坐标在所述坐标系中绘制所述实验动物的运动轨迹。The motion trajectory drawing module is used to establish a coordinate system according to the outline boundary of the target open field in the regional image, and draw the motion trajectory of the experimental animal in the coordinate system according to the second coordinates corresponding to each of the centroids .
第三方面,本申请实施例提供了一种终端设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现如上述第一方面中任一项所述的旷场实验数据分析方法。In a third aspect, an embodiment of the present application provides a terminal device, including a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, The open field experiment data analysis method as described in any one of the above-mentioned first aspects is realized.
第四方面,本申请实施例提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现如上述第一方面中任一项所述的旷场实验数据分析方法。In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the implementation is as described in any of the above-mentioned first aspects. The open field experiment data analysis method described.
第五方面,本申请实施例提供了一种计算机程序产品,当计算机程序产品在终端设备上运行时,使得终端设备执行上述第一方面中任一项所述的旷场实验数据分析方法。In a fifth aspect, the embodiments of the present application provide a computer program product that, when the computer program product runs on a terminal device, causes the terminal device to execute the open-field experiment data analysis method described in any one of the above-mentioned first aspects.
有益效果Beneficial effect
本申请实施例中,在获取到包含目标旷场的实验视频后,可在不需要进行视频播放的情况下直接对实验视频进行视频帧的提取,并可对提取的各视频帧进行二值化处理,得到各视频帧对应的二值图像,然后可从各二值图像中截取目标旷场对应的区域图像,并可通过对区域图像进行分析来建立目标旷场对应的坐标系以及实验动物在各区域图像中的质心对应的坐标,从而可根据各质心对应的坐标在坐标系中快速、准确地绘制实验动物的运动轨迹,极大地减少了旷场实验数据分析中的时间成本,并有效提高了旷场实验数据分析的分析效率和准确性。In the embodiment of this application, after acquiring the experimental video containing the target open field, the video frame of the experimental video can be extracted directly without video playback, and the extracted video frames can be binarized After processing, the binary image corresponding to each video frame is obtained, and then the regional image corresponding to the target open field can be intercepted from each binary image, and the coordinate system corresponding to the target open field can be established by analyzing the regional image and the experimental animal The coordinates corresponding to the centroids in the images of each area can be quickly and accurately drawn in the coordinate system according to the coordinates corresponding to the centroids, which greatly reduces the time cost in the open field experimental data analysis and effectively improves The analysis efficiency and accuracy of open field experiment data analysis are improved.
附图说明Description of the drawings
图1是本申请一实施例提供的旷场实验数据分析方法的流程示意图;FIG. 1 is a schematic flowchart of an open field experiment data analysis method provided by an embodiment of the present application;
图2是本申请一实施例提供的旷场实验数据分析方法在一个应用场景下得到的二值图像的流程示意图;2 is a schematic flowchart of a binary image obtained in an application scenario by the open field experimental data analysis method provided by an embodiment of the present application;
图3是本申请一实施例在一个应用场景下得到的灰度图像的示意图;FIG. 3 is a schematic diagram of a grayscale image obtained in an application scenario according to an embodiment of the present application;
图4是本申请一实施例在一个应用场景下设定的轮廓边界的示意图;FIG. 4 is a schematic diagram of contour boundaries set in an application scenario according to an embodiment of the present application;
图5是本申请一实施例在一个应用场景下得到的运动轨迹图的示意图;FIG. 5 is a schematic diagram of a motion trajectory diagram obtained in an application scenario according to an embodiment of the present application;
图6是本申请一实施例提供的旷场实验数据分析方法在一个应用场景下确定实验动物在目标区域内的活动时间的流程示意图;FIG. 6 is a schematic flow chart of determining the activity time of an experimental animal in a target area in an application scenario according to an open field experimental data analysis method provided by an embodiment of the present application;
图7是本申请实施例提供的旷场实验数据分析系统的结构示意图;FIG. 7 is a schematic structural diagram of an open field experiment data analysis system provided by an embodiment of the present application;
图8是本申请实施例提供的终端设备的结构示意图。Fig. 8 is a schematic structural diagram of a terminal device provided by an embodiment of the present application.
本发明的实施方式Embodiments of the present invention
以下描述中,为了说明而不是为了限定,提出了诸如特定系统结构、技术之类的具体细节,以便透彻理解本申请实施例。然而,本领域的技术人员应当清楚,在没有这些具体细节的其它实施例中也可以实现本申请。在其它情况中,省略对众所周知的系统、装置、电路以及方法的详细说明,以免不必要的细节妨碍本申请的描述。In the following description, for the purpose of illustration rather than limitation, specific details such as a specific system structure and technology are proposed for a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application can also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid unnecessary details from obstructing the description of this application.
应当理解,当在本申请说明书和所附权利要求书中使用时,术语“包括”指示所描述特征、整体、步骤、操作、元素和/或组件的存在,但并不排除一个或多个其它特征、整体、步骤、操作、元素、组件和/或其集合的存在或添加。It should be understood that when used in the specification and appended claims of this application, the term "comprising" indicates the existence of the described features, wholes, steps, operations, elements and/or components, but does not exclude one or more other The existence or addition of features, wholes, steps, operations, elements, components, and/or collections thereof.
还应当理解,在本申请说明书和所附权利要求书中使用的术语“和/或”是指相关联列出的项中的一个或多个的任何组合以及所有可能组合,并且包括这些组合。It should also be understood that the term "and/or" used in the specification and appended claims of this application refers to any combination of one or more of the associated listed items and all possible combinations, and includes these combinations.
如在本申请说明书和所附权利要求书中所使用的那样,术语“如果”可以依据上下文被解释为“当...时”或“一旦”或“响应于确定”或“响应于检测到”。类似地,短语“如果确定”或“如果检测到[所描述条件或事件]”可以依据上下文被解释为意指“一旦确定”或“响应于确定”或“一旦检测到[所描述条件或事件]”或“响应于检测到[所描述条件或事件]”。As used in the description of this application and the appended claims, the term "if" can be construed as "when" or "once" or "in response to determination" or "in response to detecting ". Similarly, the phrase "if determined" or "if detected [described condition or event]" can be interpreted as meaning "once determined" or "in response to determination" or "once detected [described condition or event]" depending on the context ]" or "in response to detection of [condition or event described]".
另外,在本申请说明书和所附权利要求书的描述中,术语“第一”、“第二”、“第三”等仅用于区分描述,而不能理解为指示或暗示相对重要性。In addition, in the description of the specification of this application and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the description, and cannot be understood as indicating or implying relative importance.
在本申请说明书中描述的参考“一个实施例”或“一些实施例”等意味着在本申请的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现的语句“在一个实施例中”、“在一些实施例中”、“在其他一些实施例中”、“在另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。术语“包括”、“包含”、“具有”及它们的变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。Reference to "one embodiment" or "some embodiments" described in the specification of this application means that one or more embodiments of this application include a specific feature, structure, or characteristic described in combination with the embodiment. Therefore, the sentences "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. appearing in different places in this specification are not necessarily All refer to the same embodiment, but mean "one or more but not all embodiments" unless it is specifically emphasized otherwise. The terms "including", "including", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized.
旷场实验是指通过将动物置于旷场实验装置内,并记录动物在旷场实验装置内的活动情况来分析得到动物行为数据的实验。现有的旷场实验数据分析方法一般需要对录制的视频进行播放,以在播放过程中由人工观察分析得到动物行为数据,不仅需耗费实验人员大量的时间,而且易降低旷场实验数据分析的分析效率和分析准确性。An open field experiment refers to an experiment in which animals are placed in an open field experimental device and their activities in the open field experimental device are recorded to analyze and obtain animal behavior data. The existing open-field experimental data analysis methods generally need to play the recorded video to obtain animal behavior data by manual observation and analysis during the playback process, which not only takes a lot of time for the experimenter, but also easily reduces the amount of open-field experimental data analysis. Analysis efficiency and analysis accuracy.
为解决上述问题,本申请实施例提供了一种旷场实验数据分析方法、系统及终端设备,可在不需要进行视频播放的情况下直接对旷场实验中的实验视频进行视频帧的提取,并可对提取的各视频帧进行二值化处理,得到各视频帧对应的二值图像,然后可从各二值图像中截取目标旷场对应的区域图像,并可通过对区域图像进行分析来建立目标旷场(即旷场实验装置在图像中所对应的区域)对应的坐标系以及实验动物在各区域图像中的质心对应的坐标,从而可根据各质心对应的坐标在坐标系中快速、准确地绘制实验动物的运动轨迹。In order to solve the above problems, the embodiments of the present application provide an open field experiment data analysis method, system, and terminal equipment, which can directly extract video frames from the experimental video in the open field experiment without video playback. The extracted video frames can be binarized to obtain the binary image corresponding to each video frame, and then the regional image corresponding to the target open field can be intercepted from each binary image, and the regional image can be analyzed Establish the coordinate system corresponding to the target open field (that is, the area corresponding to the open field experimental device in the image) and the coordinate corresponding to the centroid of the experimental animal in the image of each area, so that the coordinate corresponding to each centroid can be quickly and quickly in the coordinate system. Accurately draw the motion trajectory of experimental animals.
可选地,本申请实施例中的旷场实验数据分析方法可适用于旷场实验装置与实验动物之间存在色差的场景中,例如可适用于旷场实验装置为白色、实验动物为黑色的场景中,或者可适用于旷场实验装置为黑色、实验动物为白色的场景中,等等。下面将以旷场实验装置为白色、实验动物为黑色的场景来对本申请实施例提供的旷场实验数据分析方法进行详细描述。Optionally, the open-field experimental data analysis method in the embodiments of the present application can be applied to scenarios where there is a color difference between the open-field experimental device and the experimental animal, for example, it can be applied to the open-field experimental device being white and the experimental animal being black. In the scene, or can be applied to the scene where the open field experimental device is black, the experimental animal is white, and so on. The open field experimental data analysis method provided in the embodiments of the present application will be described in detail below with a scene where the open field experimental device is white and the experimental animal is black.
图1示出了本申请实施例提供的一种旷场实验数据分析方法的示意性流程图,所述旷场实验数据分析方法可以包括:FIG. 1 shows a schematic flowchart of an open field experimental data analysis method provided by an embodiment of the present application, and the open field experimental data analysis method may include:
步骤S101、获取包含目标旷场的实验视频,并提取所述实验视频对应的各视频帧;Step S101: Obtain an experimental video containing the target open field, and extract each video frame corresponding to the experimental video;
本申请实施例的执行主体可以为基于Matlab语言构建的旷场实验数据分析系统,以使用可开源获取的Matlab语言构建所述旷场实验分析系统,可确保所构建系统的方便轻巧,并使得所构建系统可简单快速地运行使用,降低旷场实验的实验成本。所述旷场实验数据分析系统可设置于任一终端设备中运行使用,所述终端设备包括但不限于:桌上型计算机、笔记本及掌上电脑等计算设备。其中,所述实验视频可以为各种格式的录制视频,例如可以为wmv(Windows Media Video)格式的录制视频,或者可以为rmvb(Real Media Variable Bitrate)格式的录制视频,或者可以为mkv(Matroska Video)格式的录制视频,或者可以为avi(Audio Video Interleaved)格式的录制视频,等等。The execution subject of the embodiments of the application may be an open field experimental data analysis system based on the Matlab language. The open field experimental analysis system is constructed using the open source Matlab language, which can ensure the convenience and lightness of the constructed system and make all The construction system can be used simply and quickly, reducing the experimental cost of open field experiments. The open field experiment data analysis system can be installed in any terminal device to run and use, and the terminal device includes, but is not limited to, computing devices such as desktop computers, notebooks, and palm computers. Wherein, the experimental video can be recorded video in various formats, for example, can be recorded video in wmv (Windows Media Video) format, or can be recorded video in rmvb (Real Media Variable Bitrate) format, or can be mkv (Matroska Video) format recording video, or it can be avi (Audio Video Interleaved) format recording video, etc.
应理解,在对某一目标旷场完成旷场实验的视频录制后,可将所录制的包含该目标旷场的实验视频存储于所述终端设备的存储装置或者存储于与所述终端设备连接的云端服务器中。在此,所述包含目标旷场的实验视频是指实验视频是在可以完整拍摄到所述目标旷场的情况下所录制的视频。在需要进行旷场实验数据分析时,可从所述存储装置或者从所述云端服务器中获取所述包含目标旷场的实验视频。具体地,在需要进行旷场实验数据分析时,用户可向所述旷场实验数据分析系统输入所述包含目标旷场的实验视频所对应的视频路径和视频名称,所述旷场实验数据分析系统则可通过解读所述视频路径和所述视频名称来获取所述实验视频。例如,所述旷场实验数据分析系统可通过下述方式解读所述视频路径和所述视频名称来获取所述实验视频:It should be understood that after the video recording of an open field experiment is completed for a certain target open field, the recorded experimental video containing the target open field can be stored in the storage device of the terminal device or stored in the storage device connected to the terminal device. In the cloud server. Here, the experimental video including the open field of the target refers to the video that is recorded when the open field of the target can be completely captured. When data analysis of the open field experiment is required, the experimental video containing the target open field may be obtained from the storage device or from the cloud server. Specifically, when an open field experimental data analysis is required, the user can input the video path and video name corresponding to the experimental video containing the target open field into the open field experimental data analysis system, and the open field experimental data analysis The system can obtain the experimental video by interpreting the video path and the video name. For example, the open field experiment data analysis system may interpret the video path and the video name to obtain the experiment video in the following manner:
datapath = 'C:\Users\pinbo\Desktop\matlab_test\open_field_ana';datapath = 'C:\Users\pinbo\Desktop\matlab_test\open_field_ana';
datafile = 'CON_1.wmv';datafile = 'CON_1.wmv';
cd(datapath);cd(datapath);
tit_fn = sprintf('%s',datafile(1:end-4)); tit_fn = sprintf('%s',datafile(1:end-4));
应理解,所述旷场实验数据分析系统获取到所述实验视频后,即可通过读取函数(如video = VideoReader(datafile))来读取所述实验视频,并可在视频读取过程中实时提取所述实验视频对应的各视频帧,如可按照视频顺序依次提取所述实验视频对应的各视频帧。其中,所述旷场实验数据分析系统在读取所述实验视频时,还可以获取所述实验视频的视频时长和帧速率,并可以根据所述视频时长和所述帧速率来确定所提取的视频帧的帧数,例如,可以根据帧数=视频时长*帧速率来确定所提取的视频帧的帧数,即所述旷场实验数据分析系统在视频读取过程中可提取所述帧数的视频帧。It should be understood that after the open field experimental data analysis system obtains the experimental video, the reading function (such as video = VideoReader (datafile)) to read the experimental video, and can extract the video frames corresponding to the experimental video in real time during the video reading process. For example, the video frames corresponding to the experimental video can be extracted in sequence according to the video sequence. Wherein, when the open-field experimental data analysis system reads the experimental video, it can also obtain the video duration and frame rate of the experimental video, and can determine the extracted data according to the video duration and the frame rate. The number of video frames, for example, the number of extracted video frames can be determined according to the number of frames = video duration * frame rate, that is, the open field experimental data analysis system can extract the number of frames during the video reading process Video frames.
步骤S102、将各所述视频帧转换为对应的二值图像,并从各所述二值图像中截取所述目标旷场对应的区域图像;Step S102: Convert each of the video frames into a corresponding binary image, and intercept an area image corresponding to the target open field from each of the binary images;
具体地,如图2所示,所述将各所述视频帧转换为对应的二值图像,可以包括:Specifically, as shown in FIG. 2, the converting each of the video frames into corresponding binary images may include:
步骤S201、将各所述视频帧转换为对应的灰度图像;Step S201: Convert each of the video frames into corresponding gray-scale images;
本申请实施例中,可以首先将各所述频帧转分别转换成灰度范围为0至1之间的灰度图像,即各所述灰度图像中各像素点的灰度值均为0至1之间,在此,可以采用现有的任一灰度转换方法来将各所述视频帧转换为对应的灰度图像,本申请实施例对此不作限定。In the embodiment of the present application, each of the frequency frames may be first converted into a grayscale image with a grayscale range of 0 to 1, that is, the grayscale value of each pixel in each grayscale image is 0. In this case, any existing gray-scale conversion method may be used to convert each of the video frames into corresponding gray-scale images, which is not limited in the embodiment of the present application.
步骤S202、获取初始分割阈值,并根据所述初始分割阈值将各所述灰度图像转换为对应的初始二值图像;Step S202: Obtain an initial segmentation threshold, and convert each of the grayscale images into corresponding initial binary images according to the initial segmentation threshold;
需要说明的是,所述初始分割阈值可以通过实验测试确定,且所述初始分割阈值的范围为0至1之间,例如,可以根据实验测试将所述初始分割阈值设置为0.3。在此,在获取到所述初始分割阈值后,针对每一帧灰度图像,可首先获取该灰度图像中各像素点的灰度值,然后可将灰度值大于所述初始分割阈值的像素点的灰度值重新设置为1(即可将实验动物对应的像素点的像素值设置为1),并可将灰度值小于或等于所述初始分割阈值的像素点的灰度值重新设置为0(即可将旷场实验装置对应的像素点的像素值设置为0),以此得到像素点的灰度值为0或1的初始二值图像。例如,在所述初始分割阈值为0.3的场景中,可将灰度值大于0.3的像素点的灰度值均设置为1,并可将灰度值小于或等于0.3像素点的灰度值均设置为0。It should be noted that the initial segmentation threshold can be determined through experimental tests, and the range of the initial segmentation threshold is between 0 and 1. For example, the initial segmentation threshold can be set to 0.3 according to experimental tests. Here, after the initial segmentation threshold is obtained, for each frame of grayscale image, the grayscale value of each pixel in the grayscale image can be obtained first, and then the grayscale value can be greater than the initial segmentation threshold. The gray value of the pixel is reset to 1 (that is, the pixel value of the pixel corresponding to the experimental animal is set to 1), and the gray value of the pixel whose gray value is less than or equal to the initial segmentation threshold can be reset Set it to 0 (that is, set the pixel value of the pixel corresponding to the open field experimental device to 0), so as to obtain the initial binary image with the pixel gray value of 0 or 1. For example, in a scene where the initial segmentation threshold is 0.3, the gray values of pixels with gray values greater than 0.3 can be set to 1, and the gray values of pixels with gray values less than or equal to 0.3 can be set to average. Set to 0.
步骤S203、确定所述初始二值图像是否满足预设条件;Step S203: Determine whether the initial binary image meets a preset condition;
步骤S204、若所述初始二值图像满足所述预设条件,则将各所述初始二值图像确定为各所述视频帧对应的二值图像;Step S204: If the initial binary image satisfies the preset condition, determine each initial binary image as a binary image corresponding to each video frame;
步骤S205、若所述初始二值化图像不满足所述预设条件,调整所述初始分割阈值,并返回执行根据所述初始分割阈值将各所述灰度图像转换为对应的初始二值图像的步骤以及后续步骤。Step S205: If the initial binarized image does not meet the preset condition, adjust the initial segmentation threshold, and return to execute converting each grayscale image into a corresponding initial binary image according to the initial segmentation threshold Steps and subsequent steps.
对于上述步骤S203至步骤S205,所述旷场实验数据分析系统在根据所述初始分割阈值得到任一灰度图像的初始二值图像后,可将所述初始二值图像显示于显示界面,以指示用户确定所显示的初始二值图像是否满足预设条件,即指示所述用户确定所述初始二值图像中的实验动物与目标旷场之间是否分割正确,并反馈对应的响应信息,如反馈实验动物与目标旷场之间分割正确的响应信息,或者反馈实验动物与目标旷场之间分割不正确的响应信息。所述旷场实验数据分析系统则可根据所述响应信息确定所述初始二值图像是否满足预设条件,若确定所述初始二值图像满足所述预设条件,则可以将各所述初始二值图像确定为各所述视频帧对应的二值图像;若确定所述初始二值化图像不满足所述预设条件,则可以调整所述初始分割阈值,在此,在所述响应信息为实验动物与目标旷场之间分割不正确的响应信息时,所述响应信息中还可以携带有所述用户输入的调整后的分割阈值,所述旷场实验数据分析系统则可根据所述响应信息中所携带的分割阈值调整所述初始分割阈值,即可将所述初始分割阈值调整至所述响应信息中所携带的分割阈值,并继续执行根据所述初始分割阈值将各所述灰度图像转换为对应的初始二值图像的步骤以及后续步骤,直到确定所述初始二值化图像满足所述预设条件为止。For the above steps S203 to S205, the open field experimental data analysis system can display the initial binary image on the display interface after obtaining the initial binary image of any grayscale image according to the initial segmentation threshold. Instruct the user to determine whether the displayed initial binary image satisfies a preset condition, that is, instruct the user to determine whether the experimental animal in the initial binary image and the target open field are segmented correctly, and feed back corresponding response information, such as Feed back the correct response information between the experimental animal and the target open field, or feedback the incorrect response information between the experimental animal and the target open field. The open field experimental data analysis system may determine whether the initial binary image satisfies a preset condition according to the response information, and if it is determined that the initial binary image satisfies the preset condition, each of the initial binary images may be The binary image is determined to be the binary image corresponding to each of the video frames; if it is determined that the initial binary image does not meet the preset condition, the initial segmentation threshold may be adjusted. Here, in the response information When segmenting incorrect response information between the experimental animal and the target open field, the response information can also carry the adjusted segmentation threshold input by the user, and the open field experimental data analysis system can be based on the The initial segmentation threshold is adjusted by the segmentation threshold carried in the response information, and the initial segmentation threshold can be adjusted to the segmentation threshold carried in the response information, and the grayscale can be continuously executed according to the initial segmentation threshold. The step of converting the degree image into the corresponding initial binary image and subsequent steps until it is determined that the initial binary image satisfies the preset condition.
需要说明的是,对初始分割阈值根据用户输入的分割阈值进行调整仅作示意性解释,不应理解为对本申请实施例的限制,本申请实施例当然也可以根据图像识别技术自动进行初始分割阈值的调整。It should be noted that the adjustment of the initial segmentation threshold according to the segmentation threshold input by the user is only for schematic explanation, and should not be construed as a limitation of the embodiment of the present application. Of course, the embodiment of the present application can also automatically perform the initial segmentation threshold according to image recognition technology. Adjustment.
应理解,所述目标旷场对应的旷场实验装置在视频录制过程中一直处于固定位置,从而使得所述目标旷场在所有视频帧中的区域均相同,即所述目标旷场在所有二值图像中的区域也均相同。因此,在一种可能的实现方式中,所述旷场实验数据分析系统在得到各所述视频帧对应的灰度图像后,可以在显示界面中显示任一灰度图像(如显示图3所示的灰度图像),以指示所述用户根据所显示的灰度图像设定所述目标旷场对应的轮廓边界(如可将图3所显示的灰度图像中旷场实验装置内的矩形框设置为如图4所示的目标旷场对应的轮廓边界),所述旷场实验数据分析系统则可接收用户所设定的轮廓边界,并可以根据所述轮廓边界从各所述二值图像中截取所述目标旷场对应的区域图像,以通过截取目标旷场对应的区域图像来进行后续的数据分析,可极大地减少数据分析中的分析工作量,从而可提高旷场实验数据分析的分析效率。It should be understood that the open field experimental device corresponding to the target open field is always at a fixed position during the video recording process, so that the target open field has the same area in all video frames, that is, the target open field is in all two areas. The areas in the value image are also the same. Therefore, in a possible implementation, the open-field experimental data analysis system can display any gray-scale image on the display interface after obtaining the gray-scale image corresponding to each video frame (as shown in Figure 3). To instruct the user to set the contour boundary corresponding to the target open field according to the displayed gray image (for example, the gray image shown in Fig. 3 can be the rectangular in the open field experimental device). The frame is set as the contour boundary corresponding to the target open field as shown in Fig. 4), the open field experimental data analysis system can receive the contour boundary set by the user, and can use the contour boundary from each of the binary values The area image corresponding to the open field of the target is intercepted in the image to perform subsequent data analysis by intercepting the image of the area corresponding to the open field of the target, which can greatly reduce the analysis workload in the data analysis, thereby improving the data analysis of the open field experiment Analysis efficiency.
需要说明的是,通过用户设定目标旷场的轮廓边界仅作示意性解释,不应理解为对本申请实施例的限制,本申请实施例当然也可以根据图像识别技术自动确定目标旷场对应的轮廓边界。It should be noted that the outline boundary of the target open field set by the user is only for schematic explanation, and should not be construed as a limitation to the embodiment of the present application. Of course, the embodiment of the present application can also automatically determine the corresponding target open field based on image recognition technology. Contour boundary.
在一种可能的实现方式中,也可以先进行区域图像的截取操作,然后再进行二值图像的转换操作,即可以首先从各所述视频帧中截取出目标旷场对应的区域图像,然后可以再对各区域图像进行二值化转换处理,后续则可以对二值化转换处理后的区域图像进行质心的确定等,以通过先进行区域图像的截取再进行区域图像的二值化处理来减少二值化处理过程中的处理工作量,从而提高旷场实验数据分析的分析效率。In a possible implementation manner, it is also possible to perform the interception operation of the area image first, and then perform the conversion operation of the binary image, that is, the area image corresponding to the target open field may be intercepted first from each video frame, and then The binarization conversion process can be performed on each region image, and the centroid of the region image after the binarization conversion process can be determined later, so that the region image can be intercepted first and then the region image binarization process. Reduce the processing workload in the binarization process, thereby improving the analysis efficiency of open field experimental data analysis.
步骤S103、获取各所述区域图像中实验动物的各像素点对应的第一坐标,并根据各所述像素点对应的第一坐标确定各所述区域图像中所述实验动物的质心对应的第二坐标;Step S103: Obtain the first coordinates corresponding to each pixel of the experimental animal in each of the regional images, and determine the first coordinate corresponding to the centroid of the experimental animal in each of the regional images according to the first coordinate corresponding to each pixel. Two coordinates
在此,所述旷场实验数据分析系统在截取出所述目标旷场对应的各区域图像后,可分别获取各所述区域图像中实验动物的各像素点对应的第一坐标,即获取各所述区域图像中灰度值为1的像素点对应的第一坐标,并可根据各所述区域图像中各像素点对应的第一坐标分别确定各所述区域图像中所述实验动物的质心对应的第二坐标,如可根据第一帧区域图像中灰度值为1的像素点对应的第一坐标计算得到第一帧区域图像中所述实验动物的质心A对应的第二坐标,可根据第二帧区域图像中灰度值为1的像素点对应的第一坐标计算得到第二帧区域图像中所述实验动物的质心B对应的第二坐标,以此类推,直到根据最后一帧区域图像中灰度值为1的像素点对应的第一坐标计算得到该最后一帧区域图像中所述实验动物的质心对应的第二坐标为止。具体地,所述旷场实验数据分析系统可通过调用下述方式来计算各所述区域图像所述实验动物的质心对应的第二坐标coordinate.cdata:Here, the open field experimental data analysis system can obtain the first coordinates corresponding to each pixel of the experimental animal in each of the regional images after intercepting the images of each area corresponding to the target open field, that is, obtain each The first coordinate corresponding to the pixel with the gray value of 1 in the regional image, and the centroid of the experimental animal in each regional image can be determined according to the first coordinate corresponding to each pixel in each regional image The corresponding second coordinate, for example, the second coordinate corresponding to the centroid A of the experimental animal in the first frame of regional image can be calculated according to the first coordinate corresponding to the pixel with the gray value of 1 in the first frame of regional image, The second coordinate corresponding to the centroid B of the experimental animal in the second frame area image is calculated according to the first coordinate corresponding to the pixel with the gray value of 1 in the second frame area image, and so on, until according to the last frame The first coordinate corresponding to the pixel with the gray value of 1 in the area image is calculated until the second coordinate corresponding to the centroid of the experimental animal in the last frame of the area image is obtained. Specifically, the open field experimental data analysis system may calculate the second coordinate coordinate.cdata corresponding to the centroid of the experimental animal in each of the regional images by calling the following method:
BW3 = double(BW_adjust);BW3 = double(BW_adjust);
[rows,cols] = size(BW3); [rows,cols] = size(BW3);
x = ones(rows,1)*(1:cols);x = ones(rows,1)*(1:cols);
y = (1:rows)'*ones(1,cols);   y = (1:rows)'*ones(1,cols);
area = sum(sum(BW3)); area = sum(sum(BW3));
meanx = sum(sum(BW3.*x))/area;         meanx = sum(sum(BW3.*x))/area;
meany = sum(sum(BW3.*y))/area;         meany = sum(sum(BW3.*y))/area;
coordinate.cdata{i,1} = [meanx,meany];    coordinate.cdata{i,1} = [meanx,meany];
EndEnd
在一种可能的实现方式中,在根据各所述像素点对应的第一坐标确定各所述区域图像中所述实验动物的质心对应的第二坐标之后,还可以包括:In a possible implementation manner, after determining the second coordinate corresponding to the centroid of the experimental animal in each of the regional images according to the first coordinate corresponding to each pixel point, the method may further include:
步骤a、根据各所述质心对应的第二坐标确定所述实验动物的移动距离;Step a: Determine the moving distance of the experimental animal according to the second coordinates corresponding to each of the centroids;
具体地,所述根据各所述质心对应的第二坐标确定所述实验动物的移动距离,可以包括:步骤a1、根据各所述质心对应的第二坐标分别计算相邻两帧区域图像中所述实验动物的质心之间的质心距离;步骤a2、基于各所述质心距离确定所述实验动物的移动距离。Specifically, the determining the moving distance of the experimental animal according to the second coordinates corresponding to each of the centroids may include: step a1, respectively, calculating all the images in the two adjacent frames of area images according to the second coordinates corresponding to each of the centroids. The centroid distance between the centroids of the experimental animals; step a2, the moving distance of the experimental animals is determined based on each of the centroid distances.
应理解,所述实验动物最终的移动距离可以根据连续两帧区域图像中所述实验动物的质心之间的质心距离确定,即可首先计算每连续两帧区域图像中所述实验动物的质心距离,然后可将各所述质心距离进行相加来得到所述实验动物最终的移动距离。It should be understood that the final moving distance of the experimental animal can be determined according to the centroid distance between the centroids of the experimental animal in two consecutive frames of regional images, that is, the centroid distance of the experimental animal in every two consecutive frames of regional images can be calculated first , And then the centroid distances can be added together to obtain the final moving distance of the experimental animal.
步骤b、获取所述实验视频的视频时长,并根据所述移动距离和所述视频时长确定所述实验动物的移动速率。Step b: Obtain the video duration of the experimental video, and determine the moving speed of the experimental animal according to the moving distance and the video duration.
本申请实施例中,所述旷场实验数据分析系统在读取所述实验视频时,还可以获取所述实验视频的视频时长,因此,在确定所述实验动物最终的移动距离后,可根据所述移动距离和所述视频时长确定所述实验动物的移动速率,例如可利用移动距离/视频时长来得到所述移动速率。In this embodiment of the application, when the open field experimental data analysis system reads the experimental video, it can also acquire the video duration of the experimental video. Therefore, after determining the final moving distance of the experimental animal, it can be based on The movement distance and the video duration determine the movement rate of the experimental animal. For example, the movement distance/video duration may be used to obtain the movement rate.
步骤S104、根据所述区域图像中所述目标旷场的轮廓边界建立坐标系,并根据各所述质心对应的第二坐标在所述坐标系中绘制所述实验动物的运动轨迹;Step S104: Establish a coordinate system according to the outline boundary of the target open field in the area image, and draw the motion track of the experimental animal in the coordinate system according to the second coordinates corresponding to each of the centroids;
具体地,所述根据所述区域图像中所述目标旷场的轮廓边界建立坐标系可以包括:以所述区域图像中所述目标旷场的左边轮廓边界为纵轴,以所述目标旷场的下边轮廓边界为横轴建立所述坐标系。Specifically, the establishing a coordinate system according to the contour boundary of the target open field in the regional image may include: taking the left contour boundary of the target open field in the regional image as the vertical axis, and taking the target open field as the vertical axis. The lower contour boundary of is the horizontal axis to establish the coordinate system.
在此,在建立所述坐标系后,则可以根据各质心对应的第二坐标在所述坐标系中绘制所述实验动物的运动轨迹,即以所述质心表征所述实验动物在所述目标旷场中的位置,从而根据质心的坐标变化来体现所述实验动物在所述目标旷场中的移动情况。具体地,可分别连接连续两帧区域图像中的质心来得到所述实验动物在所述目标旷场中的运动轨迹。本申请实施例中,在得到所述运动轨迹后,还可根据所述目标旷场的轮廓边界绘制所述运动轨迹的轮廓边界,例如,在一个具体应用场景中,可将所述目标旷场的轮廓边界绘制成所述运动轨迹的轮廓边界,从而得到如图5所示的运动轨迹图。Here, after the coordinate system is established, the motion trajectory of the experimental animal can be drawn in the coordinate system according to the second coordinates corresponding to each centroid, that is, the centroid is used to characterize the experimental animal's movement at the target. The position in the open field, so as to reflect the movement of the experimental animal in the target open field according to the coordinate change of the center of mass. Specifically, the centroids in two consecutive frames of regional images may be connected to obtain the motion trajectory of the experimental animal in the open field of the target. In the embodiment of the present application, after the motion trajectory is obtained, the contour boundary of the motion trajectory can also be drawn according to the contour boundary of the target open field. For example, in a specific application scenario, the target open field can be drawn The contour boundary of is drawn as the contour boundary of the motion trajectory, so that the motion trajectory diagram shown in FIG. 5 is obtained.
应理解,在得到所述实验动物的运动轨迹图后,可设置保存路径来保存所述运动路径图,以方便后续进行旷场实验数据的查看与分析等。It should be understood that after obtaining the motion trajectory diagram of the experimental animal, a save path can be set to save the motion path diagram, so as to facilitate subsequent viewing and analysis of open field experimental data.
在另一种可能的实现方式中,如图6所示,在根据所述目标旷场的轮廓边界建立坐标系之后,可以包括:In another possible implementation manner, as shown in FIG. 6, after establishing a coordinate system according to the contour boundary of the target open field, it may include:
步骤S601、在所述坐标系中确定目标区域,并根据各所述质心对应的第二坐标与所述目标区域对应的坐标范围确定位于所述目标区域内的质心的第一数量;Step S601: Determine a target area in the coordinate system, and determine a first number of centroids located in the target area according to the second coordinates corresponding to each of the centroids and the coordinate range corresponding to the target area;
步骤S602、确定所述质心的第二数量,所述第二数量为所述运动轨迹所包括的质心的总数量;Step S602: Determine a second number of the centroids, where the second number is the total number of the centroids included in the motion trajectory;
步骤S603、获取所述实验视频的视频时长;Step S603: Obtain the video duration of the experimental video;
步骤S604、根据所述视频时长、所述第一数量和所述第二数量确定所述实验动物在所述目标区域内的活动时间。Step S604: Determine the activity time of the experimental animal in the target area according to the video duration, the first quantity and the second quantity.
对于上述步骤S601至步骤S604,在旷场实验中,往往还需要分析所述实验动物在特定的目标区域中的停留时间等。本申请实施例中,在建立所述目标旷场对应的坐标系后,还可以指示所述用户设定目标区域在所述坐标系中的坐标范围,所述旷场实验数据分析系统则可根据所述用户所设定的坐标范围在所述坐标系中确定所述目标区域,例如确定出如图5中所示的目标区域(即图5中运动轨迹图内的小矩形区域)。For the above steps S601 to S604, in an open field experiment, it is often necessary to analyze the residence time of the experimental animal in a specific target area, etc. In the embodiment of the present application, after the coordinate system corresponding to the target open field is established, the user can also be instructed to set the coordinate range of the target area in the coordinate system, and the open field experimental data analysis system can be based on The coordinate range set by the user determines the target area in the coordinate system, for example, the target area as shown in FIG. 5 (that is, the small rectangular area in the motion trajectory diagram in FIG. 5) is determined.
在确定出所述目标区域后,所述旷场实验数据分析系统则可首先根据各所述质心对应的第二坐标和所述目标区域对应的坐标范围确定位于所述目标区域内的质心的第一数量,并可获取所述质心的第二数量,所述第二数量即为所述实验视频中所述质心的总数量,在此,所述质心的总数量可以根据所绘制的运动轨迹来确定,另外,因所述实验视频中的每一帧视频帧中均可包括所述实验动物,因此本申请实施例中,当然也可以根据所述实验视频对应的视频帧的帧数来确定所述质心的总数量,即可将所述视频帧的帧数确定为所述质心的总数量;然后可获取所述实验视频的视频时长,并可根据所述视频时长、所述第一数量和所述第二数量确定所述实验动物在所述目标区域内的活动时间,如可根据活动时间= 视频时长*(第一数量/第二数量)来确定所述实验动物在所述目标区域内的活动时间,以快速、准确得到旷场实验中实验动物在特定的目标区域内的行为数据。After the target area is determined, the open field experimental data analysis system can first determine the second coordinate of the center of mass located in the target area according to the second coordinate corresponding to each of the center of mass and the coordinate range corresponding to the target area. A number, and a second number of the centroids can be obtained. The second number is the total number of the centroids in the experimental video. Here, the total number of the centroids can be determined according to the drawn motion trajectory. In addition, because each video frame in the experimental video can include the experimental animal, in the embodiment of this application, of course, the experimental video can also be determined according to the number of video frames corresponding to the experimental video. According to the total number of centroids, the number of frames of the video frame can be determined as the total number of centroids; then the video duration of the experimental video can be obtained, and the video duration can be determined according to the video duration, the first number and The second number determines the activity time of the experimental animal in the target area, for example, it can be determined that the experimental animal is in the target area according to activity time = video duration * (first number/second number) In order to quickly and accurately obtain the behavior data of the experimental animals in the specific target area in the open field experiment.
本申请实施例中,首先获取包含目标旷场的实验视频,并直接提取所述实验视频对应的各视频帧;随后将各所述视频帧转换为对应的二值图像,并从各所述二值图像中截取所述目标旷场对应的区域图像;然后获取各所述区域图像中实验动物的各像素点对应的第一坐标,并根据各所述像素点对应的第一坐标确定各所述区域图像中所述实验动物的质心对应的第二坐标;最后根据所述区域图像中所述目标旷场的轮廓边界建立坐标系,并根据各所述质心对应的第二坐标在所述坐标系中绘制所述实验动物的运动轨迹。即本申请实施例中,在获取到实验视频后,可在不需要进行视频播放的情况下直接对实验视频进行视频帧的提取,并可对提取的各视频帧进行二值化处理,得到各视频帧对应的二值图像,然后可从各二值图像中截取目标旷场对应的区域图像,并可通过对区域图像进行分析来建立目标旷场对应的坐标系以及实验动物在各区域图像中的质心对应的坐标,从而可根据各质心对应的坐标在坐标系中快速、准确地绘制实验动物的运动轨迹,极大地减少了旷场实验数据分析中的时间成本,并有效提高了旷场实验数据分析的分析效率和准确性。In the embodiment of this application, firstly, the experimental video containing the target open field is obtained, and each video frame corresponding to the experimental video is directly extracted; then, each of the video frames is converted into a corresponding binary image, and each of the two The area image corresponding to the target open field is intercepted from the value image; then the first coordinates corresponding to each pixel of the experimental animal in each of the area images are obtained, and each of the pixels is determined according to the first coordinates corresponding to the pixels. The second coordinate corresponding to the centroid of the experimental animal in the regional image; finally a coordinate system is established according to the contour boundary of the target open field in the regional image, and the second coordinate corresponding to each centroid is in the coordinate system Draw the motion trajectory of the experimental animal in. That is, in the embodiment of the present application, after the experimental video is obtained, the video frame of the experimental video can be extracted directly without video playback, and the extracted video frames can be binarized to obtain each The binary image corresponding to the video frame can be intercepted from each binary image and the area image corresponding to the open field of the target can be intercepted, and the coordinate system corresponding to the open field of the target can be established by analyzing the regional image and the experimental animal in each area image The coordinates corresponding to the center of mass of each center of mass can quickly and accurately draw the motion trajectory of the experimental animal in the coordinate system according to the coordinate corresponding to each center of mass, which greatly reduces the time cost in the data analysis of the open field experiment, and effectively improves the open field experiment Analysis efficiency and accuracy of data analysis.
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It should be understood that the size of the sequence number of each step in the foregoing embodiment does not mean the order of execution. The execution sequence of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present application.
对应于上文实施例所述的旷场实验数据分析方法,图7示出了本申请实施例提供的旷场实验数据分析系统的结构框图,为了便于说明,仅示出了与本申请实施例相关的部分。Corresponding to the open field experimental data analysis method described in the above embodiment, FIG. 7 shows a structural block diagram of the open field experimental data analysis system provided in an embodiment of the present application. The relevant part.
参照图7,所述旷场实验数据分析系统,包括:Referring to Figure 7, the open field experiment data analysis system includes:
视频帧提取模块701,用于获取包含目标旷场的实验视频,并提取所述实验视频对应的各视频帧;The video frame extraction module 701 is configured to obtain an experimental video containing a target open field, and extract each video frame corresponding to the experimental video;
区域图像截取模块702,用于将各所述视频帧转换为对应的二值图像,并从各所述二值图像中截取所述目标旷场对应的区域图像;An area image interception module 702, configured to convert each of the video frames into a corresponding binary image, and intercept the area image corresponding to the target open field from each of the binary images;
质心坐标确定模块703,用于获取各所述区域图像中实验动物的各像素点对应的第一坐标,并根据各所述像素点对应的第一坐标确定各所述区域图像中所述实验动物的质心对应的第二坐标;The centroid coordinate determination module 703 is used to obtain the first coordinates corresponding to each pixel of the experimental animal in each of the regional images, and determine the experimental animal in each of the regional images according to the first coordinates corresponding to each of the pixel points The second coordinate corresponding to the centroid of;
运动轨迹绘制模块704,用于根据所述区域图像中所述目标旷场的轮廓边界建立坐标系,并根据各所述质心对应的第二坐标在所述坐标系中绘制所述实验动物的运动轨迹。The motion trajectory drawing module 704 is configured to establish a coordinate system according to the outline boundary of the target open field in the area image, and draw the motion of the experimental animal in the coordinate system according to the second coordinates corresponding to each of the centroids Trajectory.
在一种可能的实现方式中,所述区域图像截取模块702,可以包括:In a possible implementation manner, the regional image capturing module 702 may include:
区域图像转换单元,用于将各所述区域图像转换为对应的灰度图像;An area image conversion unit for converting each of the area images into corresponding grayscale images;
分割阈值获取单元,用于获取初始分割阈值,根据所述初始分割阈值将各所述灰度图像转换为对应的初始二值图像;A segmentation threshold acquisition unit, configured to acquire an initial segmentation threshold, and convert each of the grayscale images into a corresponding initial binary image according to the initial segmentation threshold;
二值图像判断单元,用于确定所述初始二值图像是否满足预设条件;A binary image judging unit, configured to determine whether the initial binary image satisfies a preset condition;
二值图像确定单元,用于若所述初始二值图像满足所述预设条件,则将各所述初始二值图像确定为各所述视频帧对应的二值图像;A binary image determining unit, configured to determine each initial binary image as a binary image corresponding to each video frame if the initial binary image satisfies the preset condition;
分割阈值调整单元,用于若所述初始二值化图像不满足所述预设条件,调整所述初始分割阈值,并返回执行根据所述初始分割阈值将各所述灰度图像转换为对应的初始二值图像的步骤以及后续步骤。The segmentation threshold adjustment unit is configured to adjust the initial segmentation threshold if the initial binarized image does not meet the preset condition, and return to execute converting each of the grayscale images into corresponding ones according to the initial segmentation threshold The initial binary image steps and subsequent steps.
可选地,所述区域图像截取模块702,还可以包括:Optionally, the regional image capturing module 702 may further include:
灰度图像显示单元,用于显示任一所述灰度图像,以指示用户根据所显示的灰度图像设定所述目标旷场对应的所述轮廓边界;A grayscale image display unit for displaying any one of the grayscale images to instruct the user to set the contour boundary corresponding to the target open field according to the displayed grayscale image;
区域图像截取单元,用于根据所述轮廓边界从各所述二值图像中截取所述目标旷场对应的区域图像。The area image interception unit is configured to intercept the area image corresponding to the target open field from each of the binary images according to the contour boundary.
在一种可能的实现方式中,所述旷场实验数据分析系统,还可以包括:In a possible implementation manner, the open field experiment data analysis system may further include:
移动距离确定模块,用于根据各所述质心对应的第二坐标确定所述实验动物的移动距离;A moving distance determining module, configured to determine the moving distance of the experimental animal according to the second coordinates corresponding to each of the centroids;
移动速率确定模块,用于获取所述实验视频的视频时长,并根据所述移动距离和所述视频时长确定所述实验动物的移动速率。The moving rate determining module is used to obtain the video duration of the experimental video, and determine the moving rate of the experimental animal according to the moving distance and the video duration.
可选地,所述移动距离确定模块,可以包括:Optionally, the moving distance determining module may include:
质心距离计算单元,用于根据各所述质心对应的第二坐标分别计算相邻两帧区域图像中所述实验动物的质心之间的质心距离;A centroid distance calculation unit, configured to calculate the centroid distance between the centroids of the experimental animals in two adjacent frames of regional images according to the second coordinates corresponding to each centroid;
移动距离确定单元,用于基于各所述质心距离确定所述实验动物的移动距离。The moving distance determining unit is configured to determine the moving distance of the experimental animal based on each of the centroid distances.
具体地,所述运动轨迹绘制模块704,具体用于以所述区域图像中所述目标旷场的左边轮廓边界为纵轴,以所述目标旷场的下边轮廓边界为横轴建立所述坐标系。Specifically, the motion trajectory drawing module 704 is specifically configured to use the left contour boundary of the target open field in the area image as the vertical axis, and the lower contour boundary of the target open field as the horizontal axis to establish the coordinates system.
可选地,所述旷场实验数据分析系统,还可以包括:Optionally, the open field experiment data analysis system may further include:
目标区域确定模块,用于在所述坐标系中确定目标区域,并根据各所述质心对应的第二坐标与所述目标区域对应的坐标范围确定位于所述目标区域内的质心的第一数量;The target area determination module is configured to determine a target area in the coordinate system, and determine the first number of centroids located in the target area according to the second coordinates corresponding to each of the centroids and the coordinate range corresponding to the target area ;
质心数量确定模块,用于确定所述质心的第二数量,所述第二数量为所述运动轨迹所包括的质心的总数量;A centroid quantity determination module, configured to determine a second quantity of the centroid, where the second quantity is the total quantity of centroids included in the motion trajectory;
视频时长获取模块,用于获取所述实验视频的视频时长;The video duration acquisition module is used to acquire the video duration of the experimental video;
活动时间确定模块,用于根据所述视频时长、所述第一数量和所述第二数量确定所述实验动物在所述目标区域内的活动时间。The activity time determination module is configured to determine the activity time of the experimental animal in the target area according to the video duration, the first quantity and the second quantity.
可选地,所述视频帧提取模块701,可以包括:Optionally, the video frame extraction module 701 may include:
路径名称获取单元,用于获取包含目标旷场的实验视频所对应的视频路径和视频名称;The path name obtaining unit is used to obtain the video path and video name corresponding to the experimental video containing the target open field;
实验视频获取单元,用于根据所述视频路径和所述视频名称获取所述包含目标矿场的实验视频。The experimental video acquisition unit is configured to acquire the experimental video containing the target mine according to the video path and the video name.
需要说明的是,上述装置/单元之间的信息交互、执行过程等内容,由于与本申请方法实施例基于同一构思,其具体功能及带来的技术效果,具体可参见方法实施例部分,此处不再赘述。It should be noted that the information interaction and execution process between the above-mentioned devices/units are based on the same concept as the method embodiment of this application, and its specific functions and technical effects can be found in the method embodiment section. I won't repeat it here.
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。实施例中的各功能单元、模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中,上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。另外,各功能单元、模块的具体名称也只是为了便于相互区分,并不用于限制本申请的保护范围。上述系统中单元、模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and conciseness of description, only the division of the above functional units and modules is used as an example. In practical applications, the above functions can be allocated to different functional units and modules as required. Module completion, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated in one processing unit, or each unit can exist alone physically, or two or more units can be integrated in one unit. The above-mentioned integrated units can be hardware-based Formal realization can also be realized in the form of software functional units. In addition, the specific names of the functional units and modules are only used to facilitate distinguishing each other, and are not used to limit the protection scope of the present application. For the specific working process of the units and modules in the foregoing system, reference may be made to the corresponding process in the foregoing method embodiment, which will not be repeated here.
图8为本申请一实施例提供的终端设备的结构示意图。如图8所示,该实施例的终端设备8包括:至少一个处理器80(图8中仅示出一个)处理器、存储器81以及存储在所述存储器81中并可在所述至少一个处理器80上运行的计算机程序82,所述处理器80执行所述计算机程序82时实现上述任意各个旷场实验数据分析方法实施例中的步骤。FIG. 8 is a schematic structural diagram of a terminal device provided by an embodiment of this application. As shown in FIG. 8, the terminal device 8 of this embodiment includes: at least one processor 80 (only one is shown in FIG. 8), a processor, a memory 81, and a processor that is stored in the memory 81 and can be processed in the at least one processor. A computer program 82 running on the processor 80, when the processor 80 executes the computer program 82, the steps in any of the above-mentioned open field experimental data analysis method embodiments are implemented.
所述终端设备8可以是桌上型计算机、笔记本、掌上电脑及云端服务器等计算设备。该终端设备可包括,但不仅限于,处理器80、存储器81。本领域技术人员可以理解,图8仅仅是终端设备8的举例,并不构成对终端设备8的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如还可以包括输入输出设备、网络接入设备等。The terminal device 8 may be a computing device such as a desktop computer, a notebook, a palmtop computer, and a cloud server. The terminal device may include, but is not limited to, a processor 80 and a memory 81. Those skilled in the art can understand that FIG. 8 is only an example of the terminal device 8 and does not constitute a limitation on the terminal device 8. It may include more or less components than those shown in the figure, or a combination of certain components, or different components. , For example, can also include input and output devices, network access devices, and so on.
所称处理器80可以是中央处理单元(Central Processing Unit,CPU),该处理器80还可以是其他通用处理器、数字信号处理器 (Digital Signal Processor,DSP)、专用集成电路 (Application Specific Integrated Circuit,ASIC)、现成可编程门阵列 (Field-Programmable Gate Array,FPGA) 或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。The so-called processor 80 may be a central processing unit (Central Processing Unit, CPU), the processor 80 may also be other general-purpose processors or digital signal processors (Digital Signal Processor, DSP), Application Specific Integrated Circuit (ASIC), ready-made programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor or the like.
所述存储器81在一些实施例中可以是所述终端设备8的内部存储单元,例如终端设备8的硬盘或内存。所述存储器81在另一些实施例中也可以是所述终端设备8的外部存储设备,例如所述终端设备8上配备的插接式硬盘,智能存储卡(Smart Media Card, SMC),安全数字(Secure Digital, SD)卡,闪存卡(Flash Card)等。进一步地,所述存储器81还可以既包括所述终端设备8的内部存储单元也包括外部存储设备。所述存储器81用于存储操作系统、应用程序、引导装载程序(BootLoader)、数据以及其他程序等,例如所述计算机程序的程序代码等。所述存储器81还可以用于暂时地存储已经输出或者将要输出的数据。The memory 81 may be an internal storage unit of the terminal device 8 in some embodiments, such as a hard disk or memory of the terminal device 8. In other embodiments, the memory 81 may also be an external storage device of the terminal device 8, such as a plug-in hard disk equipped on the terminal device 8, a smart memory card (Smart Media Card, SMC), and a secure digital (Secure Digital, SD) card, flash memory card (Flash Card) and so on. Further, the memory 81 may also include both an internal storage unit of the terminal device 8 and an external storage device. The memory 81 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as the program code of the computer program. The memory 81 can also be used to temporarily store data that has been output or will be output.
本申请实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现可实现上述各个方法实施例中的步骤。The embodiments of the present application also provide a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in each of the foregoing method embodiments can be realized.
本申请实施例提供了一种计算机程序产品,当计算机程序产品在终端设备上运行时,使得终端设备执行时实现可实现上述各个方法实施例中的步骤。The embodiments of the present application provide a computer program product. When the computer program product runs on a terminal device, the terminal device can realize the steps in the foregoing method embodiments when executed.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实现上述实施例方法中的全部或部分流程,可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一计算机可读存储介质中,该计算机程序在被处理器执行时,可实现上述各个方法实施例的步骤。其中,所述计算机程序包括计算机程序代码,所述计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读介质至少可以包括:能够将计算机程序代码携带到拍照装置/终端设备的任何实体或装置、记录介质、计算机存储器、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、电载波信号、电信信号以及软件分发介质。例如U盘、移动硬盘、磁碟或者光盘等。在某些司法管辖区,根据立法和专利实践,计算机可读介质不可以是电载波信号和电信信号。If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on this understanding, the implementation of all or part of the processes in the above-mentioned embodiment methods in this application can be accomplished by instructing relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When executed by the processor, the steps of the foregoing method embodiments can be implemented. Wherein, the computer program includes computer program code, and the computer program code may be in the form of source code, object code, executable file, or some intermediate forms. The computer-readable medium may at least include: any entity or device capable of carrying the computer program code to the photographing device/terminal device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electrical carrier signals, telecommunications signals, and software distribution media. For example, U disk, mobile hard disk, floppy disk or CD-ROM, etc. In some jurisdictions, according to legislation and patent practices, computer-readable media cannot be electrical carrier signals and telecommunication signals.
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。In the above-mentioned embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail or recorded in an embodiment, reference may be made to related descriptions of other embodiments.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。A person of ordinary skill in the art may realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be implemented by electronic hardware or a combination of computer software and electronic hardware. Whether these functions are performed by hardware or software depends on the specific application and design constraint conditions of the technical solution. Professionals and technicians can use different methods for each specific application to implement the described functions, but such implementation should not be considered beyond the scope of this application.
在本申请所提供的实施例中,应该理解到,所揭露的装置/设备和方法,可以通过其它的方式实现。例如,以上所描述的装置/设备实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通讯连接可以是通过一些接口,装置或单元的间接耦合或通讯连接,可以是电性,机械或其它的形式。In the embodiments provided in this application, it should be understood that the disclosed apparatus/equipment and method may be implemented in other ways. For example, the device/equipment embodiments described above are only illustrative. For example, the division of the modules or units is only a logical function division, and there may be other divisions in actual implementation, such as multiple units or Components can be combined or integrated into another system, or some features can be omitted or not implemented. In addition, the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
以上所述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。The above-mentioned embodiments are only used to illustrate the technical solutions of the present application, not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, a person of ordinary skill in the art should understand that it can still implement the foregoing The technical solutions recorded in the examples are modified, or some of the technical features are equivalently replaced; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the application, and should be included in Within the scope of protection of this application.

Claims (15)

  1. 一种旷场实验数据分析方法,其特征在于,包括:An open field experimental data analysis method, which is characterized in that it comprises:
    获取包含目标旷场的实验视频,并提取所述实验视频对应的各视频帧;Acquiring an experimental video containing the target open field, and extracting each video frame corresponding to the experimental video;
    将各所述视频帧转换为对应的二值图像,并从各所述二值图像中截取所述目标旷场对应的区域图像;Converting each of the video frames into a corresponding binary image, and intercepting an area image corresponding to the target open field from each of the binary images;
    获取各所述区域图像中实验动物的各像素点对应的第一坐标,并根据各所述像素点对应的第一坐标确定各所述区域图像中所述实验动物的质心对应的第二坐标;Acquiring the first coordinates corresponding to each pixel of the experimental animal in each of the regional images, and determining the second coordinate corresponding to the centroid of the experimental animal in each of the regional images according to the first coordinate corresponding to each of the pixel;
    根据所述区域图像中所述目标旷场的轮廓边界建立坐标系,并根据各所述质心对应的第二坐标在所述坐标系中绘制所述实验动物的运动轨迹。A coordinate system is established according to the contour boundary of the target open field in the regional image, and the motion track of the experimental animal is drawn in the coordinate system according to the second coordinates corresponding to each of the centroids.
  2. 如权利要求1所述的旷场实验数据分析方法,其特征在于,所述将各所述视频帧转换为对应的二值图像,包括:The open-field experimental data analysis method according to claim 1, wherein said converting each of said video frames into corresponding binary images comprises:
    将各所述视频帧转换为对应的灰度图像;Converting each of the video frames into corresponding gray-scale images;
    获取初始分割阈值,根据所述初始分割阈值将各所述灰度图像转换为对应的初始二值图像;Acquiring an initial segmentation threshold, and converting each of the grayscale images into a corresponding initial binary image according to the initial segmentation threshold;
    确定所述初始二值图像是否满足预设条件;Determining whether the initial binary image meets a preset condition;
    若所述初始二值图像满足所述预设条件,则将各所述初始二值图像确定为各所述视频帧对应的二值图像;If the initial binary image satisfies the preset condition, determining each initial binary image as a binary image corresponding to each video frame;
    若所述初始二值化图像不满足所述预设条件,调整所述初始分割阈值,并返回执行根据所述初始分割阈值将各所述灰度图像转换为对应的初始二值图像的步骤以及后续步骤。If the initial binary image does not meet the preset condition, adjust the initial segmentation threshold, and return to execute the step of converting each of the grayscale images into the corresponding initial binary image according to the initial segmentation threshold; and Next steps.
  3. 如权利要求2所述的旷场实验数据分析方法,其特征在于,所述从各所述二值图像中截取所述目标旷场对应的区域图像,包括:3. The open field experimental data analysis method according to claim 2, wherein the intercepting the region image corresponding to the target open field from each of the binary images comprises:
    显示任一所述灰度图像,以指示用户根据所显示的灰度图像设定所述目标旷场对应的所述轮廓边界;Displaying any one of the grayscale images to instruct the user to set the contour boundary corresponding to the target open field according to the displayed grayscale image;
    根据所述轮廓边界从各所述二值图像中截取所述目标旷场对应的区域图像。The region image corresponding to the open field of the target is intercepted from each of the binary images according to the contour boundary.
  4. 如权利要求1所述的旷场实验数据分析方法,其特征在于,在根据各所述像素点对应的第一坐标确定各所述区域图像中所述实验动物的质心对应的第二坐标之后,包括:The open-field experimental data analysis method of claim 1, wherein after determining the second coordinate corresponding to the centroid of the experimental animal in each of the regional images according to the first coordinate corresponding to each pixel point, include:
    根据各所述质心对应的第二坐标确定所述实验动物的移动距离;Determining the moving distance of the experimental animal according to the second coordinates corresponding to each of the centroids;
    获取所述实验视频的视频时长,并根据所述移动距离和所述视频时长确定所述实验动物的移动速率。Obtain the video duration of the experimental video, and determine the moving speed of the experimental animal according to the moving distance and the video duration.
  5. 如权利要求4所述的旷场实验数据分析方法,其特征在于,所述根据各所述质心对应的第二坐标确定所述实验动物的移动距离,包括:The open field experimental data analysis method of claim 4, wherein the determining the moving distance of the experimental animal according to the second coordinate corresponding to each of the centroids comprises:
    根据各所述质心对应的第二坐标分别计算相邻两帧区域图像中所述实验动物的质心之间的质心距离;Respectively calculating the centroid distance between the centroids of the experimental animals in two adjacent frames of regional images according to the second coordinates corresponding to the centroids;
    基于各所述质心距离确定所述实验动物的移动距离。The moving distance of the experimental animal is determined based on each of the centroid distances.
  6. 如权利要求1所述的旷场实验数据分析方法,其特征在于,所述根据所述区域图像中所述目标旷场的轮廓边界建立坐标系,包括:The open field experimental data analysis method according to claim 1, wherein the establishing a coordinate system according to the outline boundary of the target open field in the regional image comprises:
    以所述区域图像中所述目标旷场的左边轮廓边界为纵轴,以所述目标旷场的下边轮廓边界为横轴建立所述坐标系。The coordinate system is established by taking the left contour boundary of the target open field in the area image as the vertical axis, and taking the lower contour boundary of the target open field as the horizontal axis.
  7. 如权利要求1所述的旷场实验数据分析方法,其特征在于,在根据所述区域图像中所述目标旷场的轮廓边界建立坐标系之后,包括:The open field experimental data analysis method according to claim 1, wherein after establishing a coordinate system according to the outline boundary of the target open field in the area image, the method comprises:
    在所述坐标系中确定目标区域,并根据各所述质心对应的第二坐标与所述目标区域对应的坐标范围确定位于所述目标区域内的质心的第一数量;Determining a target area in the coordinate system, and determining a first number of centroids located in the target area according to the second coordinates corresponding to each of the centroids and the coordinate range corresponding to the target area;
    确定所述质心的第二数量,所述第二数量为所述运动轨迹所包括的质心的总数量;Determining a second number of the centroids, where the second number is the total number of centroids included in the motion track;
    获取所述实验视频的视频时长;Obtain the video duration of the experimental video;
    根据所述视频时长、所述第一数量和所述第二数量确定所述实验动物在所述目标区域内的活动时间。The activity time of the experimental animal in the target area is determined according to the video duration, the first quantity and the second quantity.
  8. 如权利要求1至7中任一项所述的旷场实验数据分析方法,其特征在于,所述获取包含目标旷场的实验视频,包括:The method for analyzing open field experimental data according to any one of claims 1 to 7, wherein said acquiring an experimental video containing a target open field comprises:
    获取包含目标旷场的实验视频所对应的视频路径和视频名称;Obtain the video path and video name corresponding to the experimental video containing the target open field;
    根据所述视频路径和所述视频名称获取所述包含目标矿场的实验视频。Obtain the experimental video containing the target mine according to the video path and the video name.
  9. 一种旷场实验数据分析系统,其特征在于,包括:An open field experiment data analysis system, which is characterized in that it comprises:
    视频帧提取模块,用于获取包含目标旷场的实验视频,并提取所述实验视频对应的各视频帧;The video frame extraction module is used to obtain the experimental video containing the target open field, and extract each video frame corresponding to the experimental video;
    区域图像截取模块,用于将各所述视频帧转换为对应的二值图像,并从各所述二值图像中截取所述目标旷场对应的区域图像;An area image interception module, configured to convert each of the video frames into a corresponding binary image, and intercept the area image corresponding to the target open field from each of the binary images;
    质心坐标确定模块,用于获取各所述区域图像中实验动物的各像素点对应的第一坐标,并根据各所述像素点对应的第一坐标确定各所述区域图像中所述实验动物的质心对应的第二坐标;The centroid coordinate determination module is used to obtain the first coordinate corresponding to each pixel of the experimental animal in each of the regional images, and determine the first coordinate of the experimental animal in each of the regional images according to the first coordinate corresponding to each pixel. The second coordinate corresponding to the centroid;
    运动轨迹绘制模块,用于根据所述区域图像中所述目标旷场的轮廓边界建立坐标系,并根据各所述质心对应的第二坐标在所述坐标系中绘制所述实验动物的运动轨迹。The motion trajectory drawing module is used to establish a coordinate system according to the outline boundary of the target open field in the regional image, and draw the motion trajectory of the experimental animal in the coordinate system according to the second coordinates corresponding to each of the centroids .
  10. 如权利要求9所述的旷场实验数据分析系统,其特征在于,所述区域图像截取模块,包括:The open field experiment data analysis system according to claim 9, wherein the area image interception module comprises:
    区域图像转换单元,用于将各所述区域图像转换为对应的灰度图像;An area image conversion unit for converting each of the area images into corresponding grayscale images;
    分割阈值获取单元,用于获取初始分割阈值,根据所述初始分割阈值将各所述灰度图像转换为对应的初始二值图像;A segmentation threshold acquisition unit, configured to acquire an initial segmentation threshold, and convert each of the grayscale images into a corresponding initial binary image according to the initial segmentation threshold;
    二值图像判断单元,用于确定所述初始二值图像是否满足预设条件;A binary image judging unit, configured to determine whether the initial binary image satisfies a preset condition;
    二值图像确定单元,用于若所述初始二值图像满足所述预设条件,则将各所述初始二值图像确定为各所述视频帧对应的二值图像;A binary image determining unit, configured to determine each initial binary image as a binary image corresponding to each video frame if the initial binary image satisfies the preset condition;
    分割阈值调整单元,用于若所述初始二值化图像不满足所述预设条件,调整所述初始分割阈值,并返回执行根据所述初始分割阈值将各所述灰度图像转换为对应的初始二值图像的步骤以及后续步骤。The segmentation threshold adjustment unit is configured to adjust the initial segmentation threshold if the initial binarized image does not meet the preset condition, and return to execute converting each of the grayscale images into corresponding ones according to the initial segmentation threshold The initial binary image steps and subsequent steps.
  11. 如权利要求10所述的旷场实验数据分析系统,其特征在于,所述区域图像截取模块,包括:The open field experiment data analysis system according to claim 10, wherein the area image interception module comprises:
    灰度图像显示单元,用于显示任一所述灰度图像,以指示用户根据所显示的灰度图像设定所述目标旷场对应的所述轮廓边界;A grayscale image display unit for displaying any one of the grayscale images to instruct the user to set the contour boundary corresponding to the target open field according to the displayed grayscale image;
    区域图像截取单元,用于根据所述轮廓边界从各所述二值图像中截取所述目标旷场对应的区域图像。The area image interception unit is configured to intercept the area image corresponding to the target open field from each of the binary images according to the contour boundary.
  12. 如权利要求9所述的旷场实验数据分析系统,其特征在于,所述旷场实验数据分析系统,还包括:The open field experiment data analysis system of claim 9, wherein the open field experiment data analysis system further comprises:
    移动距离确定模块,用于根据各所述质心对应的第二坐标确定所述实验动物的移动距离;A moving distance determining module, configured to determine the moving distance of the experimental animal according to the second coordinates corresponding to each of the centroids;
    移动速率确定模块,用于获取所述实验视频的视频时长,并根据所述移动距离和所述视频时长确定所述实验动物的移动速率。The moving rate determining module is used to obtain the video duration of the experimental video, and determine the moving rate of the experimental animal according to the moving distance and the video duration.
  13. 如权利要求9至12中任一项所述的旷场实验数据分析系统,其特征在于,所述旷场实验数据分析系统,还包括:The open field experimental data analysis system according to any one of claims 9 to 12, wherein the open field experimental data analysis system further comprises:
    目标区域确定模块,用于在所述坐标系中确定目标区域,并根据各所述质心对应的第二坐标与所述目标区域对应的坐标范围确定位于所述目标区域内的质心的第一数量;The target area determination module is configured to determine a target area in the coordinate system, and determine the first number of centroids located in the target area according to the second coordinates corresponding to each of the centroids and the coordinate range corresponding to the target area ;
    质心数量确定模块,用于确定所述质心的第二数量,所述第二数量为所述运动轨迹所包括的质心的总数量;A centroid quantity determination module, configured to determine a second quantity of the centroid, where the second quantity is the total quantity of centroids included in the motion trajectory;
    视频时长获取模块,用于获取所述实验视频的视频时长;The video duration acquisition module is used to acquire the video duration of the experimental video;
    活动时间确定模块,用于根据所述视频时长、所述第一数量和所述第二数量确定所述实验动物在所述目标区域内的活动时间。The activity time determination module is configured to determine the activity time of the experimental animal in the target area according to the video duration, the first quantity and the second quantity.
  14. 一种终端设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现如权利要求1至8任一项所述的旷场实验数据分析方法。A terminal device, comprising a memory, a processor, and a computer program stored in the memory and capable of running on the processor, wherein the processor executes the computer program as claimed in claims 1 to 8. Any one of the open field experiment data analysis methods.
  15. 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1至8任一项所述的旷场实验数据分析方法。A computer-readable storage medium, the computer-readable storage medium stores a computer program, wherein the computer program is executed by a processor to realize the open field experiment data according to any one of claims 1 to 8 Analytical method.
PCT/CN2019/103707 2019-08-30 2019-08-30 Open-field experiment data analysis method and system and terminal device WO2021035687A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2019/103707 WO2021035687A1 (en) 2019-08-30 2019-08-30 Open-field experiment data analysis method and system and terminal device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2019/103707 WO2021035687A1 (en) 2019-08-30 2019-08-30 Open-field experiment data analysis method and system and terminal device

Publications (1)

Publication Number Publication Date
WO2021035687A1 true WO2021035687A1 (en) 2021-03-04

Family

ID=74684400

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/103707 WO2021035687A1 (en) 2019-08-30 2019-08-30 Open-field experiment data analysis method and system and terminal device

Country Status (1)

Country Link
WO (1) WO2021035687A1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101527044A (en) * 2009-03-16 2009-09-09 江苏银河电子股份有限公司 Automatic segmenting and tracking method of multiple-video moving target
JP2016015016A (en) * 2014-07-02 2016-01-28 国立大学法人 奈良先端科学技術大学院大学 Action recognizing apparatus, and action recognizing method
CN109152555A (en) * 2016-03-18 2019-01-04 哈佛大学校长及研究员协会 Automatic classification animal behavior
CN109658453A (en) * 2018-12-24 2019-04-19 上海曼恒数字技术股份有限公司 The center of circle determines method, apparatus, equipment and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101527044A (en) * 2009-03-16 2009-09-09 江苏银河电子股份有限公司 Automatic segmenting and tracking method of multiple-video moving target
JP2016015016A (en) * 2014-07-02 2016-01-28 国立大学法人 奈良先端科学技術大学院大学 Action recognizing apparatus, and action recognizing method
CN109152555A (en) * 2016-03-18 2019-01-04 哈佛大学校长及研究员协会 Automatic classification animal behavior
CN109658453A (en) * 2018-12-24 2019-04-19 上海曼恒数字技术股份有限公司 The center of circle determines method, apparatus, equipment and storage medium

Similar Documents

Publication Publication Date Title
CN110599520B (en) Open field experiment data analysis method, system and terminal equipment
US9014467B2 (en) Image processing method and image processing device
US11600008B2 (en) Human-tracking methods, systems, and storage media
CN112561080B (en) Sample screening method, sample screening device and terminal equipment
WO2021184847A1 (en) Method and device for shielded license plate character recognition, storage medium, and smart device
WO2020143330A1 (en) Facial image capturing method, computer-readable storage medium and terminal device
WO2021104097A1 (en) Meme generation method and apparatus, and terminal device
CN109948420B (en) Face comparison method and device and terminal equipment
WO2020143165A1 (en) Reproduced image recognition method and system, and terminal device
WO2023173646A1 (en) Expression recognition method and apparatus
CN113158773B (en) Training method and training device for living body detection model
CN110941978B (en) Face clustering method and device for unidentified personnel and storage medium
WO2022166258A1 (en) Behavior recognition method and apparatus, terminal device, and computer-readable storage medium
CN110349161B (en) Image segmentation method, image segmentation device, electronic equipment and storage medium
CN112149583A (en) Smoke detection method, terminal device and storage medium
WO2021147866A1 (en) Ecg signal acquisition method and device, storage medium, and electronic device
CN111667504A (en) Face tracking method, device and equipment
CN113869137A (en) Event detection method and device, terminal equipment and storage medium
CN115631122A (en) Image optimization method and device for edge image algorithm
US11348254B2 (en) Visual search method, computer device, and storage medium
CN112329602A (en) Method and device for acquiring face annotation image, electronic equipment and storage medium
CN111428740A (en) Detection method and device for network-shot photo, computer equipment and storage medium
CN112966687B (en) Image segmentation model training method and device and communication equipment
US11546577B2 (en) Video jitter detection method and apparatus
WO2021035687A1 (en) Open-field experiment data analysis method and system and terminal device

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19942695

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19942695

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 19942695

Country of ref document: EP

Kind code of ref document: A1