WO2021195873A1 - Method and device for identifying region of interest in sfr test chart image, and medium - Google Patents

Method and device for identifying region of interest in sfr test chart image, and medium Download PDF

Info

Publication number
WO2021195873A1
WO2021195873A1 PCT/CN2020/082153 CN2020082153W WO2021195873A1 WO 2021195873 A1 WO2021195873 A1 WO 2021195873A1 CN 2020082153 W CN2020082153 W CN 2020082153W WO 2021195873 A1 WO2021195873 A1 WO 2021195873A1
Authority
WO
WIPO (PCT)
Prior art keywords
interest
region
contour
sfr
image
Prior art date
Application number
PCT/CN2020/082153
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/CN2020/082153 priority Critical patent/WO2021195873A1/en
Publication of WO2021195873A1 publication Critical patent/WO2021195873A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection

Definitions

  • the present invention relates to the field of image technology, in particular to a method for recognizing a region of interest in an image of an SFR test card, a device for recognizing a region of interest in an image of an SFR test card, and a non-temporary computer storage medium.
  • the spatial frequency response SFR (Spatial Frequency Response) test card has a white background, as shown in Figure 1, which includes a number of obliquely distributed black blocks, and the area of interest is centered on a certain hypotenuse of the designated black block Determine the spatial frequency response SFR of the designated black block according to the region of interest, so as to evaluate the resolution of the camera under test according to the spatial frequency response SFR of the designated black block.
  • some solutions require the user to manually mark the region of interest, but the application of this method has limitations and the operation is more troublesome. Or, some solutions determine the area of interest of the SFR test card through a preset configuration file. However, when the position of the field of view changes with this method, the coordinates of the determined area of interest may not meet the requirements of the spatial frequency response SFR algorithm. Regional requirements affect the accuracy of the spatial frequency response SFR algorithm.
  • the present invention aims to solve at least one of the technical problems existing in the prior art.
  • One of the objectives of this application is to propose a method for recognizing the region of interest in the image of the SFR test card, which can realize the automatic recognition of the region of interest and improve the accuracy of the results of the SFR algorithm.
  • the second purpose of this application is to propose a non-temporary computer storage medium.
  • the third purpose of this application is to provide a device for identifying the region of interest in the image of the SFR test card.
  • the method for identifying the region of interest in the SFR test card image includes: acquiring an SFR test card image; calculating the edge contour of the test black block in the SFR test card image; Calculate the centroid coordinates of the edge contour; determine the vertex coordinates of the test black block according to the distance between the contour point of the edge contour and the centroid; according to the vertex coordinates of the test black block and the set constraint value of the region of interest Determine the region of interest.
  • the edge contour of the test black block in the SFR test card image and the centroid coordinates of the edge contour are calculated, and the distance between the contour point of the edge contour and the centroid is used to determine
  • the vertex coordinates of the test black block are combined with the set constraint value of the region of interest to calculate the vertex coordinates of the region of interest, so as to realize the automatic recognition of the region of interest in the SFR test card image, without manual alignment, saving time and effort ,
  • the accuracy is high, and, compared with the method of determining the region of interest of the SFR test card by using a preset configuration file, the method of the embodiment of the present application uses the distance between the contour point of the edge contour and the centroid to determine the test black block Vertex coordinates, based on the vertex coordinates of the test black block to identify the region of interest, where the determination of the test black block position is not affected by the change of the field of view and the field of view,
  • the method before calculating the edge contour of the test black block in the SFR test card image, the method further includes: graying and binarizing the SFR test card image to remove the image The color in the middle and black and white are helpful to test the recognition of the edge contour of the black block.
  • the method further includes: calculating the area enclosed by the edge contour; obtaining the first area whose area is greater than the first preset area threshold. A type of contour and a second type of contour whose area is smaller than a second preset area threshold; the first type of contour and the second type of contour are removed from all the calculated edge contours to reduce non-test black
  • the interference of block edge contours improves the accuracy of the SFR algorithm results.
  • the method further includes: calculating the maximum x coordinate and the minimum x coordinate of the edge contour point of each test black block. Coordinates, the maximum y coordinate and the minimum y coordinate; calculate the x coordinate difference between the maximum x coordinate and the minimum x coordinate, and obtain the first type contour and all the contours whose x coordinate difference is greater than the first preset difference threshold The second-type contour whose x-coordinate difference is less than a second preset difference threshold, remove the first-type contour and the second-type contour from all the calculated edge contours; calculate the maximum y-coordinate The difference between the y-coordinate and the minimum y-coordinate to obtain the first-type contour whose y-coordinate difference is greater than the first preset difference threshold and the second-type contour whose y-coordinate difference is less than the second preset difference threshold Class contour, removing the first class contour and the second class contour from all the calculated edge contours.
  • determining the vertex coordinates of the test black block according to the distance between the contour point of the edge contour and the centroid includes the steps of: calculating the distance between two contour points in the edge contour; The two contour points with the smallest distance are selected from the contour, and the distance between the two contour points and the centroid is calculated, and the two contour points with the smallest distance from the centroid are removed from the contour points of the edge contour Repeat this step until there are four remaining contour points in the edge contour; use the coordinates of the remaining four contour points as the coordinates of the four vertices of the test black block, so that it is not affected by the field of view and the view The influence of field angle changes is conducive to the automatic identification and adaptation of black blocks.
  • the method before determining the vertex coordinates of the test black block according to the distance between the contour point of the edge contour and the centroid, the method further includes: simplifying the edge contour to obtain the pre-defined edge contour. Setting a number of contour points is beneficial to reduce the amount of calculation and improve the calculation efficiency of the vertex coordinates of the black block.
  • determining the region of interest according to the vertex coordinates of the test black block and the set constraint value of the region of interest includes the step of: calculating the test according to the four vertex coordinates of the test black block The coordinates of the center point of each side of the black block; taking the coordinates of the center point as the diagonal center point of the region of interest, calculate the area of interest according to the set length and width pixel values of the region of interest Vertex coordinates to realize automatic recognition of the region of interest.
  • determining the region of interest according to the vertex coordinates of the test black block and the set constraint value of the region of interest includes the step of: calculating the test according to the four vertex coordinates of the test black block The coordinates of the center point of each side of the black block and the length of the contour side; calculate the length of the region of interest according to the side length of the contour and the ratio of the length and width of the region of interest to the length of the contour side. Width pixel value; taking the center point coordinates as the diagonal center point of the region of interest, calculate the vertex coordinates of the region of interest according to the set length and width pixel values of the region of interest to realize automatic recognition Region of interest.
  • determining the region of interest according to the vertex coordinates of the test black block and the set constraint value of the region of interest includes the step of: calculating the coordinates of every two points according to the four vertex coordinates of the test black block.
  • the midpoint of the two vertices is taken as the intersection of the diagonals of the rectangle, and the straight line obtained by the straight line equation is taken as a diagonal bisector of the rectangle, and the four pixels of the rectangle are calculated according to the preset length and width pixel values of the region of interest.
  • a non-transitory computer storage medium has a computer program stored thereon, and when the computer program is executed, the method for identifying a region of interest in an image of an SFR test card described in the foregoing embodiment is implemented.
  • An apparatus for identifying a region of interest in an image of an SFR test card includes: a display for displaying the image of the SFR test card; a processor and a memory connected in communication with the processor; The memory stores instructions that can be executed by the processor, and when the instructions are executed by the processor, the processor executes the method for identifying the region of interest in the SFR test card image described in the foregoing embodiment.
  • the method for recognizing the region of interest in the image of the SFR test card provided by the above-mentioned embodiment is executed by the processor to realize the detection of the region of interest in the image of the SFR test card.
  • Automatic recognition no manual alignment is required, and the problem of inaccurate calculation of the coordinates of the region of interest can be avoided, and the accuracy of the results of the SFR algorithm can be improved.
  • Fig. 1 is a schematic diagram of black blocks in an image of an SFR test card according to an embodiment of the present application
  • Fig. 2 is a flowchart of a method for identifying a region of interest in an image of an SFR test card according to an embodiment of the present application
  • Fig. 3 is a schematic diagram of a region of interest in an image of an SFR test card according to an embodiment of the present application
  • FIG. 4 is a schematic diagram of a region of interest in an image of an SFR test card according to another embodiment of the present application.
  • Fig. 5 is a structural block diagram of a device for identifying a region of interest in an image of an SFR test card according to an embodiment of the present application.
  • Device 1 for identifying the region of interest in the image of the SFR test card; display 2; processor 3; memory 4.
  • Fig. 2 shows a flowchart of a method for identifying a region of interest in an image of an SFR test card provided by an embodiment of the application.
  • the method for identifying the region of interest in the image of the SFR test card in the embodiment of the present application at least includes steps S1-S5.
  • Step S1 Obtain an image of the SFR test card.
  • the SFR test card is a card with a white background and multiple black test blocks as shown in Figure 1.
  • the image of the SFR test card can be captured by an imaging device such as a camera to determine the sense of the image.
  • the region of interest, the region of interest is used as the image area for analysis, used to calculate the MTF value and other purposes.
  • Step S2 Calculate the edge contour of the test black block in the SFR test card image.
  • the method of the embodiment of the present application realizes the automatic recognition of the region of interest by determining the position of the test black block in the SFR test card image. Therefore, the edge of the test black block needs to be defined, that is, the edge contour of the test black block needs to be extracted.
  • the edge contour refers to the boundary line between the black block and the white background in the SFR test card image.
  • edge detection algorithms such as Scharr operator, Sobels operator, Canny operator, Laplacian operator, etc.
  • edge tracking Algorithms such as the Square tracking algorithm
  • Step S3 Calculate the centroid coordinates of the edge contour.
  • calculation can be performed by using a method such as a sub-pixel centroid positioning algorithm, a binarized centroid positioning algorithm, or a weighted binarized centroid positioning algorithm, etc., to obtain the centroid coordinates of the edge contour. Specifically, an appropriate selection can be made according to the actual situation.
  • the algorithm of this embodiment is not limited and fixed here.
  • Step S4 Determine the vertex coordinates of the test black block according to the distance between the contour point of the edge contour and the centroid.
  • the test black block may be a square, and the vertex coordinates of the test black block are the contour points with the largest distance from the center of mass. Obtaining the vertex coordinates of the test black block is to calculate the distance between each contour point and the center of mass, and determine the distance between each contour point and the center of mass. The four contour points with the largest distance are the vertex coordinates of the test black block.
  • the two contour points with the smallest distance can be selected from the edge contour, and the distance between the two contour points and the centroid can be calculated, from the two contour points Remove a contour point with a small distance from the center of mass and keep a contour point with a large distance from the center of mass. Repeat this step until there are four remaining contour points in the edge contour, so that the coordinates of the remaining four contour points are used as the four points of the test black block. Vertex coordinates.
  • the position of the test black block can still be determined when the field of view is changed, such as when part of the image is cropped. It is not affected by the range of the field of view, and when the field of view of several consecutive photos changes due to autofocus, the vertex coordinates of the test black block can also be automatically recognized, so that the changes in the coordinates of the region of interest can also be automatically recognized and adapted. This avoids the problem of inaccurate calculated values caused by the fixed coordinates of the region of interest, which is beneficial to improve the accuracy of the SFR algorithm.
  • Step S5 Determine the region of interest according to the vertex coordinates of the test black block and the set constraint value of the region of interest.
  • the SFR algorithm has certain requirements for the region of interest.
  • the width of the region of interest is 40-120 pixels, and the height is 80-300 pixels.
  • the width B is greater than 5 pixels. Therefore, in the embodiment of the present application, the constraint value of the region of interest can be set.
  • the set constraint value of the region of interest can include a preset length and width pixel value or a preset length and width. The ratio of the side length of the silhouette, etc.
  • the vertex coordinates of the region of interest are used to determine the region of interest and realize the automatic recognition of the region of interest.
  • the edge contour of the test black block in the SFR test card image and the centroid coordinates of the edge contour are calculated, and the distance between the contour point of the edge contour and the centroid is used to determine the test
  • the vertex coordinates of the black block are combined with the set constraint values of the region of interest to calculate the vertex coordinates of the region of interest, so as to realize the automatic recognition of the region of interest in the SFR test card image, without the need for manual and precise alignment.
  • the method of the embodiment of the present application uses the distance between the contour point of the edge contour and the centroid to determine the vertex coordinates of the test black block, based on the test
  • the vertex coordinates of the black block identify the region of interest, where the determination of the test black block position is not affected by the field of view range and field angle changes, that is, the test black block position can also be determined when the field of view range or field angle changes.
  • adaptive automatic recognition can be realized, the problem of inaccurate calculated values caused by fixed coordinates of the region of interest can be avoided, and the accuracy of the results of the SFR algorithm can be improved.
  • the method in the embodiment of the present application further includes performing grayscale and binarization processing on the SFR test card image. Specifically, grayscale processing is performed on the acquired SFR test card image to generate a corresponding grayscale image.
  • grayscale processing process the component method, maximum value method, average method, or weighted average method can be used.
  • the 256 brightness levels of the grayscale image are selected by selecting appropriate thresholds to obtain a binarized image that can still reflect the overall and local characteristics of the image, that is, through grayscale processing, the image loses color, and then the binarization process , Make the image appear black and white, which is more conducive to the recognition of the edge contour of the black block in the SFR image.
  • the method of the embodiment of the present application after calculating the edge contour of the test black block in the SFR test card image, further includes: Area, to obtain the first type contour whose area is larger than the first preset area threshold and the second type contour whose area is smaller than the second preset area threshold, and then remove the first type contour and the second type contour from all the edge contours calculated , That is, remove the edge contours of the SFR test card image except for the test black block.
  • the method of the present application further includes calculating the maximum x-coordinate, the minimum x-coordinate, the maximum y-coordinate, and the minimum y-coordinate of the edge contour point of each test black block, and then the maximum x-coordinate and the minimum x-coordinate are calculated.
  • the x coordinate difference of the coordinates, the first type of contour whose x coordinate difference is greater than the first preset difference threshold and the second type of contour whose x coordinate difference is less than the second preset difference threshold are obtained in all the calculated edges Remove the first-type contour and the second-type contour from the contour, and calculate the y-coordinate difference between the maximum y-coordinate and the minimum y-coordinate to obtain the first-type contour and the y-coordinate difference whose y-coordinate difference is greater than the first preset difference threshold For contours of the second type whose value is less than the second preset difference threshold, the contours of the first type and the second type are removed from all the calculated edge contours.
  • the edge contour can be a square, and calculate the maximum x coordinate, minimum x coordinate, and The maximum y coordinate and the minimum y coordinate are obtained, and the difference between the x coordinate and the y coordinate is obtained, which is the length of the side of the square, and the first type of contour with the larger side length and the second type of contour with the smaller side length are obtained. Remove the first type contour and the second type contour in all the edge contours, so as to remove the other edge contours in the SFR image except the test black block.
  • the method of the embodiment of the present application compares the area and/or side length of the edge contour with a preset threshold to remove the excessively large and small edge contours in the SFR test card image, which can be retained to the greatest extent Test the edge contour of the black block, so as to avoid the interference of the edge contour of the non-test black block.
  • the method of the embodiment of the present application before determining the vertex coordinates of the test black block according to the distance between the contour point of the edge contour and the centroid, further includes simplifying the edge contour to obtain a preset number of contour points in the edge contour. That is, the number of contour points included in the edge contour is smaller than a certain threshold to simplify the edge contour, thereby facilitating rapid calculation of the vertex coordinates of the test black block, reducing the amount of calculation, and improving the calculation efficiency.
  • the area of interest corresponding to the test black block includes two types, one is the area parallel to the edge of the SFR test card image, as shown in Figure 3; the other is the sense of a certain angle with the test black block.
  • the region of interest for example, an area where one side is substantially parallel to the hypotenuse of the edge contour of the test black block, and the other side is substantially perpendicular to the hypotenuse of the edge contour of the test black block, as shown in FIG. 4.
  • rectangle a represents the test black block
  • rectangle b represents the region of interest
  • the embodiment of the present application can calculate the center point coordinates of each side of the test black block according to the coordinates of the four vertices of the test black block, and then use the center point coordinates as the pair of the region of interest.
  • the vertex coordinates of the area of interest are calculated according to the set length and width pixel values of the area of interest to determine the area of interest.
  • the embodiment of the present application can determine the tilt angle of the region of interest according to the coordinates of the apex of the region of interest, and adjust the coordinates of the apex of the region of interest to make the tilt angle of the region of interest at
  • the preset angle range is, for example, 6°-8°, to meet the requirements of the region of interest in the SFR algorithm.
  • the slope of the line where each two vertices are located and the inclination angle of the line and the coordinate axis are calculated according to the coordinates of the four vertices of the test black block; the inclination angle of the line and the coordinate axis is calculated as the preset tilt angle and passed
  • the straight line equation of the midpoint of the two vertices; the midpoint of the two vertices is taken as the intersection of the diagonals of the rectangle, and the straight line obtained by the straight line equation is taken as the diagonal bisector of the rectangle, according to the preset length and width pixel values of the region of interest, Find the coordinates of the four vertices of the rectangle; intercept the image content according to the coordinates of the vertices of the rectangle, and rotate the entire image content by a preset angle as the image content of the region of interest.
  • the application embodiment can also calculate the region of interest based on the coordinates of the center point of each side of the test black block, the set constraint value of the region of interest, and the known slope of each side of the region of interest. The vertex coordinates to determine the area of interest.
  • the constraint value for the set region of interest that is, the preset length and width pixel value or the ratio value of the given length and width to the contour side length, is preset by the program and should be finalized
  • the region of interest can meet the requirements of the region of interest in the SFR algorithm as much as possible.
  • the non-temporary computer storage medium provided by the embodiment of the second aspect of the present application has a computer program stored thereon, wherein the computer program is executed to implement the method for identifying the region of interest in the SFR test card image provided by the above embodiment.
  • the device for identifying the region of interest in the image of the SFR test card provided by the embodiment of the third aspect of the present application is shown in FIG. .
  • the display 2 is used to display the image of the SFR test card
  • the memory 4 stores instructions that can be executed by the processor 3.
  • the processor 3 executes the identification of the SFR test card image provided by the above-mentioned embodiment. Method of interest area.
  • the processor 3 executes the method for recognizing the region of interest in the image of the SFR test card provided in the above embodiment, so that the interest in the image of the SFR test card can be realized.
  • the automatic recognition of the region does not require manual and precise alignment, and can avoid the problem of inaccurate calculation of the coordinates of the region of interest, and improve the accuracy of the SFR algorithm.
  • any process or method description in the flowchart or described in other ways herein can be understood as meaning that includes one or more executable instructions for implementing custom logic functions or steps of the process.
  • Modules, fragments, or parts of code, and the scope of the preferred embodiments of the present application includes additional implementations, which may not be in the order shown or discussed, including in a substantially simultaneous manner or in the reverse order according to the functions involved , To perform functions, which should be understood by those skilled in the art to which the embodiments of this application belong.
  • a "computer-readable medium” can be any device that can contain, store, communicate, propagate, or transmit a program for use by an instruction execution system, device, or device or in combination with these instruction execution systems, devices, or devices.
  • computer readable media include the following: electrical connections (electronic devices) with one or more wiring, portable computer disk cases (magnetic devices), random access memory (RAM), Read only memory (ROM), erasable and editable read only memory (EPROM or flash memory), fiber optic devices, and portable compact disk read only memory (CDROM).
  • the computer-readable medium may even be paper or other suitable medium on which the program can be printed, because it can be used, for example, by optically scanning the paper or other medium, followed by editing, interpretation, or other suitable media if necessary. The program is processed in a manner to obtain the program electronically, and then stored in the computer memory.
  • each part of this application can be implemented by hardware, software, firmware, or a combination thereof.
  • multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system.
  • Discrete logic gate circuits with logic functions for data signals Logic circuits, application specific integrated circuits with suitable combinational logic gates, programmable gate array (PGA), field programmable gate array (FPGA), etc.
  • a person of ordinary skill in the art can understand that all or part of the steps carried in the method of the foregoing embodiments can be implemented by a program instructing relevant hardware to complete.
  • the program can be stored in a computer-readable storage medium. When executed, it includes one of the steps of the method embodiment or a combination thereof.
  • the functional units in the various embodiments of the present application may be integrated into one processing module, or each unit may exist alone physically, or two or more units may be integrated into one module.
  • the above-mentioned integrated modules can be implemented in the form of hardware or software functional modules. If the integrated module is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer readable storage medium.
  • the aforementioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.

Landscapes

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

Abstract

The present application relates to a method and device for identifying a region of interest in an SFR test chart image, and a medium. The method comprises: acquiring an SFR test chart image; calculating edge contours of a black test block in the SFR test chart image; calculating the coordinates of the centroid of the edge contours; determining, according to distances between contour points on the edge contours and the centroid, the vertex coordinates of the black test block; and determining a region of interest according to the vertex coordinates of the black test block and a preset region-of-interest constraint value.

Description

识别SFR测试卡图像中感兴趣区域的方法及装置、介质Method, device and medium for identifying region of interest in SFR test card image 技术领域Technical field
本发明涉及图像技术领域,具体而言,涉及一种识别SFR测试卡图像中感兴趣区域的方法、一种识别SFR测试卡图像中感兴趣区域的装置以及一种非临时性计算机存储介质。The present invention relates to the field of image technology, in particular to a method for recognizing a region of interest in an image of an SFR test card, a device for recognizing a region of interest in an image of an SFR test card, and a non-temporary computer storage medium.
背景技术Background technique
随着数字图像的飞速发展,摄像头已经被广泛应用到人们的生活之中,摄像头性能测试在设计和生产中已经变得十分重要,对摄像头的分辨率进行测试是摄像头性能测试的必要环节。With the rapid development of digital images, cameras have been widely used in people's lives. Camera performance testing has become very important in design and production. Testing the resolution of the camera is a necessary part of the camera performance test.
空间频率响应SFR(Spatial Frequency Response)测试卡以白色为背景,如图1所示,其中包括多个倾斜分布的黑块,感兴趣区域是以指定黑块的某个斜边上的点为中心的矩形,根据感兴趣区域确定指定黑块的空间频率响应SFR,从而根据指定黑块的空间频率响应SFR对待测试摄像头的分辨率进行评价。The spatial frequency response SFR (Spatial Frequency Response) test card has a white background, as shown in Figure 1, which includes a number of obliquely distributed black blocks, and the area of interest is centered on a certain hypotenuse of the designated black block Determine the spatial frequency response SFR of the designated black block according to the region of interest, so as to evaluate the resolution of the camera under test according to the spatial frequency response SFR of the designated black block.
相关技术中,对于图像感兴趣区域的确定,有些方案需要用户人工标注感兴趣区域,但该方法的应用具有局限性,且操作比较麻烦。或者,有些方案通过预设的配置文件确定SFR测试卡的感兴趣区域,但是,该方法在视场位置发生变化时,可能会导致确定的感兴趣区域坐标不满足空间频率响应SFR算法对感兴趣区域的要求,影响空间频率响应SFR算法的准确性。In related technologies, for determining the region of interest in an image, some solutions require the user to manually mark the region of interest, but the application of this method has limitations and the operation is more troublesome. Or, some solutions determine the area of interest of the SFR test card through a preset configuration file. However, when the position of the field of view changes with this method, the coordinates of the determined area of interest may not meet the requirements of the spatial frequency response SFR algorithm. Regional requirements affect the accuracy of the spatial frequency response SFR algorithm.
发明内容Summary of the invention
本发明旨在至少解决现有技术中存在的技术问题之一。The present invention aims to solve at least one of the technical problems existing in the prior art.
本申请目的之一在于提出一种识别SFR测试卡图像中感兴趣区域的方法,该方法可以实现感兴趣区域的自动识别,提高SFR算法结果的准确性。One of the objectives of this application is to propose a method for recognizing the region of interest in the image of the SFR test card, which can realize the automatic recognition of the region of interest and improve the accuracy of the results of the SFR algorithm.
本申请的目的之二在于提出一种非临时性计算机存储介质。The second purpose of this application is to propose a non-temporary computer storage medium.
本申请的目的之三在于提出一种识别SFR测试卡图像中感兴趣区域的装置。The third purpose of this application is to provide a device for identifying the region of interest in the image of the SFR test card.
为了解决上述问题,本申请第一方面实施例提供的识别SFR测试卡图像中感兴趣区域的方法,包括:获取SFR测试卡图像;计算出所述SFR测试卡图像中测试黑块的边缘轮廓;计算所述边缘轮廓的质心坐标;根据所述边缘轮廓的轮廓点与质心的距离确定所述测试黑 块的顶点坐标;根据所述测试黑块的顶点坐标和设定的感兴趣区域的约束值确定所述感兴趣区域。In order to solve the above-mentioned problems, the method for identifying the region of interest in the SFR test card image provided by the embodiment of the first aspect of the present application includes: acquiring an SFR test card image; calculating the edge contour of the test black block in the SFR test card image; Calculate the centroid coordinates of the edge contour; determine the vertex coordinates of the test black block according to the distance between the contour point of the edge contour and the centroid; according to the vertex coordinates of the test black block and the set constraint value of the region of interest Determine the region of interest.
根据本申请实施例识别SFR测试卡图像中感兴趣区域的方法,通过计算SFR测试卡图像中测试黑块的边缘轮廓以及边缘轮廓的质心坐标,并利用边缘轮廓的轮廓点与质心的距离以确定测试黑块的顶点坐标,再结合设定的感兴趣区域的约束值,计算出感兴趣区域的顶点坐标,从而实现对SFR测试卡图像中感兴趣区域的自动识别,无需手动对齐,省时省力,精确度高,以及,相较于采用预设的配置文件确定SFR测试卡感兴趣区域的方法,本申请实施例的方法通过利用边缘轮廓的轮廓点与质心的距离,以确定测试黑块的顶点坐标,基于测试黑块的顶点坐标识别感兴趣区域,其中,测试黑块位置的确定不受视场范围和视场角变化的影响,即在视场范围或视场角变化时也可以确定测试黑块位置,从而可以实现自适应自动识别,避免了因感兴趣区域坐标固定导致计算值不准确的问题,提高SFR算法结果的准确性。According to the method of identifying the region of interest in the SFR test card image according to the embodiment of the present application, the edge contour of the test black block in the SFR test card image and the centroid coordinates of the edge contour are calculated, and the distance between the contour point of the edge contour and the centroid is used to determine The vertex coordinates of the test black block are combined with the set constraint value of the region of interest to calculate the vertex coordinates of the region of interest, so as to realize the automatic recognition of the region of interest in the SFR test card image, without manual alignment, saving time and effort , The accuracy is high, and, compared with the method of determining the region of interest of the SFR test card by using a preset configuration file, the method of the embodiment of the present application uses the distance between the contour point of the edge contour and the centroid to determine the test black block Vertex coordinates, based on the vertex coordinates of the test black block to identify the region of interest, where the determination of the test black block position is not affected by the change of the field of view and the field of view, that is, it can be determined when the field of view or the field of view changes. The location of the black block is tested, so as to realize self-adaptive automatic recognition, avoid the problem of inaccurate calculation values due to fixed coordinates of the region of interest, and improve the accuracy of the SFR algorithm results.
在一些实施例中,在计算出所述SFR测试卡图像中测试黑块的边缘轮廓之前,所述方法还包括:对所述SFR测试卡图像进行灰度化和二值化处理,可以去除图像中的色彩以及进行黑白化,利于测试黑块的边缘轮廓的识别。In some embodiments, before calculating the edge contour of the test black block in the SFR test card image, the method further includes: graying and binarizing the SFR test card image to remove the image The color in the middle and black and white are helpful to test the recognition of the edge contour of the black block.
在一些实施例中,在计算出所述SFR测试卡图像中测试黑块的边缘轮廓之后,所述方法还包括:计算所述边缘轮廓包围的面积;获得面积大于第一预设面积阈值的第一类轮廓和面积小于第二预设面积阈值的第二类轮廓;在所述计算出的所有所述边缘轮廓中去除所述第一类轮廓和所述第二类轮廓,以减少非测试黑块边缘轮廓的干扰,提高SFR算法结果的准确性。In some embodiments, after calculating the edge contour of the test black block in the SFR test card image, the method further includes: calculating the area enclosed by the edge contour; obtaining the first area whose area is greater than the first preset area threshold. A type of contour and a second type of contour whose area is smaller than a second preset area threshold; the first type of contour and the second type of contour are removed from all the calculated edge contours to reduce non-test black The interference of block edge contours improves the accuracy of the SFR algorithm results.
在一些实施例中,在计算出所述SFR测试卡图像中测试黑块的边缘轮廓之后,所述方法还包括:计算每个所述测试黑块的边缘轮廓点的中最大x坐标、最小x坐标、最大y坐标和最小y坐标;计算所述最大x坐标与所述最小x坐标的x坐标差值,获得所述x坐标差值大于第一预设差值阈值的第一类轮廓和所述x坐标差值小于第二预设差值阈值的第二类轮廓,在所述计算出的所有边缘轮廓中去除所述第一类轮廓和所述第二类轮廓;计算所述最大y坐标与所述最小y坐标的y坐标差值,获得所述y坐标差值大于第一预设差值阈值的第一类轮廓和所述y坐标差值小于第二预设差值阈值的第二类轮廓,在所述计算出的所有边缘轮廓中去除所述第一类轮廓和所述第二类轮廓。In some embodiments, after calculating the edge contour of the test black block in the SFR test card image, the method further includes: calculating the maximum x coordinate and the minimum x coordinate of the edge contour point of each test black block. Coordinates, the maximum y coordinate and the minimum y coordinate; calculate the x coordinate difference between the maximum x coordinate and the minimum x coordinate, and obtain the first type contour and all the contours whose x coordinate difference is greater than the first preset difference threshold The second-type contour whose x-coordinate difference is less than a second preset difference threshold, remove the first-type contour and the second-type contour from all the calculated edge contours; calculate the maximum y-coordinate The difference between the y-coordinate and the minimum y-coordinate to obtain the first-type contour whose y-coordinate difference is greater than the first preset difference threshold and the second-type contour whose y-coordinate difference is less than the second preset difference threshold Class contour, removing the first class contour and the second class contour from all the calculated edge contours.
在一些实施例中,根据所述边缘轮廓的轮廓点与质心的距离确定所述测试黑块的顶点坐标,包括步骤:计算所述边缘轮廓中两两轮廓点之间的距离;从所述边缘轮廓中选取距离 最小的两个轮廓点,并计算两个所述轮廓点与所述质心的距离,从所述边缘轮廓的轮廓点中去除两个所述轮廓点中与所述质心距离小的一个轮廓点,重复本步骤,直至所述边缘轮廓中剩余四个轮廓点;将所述剩余四个轮廓点的坐标作为所述测试黑块的四个顶点坐标,从而不受视场范围和视场角变化的影响,利于测试黑块自动识别适应。In some embodiments, determining the vertex coordinates of the test black block according to the distance between the contour point of the edge contour and the centroid includes the steps of: calculating the distance between two contour points in the edge contour; The two contour points with the smallest distance are selected from the contour, and the distance between the two contour points and the centroid is calculated, and the two contour points with the smallest distance from the centroid are removed from the contour points of the edge contour Repeat this step until there are four remaining contour points in the edge contour; use the coordinates of the remaining four contour points as the coordinates of the four vertices of the test black block, so that it is not affected by the field of view and the view The influence of field angle changes is conducive to the automatic identification and adaptation of black blocks.
在一些实施例中,在根据所述边缘轮廓的轮廓点与质心的距离确定所述测试黑块的顶点坐标之前,所述方法还包括:简化所述边缘轮廓,以获得所述边缘轮廓中预设数量的轮廓点,利于减少运算量,提高测试黑块顶点坐标的计算效率。In some embodiments, before determining the vertex coordinates of the test black block according to the distance between the contour point of the edge contour and the centroid, the method further includes: simplifying the edge contour to obtain the pre-defined edge contour. Setting a number of contour points is beneficial to reduce the amount of calculation and improve the calculation efficiency of the vertex coordinates of the black block.
在一些实施例中,根据所述测试黑块的顶点坐标和设定的感兴趣区域的约束值确定所述感兴趣区域,包括步骤:根据所述测试黑块的四个顶点坐标计算所述测试黑块每条边的中心点坐标;以所述中心点坐标为所述感兴趣区域的对角线中心点,根据设定的所述感兴趣区域的长宽像素值计算所述感兴趣区域的顶点坐标,实现自动识别感兴趣区域。In some embodiments, determining the region of interest according to the vertex coordinates of the test black block and the set constraint value of the region of interest includes the step of: calculating the test according to the four vertex coordinates of the test black block The coordinates of the center point of each side of the black block; taking the coordinates of the center point as the diagonal center point of the region of interest, calculate the area of interest according to the set length and width pixel values of the region of interest Vertex coordinates to realize automatic recognition of the region of interest.
在一些实施例中,根据所述测试黑块的顶点坐标和设定的感兴趣区域的约束值确定所述感兴趣区域,包括步骤:根据所述测试黑块的四个顶点坐标计算所述测试黑块每条边的中心点坐标和轮廓边长;根据所述轮廓边长、设定的所述感兴趣区域的长宽与所述轮廓边长的比例值,计算所述感兴趣区域的长宽像素值;以所述中心点坐标为所述感兴趣区域的对角线中心点,根据设定的所述感兴趣区域的长宽像素值计算所述感兴趣区域的顶点坐标,实现自动识别感兴趣区域。In some embodiments, determining the region of interest according to the vertex coordinates of the test black block and the set constraint value of the region of interest includes the step of: calculating the test according to the four vertex coordinates of the test black block The coordinates of the center point of each side of the black block and the length of the contour side; calculate the length of the region of interest according to the side length of the contour and the ratio of the length and width of the region of interest to the length of the contour side. Width pixel value; taking the center point coordinates as the diagonal center point of the region of interest, calculate the vertex coordinates of the region of interest according to the set length and width pixel values of the region of interest to realize automatic recognition Region of interest.
在一些实施例中,根据所述测试黑块的顶点坐标和设定的感兴趣区域的约束值确定所述感兴趣区域,包括步骤:根据所述测试黑块的四个顶点坐标计算出每两个顶点所在直线的斜率和所述所在直线与坐标轴的倾斜角度;求出与所述所在直线与坐标轴的倾斜角度为预设倾斜角度并经过两个顶点中点的直线方程;以所述两个顶点中点作为矩形的对角线交点,且以所述直线方程所得直线作为矩形的一个对边平分线,根据预设的感兴趣区域长宽像素值,求出所述矩形的四个顶点坐标;根据所述矩形的顶点坐标截取图像内容,并将所述图像内容整体旋转一个预设的角度作为所述感兴趣区域的图像内容。In some embodiments, determining the region of interest according to the vertex coordinates of the test black block and the set constraint value of the region of interest includes the step of: calculating the coordinates of every two points according to the four vertex coordinates of the test black block. The slope of the straight line where the vertices are located and the inclination angle of the straight line and the coordinate axis; find the inclination angle of the straight line and the coordinate axis as the preset inclination angle and the straight line equation passing through the midpoint of the two vertices; The midpoint of the two vertices is taken as the intersection of the diagonals of the rectangle, and the straight line obtained by the straight line equation is taken as a diagonal bisector of the rectangle, and the four pixels of the rectangle are calculated according to the preset length and width pixel values of the region of interest. Vertex coordinates; the image content is intercepted according to the coordinates of the vertices of the rectangle, and the image content is rotated as a whole by a preset angle as the image content of the region of interest.
本申请第二方面实施例的一种非临时性计算机存储介质,其上存储有计算机程序,所述计算机程序被执行时实现上述实施例所述的识别SFR测试卡图像中感兴趣区域的方法。A non-transitory computer storage medium according to an embodiment of the second aspect of the present application has a computer program stored thereon, and when the computer program is executed, the method for identifying a region of interest in an image of an SFR test card described in the foregoing embodiment is implemented.
本申请第三方面实施例的一种识别SFR测试卡图像中感兴趣区域的装置,包括:显示器,用于显示SFR测试卡图像;处理器以及与所述处理器通信连接的存储器;其中,所述存储器存储有可被所述处理器执行的指令,所述指令被所述处理器执行时,使所述处理器执行上述实施例所述的识别SFR测试卡图像中感兴趣区域的方法。An apparatus for identifying a region of interest in an image of an SFR test card according to an embodiment of the third aspect of the present application includes: a display for displaying the image of the SFR test card; a processor and a memory connected in communication with the processor; The memory stores instructions that can be executed by the processor, and when the instructions are executed by the processor, the processor executes the method for identifying the region of interest in the SFR test card image described in the foregoing embodiment.
根据本申请实施例的识别SFR测试卡图像中感兴趣区域的装置,通过处理器执行上述实施例提供的识别SFR测试卡图像中感兴趣区域的方法,可以实现SFR测试卡图像中感兴趣区域的自动识别,无需手动对齐,且能够避免感兴趣区域坐标计算不准确的问题,提高SFR算法结果的准确性。According to the device for recognizing the region of interest in the image of the SFR test card according to the embodiment of the present application, the method for recognizing the region of interest in the image of the SFR test card provided by the above-mentioned embodiment is executed by the processor to realize the detection of the region of interest in the image of the SFR test card. Automatic recognition, no manual alignment is required, and the problem of inaccurate calculation of the coordinates of the region of interest can be avoided, and the accuracy of the results of the SFR algorithm can be improved.
本发明的附加方面和优点将在下面的描述中部分给出,部分将从下面的描述中变得明显,或通过本发明的实践了解到。The additional aspects and advantages of the present invention will be partly given in the following description, and partly will become obvious from the following description, or be understood through the practice of the present invention.
附图说明Description of the drawings
本发明的上述和/或附加的方面和优点从结合下面附图对实施例的描述中将变得明显和容易理解,其中:The above and/or additional aspects and advantages of the present invention will become obvious and easy to understand from the description of the embodiments in conjunction with the following drawings, in which:
图1是根据本申请一个实施例的SFR测试卡图像中黑块的示意图;Fig. 1 is a schematic diagram of black blocks in an image of an SFR test card according to an embodiment of the present application;
图2是根据本申请一个实施例的识别SFR测试卡图像中感兴趣区域方法的流程图;Fig. 2 is a flowchart of a method for identifying a region of interest in an image of an SFR test card according to an embodiment of the present application;
图3是根据本申请一个实施例的SFR测试卡图像中感兴趣区域的示意图;Fig. 3 is a schematic diagram of a region of interest in an image of an SFR test card according to an embodiment of the present application;
图4是根据本申请另一个实施例的SFR测试卡图像中感兴趣区域的示意图;4 is a schematic diagram of a region of interest in an image of an SFR test card according to another embodiment of the present application;
图5是根据本申请一个实施例的识别SFR测试卡图像中感兴趣区域装置的结构框图。Fig. 5 is a structural block diagram of a device for identifying a region of interest in an image of an SFR test card according to an embodiment of the present application.
附图标记:Reference signs:
识别SFR测试卡图像中感兴趣区域的装置1;显示器2;处理器3;存储器4。 Device 1 for identifying the region of interest in the image of the SFR test card; display 2; processor 3; memory 4.
具体实施方式Detailed ways
下面详细描述本发明的实施例,所述实施例的示例在附图中示出,其中自始至终相同或类似的标号表示相同或类似的元件或具有相同或类似功能的元件。下面通过参考附图描述的实施例是示例性的,仅用于解释本发明,而不能理解为对本发明的限制。The embodiments of the present invention are described in detail below. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals indicate the same or similar elements or elements with the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary, and are only used to explain the present invention, but should not be understood as limiting the present invention.
为了能够更加详尽地了解本公开实施例的特点与技术内容,In order to have a more detailed understanding of the features and technical content of the embodiments of the present disclosure,
下面结合附图对本公开实施例的实现进行详细阐述,所附附图仅供参考说明之用,并非用来限定本公开实施例。在以下的技术描述中,为方便解释起见,通过多个细节以提供对所披露实施例的充分理解。然而,在没有这些细节的情况下,一个或多个实施例仍然可以实施。在其它情况下,为简化附图,熟知的结构和装置可以简化展示。The implementation of the embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings. The attached drawings are for reference and description purposes only, and are not used to limit the embodiments of the present disclosure. In the following technical description, for the convenience of explanation, a number of details are used to provide a sufficient understanding of the disclosed embodiments. However, without these details, one or more embodiments can still be implemented. In other cases, in order to simplify the drawings, well-known structures and devices may be simplified for display.
下面参考附图描述根据本申请实施例的识别SFR测试卡图像中感兴趣区域的方法,该 方法可以实现感兴趣区域的自动识别,提高SFR算法结果的准确性。The following describes a method for identifying a region of interest in an image of an SFR test card according to an embodiment of the present application with reference to the accompanying drawings. This method can realize automatic identification of the region of interest and improve the accuracy of the SFR algorithm result.
图2所示为本申请的一个实施例提供的识别SFR测试卡图像中感兴趣区域的方法的流程图。如图2所示,本申请实施例的识别SFR测试卡图像中感兴趣区域的方法至少包括步骤S1-S5。Fig. 2 shows a flowchart of a method for identifying a region of interest in an image of an SFR test card provided by an embodiment of the application. As shown in FIG. 2, the method for identifying the region of interest in the image of the SFR test card in the embodiment of the present application at least includes steps S1-S5.
步骤S1,获取SFR测试卡图像。Step S1: Obtain an image of the SFR test card.
其中,SFR测试卡为如图1中所示的以白色为背景且包括多个黑色测试块的卡片,在实际操作时,可以通过成像设备如摄像头采集SFR测试卡图像,进而确定图像中的感兴趣区域,以感兴趣区域作为分析的图像区域,用于计算MTF值及其它用途。Among them, the SFR test card is a card with a white background and multiple black test blocks as shown in Figure 1. In actual operation, the image of the SFR test card can be captured by an imaging device such as a camera to determine the sense of the image. The region of interest, the region of interest is used as the image area for analysis, used to calculate the MTF value and other purposes.
步骤S2,计算出SFR测试卡图像中测试黑块的边缘轮廓。Step S2: Calculate the edge contour of the test black block in the SFR test card image.
本申请实施例的方法,通过确定SFR测试卡图像中测试黑块的位置,以实现对感兴趣区域的自动识别,因此需要对测试黑块进行边缘界定,即需提取测试黑块的边缘轮廓,其中边缘轮廓指的是SFR测试卡图像中黑块与白色背景的交界线。The method of the embodiment of the present application realizes the automatic recognition of the region of interest by determining the position of the test black block in the SFR test card image. Therefore, the edge of the test black block needs to be defined, that is, the edge contour of the test black block needs to be extracted. The edge contour refers to the boundary line between the black block and the white background in the SFR test card image.
具体地,可以通过提取图像的边缘后再提取其对应边界来实现,其中可以采用边缘检测算法如Scharr算子、Sobels算子、Canny算子、Laplacian算子等提取图像的边缘,再通过边缘跟踪算法如Square跟踪算法,实现图像对应边界的提取,以生成测试黑块的边缘轮廓。或者采用图像梯度算法,通过计算和统计图像局部区域的梯度方向直方图来构成边缘轮廓,或者采用其他算法以获得测试黑块的边缘轮廓,对此不作限制。Specifically, it can be achieved by extracting the edge of the image and then extracting the corresponding boundary, in which edge detection algorithms such as Scharr operator, Sobels operator, Canny operator, Laplacian operator, etc. can be used to extract the edge of the image, and then through edge tracking Algorithms, such as the Square tracking algorithm, realize the extraction of the corresponding boundary of the image to generate the edge contour of the test black block. Or adopt the image gradient algorithm to form the edge contour by calculating and statistics the gradient direction histogram of the local area of the image, or adopt other algorithms to obtain the edge contour of the test black block, which is not limited.
步骤S3,计算边缘轮廓的质心坐标。Step S3: Calculate the centroid coordinates of the edge contour.
在实施例中,可以通过采用亚像素质心定位算法或二值化质心定位算法或加权二值化质心定位算法等方法进行计算,以获得边缘轮廓的质心坐标,具体地可根据实际情况选择适当的算法,本实施例在此并不进行限制和固定。In the embodiment, calculation can be performed by using a method such as a sub-pixel centroid positioning algorithm, a binarized centroid positioning algorithm, or a weighted binarized centroid positioning algorithm, etc., to obtain the centroid coordinates of the edge contour. Specifically, an appropriate selection can be made according to the actual situation. The algorithm of this embodiment is not limited and fixed here.
步骤S4,根据边缘轮廓的轮廓点与质心的距离确定测试黑块的顶点坐标。Step S4: Determine the vertex coordinates of the test black block according to the distance between the contour point of the edge contour and the centroid.
在实施例中,测试黑块可以为方形,测试黑块的顶点坐标为与质心的距离最大的轮廓点,获得测试黑块的顶点坐标即计算每个轮廓点与质心的距离,确定其中与质心的距离最大的四个轮廓点为测试黑块的顶点坐标。In an embodiment, the test black block may be a square, and the vertex coordinates of the test black block are the contour points with the largest distance from the center of mass. Obtaining the vertex coordinates of the test black block is to calculate the distance between each contour point and the center of mass, and determine the distance between each contour point and the center of mass. The four contour points with the largest distance are the vertex coordinates of the test black block.
在实施例中,可以通过计算边缘轮廓中两两轮廓点之间的距离,从边缘轮廓中选取距离最小的两个轮廓点,并计算两个轮廓点与质心的距离,从两个轮廓点中去除与质心距离小的一个轮廓点,保留与质心距离大的一个轮廓点,重复本步骤,直至边缘轮廓中剩余四个轮廓点,从而将剩余的四个轮廓点的坐标作为测试黑块的四个顶点坐标。In an embodiment, by calculating the distance between the two contour points in the edge contour, the two contour points with the smallest distance can be selected from the edge contour, and the distance between the two contour points and the centroid can be calculated, from the two contour points Remove a contour point with a small distance from the center of mass and keep a contour point with a large distance from the center of mass. Repeat this step until there are four remaining contour points in the edge contour, so that the coordinates of the remaining four contour points are used as the four points of the test black block. Vertex coordinates.
因此,通过采用本申请实施例的确定SFR测试卡图像中测试黑块的顶点坐标方式,在 视场范围发生改变,如图像内有部分被裁剪的情况时,仍可以确定测试黑块的位置,不受视场范围的影响,以及在因自动对焦导致的连续几张照片视场角变化时,也可以自动识别测试黑块的顶点坐标,进而使得感兴趣区域坐标的变化也能自动识别适应,从而避免了因为感兴趣区域坐标固定而导致的计算值不准确的问题,利于提高SFR算法的准确性。Therefore, by adopting the method of determining the vertex coordinates of the test black block in the SFR test card image of the embodiment of the present application, the position of the test black block can still be determined when the field of view is changed, such as when part of the image is cropped. It is not affected by the range of the field of view, and when the field of view of several consecutive photos changes due to autofocus, the vertex coordinates of the test black block can also be automatically recognized, so that the changes in the coordinates of the region of interest can also be automatically recognized and adapted. This avoids the problem of inaccurate calculated values caused by the fixed coordinates of the region of interest, which is beneficial to improve the accuracy of the SFR algorithm.
步骤S5,根据测试黑块的顶点坐标和设定的感兴趣区域的约束值确定感兴趣区域。Step S5: Determine the region of interest according to the vertex coordinates of the test black block and the set constraint value of the region of interest.
其中,SFR算法对于感兴趣区域有一定的要求,例如,感兴趣区域的宽度为40-120像素,高度为80-300像素,位于测试黑块区域的宽度A大于5像素,位于白色背景区域的宽度B大于5像素,因此,本申请实施例中可以设定感兴趣区域的约束值,例如,设定的感兴趣区域的约束值可以包括预设的长宽像素值或预设的长宽与轮廓边长的比例值等。Among them, the SFR algorithm has certain requirements for the region of interest. For example, the width of the region of interest is 40-120 pixels, and the height is 80-300 pixels. The width B is greater than 5 pixels. Therefore, in the embodiment of the present application, the constraint value of the region of interest can be set. For example, the set constraint value of the region of interest can include a preset length and width pixel value or a preset length and width. The ratio of the side length of the silhouette, etc.
具体地,根据测试黑块的四个顶点坐标计算测试黑块每条边的中心点坐标;以中心点坐标为感兴趣区域的对角线中心点,根据设定的感兴趣区域的约束值计算感兴趣区域的顶点坐标,以确定感兴趣区域,实现感兴趣区域的自动识别。Specifically, calculate the center point coordinates of each side of the test black block according to the coordinates of the four vertices of the test black block; take the center point coordinates as the diagonal center point of the area of interest, and calculate according to the set constraint value of the area of interest The vertex coordinates of the region of interest are used to determine the region of interest and realize the automatic recognition of the region of interest.
根据本申请实施例识别SFR测试卡图像中感兴趣区域的方法,通过计算SFR测试卡图像中测试黑块的边缘轮廓以及边缘轮廓的质心坐标,并利用边缘轮廓的轮廓点与质心的距离确定测试黑块的顶点坐标,再结合设定的感兴趣区域的约束值,以计算出感兴趣区域的顶点坐标,从而实现对SFR测试卡图像中感兴趣区域的自动识别,无需再通过手动精准对齐,同时,相较于采用预设的配置文件确定SFR测试卡感兴趣区域的方法,本申请实施例的方法通过利用边缘轮廓的轮廓点与质心的距离,以确定测试黑块的顶点坐标,基于测试黑块的顶点坐标识别感兴趣区域,其中,测试黑块位置的确定不受视场范围和视场角变化的影响,即在视场范围或视场角变化时也可以确定测试黑块位置,从而可以实现自适应自动识别,避免了因感兴趣区域坐标固定导致计算值不准确的问题,提高SFR算法结果的准确性。According to the method for identifying the region of interest in the SFR test card image according to the embodiment of the present application, the edge contour of the test black block in the SFR test card image and the centroid coordinates of the edge contour are calculated, and the distance between the contour point of the edge contour and the centroid is used to determine the test The vertex coordinates of the black block are combined with the set constraint values of the region of interest to calculate the vertex coordinates of the region of interest, so as to realize the automatic recognition of the region of interest in the SFR test card image, without the need for manual and precise alignment. At the same time, compared with the method of determining the region of interest of the SFR test card by using a preset configuration file, the method of the embodiment of the present application uses the distance between the contour point of the edge contour and the centroid to determine the vertex coordinates of the test black block, based on the test The vertex coordinates of the black block identify the region of interest, where the determination of the test black block position is not affected by the field of view range and field angle changes, that is, the test black block position can also be determined when the field of view range or field angle changes. In this way, adaptive automatic recognition can be realized, the problem of inaccurate calculated values caused by fixed coordinates of the region of interest can be avoided, and the accuracy of the results of the SFR algorithm can be improved.
在实施例中,本申请实施例的方法中在计算出SFR测试卡图像中测试黑块的边缘轮廓之前,还包括,对SFR测试卡图像进行灰度化和二值化处理。具体地,对获取的SFR测试卡图像进行灰度化处理,以生成对应的灰度图像,在灰度化处理过程中,可以采用分量法、最大值法、平均值法或加权平均法等,进而将256个亮度等级的灰度图像通过选取适当的阈值,而获得仍然可以反映图像整体和局部特征的二值化图像,即通过灰度化处理,使图像失去色彩,进而经二值化处理,使图像呈现黑白效果,从而更加利于SFR图像中测试黑块的边缘轮廓的识别。In the embodiment, before calculating the edge contour of the test black block in the SFR test card image, the method in the embodiment of the present application further includes performing grayscale and binarization processing on the SFR test card image. Specifically, grayscale processing is performed on the acquired SFR test card image to generate a corresponding grayscale image. In the grayscale processing process, the component method, maximum value method, average method, or weighted average method can be used. Furthermore, the 256 brightness levels of the grayscale image are selected by selecting appropriate thresholds to obtain a binarized image that can still reflect the overall and local characteristics of the image, that is, through grayscale processing, the image loses color, and then the binarization process , Make the image appear black and white, which is more conducive to the recognition of the edge contour of the black block in the SFR image.
在实施例中,为减少除测试黑块以外其它的边缘轮廓的干扰,本申请实施例的方法中在 计算出SFR测试卡图像中测试黑块的边缘轮廓之后,还包括,计算边缘轮廓包围的面积,以获得面积大于第一预设面积阈值的第一类轮廓和面积小于第二预设面积阈值的第二类轮廓,进而在计算出所有边缘轮廓中去除第一类轮廓和第二类轮廓,即去除SFR测试卡图像中除测试黑块以外其它的边缘轮廓。In the embodiment, in order to reduce the interference of other edge contours except the test black block, the method of the embodiment of the present application, after calculating the edge contour of the test black block in the SFR test card image, further includes: Area, to obtain the first type contour whose area is larger than the first preset area threshold and the second type contour whose area is smaller than the second preset area threshold, and then remove the first type contour and the second type contour from all the edge contours calculated , That is, remove the edge contours of the SFR test card image except for the test black block.
或者,在实施例中,本申请的方法还包括,计算每个测试黑块的边缘轮廓点的中最大x坐标、最小x坐标、最大y坐标和最小y坐标,进而计算最大x坐标与最小x坐标的x坐标差值,获得x坐标差值大于第一预设差值阈值的第一类轮廓和x坐标差值小于第二预设差值阈值的第二类轮廓,在计算出的所有边缘轮廓中去除第一类轮廓和第二类轮廓,以及计算最大y坐标与最小y坐标的y坐标差值,获得y坐标差值大于第一预设差值阈值的第一类轮廓和y坐标差值小于第二预设差值阈值的第二类轮廓,在计算出的所有边缘轮廓中去除第一类轮廓和第二类轮廓。也就是通过将边缘轮廓的边长与预设阈值作比较,去除SFR测试卡图像中除测试黑块以外其它的边缘轮廓,例如边缘轮廓可以为正方形,计算正方形的最大x坐标、最小x坐标、最大y坐标和最小y坐标,获得x坐标差值与y坐标差值,也就是正方形的边长长度,获得边长长度较大的第一类轮廓和边长长度较小的第二类轮廓,去除所有边缘轮廓中的第一类轮廓和第二类轮廓,从而去除SFR图像中除测试黑块以外其它的边缘轮廓。简言之,本申请实施例的方法通过将边缘轮廓的面积和\或边长,与预设阈值作比较,以去除SFR测试卡图像中过大和过小的边缘轮廓,可以在最大程度上保留测试黑块的边缘轮廓,从而避免非测试黑块边缘轮廓的干扰。Or, in an embodiment, the method of the present application further includes calculating the maximum x-coordinate, the minimum x-coordinate, the maximum y-coordinate, and the minimum y-coordinate of the edge contour point of each test black block, and then the maximum x-coordinate and the minimum x-coordinate are calculated. The x coordinate difference of the coordinates, the first type of contour whose x coordinate difference is greater than the first preset difference threshold and the second type of contour whose x coordinate difference is less than the second preset difference threshold are obtained in all the calculated edges Remove the first-type contour and the second-type contour from the contour, and calculate the y-coordinate difference between the maximum y-coordinate and the minimum y-coordinate to obtain the first-type contour and the y-coordinate difference whose y-coordinate difference is greater than the first preset difference threshold For contours of the second type whose value is less than the second preset difference threshold, the contours of the first type and the second type are removed from all the calculated edge contours. That is, by comparing the side length of the edge contour with the preset threshold, remove the other edge contours except the test black block in the SFR test card image. For example, the edge contour can be a square, and calculate the maximum x coordinate, minimum x coordinate, and The maximum y coordinate and the minimum y coordinate are obtained, and the difference between the x coordinate and the y coordinate is obtained, which is the length of the side of the square, and the first type of contour with the larger side length and the second type of contour with the smaller side length are obtained. Remove the first type contour and the second type contour in all the edge contours, so as to remove the other edge contours in the SFR image except the test black block. In short, the method of the embodiment of the present application compares the area and/or side length of the edge contour with a preset threshold to remove the excessively large and small edge contours in the SFR test card image, which can be retained to the greatest extent Test the edge contour of the black block, so as to avoid the interference of the edge contour of the non-test black block.
在实施例中,本申请实施例的方法在根据边缘轮廓的轮廓点与质心的距离确定测试黑块的顶点坐标之前,还包括,简化边缘轮廓,以获得边缘轮廓中预设数量的轮廓点,也就是使边缘轮廓中所包含的轮廓点的数量小于一定的阈值,以简化边缘轮廓,从而利于快速计算测试黑块的顶点坐标,降低计算量,提高计算效率。In the embodiment, before determining the vertex coordinates of the test black block according to the distance between the contour point of the edge contour and the centroid, the method of the embodiment of the present application further includes simplifying the edge contour to obtain a preset number of contour points in the edge contour. That is, the number of contour points included in the edge contour is smaller than a certain threshold to simplify the edge contour, thereby facilitating rapid calculation of the vertex coordinates of the test black block, reducing the amount of calculation, and improving the calculation efficiency.
在实施例中,测试黑块对应的感兴趣区域包括两种,一种为与SFR测试卡图像的边缘平行的区域,如图3所示;另一种为与测试黑块具有一定角度的感兴趣区域,例如,其中一边与测试黑块的边缘轮廓的斜边基本平行,另一边与测试黑块的边缘轮廓的斜边基本垂直的区域,如图4所示。其中,矩形a代表测试黑块,矩形b代表感兴趣区域In the embodiment, the area of interest corresponding to the test black block includes two types, one is the area parallel to the edge of the SFR test card image, as shown in Figure 3; the other is the sense of a certain angle with the test black block. The region of interest, for example, an area where one side is substantially parallel to the hypotenuse of the edge contour of the test black block, and the other side is substantially perpendicular to the hypotenuse of the edge contour of the test black block, as shown in FIG. 4. Among them, rectangle a represents the test black block, rectangle b represents the region of interest
具体地,对于图3所示的感兴趣区域,本申请实施例可以根据测试黑块的四个顶点坐标计算测试黑块每条边的中心点坐标,进而以中心点坐标为感兴趣区域的对角线中心点,根据设定的感兴趣区域的长宽像素值计算感兴趣区域的顶点坐标,以确定感兴趣区域。Specifically, for the region of interest shown in FIG. 3, the embodiment of the present application can calculate the center point coordinates of each side of the test black block according to the coordinates of the four vertices of the test black block, and then use the center point coordinates as the pair of the region of interest. For the center point of the corner line, the vertex coordinates of the area of interest are calculated according to the set length and width pixel values of the area of interest to determine the area of interest.
或者,可以根据测试黑块的四个顶点坐标计算测试黑块每条边的中心点坐标和轮廓边 长,以及根据轮廓边长以及设定的感兴趣区域的长宽与轮廓边长的比例值,计算感兴趣区域的长宽像素值,进而以中心点坐标为感兴趣区域的对角线中心点,根据设定的感兴趣区域的长宽像素值计算感兴趣区域的顶点坐标,以确定感兴趣区域。Or, you can calculate the center point coordinates and silhouette side length of each side of the test black block according to the four vertices coordinates of the test black block, and according to the silhouette side length and the ratio of the length and width of the set area of interest to the silhouette side length , Calculate the length and width pixel values of the region of interest, and then take the center point coordinates as the diagonal center point of the region of interest, and calculate the vertex coordinates of the region of interest according to the set length and width pixel values of the region of interest to determine the feeling Area of interest.
以及对于图4所示的感兴趣区域,本申请实施例可以根据感兴趣区域的顶点坐标确定感兴趣区域的倾斜角度,并通过调整感兴趣区域的顶点坐标,以使得感兴趣区域的倾斜角度处于预设角度范围例如6°-8°,以满足SFR算法中感兴趣区域的要求。具体地,根据测试黑块的四个顶点坐标计算出每两个顶点所在直线的斜率和所在直线与坐标轴的倾斜角度;求出与所在直线与坐标轴的倾斜角度为预设倾斜角度并经过两个顶点中点的直线方程;以两个顶点中点作为矩形的对角线交点,且以直线方程所得直线作为矩形的一个对边平分线,根据预设的感兴趣区域长宽像素值,求出矩形的四个顶点坐标;根据矩形的顶点坐标截取图像内容,并将图像内容整体旋转一个预设的角度作为感兴趣区域的图像内容。也就是在计算出感兴趣区域的顶点坐标后,确定图3所示的与SFR测试卡图像平行的感兴趣区域,进而通过旋转调整该感兴趣区域,获得图4所示的与测试黑块具有一定角度的感兴趣区域,且使得感兴趣区域在预设角度范围内,满足SFR算法要求。And for the region of interest shown in FIG. 4, the embodiment of the present application can determine the tilt angle of the region of interest according to the coordinates of the apex of the region of interest, and adjust the coordinates of the apex of the region of interest to make the tilt angle of the region of interest at The preset angle range is, for example, 6°-8°, to meet the requirements of the region of interest in the SFR algorithm. Specifically, the slope of the line where each two vertices are located and the inclination angle of the line and the coordinate axis are calculated according to the coordinates of the four vertices of the test black block; the inclination angle of the line and the coordinate axis is calculated as the preset tilt angle and passed The straight line equation of the midpoint of the two vertices; the midpoint of the two vertices is taken as the intersection of the diagonals of the rectangle, and the straight line obtained by the straight line equation is taken as the diagonal bisector of the rectangle, according to the preset length and width pixel values of the region of interest, Find the coordinates of the four vertices of the rectangle; intercept the image content according to the coordinates of the vertices of the rectangle, and rotate the entire image content by a preset angle as the image content of the region of interest. That is, after calculating the vertex coordinates of the region of interest, determine the region of interest parallel to the SFR test card image shown in Figure 3, and then adjust the region of interest through rotation to obtain the black block with the test shown in Figure 4 A region of interest at a certain angle, and the region of interest is within a preset angle range, which meets the requirements of the SFR algorithm.
或者,如果需要感兴趣区域的一边与测试黑块的边缘轮廓的斜边基本平行,另一边与测试黑块的边缘轮廓的斜边基本垂直,即已知感兴趣区域每条边的斜率,本申请实施例也可以根据测试黑块每条边的中心点坐标,以及设定的感兴趣区域的约束值,以及已知的感兴趣区域的每条边的斜率,通过直线方程计算获得感兴趣区域的顶点坐标,以确定感兴趣区域。Or, if one side of the region of interest needs to be substantially parallel to the hypotenuse of the edge contour of the test black block, and the other side is substantially perpendicular to the hypotenuse of the edge contour of the test black block, that is, the slope of each side of the region of interest is known. The application embodiment can also calculate the region of interest based on the coordinates of the center point of each side of the test black block, the set constraint value of the region of interest, and the known slope of each side of the region of interest. The vertex coordinates to determine the area of interest.
需要说明的是,对于设定的感兴趣区域的约束值,即预设的的长宽像素值或者给定的长宽与轮廓边长的比例值,是程序预先设置好的,应使得最终确定的感兴趣区域最大可能地满足SFR算法中感兴趣区域的要求。It should be noted that the constraint value for the set region of interest, that is, the preset length and width pixel value or the ratio value of the given length and width to the contour side length, is preset by the program and should be finalized The region of interest can meet the requirements of the region of interest in the SFR algorithm as much as possible.
本申请第二方面实施例提供的非临时性计算机存储介质,其上存储有计算机程序,其中,计算机程序被执行时实现上述实施例提供的识别SFR测试卡图像中感兴趣区域的方法。The non-temporary computer storage medium provided by the embodiment of the second aspect of the present application has a computer program stored thereon, wherein the computer program is executed to implement the method for identifying the region of interest in the SFR test card image provided by the above embodiment.
本申请第三方面实施例提供的识别SFR测试卡图像中感兴趣区域的装置,如图5所示,本申请实施例的装置1包括显示器2、处理器3以及与处理器通信连接的存储器4。The device for identifying the region of interest in the image of the SFR test card provided by the embodiment of the third aspect of the present application is shown in FIG. .
其中,显示器2用于显示SFR测试卡图像,存储器4存储有可被处理器3执行的指令,该指令被处理器3执行时,处理器3执行上述实施例提供的识别SFR测试卡图像中感兴趣区域的方法。Wherein, the display 2 is used to display the image of the SFR test card, and the memory 4 stores instructions that can be executed by the processor 3. When the instructions are executed by the processor 3, the processor 3 executes the identification of the SFR test card image provided by the above-mentioned embodiment. Method of interest area.
根据本申请实施例的识别SFR测试卡图像中感兴趣区域的装置1,通过处理器3执行 上述实施例提供的识别SFR测试卡图像中感兴趣区域的方法,可以实现SFR测试卡图像中感兴趣区域的自动识别,无需手动精准对齐,且能够避免感兴趣区域坐标计算不准确的问题,提高SFR算法的准确性。According to the device 1 for recognizing the region of interest in the image of the SFR test card according to the embodiment of the present application, the processor 3 executes the method for recognizing the region of interest in the image of the SFR test card provided in the above embodiment, so that the interest in the image of the SFR test card can be realized. The automatic recognition of the region does not require manual and precise alignment, and can avoid the problem of inaccurate calculation of the coordinates of the region of interest, and improve the accuracy of the SFR algorithm.
在本说明书的描述中,流程图中或在此以其他方式描述的任何过程或方法描述可以被理解为,表示包括一个或更多个用于实现定制逻辑功能或过程的步骤的可执行指令的代码的模块、片段或部分,并且本申请的优选实施方式的范围包括另外的实现,其中可以不按所示出或讨论的顺序,包括根据所涉及的功能按基本同时的方式或按相反的顺序,来执行功能,这应被本申请的实施例所属技术领域的技术人员所理解。In the description of this specification, any process or method description in the flowchart or described in other ways herein can be understood as meaning that includes one or more executable instructions for implementing custom logic functions or steps of the process. Modules, fragments, or parts of code, and the scope of the preferred embodiments of the present application includes additional implementations, which may not be in the order shown or discussed, including in a substantially simultaneous manner or in the reverse order according to the functions involved , To perform functions, which should be understood by those skilled in the art to which the embodiments of this application belong.
在流程图中表示或在此以其他方式描述的逻辑和/或步骤,例如,可以被认为是用于实现逻辑功能的可执行指令的定序列表,可以具体实现在任何计算机可读介质中,以供指令执行系统、装置或设备(如基于计算机的系统、包括处理器的系统或其他可以从指令执行系统、装置或设备取指令并执行指令的系统)使用,或结合这些指令执行系统、装置或设备而使用。就本说明书而言,"计算机可读介质"可以是任何可以包含、存储、通信、传播或传输程序以供指令执行系统、装置或设备或结合这些指令执行系统、装置或设备而使用的装置。计算机可读介质的更具体的示例(非穷尽性列表)包括以下:具有一个或多个布线的电连接部(电子装置),便携式计算机盘盒(磁装置),随机存取存储器(RAM),只读存储器(ROM),可擦除可编辑只读存储器(EPROM或闪速存储器),光纤装置,以及便携式光盘只读存储器(CDROM)。另外,计算机可读介质甚至可以是可在其上打印所述程序的纸或其他合适的介质,因为可以例如通过对纸或其他介质进行光学扫描,接着进行编辑、解译或必要时以其他合适方式进行处理来以电子方式获得所述程序,然后将其存储在计算机存储器中。The logic and/or steps represented in the flowchart or described in other ways herein, for example, can be considered as a sequenced list of executable instructions for realizing logic functions, and can be embodied in any computer-readable medium, For use by instruction execution systems, devices, or equipment (such as computer-based systems, systems including processors, or other systems that can fetch and execute instructions from instruction execution systems, devices, or equipment), or combine these instruction execution systems, devices Or equipment. For the purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transmit a program for use by an instruction execution system, device, or device or in combination with these instruction execution systems, devices, or devices. More specific examples (non-exhaustive list) of computer readable media include the following: electrical connections (electronic devices) with one or more wiring, portable computer disk cases (magnetic devices), random access memory (RAM), Read only memory (ROM), erasable and editable read only memory (EPROM or flash memory), fiber optic devices, and portable compact disk read only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program can be printed, because it can be used, for example, by optically scanning the paper or other medium, followed by editing, interpretation, or other suitable media if necessary. The program is processed in a manner to obtain the program electronically, and then stored in the computer memory.
应当理解,本申请的各部分可以用硬件、软件、固件或它们的组合来实现。在上述实施方式中,多个步骤或方法可以用存储在存储器中且由合适的指令执行系统执行的软件或固件来实现。如,如果用硬件来实现和在另一实施方式中一样,可用本领域公知的下列技术中的任一项或他们的组合来实现:具有用于对数据信号实现逻辑功能的逻辑门电路的离散逻辑电路,具有合适的组合逻辑门电路的专用集成电路,可编程门阵列(PGA),现场可编程门阵列(FPGA)等。It should be understood that each part of this application can be implemented by hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if it is implemented by hardware as in another embodiment, it can be implemented by any one or a combination of the following technologies known in the art: Discrete logic gate circuits with logic functions for data signals Logic circuits, application specific integrated circuits with suitable combinational logic gates, programmable gate array (PGA), field programmable gate array (FPGA), etc.
本技术领域的普通技术人员可以理解实现上述实施例方法携带的全部或部分步骤是可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,该程序在执行时,包括方法实施例的步骤之一或其组合。A person of ordinary skill in the art can understand that all or part of the steps carried in the method of the foregoing embodiments can be implemented by a program instructing relevant hardware to complete. The program can be stored in a computer-readable storage medium. When executed, it includes one of the steps of the method embodiment or a combination thereof.
此外,在本申请各个实施例中的各功能单元可以集成在一个处理模块中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。所述集成的模块如果以软件功能模块的形式实现并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中。In addition, the functional units in the various embodiments of the present application may be integrated into one processing module, or each unit may exist alone physically, or two or more units may be integrated into one module. The above-mentioned integrated modules can be implemented in the form of hardware or software functional modules. If the integrated module is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer readable storage medium.
上述提到的存储介质可以是只读存储器,磁盘或光盘等。尽管上面已经示出和描述了本申请的实施例,可以理解的是,上述实施例是示例性的,不能理解为对本申请的限制,本领域的普通技术人员在本申请的范围内可以对上述实施例进行变化、修改、替换和变型。The aforementioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it can be understood that the above-mentioned embodiments are exemplary and should not be construed as limiting the present application. A person of ordinary skill in the art can comment on the foregoing within the scope of the present application. The embodiment undergoes changes, modifications, substitutions, and modifications.
在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、“示意性实施例”、“示例”、“具体示例”、或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本发明的至少一个实施例或示例中。在本说明书中,对上述术语的示意性表述不一定指的是相同的实施例或示例。而且,描述的具体特征、结构、材料或者特点可以在任何的一个或多个实施例或示例中以合适的方式结合。In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "exemplary embodiments", "examples", "specific examples", or "some examples" etc. means to incorporate the implementation The specific features, structures, materials or characteristics described by the examples or examples are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above-mentioned terms do not necessarily refer to the same embodiment or example. Moreover, the described specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
尽管已经示出和描述了本发明的实施例,本领域的普通技术人员可以理解:在不脱离本发明的原理和宗旨的情况下可以对这些实施例进行多种变化、修改、替换和变型,本发明的范围由权利要求及其等同物限定。Although the embodiments of the present invention have been shown and described, those of ordinary skill in the art can understand that various changes, modifications, substitutions and modifications can be made to these embodiments without departing from the principle and purpose of the present invention. The scope of the present invention is defined by the claims and their equivalents.

Claims (11)

  1. 一种识别SFR测试卡图像中感兴趣区域的方法,其特征在于,包括:A method for identifying a region of interest in an image of an SFR test card, which is characterized in that it includes:
    获取SFR测试卡图像;Obtain the image of the SFR test card;
    计算出所述SFR测试卡图像中测试黑块的边缘轮廓;Calculate the edge contour of the test black block in the SFR test card image;
    计算所述边缘轮廓的质心坐标;Calculating the centroid coordinates of the edge contour;
    根据所述边缘轮廓的轮廓点与质心的距离确定所述测试黑块的顶点坐标;Determine the vertex coordinates of the test black block according to the distance between the contour point of the edge contour and the center of mass;
    根据所述测试黑块的顶点坐标和设定的感兴趣区域的约束值确定所述感兴趣区域。The region of interest is determined according to the vertex coordinates of the test black block and the set constraint value of the region of interest.
  2. 根据权利要求1所述的识别SFR测试卡图像中感兴趣区域的方法,其特征在于,在计算出所述SFR测试卡图像中测试黑块的边缘轮廓之前,所述方法还包括:对所述SFR测试卡图像进行灰度化和二值化处理。The method for identifying the region of interest in the SFR test card image according to claim 1, wherein before calculating the edge contour of the test black block in the SFR test card image, the method further comprises: checking the The SFR test card image is grayed and binarized.
  3. 根据权利要求1或2所述的识别SFR测试卡图像中感兴趣区域的方法,其特征在于,在计算出所述SFR测试卡图像中测试黑块的边缘轮廓之后,所述方法还包括:The method for identifying the region of interest in the SFR test card image according to claim 1 or 2, wherein after calculating the edge contour of the test black block in the SFR test card image, the method further comprises:
    计算所述边缘轮廓包围的面积;Calculating the area enclosed by the edge contour;
    获得面积大于第一预设面积阈值的第一类轮廓和面积小于第二预设面积阈值的第二类轮廓;Obtaining a first-type contour with an area larger than a first preset area threshold and a second-type contour with an area smaller than a second preset area threshold;
    在所述计算出的所有所述边缘轮廓中去除所述第一类轮廓和所述第二类轮廓。Remove the first-type contour and the second-type contour from all the calculated edge contours.
  4. 根据权利要求1或2所述的识别SFR测试卡图像中感兴趣区域的方法,其特征在于,在计算出所述SFR测试卡图像中测试黑块的边缘轮廓之后,所述方法还包括:The method for identifying the region of interest in the SFR test card image according to claim 1 or 2, wherein after calculating the edge contour of the test black block in the SFR test card image, the method further comprises:
    计算每个所述测试黑块的边缘轮廓点中最大x坐标、最小x坐标、最大y坐标和最小y坐标;Calculating the maximum x coordinate, the minimum x coordinate, the maximum y coordinate and the minimum y coordinate among the edge contour points of each test black block;
    计算所述最大x坐标与所述最小x坐标的x坐标差值,获得所述x坐标差值大于第一预设差值阈值的第一类轮廓和所述x坐标差值小于第二预设差值阈值的第二类轮廓,在所述计算出的所有边缘轮廓中去除所述第一类轮廓和所述第二类轮廓;Calculate the x coordinate difference between the maximum x coordinate and the minimum x coordinate to obtain a first type of contour whose x coordinate difference is greater than a first preset difference threshold and the x coordinate difference is less than a second preset A second-type contour of a difference threshold, removing the first-type contour and the second-type contour from all the calculated edge contours;
    计算所述最大y坐标与所述最小y坐标的y坐标差值,获得所述y坐标差值大于第一预设差值阈值的第一类轮廓和所述y坐标差值小于第二预设差值阈值的第二类轮廓,在所述计算出的所有边缘轮廓中去除所述第一类轮廓和所述第二类轮廓。Calculate the y-coordinate difference between the maximum y-coordinate and the minimum y-coordinate to obtain a first type of contour whose y-coordinate difference is greater than a first preset difference threshold and the y-coordinate difference is less than a second preset The second-type contour of the difference threshold is used to remove the first-type contour and the second-type contour from all the calculated edge contours.
  5. 根据权利要求1所述的识别SFR测试卡图像中感兴趣区域的方法,其特征在于,根据所述边缘轮廓的轮廓点与质心的距离确定所述测试黑块的顶点坐标,包括步骤:The method for recognizing a region of interest in an image of an SFR test card according to claim 1, wherein determining the vertex coordinates of the test black block according to the distance between the contour point of the edge contour and the center of mass comprises the steps of:
    计算所述边缘轮廓中两两轮廓点之间的距离;Calculating the distance between two contour points in the edge contour;
    从所述边缘轮廓中选取距离最小的两个轮廓点,并计算两个所述轮廓点与所述质心的距离,从所述边缘轮廓的轮廓点中去除两个所述轮廓点中与所述质心距离小的一个轮廓点,重复本步骤,直至所述边缘轮廓中剩余四个轮廓点;Select the two contour points with the smallest distance from the edge contour, calculate the distance between the two contour points and the centroid, and remove the two contour points from the contour points of the edge contour. For a contour point with a smaller centroid distance, repeat this step until there are four contour points remaining in the edge contour;
    将所述剩余四个轮廓点的坐标作为所述测试黑块的四个顶点坐标。The coordinates of the remaining four contour points are used as the coordinates of the four vertices of the test black block.
  6. 根据权利要求5所述的识别SFR测试卡图像中感兴趣区域的方法,其特征在于,在根据所述边缘轮廓的轮廓点与质心的距离确定所述测试黑块的顶点坐标之前,所述方法还包括:简化所述边缘轮廓,以获得所述边缘轮廓中预设数量的轮廓点。The method for identifying the region of interest in the SFR test card image according to claim 5, characterized in that, before determining the vertex coordinates of the test black block according to the distance between the contour point of the edge contour and the centroid, the method It also includes: simplifying the edge contour to obtain a preset number of contour points in the edge contour.
  7. 根据权利要求5所述的识别SFR测试卡图像中感兴趣区域的方法,其特征在于,根据所述测试黑块的顶点坐标和设定的感兴趣区域的约束值确定所述感兴趣区域,包括步骤:The method for identifying a region of interest in an image of an SFR test card according to claim 5, wherein determining the region of interest according to the vertex coordinates of the test black block and the set constraint value of the region of interest includes step:
    根据所述测试黑块的四个顶点坐标计算所述测试黑块每条边的中心点坐标;Calculating the coordinates of the center point of each side of the test black block according to the coordinates of the four vertices of the test black block;
    以所述中心点坐标为所述感兴趣区域的对角线中心点,根据设定的所述感兴趣区域的长宽像素值计算所述感兴趣区域的顶点坐标。Using the center point coordinates as the diagonal center point of the region of interest, the vertex coordinates of the region of interest are calculated according to the set length and width pixel values of the region of interest.
  8. 根据权利要求5所述的识别SFR测试卡图像中感兴趣区域的方法,其特征在于,根据所述测试黑块的顶点坐标和设定的感兴趣区域的约束值确定所述感兴趣区域,包括步骤:The method for identifying a region of interest in an image of an SFR test card according to claim 5, wherein determining the region of interest according to the vertex coordinates of the test black block and the set constraint value of the region of interest includes step:
    根据所述测试黑块的四个顶点坐标计算所述测试黑块每条边的中心点坐标和轮廓边长;Calculating the coordinates of the center point and the contour side length of each side of the test black block according to the coordinates of the four vertices of the test black block;
    根据所述轮廓边长、设定的所述感兴趣区域的长宽与所述轮廓边长的比例值,计算所述感兴趣区域的长宽像素值;Calculating the pixel value of the length and width of the region of interest according to the side length of the contour and the set ratio of the length and width of the region of interest to the side length of the contour;
    以所述中心点坐标为所述感兴趣区域的对角线中心点,根据设定的所述感兴趣区域的长宽像素值计算所述感兴趣区域的顶点坐标。Using the center point coordinates as the diagonal center point of the region of interest, the vertex coordinates of the region of interest are calculated according to the set length and width pixel values of the region of interest.
  9. 根据权利要求5所述的识别SFR测试卡图像中感兴趣区域的方法,其特征在于,根据所述测试黑块的顶点坐标和设定的感兴趣区域的约束值确定所述感兴趣区域,包括步骤:The method for identifying a region of interest in an image of an SFR test card according to claim 5, wherein determining the region of interest according to the vertex coordinates of the test black block and the set constraint value of the region of interest includes step:
    根据所述测试黑块的四个顶点坐标计算出每两个顶点所在直线的斜率和所述所在直线与坐标轴的倾斜角度;Calculating the slope of the line where each two vertices are located and the inclination angle of the line and the coordinate axis according to the coordinates of the four vertices of the test black block;
    求出与所述所在直线与坐标轴的倾斜角度为预设倾斜角度并经过两个顶点中点的直线方程;Finding a straight line equation that is a preset inclination angle and passes through the midpoint of the two vertices;
    以所述两个顶点中点作为矩形的对角线交点,且以所述直线方程所得直线作为矩形的一个对边平分线,根据预设的感兴趣区域长宽像素值,求出所述矩形的四个顶点坐标;The midpoint of the two vertices is taken as the intersection of the diagonals of the rectangle, and the straight line obtained by the straight line equation is taken as a diagonal bisector of the rectangle, and the rectangle is obtained according to the preset length and width pixel values of the region of interest. The coordinates of the four vertices;
    根据所述矩形的顶点坐标截取图像内容,并将所述图像内容整体旋转一个预设的角度作为所述感兴趣区域的图像内容。The image content is intercepted according to the coordinates of the vertices of the rectangle, and the image content is rotated as a whole by a preset angle as the image content of the region of interest.
  10. 一种非临时性计算机存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被执行时实现权利要求1-9任一项所述的识别SFR测试卡图像中感兴趣区域的方法。A non-temporary computer storage medium with a computer program stored thereon, wherein the computer program implements the method for identifying a region of interest in an image of an SFR test card according to any one of claims 1-9 when the computer program is executed .
  11. 一种识别SFR测试卡图像中感兴趣区域的装置,其特征在于,包括:A device for identifying a region of interest in an image of an SFR test card, which is characterized in that it comprises:
    显示器,用于显示SFR测试卡图像;Display, used to display SFR test card image;
    处理器以及与所述处理器通信连接的存储器;其中,A processor and a memory communicatively connected with the processor; wherein,
    所述存储器存储有可被所述处理器执行的指令,所述指令被所述处理器执行时,使所述处理器执行权利要求1-9任一项所述的识别SFR测试卡图像中感兴趣区域的方法。The memory stores instructions that can be executed by the processor, and when the instructions are executed by the processor, the processor executes the recognition of the SFR test card image according to any one of claims 1-9. Method of interest area.
PCT/CN2020/082153 2020-03-30 2020-03-30 Method and device for identifying region of interest in sfr test chart image, and medium WO2021195873A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/082153 WO2021195873A1 (en) 2020-03-30 2020-03-30 Method and device for identifying region of interest in sfr test chart image, and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/082153 WO2021195873A1 (en) 2020-03-30 2020-03-30 Method and device for identifying region of interest in sfr test chart image, and medium

Publications (1)

Publication Number Publication Date
WO2021195873A1 true WO2021195873A1 (en) 2021-10-07

Family

ID=77927095

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/082153 WO2021195873A1 (en) 2020-03-30 2020-03-30 Method and device for identifying region of interest in sfr test chart image, and medium

Country Status (1)

Country Link
WO (1) WO2021195873A1 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113902894A (en) * 2021-10-26 2022-01-07 中国人民解放军火箭军工程大学 Strip type level meter automatic reading identification method based on image processing
CN114943769A (en) * 2022-07-26 2022-08-26 广州镭晨智能装备科技有限公司 Positioning method, positioning device, electronic equipment and medium
CN116150829A (en) * 2023-02-08 2023-05-23 珠海美华医疗科技有限公司 Design method of trace drug sensitive test card with S-shaped flow channel
CN118334499A (en) * 2024-06-12 2024-07-12 广东朝歌智慧互联科技有限公司 Method and device for calculating SFR image resolving capability of camera and computer storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2933777A1 (en) * 2014-04-17 2015-10-21 amberMind Three dimensional modeling
CN105321169A (en) * 2014-05-31 2016-02-10 苹果公司 Method and system for a single frame camera module active alignment tilt correction
KR20160088814A (en) * 2015-01-16 2016-07-26 오인환 Conversion Method For A 2D Image to 3D Graphic Models
CN106846352A (en) * 2016-12-30 2017-06-13 歌尔科技有限公司 A kind of edge of a knife image acquisition method and device for camera lens parsing power test
CN109977833A (en) * 2019-03-19 2019-07-05 网易(杭州)网络有限公司 Object tracking method, object tracking device, storage medium and electronic equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2933777A1 (en) * 2014-04-17 2015-10-21 amberMind Three dimensional modeling
CN105321169A (en) * 2014-05-31 2016-02-10 苹果公司 Method and system for a single frame camera module active alignment tilt correction
KR20160088814A (en) * 2015-01-16 2016-07-26 오인환 Conversion Method For A 2D Image to 3D Graphic Models
CN106846352A (en) * 2016-12-30 2017-06-13 歌尔科技有限公司 A kind of edge of a knife image acquisition method and device for camera lens parsing power test
CN109977833A (en) * 2019-03-19 2019-07-05 网易(杭州)网络有限公司 Object tracking method, object tracking device, storage medium and electronic equipment

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113902894A (en) * 2021-10-26 2022-01-07 中国人民解放军火箭军工程大学 Strip type level meter automatic reading identification method based on image processing
CN113902894B (en) * 2021-10-26 2024-05-31 中国人民解放军火箭军工程大学 Automatic reading identification method for strip level based on image processing
CN114943769A (en) * 2022-07-26 2022-08-26 广州镭晨智能装备科技有限公司 Positioning method, positioning device, electronic equipment and medium
CN116150829A (en) * 2023-02-08 2023-05-23 珠海美华医疗科技有限公司 Design method of trace drug sensitive test card with S-shaped flow channel
CN116150829B (en) * 2023-02-08 2023-11-24 珠海美华医疗科技有限公司 Design method of trace drug sensitive test card with S-shaped flow channel
CN118334499A (en) * 2024-06-12 2024-07-12 广东朝歌智慧互联科技有限公司 Method and device for calculating SFR image resolving capability of camera and computer storage medium

Similar Documents

Publication Publication Date Title
WO2021195873A1 (en) Method and device for identifying region of interest in sfr test chart image, and medium
CN111243032B (en) Full-automatic detection method for checkerboard corner points
US8385657B2 (en) Multiscale edge detection and fiber enhancement using differences of oriented means
RU2653461C2 (en) Glare detection in the image data frame
CN110930390B (en) Chip pin missing detection method based on semi-supervised deep learning
WO2017020829A1 (en) Resolution testing method and resolution testing device
TWI765442B (en) Method for defect level determination and computer readable storage medium thereof
CN115205223B (en) Visual inspection method and device for transparent object, computer equipment and medium
CN108918093B (en) Optical filter mirror surface defect detection method and device and terminal equipment
CN109948521B (en) Image deviation rectifying method and device, equipment and storage medium
CN113762253B (en) Speckle extraction method and device, electronic device and storage medium
CN111259891B (en) Method, device, equipment and medium for identifying identity card in natural scene
CN113283439B (en) Intelligent counting method, device and system based on image recognition
US20230177680A1 (en) Assay reading method
CN117152165B (en) Photosensitive chip defect detection method and device, storage medium and electronic equipment
US10395090B2 (en) Symbol detection for desired image reconstruction
CN112419207A (en) Image correction method, device and system
US11216905B2 (en) Automatic detection, counting, and measurement of lumber boards using a handheld device
CN115761270A (en) Color card detection method and device, electronic equipment and storage medium
CN113076952B (en) Text automatic recognition and enhancement method and device
CN110288040A (en) A kind of similar evaluation method of image based on validating topology and equipment
CN113822927A (en) Face detection method, device, medium and equipment suitable for weak-quality images
WO2020168818A1 (en) Image processing method, system and device, storage medium, and blackboard device
CN111062984A (en) Method, device and equipment for measuring area of video image region and storage medium
CN113469171A (en) Method, device and medium for identifying interest area in SFR test card image

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: 20928583

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: 20928583

Country of ref document: EP

Kind code of ref document: A1