CN115311239A - Virtual scale construction method, system and measurement method for video image measurement - Google Patents

Virtual scale construction method, system and measurement method for video image measurement Download PDF

Info

Publication number
CN115311239A
CN115311239A CN202210973582.6A CN202210973582A CN115311239A CN 115311239 A CN115311239 A CN 115311239A CN 202210973582 A CN202210973582 A CN 202210973582A CN 115311239 A CN115311239 A CN 115311239A
Authority
CN
China
Prior art keywords
scale
gradient
image
virtual
end cap
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210973582.6A
Other languages
Chinese (zh)
Inventor
孔德润
董兰芳
董天意
晋晶
彭杰
宋绍方
谢鑫
吴艾久
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hefei Zhongna Medical Instrument Co ltd
Original Assignee
Hefei Zhongna Medical Instrument Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hefei Zhongna Medical Instrument Co ltd filed Critical Hefei Zhongna Medical Instrument Co ltd
Priority to CN202210973582.6A priority Critical patent/CN115311239A/en
Publication of CN115311239A publication Critical patent/CN115311239A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0012Biomedical image inspection
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B1/00Instruments for performing medical examinations of the interior of cavities or tubes of the body by visual or photographical inspection, e.g. endoscopes; Illuminating arrangements therefor
    • A61B1/00002Operational features of endoscopes
    • A61B1/00004Operational features of endoscopes characterised by electronic signal processing
    • A61B1/00009Operational features of endoscopes characterised by electronic signal processing of image signals during a use of endoscope
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/12Edge-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • G06T7/62Analysis of geometric attributes of area, perimeter, diameter or volume
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10016Video; Image sequence
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10068Endoscopic image

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Surgery (AREA)
  • Nuclear Medicine, Radiotherapy & Molecular Imaging (AREA)
  • Radiology & Medical Imaging (AREA)
  • Pathology (AREA)
  • Optics & Photonics (AREA)
  • Biophysics (AREA)
  • Biomedical Technology (AREA)
  • Heart & Thoracic Surgery (AREA)
  • Signal Processing (AREA)
  • Molecular Biology (AREA)
  • Animal Behavior & Ethology (AREA)
  • Geometry (AREA)
  • Public Health (AREA)
  • Veterinary Medicine (AREA)
  • Quality & Reliability (AREA)
  • Endoscopes (AREA)

Abstract

The invention relates to a virtual scale construction method, a virtual scale construction system and a virtual scale measurement method for video image measurement. A virtual scale construction method for video image measurement comprises the following steps: s1, acquiring image data of a target area captured by an endoscope. And S2, performing frame processing on the image data, and extracting the corresponding end cap contour in each frame image. And S3, calculating the geometric center and the geometric radius of the outline of the end cap by adopting a Hough gradient. And S4, establishing a relative coordinate system serving as a blank scale on each frame of image in the image data. And S5, carrying out scale marking on the blank scale so as to obtain the required virtual scale. According to the invention, the virtual scale is constructed on the end cap of the endoscope, the length, the width or the diameter of the measured object can be directly read on the image acquired by the endoscope, the numerical value of the virtual scale is adjusted again according to the barrel distortion condition, and the reading error is reduced.

Description

Virtual scale construction method, system and measurement method for video image measurement
Technical Field
The invention relates to the technical field of pathological change region form and position measurement, in particular to a virtual scale construction method for video image measurement, a virtual scale construction system for video image measurement, a computer terminal for realizing the function of the virtual scale construction method for video image measurement and a measurement method for video images.
Background
The endoscope is based on the principle of physical imaging, and a tube with light is introduced into stomach via oral cavity or into body via other natural pore canal for examination or treatment of diseases. It can go deep into the general conduit internal organs (such as digestive tract, respiratory tract, urinary tract) and closed type body endoscope acupoints (such as chest cavity, abdominal cavity and joint cavity) to make observation diagnosis and living body material selection, and at the same time it can make intracavity operation (such as tumor removal, cancerous obstruction dredging, gallbladder cutting and Oddi sphincter incision, etc.), and can use high-new technology (such as microwave and laser, etc.) to make interventional therapy, and also possesses several functions of photography and video recording, etc..
For example, when the endoscope is used in the digestive tract endoscopic exploration and treatment process, the length and width of in vivo tissues such as lesions or blood vessels, polyps, adenomas and the like need to be measured, the conventional method is to measure the length and width by means of visual observation or instrument ruler and the like, but due to the technical problem of the endoscope, data reading of an image video directly shot by the endoscope is not accurate, and since the endoscope usually adopts a wide-angle lens to obtain more fields of view in a cavity, the relative size of the image from the central point of the image to the edge point of the image is gradually reduced, and the image video with barrel distortion is seen as if a picture with a normal size is wrapped on a sphere to form barrel distortion, and the accuracy of measurement is not high because the image video with barrel distortion is directly read and is smaller than the true value.
Disclosure of Invention
Based on this, it is necessary to provide a virtual scale construction method for video image measurement, a virtual scale construction system for video image measurement, a computer terminal implementing the function of the virtual scale construction method for video image measurement, and a measurement method for video image, in order to solve the problem that the read data is smaller than the true value due to barrel distortion of the image video.
In order to achieve the purpose, the invention adopts the following technical scheme:
a virtual scale construction method for video image measurement comprises the following steps:
s1, acquiring image data of a target area captured by an endoscope;
s2, performing frame processing on the image data, and extracting corresponding end cap outlines in each frame image, wherein the extraction process of the end cap outlines is as follows:
s21, denoising each frame of image in the image data;
s22, identifying edge areas with gradient differences in each frame of image after noise reduction through a Canny edge detection algorithm;
s23, identifying an area with circular edge characteristics in each frame of image after edge detection through a circle detection algorithm, and further obtaining the outline of the end cap;
s3, calculating the geometric center and the geometric radius of the outline of the end cap by adopting a Hough gradient;
s4, establishing a relative coordinate system serving as a blank scale on each frame image in the image data, wherein the relative coordinate system has the following characteristics:
(1) Using the geometric center of the end cap outline as an origin;
(2) Taking the horizontal direction as an X axis and the vertical direction as a Y axis;
(3) Determining the limits of the axes based on the geometric radius of the end cap;
s5, carrying out scale marking on the blank scale so as to obtain a required virtual scale; the marking process of the scale mark is as follows:
s51, carrying out primary scale division on the blank scale to obtain scale marks;
s52, marking a real reference scale with scale marks on a blank paper surface to obtain a reference scale paper surface;
s53, shooting a datum scale paper surface through an endoscope, and enabling an original point of the datum scale to coincide with an original point of a blank scale to obtain a test image;
and S54, carrying out numerical value marking on the scale marks in the blank scale according to the scale value of the reference scale in the test image so as to obtain the required virtual scale.
Further, the noise reduction processing method includes any one of gaussian filtering, median filtering, mean filtering, P-M equation or TV model.
Further, the method for identifying the edge area comprises the following steps:
calculating the gradient amplitude and the gradient direction of each pixel point in each frame of image in the image data;
carrying out non-maximum suppression on the gradient amplitude of the pixel point according to the gradient direction;
and carrying out double-threshold processing on the gradient amplitude of the pixel points, and connecting edges to obtain an edge area.
Furthermore, the calculation method of the gradient strength and the gradient direction of the pixel point comprises a Sobel filter operator or a Prewitt operator.
In one embodiment, the scale value marking method of the blank scale comprises the following steps:
and S100, extracting a reference scale on the test image.
S200, adjusting according to a preset proportion by taking the original point of the reference scale extracted in the previous step as a fixed point. And the scale marks of the reference scale are made to coincide with the scale mark portions of the blank scale.
S300, calculating the scale value of the overlapped scale lines of the blank scale according to the proportion.
S400, repeating the step S200 until the scales of the blank scale are marked.
Further, the method for extracting the real scale comprises the following steps:
performing Gaussian down-sampling on the test image;
performing gradient calculation on each pixel point of the descending test image to obtain the gradient amplitude and the gradient direction of each pixel point;
presetting a gradient threshold, judging the gradient amplitude of each pixel point and the preset gradient threshold, marking the pixel points with the gradient amplitudes larger than the gradient threshold as associated pixel points, and marking the pixel points with the gradient amplitudes smaller than the gradient threshold as isolated pixel points;
constructing the associated pixel points into a line segment support domain, and integrating according to the gradient direction of the associated pixel points to obtain a line segment support domain direction;
calculating the direction error between the gradient direction of isolated pixel points around the line segment support domain and the direction of the line segment support domain;
if the direction error is smaller than a preset tolerance error value, judging whether the direction error is larger than a gradient threshold value;
if the direction error is larger than the preset direction error, changing the isolated pixel point corresponding to the direction error into a related pixel point and bringing the related pixel point into a line segment support domain;
updating the line segment support domain, and performing rectangular approximation calculation on the updated line segment support domain to obtain an estimated rectangle;
judging whether the pixel density of the estimated rectangle is larger than a preset density value;
if so, judging the estimation rectangle to be a line segment, and reserving the mutually communicated line segments to obtain the real scale.
Further, the pixel density calculation method comprises the following steps:
counting the number of associated pixel points in the estimation rectangle to obtain the number m of the associated points;
judging whether the gradient amplitude of the associated pixel point in the last step is larger than a gradient threshold value or not;
marking the associated pixel points larger than the gradient threshold value, and counting to obtain the number n of the marks;
and calculating the ratio of the number n of the marks to the number m of the associated points to obtain the pixel density.
The invention also comprises a virtual scale construction system for video image measurement, which is applied to the virtual scale construction method for video image measurement.
The data acquisition module is used for acquiring image data of a target area captured by the endoscope.
The image processing module is used for performing framing processing on the image data and extracting corresponding end cap outlines in each frame of image; the method is also used for calculating the geometric center and the geometric radius of the end cap outline by adopting Hough gradient; the system is also used for establishing a relative coordinate system as a blank scale on each frame image in the image data; and the system is also used for carrying out scale marking on the blank scale so as to obtain the required virtual scale.
The invention also provides a video image-oriented measuring method, which comprises the following steps:
and constructing a virtual scale for the end cap of the endoscope by adopting the virtual scale constructing method facing the video image measurement.
The end cap of the endoscope is pressed close to the surface of the measured object, and the measured object is shot.
The length or width or diameter of the object to be measured is directly read according to the image shot by the endoscope.
The invention also provides a computer terminal, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor executes the program to realize the steps of the virtual ruler construction method for video image measurement.
The technical scheme provided by the invention has the following beneficial effects:
1. according to the invention, the virtual scale is constructed on the end cap of the endoscope, the length, the width or the diameter of the measured object can be directly read from the image acquired by the endoscope, the numerical value of the virtual scale is adjusted again according to the barrel distortion condition, the reading error is reduced, and the accuracy of obtaining the length, the width or the diameter of the measured object is improved;
2. according to the invention, the virtual scale is constructed on the image acquired by the endoscope, so that the length, the width or the diameter of the measured object can be conveniently and directly read without influencing the normal use of the endoscope, and other tools such as an instrument ruler and the like are not required to be additionally used; the method is suitable for dynamic measurement of real-time video sequence images and static measurement of image pictures acquired by exploration.
3. The invention changes the setting of the conventional digital scale by adjusting the parameters of the virtual scale, is convenient for clear reading in the area with serious barrel distortion and further reduces the reading error.
Drawings
FIG. 1 is a flow chart of a virtual ruler construction method for video image measurement according to the present invention;
FIG. 2 is a flow chart of a video image-oriented measurement method based on FIG. 1;
FIG. 3 is a diagram showing an endoscope capturing an unprocessed object to be measured;
fig. 4 is a real image of the object to be measured taken by the endoscope after the processing of fig. 1.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Example 1
The virtual scale construction method for video image measurement solves the problem of inaccurate data reading caused by barrel-shaped distortion images shot by an endoscope in the prior art, and improves the data reading accuracy. The invention makes full use of the barrel distortion characteristic, constructs the virtual scale on the basis of considering the barrel distortion, obtains the virtual scale which accords with the endoscope measurement, and provides a virtual tool for the subsequent measurement of the measured object.
As shown in fig. 1, the virtual scale construction method for video image measurement according to the embodiment is used for constructing a virtual scale on an image of an inner region of an end cap acquired by an endoscope, and the length, width or diameter of an object to be measured is conveniently read by constructing the virtual scale with barrel distortion taken into consideration. The virtual scale construction method comprises the following steps:
s1, acquiring image data of a target area captured by an endoscope.
In order to prevent the lens of the endoscope from directly contacting a subject to be measured, being blocked by the subject to be measured, and further preventing the endoscope from being unable to normally photograph, the end cap is attached to the distal end of the endoscope, and the outer wall surface of the endoscope is circular, so that the entire shape of the end cap is also cylindrical.
S2, performing frame processing on the image data, and extracting corresponding end cap outlines in each frame image, wherein the extraction process of the end cap outlines is as follows:
and S21, carrying out noise reduction processing on each frame of image in the image data. The noise reduction mode can be any one of Gaussian filtering, median filtering, mean filtering, P-M equation or TV model. For example, gaussian filtering is performed by scanning each pixel in each frame of image with a template (or convolution or mask), and replacing the value of the pixel in the center of the template with the weighted average gray value of the pixels in the neighborhood determined by the template.
And S22, identifying edge regions with gradient differences in the noise-reduced frame images through a Canny edge detection algorithm. The method comprises the following specific steps:
calculating the gradient amplitude and gradient direction of each pixel point in each frame image in the image data through a Sobel filtering operator or a Prewitt operator;
carrying out non-maximum suppression on the gradient amplitude of the pixel point according to the gradient direction;
and carrying out double-threshold processing on the gradient amplitude of the pixel points, and connecting edges to obtain an edge region.
And S23, identifying the area with the circular edge characteristics in each frame of image after edge detection through a circle detection algorithm, and further obtaining the outline of the end cap. The circle detection algorithm includes any one of hough circle detection algorithm, RCD algorithm, and RHT algorithm, but is not limited to these examples. Taking the RHT algorithm as an example, several points are randomly selected, circles are drawn according to centers of the found points, and then, a plurality of iterations are performed to find an optimal circle within a preset tolerance threshold.
And S3, calculating the geometric center and the geometric radius of the outline of the end cap by adopting a Hough gradient. The method comprises the following specific steps: firstly, detecting the circle center (geometric center) of the outline of the end cap, wherein the circle center is the intersection of the normal lines of the circumference, setting a threshold value, and considering the intersection point as the circle center when the number of the intersected straight lines at a certain point is more than the threshold value; the circle center is then used to derive the radius of the circle (geometric radius) from which the distances from the center to the circumference are the same, and a threshold is determined, and the distance is considered to be the radius of the center as long as the number of identical distances is greater than the threshold.
S4, establishing a relative coordinate system serving as a blank scale on each frame image in the image data, wherein the relative coordinate system has the following characteristics:
(1) Using the geometric center of the outline of the end cap as an origin;
(2) Taking the horizontal direction as an X axis and the vertical direction as a Y axis;
(3) The axes are defined with reference to the geometric radius of the end cap. The geometric radius of the selected end cap of different endoscopes is different, so the geometric radius of the end cap adopted in the step is determined according to the geometric radius of the end cap adopted by the actual endoscope, and the limitation of different X/Y axes according to the geometric radius of the end cap is required to be adjusted.
S5, carrying out scale marking on the blank scale so as to obtain a required virtual scale; the marking process of the scale mark is as follows:
and S51, carrying out primary scale division on the blank scale to obtain scale marks. The spacing between the graduations can be referenced to the geometric radius of the end cap to make a reasonable division.
S52, marking a real reference scale with scale marks on a blank paper surface to obtain a reference scale paper surface. A blank paper surface is selected, so that the reference scale can protrude out, the subsequent image processing is facilitated, the cross scale can be selected as the reference scale, the reference scale can be directly matched with a relative coordinate system, the scale marks of the reference scale can refer to the geometric radius of the end cap, and the scales of the conventional scale can be adopted.
S53, shooting a datum scale paper surface through an endoscope, and enabling an original point of the datum scale to coincide with an original point of the blank scale to obtain a test image. When the reference scale is photographed on a paper surface, it is emphasized that in order to ensure that the acquired image can be matched with the relative coordinate system, the image needs to be photographed with the origin of the reference scale as the center, and then a test image needs to be obtained.
And S54, carrying out numerical value marking on the scale marks in the blank scale according to the scale value of the reference scale in the mapping image so as to obtain the required virtual scale. And (3) referring to the distortion condition of the reference scale in the test image, carrying out numerical value marking on the scale marks of the blank scale, and enabling the numerical value marking of the blank scale to consider barrel distortion so as to obtain a virtual scale considering errors and enable subsequent reading to be more accurate.
The scale numerical value marking method of the blank scale comprises the following steps of:
s100, extracting a reference scale on the test image. The extraction method comprises the following specific steps:
and performing Gaussian down-sampling on the test image.
And performing gradient calculation on each pixel point of the descending and collected test image to obtain the gradient amplitude and the gradient direction of each pixel point. The specific calculation mode can be that gradient calculation is carried out on the lower right four pixels of each pixel point in the test image, a template which is as small as possible is used for calculation, dependence among the pixel points in the gradient calculation process is reduced, pixel gradient can be calculated according to the gray value of the positions of the pixel points in the image, and then the gradient direction and the gradient amplitude are obtained.
And presetting a gradient threshold, judging the gradient amplitude of each pixel point and the preset gradient threshold, marking the pixel points with the gradient amplitudes larger than the gradient threshold as associated pixel points, and marking the pixel points with the gradient amplitudes smaller than the gradient threshold as isolated pixel points. The gradient amplitude value of part of the pixel points is small, the part of the pixel points can be noise in the image, the gradient amplitude value of the pixel points is screened by setting a gradient threshold value, and if the gradient amplitude value of the pixel points is smaller than the set gradient threshold value, the pixel points can not be considered when the segment area is constructed.
And constructing the associated pixel points into a line segment support domain, and integrating according to the gradient direction of the associated pixel points to obtain the direction of the line segment support domain.
And calculating the direction error between the gradient direction of the isolated pixel points around the line segment support domain and the direction of the line segment support domain.
If the direction error is smaller than a preset tolerance error value, judging whether the direction error is larger than a gradient threshold value. The tolerance error value represents an error allowable value between the direction of the line segment support domain and the gradient direction of the pixel point, and errors smaller than the error allowable value can be tolerated and are regarded as no errors.
If the direction error is larger than the preset direction error, the isolated pixel point corresponding to the direction error is changed into a related pixel point and is included in the line segment support domain.
And updating the line segment support domain, and performing rectangle approximation calculation on the updated line segment support domain to obtain an estimated rectangle. The purpose of updating is to obtain a line segment support field added with a new associated pixel point.
And judging whether the pixel density of the estimated rectangle is larger than a preset density value. The calculation process to estimate the pixel density of the rectangle is as follows: counting the number of associated pixel points in the estimation rectangle to obtain the number m of the associated points; judging whether the gradient amplitude of the associated pixel point in the last step is larger than a gradient threshold value or not; marking the associated pixel points which are greater than the gradient threshold value, and counting to obtain the number n of the marks; and calculating the ratio of the number n of the marks to the number m of the associated points to obtain the pixel density.
If so, judging the estimation rectangle to be a line segment, and reserving the mutually communicated line segments to obtain the real scale.
S200, adjusting according to a preset proportion by taking the original point of the reference scale extracted in the previous step as a fixed point; and the scale lines of the reference scale and the scale areas of the blank scale are partially overlapped.
And S300, calculating the scale value of the overlapping area of the blank scale according to the proportion.
S400, repeating the step S200 until the scales of the blank scale are marked. When the blank scale has scales with digital marks, a virtual scale is formed. Barrel distortion, which is the gradual decrease in the relative size of an image from the center point of the image to the edge points of the image, appears as if a normal size picture is wrapped around a ball. Fisheye cameras use this type of distortion to map an infinitely wide object plane into a limited image area to present a hemispherical effect. When the zoom lens is used, barrel distortion occurs if the focal length is adjusted to the middle section of the lens, and the barrel distortion effect is most obvious when a wide-angle lens is used, so that if a ruler is directly constructed, data read through the ruler is inaccurate, a virtual ruler is constructed on the basis of considering barrel distortion, and the problem of vertical inaccuracy of the ruler caused by barrel distortion can be reduced.
According to the scale numerical value marking method of the embodiment, the scale lines of the blank scale can be accurately marked, the marking is accurate, and the error rate is low. The embodiment is suitable for clinical medicine, and is mainly used for the shape and position measuring technology of a lesion area in the digestive tract endoscopic exploration and treatment process, such as the measurement of the length, the width and the diameter of a focus or an in vivo tissue of a blood vessel, polyp, adenoma and the like. The method is suitable for dynamic measurement of real-time video sequence images and static measurement of image pictures acquired by exploration.
The virtual scale construction method for video image measurement in this embodiment may be designed as an application software, such as a virtual scale construction system for video image measurement, and loaded into a required electronic device to implement the corresponding virtual scale construction method for video image measurement.
In this embodiment, the virtual scale construction system for video image measurement includes a data acquisition module and an image processing module.
The data acquisition module is used for acquiring image data of a target area captured by the endoscope.
The image processing module is used for performing framing processing on the image data and extracting corresponding end cap contours in each frame of image; the method is also used for calculating the geometric center and the geometric radius of the end cap outline by adopting Hough gradient; the system is also used for establishing a relative coordinate system as a blank scale on each frame image in the image data; and the system is also used for carrying out scale marking on the blank scale so as to obtain the required virtual scale.
When the virtual scale construction system for video image measurement is executed, the steps of the virtual scale construction method for video image measurement are realized, so that the virtual scale construction system for video image measurement is not described in detail.
When the system is applied to the equipment, the system can be realized through the cooperation of the video card and the controller, the video card is used for collecting image data, and the controller is used for loading the software for image processing, so that the construction of the virtual scale is realized.
As shown in fig. 2, on the basis of the virtual scale construction method for video image measurement, the present embodiment further provides a method for video image measurement, where the method includes the following steps: pressing an end cap of the endoscope to the surface of a measured object, and shooting the measured object; directly reading the length or width or diameter of a measured object according to an image shot by an endoscope; before the end cap of the endoscope is close to the surface of the measured object, the end cap is subjected to virtual scale construction, and the virtual scale construction method adopts the virtual scale construction method facing the video image measurement, so detailed description is omitted.
The virtual scale is directly constructed on the image shot by the endoscope, so that the direct reading of a user is facilitated, the measurement is not required to be carried out through visual measurement or by means of an instrument ruler, and the measurement efficiency or the measurement accuracy is improved to a certain extent.
The application software may be applied to various terminals such as a computer terminal including a memory, a processor and a computer program stored on the memory and executable on the processor. And when the processor executes the program, the steps of the virtual scale construction method facing the video image measurement are realized.
Example 2
This embodiment provides a virtual scale construction method for video image measurement, which is similar to the construction method in embodiment 1, and the difference is that a reference scale in which the graduation of a graduation line is much smaller than that of a blank scale is directly adopted in this embodiment, for example: the number of the scale marks of the reference scale in the same range is 200, and the number of the scale marks of the blank scale in the same range is 20, so that the scale marks of the blank scale in the step are numerically marked according to the scale value of the reference scale in the test image, and further the required virtual scale is obtained, and the scale marks of the blank scale can be numerically marked directly according to the overlapped scale mark area.
The method of the embodiment can rapidly carry out numerical marking on the scale marks in the blank scale, does not need to adopt the scale numerical marking method of the blank scale in the embodiment 1, and can reduce the calculation steps.
All possible combinations of the technical features in the above embodiments may not be described for the sake of brevity, but should be considered as being within the scope of the present disclosure as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present invention, and the description thereof is specific and detailed, but not to be understood as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the inventive concept, which falls within the scope of the present invention. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A virtual scale construction method for video image measurement is used for constructing a virtual scale on an image of an inner area of an end cap collected by an endoscope, and is characterized by comprising the following steps of:
s1, acquiring image data of a target area captured by an endoscope;
s2, performing frame processing on the image data, and extracting corresponding end cap outlines in each frame image, wherein the extraction process of the end cap outlines is as follows:
s21, denoising each frame of image in the image data;
s22, identifying edge areas with gradient differences in each frame of image after noise reduction through a Canny edge detection algorithm;
s23, identifying an area with circular edge characteristics in each frame of image after edge detection through a circle detection algorithm, and further obtaining the outline of the end cap;
s3, calculating the geometric center and the geometric radius of the end cap profile by adopting a Hough gradient;
s4, establishing a relative coordinate system serving as a blank scale on each frame of image in the image data, wherein the relative coordinate system has the following characteristics:
(1) With the geometric center of the end cap profile as the origin;
(2) Taking the horizontal direction as an X axis and the vertical direction as a Y axis;
(3) Defining the limits of each axis based on the geometric radius of the end cap;
s5, carrying out scale marking on the blank scale to obtain a required virtual scale; the marking process of the scale mark is as follows:
s51, performing primary scale division on the blank scale to obtain scale marks;
s52, marking a real reference scale with scale marks on a blank paper surface to obtain a reference scale paper surface;
s53, shooting the paper surface of the reference scale through the endoscope, and enabling the origin of the reference scale to coincide with the origin of the blank scale to obtain a test image;
and S54, carrying out numerical value marking on the scale marks in the blank scale according to the scale value of the reference scale in the test image so as to obtain the required virtual scale.
2. The method for constructing a virtual scale for video image measurement according to claim 1, wherein the denoising processing method comprises any one of gaussian filtering, median filtering, mean filtering, P-M equation, or TV model.
3. The virtual scale construction method for video image measurement according to claim 1, wherein the edge region identification method comprises the following steps:
calculating the gradient amplitude and the gradient direction of each pixel point in each frame of image in the image data;
carrying out non-maximum suppression on the gradient amplitude of the pixel points according to the gradient direction;
and carrying out double-threshold processing on the gradient amplitude of the pixel points, and connecting edges to obtain the edge area.
4. The method for constructing the virtual scale for the video image measurement according to claim 3, wherein the method for calculating the gradient strength and the gradient direction of the pixel points comprises a Sobel filter operator or a Prewitt operator.
5. The method for constructing the virtual scale for the video image measurement according to claim 4, wherein the method for marking the scale value of the blank scale comprises the following steps:
s100, extracting a reference scale on the test image;
s200, adjusting according to a preset proportion by taking the original point of the reference scale extracted in the previous step as a fixed point; and the scale mark of the reference scale is overlapped with the scale mark part of the blank scale;
s300, calculating the scale value of the overlapped scale lines of the blank scale according to the proportion;
s400, repeating the step S200 until the scales of the blank scale are marked.
6. The virtual scale construction method for video image measurement according to claim 5, wherein the real scale extraction method comprises the following steps:
performing Gaussian down-sampling on the test image;
performing gradient calculation on each pixel point of the descending test image to obtain the gradient amplitude and the gradient direction of each pixel point;
presetting a gradient threshold, judging the gradient amplitude of each pixel point and the preset gradient threshold, marking the pixel points with the gradient amplitudes larger than the gradient threshold as associated pixel points, and marking the pixel points with the gradient amplitudes smaller than the gradient threshold as isolated pixel points;
constructing a line segment support domain by the associated pixel points, and integrating according to the gradient direction of the associated pixel points to obtain a line segment support domain direction;
calculating the direction error between the gradient direction of the isolated pixel points around the line segment support domain and the direction of the line segment support domain;
if the direction error is smaller than a preset tolerance error value, judging whether the direction error is larger than a gradient threshold value;
if the direction error is larger than the preset direction error, changing the isolated pixel point corresponding to the direction error into a related pixel point and bringing the related pixel point into a line segment support domain;
updating the line segment support domain, and performing rectangle approximation calculation on the updated line segment support domain to obtain an estimated rectangle;
judging whether the pixel density of the estimation rectangle is larger than a preset density value or not;
if yes, the estimation rectangle is judged to be a line segment, and the line segments which are mutually communicated are reserved to obtain the real scale.
7. The virtual scale construction method for video image measurement according to claim 6, wherein the pixel density calculation method comprises the following steps:
counting the number of associated pixel points in the estimation rectangle to obtain the number m of associated points;
judging whether the gradient amplitude of the associated pixel point in the last step is larger than the gradient threshold value;
marking the associated pixel points which are greater than the gradient threshold value, and counting to obtain the number n of the marks;
and calculating the ratio of the number n of the marks to the number m of the associated points to obtain the pixel density.
8. A virtual scale construction system for video image measurement, which is used for constructing a virtual scale on an image of an inner region of an end cap acquired by an endoscope, and is applied to the virtual scale construction method for video image measurement according to any one of claims 1 to 7, and the virtual scale construction system for video image measurement comprises:
the data acquisition module is used for acquiring image data of a target area captured by the endoscope;
the image processing module is used for performing frame processing on the image data and extracting corresponding end cap outlines in each frame image; further for calculating the geometric center and geometric radius of the endcap profile using a Hough gradient; the system is also used for establishing a relative coordinate system as a blank scale on each frame image in the image data; and the system is also used for carrying out scale marking on the blank scale so as to obtain the required virtual scale.
9. A measuring method for video images is characterized by comprising the following steps:
pressing an end cap of an endoscope to the surface of a measured object, and shooting the measured object;
directly reading the length or width or diameter of the object to be measured according to the image shot by the endoscope;
it is characterized in that the preparation method is characterized in that,
before the end cap of the endoscope is close to the surface of the measured object, a virtual scale is constructed on the end cap, and the construction method of the virtual scale adopts the construction method of the virtual scale facing the video image measurement as claimed in any one of claims 1 to 7.
10. A computer terminal comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor when executing the program implements the steps of the virtual scale construction method for video image measurement as claimed in any one of claims 1-7.
CN202210973582.6A 2022-08-15 2022-08-15 Virtual scale construction method, system and measurement method for video image measurement Pending CN115311239A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210973582.6A CN115311239A (en) 2022-08-15 2022-08-15 Virtual scale construction method, system and measurement method for video image measurement

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210973582.6A CN115311239A (en) 2022-08-15 2022-08-15 Virtual scale construction method, system and measurement method for video image measurement

Publications (1)

Publication Number Publication Date
CN115311239A true CN115311239A (en) 2022-11-08

Family

ID=83863548

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210973582.6A Pending CN115311239A (en) 2022-08-15 2022-08-15 Virtual scale construction method, system and measurement method for video image measurement

Country Status (1)

Country Link
CN (1) CN115311239A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117274525A (en) * 2023-11-21 2023-12-22 江西格如灵科技股份有限公司 Virtual tape measure measurement simulation method and system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117274525A (en) * 2023-11-21 2023-12-22 江西格如灵科技股份有限公司 Virtual tape measure measurement simulation method and system
CN117274525B (en) * 2023-11-21 2024-03-29 江西格如灵科技股份有限公司 Virtual tape measure measurement simulation method and system

Similar Documents

Publication Publication Date Title
CN110010249B (en) Augmented reality operation navigation method and system based on video superposition and electronic equipment
JP6150583B2 (en) Image processing apparatus, endoscope apparatus, program, and operation method of image processing apparatus
CN111091562B (en) Method and system for measuring size of digestive tract lesion
US10346978B2 (en) Method and apparatus for area or volume of object of interest from gastrointestinal images
EP2472473B1 (en) Image analysis device
US20060106283A1 (en) Methods and devices for endoscopic imaging
TWI605795B (en) Method and system of determining probe position in surgical site
EP1994879A1 (en) Image analyzing device and image analyzing method
US10736559B2 (en) Method and apparatus for estimating area or volume of object of interest from gastrointestinal images
US11455720B2 (en) Apparatus for ultrasound diagnosis of liver steatosis using feature points of ultrasound image and remote medical-diagnosis method using the same
US20190304121A1 (en) Method and Apparatus for Estimating Area or Volume of Object of Interest from Gastrointestinal Images
CN108113629B (en) Hard tube endoscope rotation angle measuring method and device
CN115311239A (en) Virtual scale construction method, system and measurement method for video image measurement
CN115619790B (en) Hybrid perspective method, system and equipment based on binocular positioning
CN106236264A (en) The gastrointestinal procedures air navigation aid of optically-based tracking and images match and system
CN114642444A (en) Oral implantation precision evaluation method and system and terminal equipment
US20210161604A1 (en) Systems and methods of navigation for robotic colonoscopy
CN112261399B (en) Capsule endoscope image three-dimensional reconstruction method, electronic device and readable storage medium
JP6987243B2 (en) Landmark estimation method, endoscope device, and position estimation program
CN115239641A (en) Method and device for measuring size of focus based on digestive endoscopy
JP2014147572A (en) Endoscope device and program
CN111743628A (en) Automatic puncture mechanical arm path planning method based on computer vision
CN115272588B (en) Human body spine fitting method and system based on depth image and electronic equipment
CN111000580A (en) Intervertebral disc scanning method and device, console equipment and CT system
CN116974369B (en) Method, system, equipment and storage medium for operating medical image in operation

Legal Events

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