CN115374517A - Testing method and device for wiring software, electronic equipment and storage medium - Google Patents

Testing method and device for wiring software, electronic equipment and storage medium Download PDF

Info

Publication number
CN115374517A
CN115374517A CN202211015205.8A CN202211015205A CN115374517A CN 115374517 A CN115374517 A CN 115374517A CN 202211015205 A CN202211015205 A CN 202211015205A CN 115374517 A CN115374517 A CN 115374517A
Authority
CN
China
Prior art keywords
difference
test
images
pixel points
subset
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211015205.8A
Other languages
Chinese (zh)
Inventor
李成龙
单晔
柴玉娜
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beike Technology Co Ltd
Original Assignee
Beike Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beike Technology Co Ltd filed Critical Beike Technology Co Ltd
Priority to CN202211015205.8A priority Critical patent/CN115374517A/en
Publication of CN115374517A publication Critical patent/CN115374517A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/10Geometric CAD
    • G06F30/13Architectural design, e.g. computer-aided architectural design [CAAD] related to design of buildings, bridges, landscapes, production plants or roads
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/10Geometric CAD
    • G06F30/18Network design, e.g. design based on topological or interconnect aspects of utility systems, piping, heating ventilation air conditioning [HVAC] or cabling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/20Design optimisation, verification or simulation
    • G06F30/27Design optimisation, verification or simulation using machine learning, e.g. artificial intelligence, neural networks, support vector machines [SVM] or training a model
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/74Image or video pattern matching; Proximity measures in feature spaces
    • G06V10/75Organisation of the matching processes, e.g. simultaneous or sequential comparisons of image or video features; Coarse-fine approaches, e.g. multi-scale approaches; using context analysis; Selection of dictionaries
    • G06V10/758Involving statistics of pixels or of feature values, e.g. histogram matching
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/764Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2111/00Details relating to CAD techniques
    • G06F2111/20Configuration CAD, e.g. designing by assembling or positioning modules selected from libraries of predesigned modules
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2113/00Details relating to the application field
    • G06F2113/16Cables, cable trees or wire harnesses

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Evolutionary Computation (AREA)
  • Geometry (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Computer Hardware Design (AREA)
  • Artificial Intelligence (AREA)
  • Medical Informatics (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Mathematical Analysis (AREA)
  • Databases & Information Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Multimedia (AREA)
  • Pure & Applied Mathematics (AREA)
  • Computational Mathematics (AREA)
  • Computing Systems (AREA)
  • Mathematical Optimization (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Architecture (AREA)
  • Civil Engineering (AREA)
  • Structural Engineering (AREA)
  • Image Processing (AREA)

Abstract

The embodiment of the disclosure discloses a testing method and device of wiring software, electronic equipment and a storage medium, wherein the method comprises the following steps: respectively inputting a test case and at least one drawing visual angle in a reference environment and a test environment to obtain at least one group of reference images and test images, wherein the group of reference images and the test images correspond to a wiring rule; responding to the difference existing in the at least one group of reference images and the test images, and determining difference pixel points of the at least one group of reference images and the test images; classifying the difference pixel points according to a nearest neighbor algorithm to obtain at least one difference area; and visually displaying the at least one difference area. The embodiment of the disclosure can realize the automation of the test of the wiring software based on the image processing technology, and solves the problem of extremely high test cost caused by manual test verification of each wiring rule.

Description

Testing method and device for wiring software, electronic equipment and storage medium
Technical Field
The disclosure relates to the technical field of intelligent decoration, and in particular to a testing method and device for wiring software, electronic equipment and a storage medium.
Background
In the existing indoor decoration field, the wiring layout of the hydropower is mainly executed by constructors according to experience, so that the quality of the hydropower wiring is seriously dependent on the constructors, and the problems of unreasonable wiring layout, low wiring layout efficiency and the like can occur.
In order to solve the problems in the prior art, a wiring application program is generated at the same time, and the wiring application program can automatically generate the wiring layout of water and electricity through a built-in wiring rule. Because the number of the wiring rules is dozens of, in a scenario that a regression test is needed, such as function iteration of a wiring application program, manual test verification needs to be performed on each rule, so that the test cost is extremely high, the test time is extremely long, and further the project release time may be delayed.
Disclosure of Invention
One technical problem to be solved by the embodiments of the present disclosure is: a method and a device for testing wiring software, electronic equipment and a storage medium are provided, and automatic testing of the wiring software is realized.
According to an aspect of an embodiment of the present disclosure, there is provided a method for testing wiring software, the method including:
respectively inputting a test case and at least one drawing view angle in a reference environment and a test environment to obtain at least one group of reference images and test images, wherein the group of reference images and the test images correspond to a wiring rule;
responding to the difference between the at least one group of reference images and the test images, and determining difference pixel points of the at least one group of reference images and the test images;
classifying the difference pixel points according to a nearest neighbor algorithm to obtain at least one difference area;
and visually displaying the at least one difference area.
In an embodiment of the present disclosure, the visually displaying the at least one difference region includes:
determining at least one group of reference images with difference areas and wiring rules to be rectified corresponding to the test images;
and outputting the wiring rule to be corrected, a reference image corresponding to the wiring rule to be corrected and a test image marked with the at least one difference area.
In another embodiment of the present disclosure, the classifying the difference pixel points according to a nearest neighbor algorithm to obtain at least one difference region includes:
performing noise point filtering on all difference pixel points existing in the at least one group of reference images and the test images to obtain difference pixel sets, wherein one difference pixel set records the difference pixel points of one group of reference images and the test images;
dividing the difference pixel set into at least one sub-set, wherein the distance between any pixel points in one sub-set is not more than a set distance;
determining the coordinate extreme values of all the difference pixel points in the at least one subset; the coordinate extreme value is the minimum coordinate value in the left and lower directions and the maximum coordinate value in the right and upper directions of all the difference pixel points in the corresponding subset;
and determining at least one difference area corresponding to the at least one subset based on the coordinate extreme value, wherein each subset corresponds to one difference area.
In another embodiment of the present disclosure, the dividing the difference pixel set into at least one subset includes:
taking out a pixel point from the at least one difference pixel set;
when the existing subset does not exist, the extracted pixel points are placed into a new subset;
when the existing subset exists, calculating the distance between the extracted pixel point and the pixel point in the existing subset;
based on the distance between the pixel point and the pixel point in the existing sub-set, putting the pixel point into the corresponding existing sub-set or putting the pixel point into a new sub-set;
and executing the step of taking out a pixel point from the at least one difference pixel set until the at least one difference pixel set becomes an empty set.
In another embodiment of the present disclosure, the placing the extracted pixel point into a corresponding existing subset, or into a new subset, includes:
in response to the existing subset with the distance between the pixel points and the extracted pixel points not larger than the set threshold, the extracted pixel points are placed into the existing subset with the distance between the pixel points and the existing subset not larger than the set threshold;
and in response to the fact that the distances between the extracted pixel points and the pixel points in the existing sub-set are larger than the set threshold value, placing the extracted pixel points into a new sub-set.
In another embodiment of the present disclosure, the method further comprises:
and when the at least one group of reference images and the test images have no difference, outputting prompt information that the wiring rules corresponding to the at least one group of reference images and the test images pass the test.
In another embodiment of the present disclosure, before determining the differential pixel points of the at least one set of the reference image and the test image, the method further comprises:
performing gray scale processing on the at least one group of reference images and the test images;
performing binary processing on at least one group of reference images and test images subjected to gray level processing;
the determining the difference pixel points of the at least one group of reference images and the test images comprises:
and determining difference pixel points of at least one group of reference images and test images after binary processing.
According to still another aspect of the embodiments of the present disclosure, there is provided a test apparatus of wiring software, the apparatus including:
the image acquisition module is used for respectively inputting a test case and at least one drawing view angle in a reference environment and a test environment to obtain at least one group of reference images and test images, wherein the group of reference images and the test images correspond to a wiring rule;
the difference pixel determining module is used for responding to the difference between the at least one group of reference images and the test images and determining difference pixel points of the at least one group of reference images and the test images;
the difference region determining module is used for classifying the difference pixel points according to a nearest neighbor algorithm to obtain at least one difference region;
and the display module is used for visually displaying the at least one difference area.
In one embodiment of the present disclosure, the display module comprises:
the rule determining submodule is used for determining at least one group of standard images with difference areas and wiring rules to be rectified corresponding to the test images;
and the output sub-module is used for outputting the wiring rule to be corrected, a reference image corresponding to the wiring rule to be corrected and a test image marked with the at least one difference area.
In another embodiment of the present disclosure, the difference region determining module includes:
the noise filtering submodule is used for filtering noise points of all difference pixel points existing in the at least one group of reference images and the test images to obtain difference pixel sets, wherein one difference pixel set records the difference pixel points of one group of reference images and the test images;
the dividing submodule is used for dividing the difference pixel set into at least one subset, wherein the distance between any pixel points in one subset is not more than a set distance;
an extreme value determining submodule, configured to determine a coordinate extreme value of all the difference pixel points in the at least one subset; the coordinate extreme value is the minimum coordinate value in the left and lower directions and the maximum coordinate value in the right and upper directions of all the difference pixel points in the corresponding subset;
and the region determining submodule is used for determining at least one difference region corresponding to the at least one subset based on the coordinate extreme value, and each subset corresponds to one difference region.
In another embodiment of the present disclosure, the dividing sub-module includes:
the pixel extracting submodule is used for extracting a pixel point from the at least one difference pixel set;
the first embedding submodule is used for embedding the taken pixel points into a new subset when the existing subset does not exist;
the distance calculation submodule is used for calculating the distance between the extracted pixel point and the pixel point in the existing subset when the existing subset exists;
the second embedding submodule is used for embedding the extracted pixel points into the corresponding existing subset or a new subset based on the distance between the extracted pixel points and the pixel points in the existing subset;
the pixel extraction submodule is configured to execute the step of extracting a pixel point from the at least one difference pixel set until the at least one difference pixel set becomes an empty set.
In another embodiment of the present disclosure, the second embedding submodule is specifically configured to, in response to that there is an existing subset whose distance to the fetched pixel point is not greater than a set threshold, embed the fetched pixel point into the existing subset whose distance to the fetched pixel point is not greater than the set threshold; and in response to the fact that the distances between the extracted pixel points and the pixel points in the existing sub-set are larger than the set threshold value, placing the extracted pixel points into a new sub-set.
In another embodiment of the present disclosure, the apparatus further comprises:
and the test passing module is used for outputting prompt information that the wiring rule corresponding to the at least one group of reference images and the test images passes the test when the at least one group of reference images and the test images are not different.
In another embodiment of the present disclosure, the apparatus further comprises:
the gray processing module is used for carrying out gray processing on the at least one group of reference images and the test images;
the binary processing module is used for carrying out binary processing on at least one group of reference images and test images subjected to gray processing;
the difference pixel determining module is specifically configured to determine difference pixel points of at least one group of reference images and test images after binary processing.
According to still another aspect of the embodiments of the present disclosure, there is provided an electronic apparatus including:
a memory for storing a computer product;
and the processor is used for executing the computer product stored in the memory, and when the computer product is executed, the testing method of the wiring software is realized.
According to still another aspect of the embodiments of the present disclosure, there is provided a computer-readable storage medium having stored thereon computer instructions, which, when executed by a processor, implement the method for testing the wiring software described above.
According to still another aspect of the embodiments of the present disclosure, there is provided a computer program product including computer program instructions, wherein the computer program instructions, when executed by a processor, implement the method for testing wiring software described above.
Based on the testing method and device of the wiring software, the electronic equipment and the storage medium provided by the embodiment of the disclosure, at least one group of reference images and at least one group of test images are obtained by respectively inputting test cases and at least one drawing view angle in a reference environment and a test environment; then determining difference pixel points of the at least one group of reference images and the test images; classifying the difference pixel points according to a nearest neighbor algorithm to obtain at least one difference area; and visually displaying the at least one difference area. The method and the device for testing the wiring software can automatically determine whether the reference image and the test image have different pixels based on the image processing technology, and then test of the wiring software is completed.
The technical solution of the present disclosure is further described in detail by the accompanying drawings and examples.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and together with the description, serve to explain the principles of the disclosure.
The present disclosure may be more clearly understood from the following detailed description, taken with reference to the accompanying drawings, in which:
FIG. 1 is a flow chart of one embodiment of a testing method of wiring software of the present disclosure;
FIG. 2A is a flow chart of a method for testing wiring software to determine a difference region according to the present disclosure;
FIG. 2B is a schematic diagram of a differential pixel determination method for testing wiring software according to the present disclosure;
FIG. 2C is a schematic diagram of the testing method of wiring software of the present disclosure before determining a difference region;
FIG. 2D is a schematic diagram of the testing method of the wiring software of the present disclosure after determining the difference region;
fig. 2E is a schematic diagram of a visual display test result of the testing method of the wiring software according to the present disclosure;
FIG. 2F is a flow chart of a method of testing wiring software of the present disclosure for classifying difference pixels;
FIG. 3 is a flow chart of yet another embodiment of a testing method of wiring software of the present disclosure;
FIG. 4 is a schematic structural diagram of one embodiment of a testing device for wiring software according to the present disclosure;
FIG. 5 is a schematic structural diagram of a testing device for wiring software according to yet another embodiment of the present disclosure;
FIG. 6 is a schematic structural diagram of a testing device for wiring software according to yet another embodiment of the present disclosure;
fig. 7 is a block diagram of an electronic device according to an exemplary embodiment of the disclosure.
Detailed Description
Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. It should be noted that: the relative arrangement of the components and steps, the numerical expressions, and numerical values set forth in these embodiments do not limit the scope of the present disclosure unless specifically stated otherwise.
Meanwhile, it should be understood that the sizes of the respective portions shown in the drawings are not drawn in an actual proportional relationship for the convenience of description.
The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the disclosure, its application, or uses.
Techniques, methods, and apparatus known to those of ordinary skill in the relevant art may not be discussed in detail but are intended to be part of the specification where appropriate.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, further discussion thereof is not required in subsequent figures.
The disclosed embodiments may be applied to electronic devices such as computer systems/servers, which are operational with numerous other general purpose or special purpose computing system environments or configurations. Examples of well known computing systems, environments, and/or configurations that may be suitable for use with electronic devices, such as computer systems/servers, include, but are not limited to: personal computer systems, server computer systems, thin clients, thick clients, hand-held or laptop devices, microprocessor-based systems, set top boxes, programmable consumer electronics, network pcs, minicomputer systems, mainframe computer systems, distributed cloud computing environments that include any of the above systems, and the like.
The electronic device, such as a computer system/server, may be described in the general context of computer system-executable instructions, such as program modules, being executed by a computer system. Generally, program modules may include routines, programs, objects, components, logic, data structures, etc. that perform particular tasks or implement particular abstract data types. The computer system/server may be practiced in distributed cloud computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed cloud computing environment, program modules may be located in both local and remote computer system storage media including memory storage devices.
Summary of the disclosure
The technical scheme provided by the embodiment of the disclosure is used in the field of testing of wiring software, wherein the wiring rules built in the wiring software are very many, in a scene where the testing of the wiring software is required, in order to realize the automatic testing of all the wiring rules of the wiring software, a plurality of test cases and the drawing view angle corresponding to each test case can be prepared in advance, and one reference image obtained under the corresponding drawing view angle of the test case corresponds to one wiring rule. Therefore, the corresponding reference image and the corresponding test image are respectively obtained in the reference environment and the test environment under the same drawing view angle, and then image recognition is carried out through an image processing technology, so that whether wrong wiring rule codes exist in the test environment or not can be determined, cause positioning can be rapidly carried out, and the problems of high test cost and long test time of carrying out manual test verification on each wiring rule are solved.
Exemplary embodiments
FIG. 1 is a flow chart of one embodiment of a testing method of wiring software of the present disclosure; the testing method of the wiring software can be applied to electronic devices (such as testing equipment of the wiring software, a computer system, etc.), in the embodiment of the present disclosure, a server is taken as an example for illustration, and as shown in fig. 1, the testing method of the wiring software includes the following steps:
in step 101, a test case and at least one drawing view angle are respectively input in a reference environment and a test environment, so as to obtain at least one group of reference image and test image, wherein the group of reference image and test image correspond to a wiring rule.
In an embodiment, the mapping view angle refers to a view angle at which the reference image and the test image are acquired, and the reference image and the test image need to be acquired under the same mapping view angle in the reference environment and the test environment, respectively. After a test case is executed to obtain a wiring result, a preset drawing view angle can be adopted to obtain a reference image and a test image from the wiring result, and a group of the reference image and the test image obtained at each drawing view angle corresponds to a wiring rule.
In an embodiment, since one test case cannot generally cover dozens of wiring rules built in the wiring software, the number of the test cases is generally more than one, and the wiring rules and the corresponding drawing view angles which can be used by each test case can be preset.
In one embodiment, the routing rules may include a position-type routing rule and an avoidance-type routing rule, the position-type routing rule emphasizes the distance or relative position between a line and a line, between a line and a wall; the avoidance-type routing rule emphasizes the relative positions (up and down positions) of the lines when different lines cross.
In step 102, in response to the difference between the at least one set of reference image and the test image, difference pixel points of the at least one set of reference image and the test image are determined.
In one embodiment, for each set of the reference image and the test image, whether there are pixels with differences in the reference image and the test image can be determined through image difference identification.
In an embodiment, before performing difference identification on the reference image and the test image, gray processing and binary processing may be performed on the reference image and the test image in sequence. Among them, since an image usually includes three color channels of red, green, and blue, and an image subjected to graying is changed from three channels to a single channel, data processing of the single channel is much simpler, and thus, the image can be subjected to graying first. Common gray scale algorithms include an average value method, an eye perception method, a saturation tendency algorithm and the like, and any gray scale algorithm can be adopted without limiting the gray scale processing algorithm in the embodiment of the disclosure.
In an embodiment, the image subjected to the gray scale processing essentially stores an integer two-dimensional array with a numerical range of [0 to 255], and after the gray scale image is subjected to binarization processing, a binarized image reflecting the whole and local features of the image can be obtained, so that not only is the data amount further reduced, but also the basic contour features of the image can be seen.
In an embodiment, the binary processed image is essentially an integer two-dimensional array with a value of 0 or 1, where 0 represents black and 1 represents white, and pixels at corresponding positions of the binary processed reference image and the test image are subjected to an exclusive or operation, so as to identify pixels with differences in the image, see fig. 2B, and a schematic diagram of determining pixels with differences through the exclusive or operation is illustrated in fig. 2B.
In step 103, the difference pixel points are classified according to a nearest neighbor algorithm to obtain at least one difference region.
In an embodiment, after determining the difference pixel points in the reference image and the test image, random noise pixel points may be filtered, specifically, a corrosion algorithm may be used to filter the noise points, and then the difference pixel set in the test image is obtained.
In an embodiment, after determining the difference pixel points in the reference image and the test image, if the area where the difference pixel point is located is not further determined, referring to fig. 2C, if only the difference pixel point is determined, and the difference area where each difference pixel point is located is not determined, a problem that the test of the wiring software cannot be accurately positioned may be caused, for example, if a plurality of difference pixel points exist in the white rectangular area in fig. 2C, which correspond to the plurality of difference areas, but the position where the test of the wiring software cannot be accurately positioned because the classification is not performed according to the nearest neighbor algorithm. After the difference regions are determined according to the nearest neighbor algorithm, each difference region can be clearly marked, see fig. 2D.
In an embodiment, a specific implementation manner of classifying the differential pixel points according to a nearest neighbor algorithm to obtain at least one differential area may be seen in the embodiment shown in fig. 2A, which is not described in detail herein.
In step 104, the at least one difference region is visually displayed.
In an embodiment, if a group of reference images and the test images have a difference, it is determined that the wiring rule corresponding to the group of images has a problem, and the difference region and the corresponding wiring rule to be rectified can be visually displayed on a webpage.
In an embodiment, referring to fig. 2E, a visual test result is illustrated, in which not only the difference region is displayed, but also the wiring rule to be rectified is displayed through a code, so that the visual display mode is more beneficial for a tester to find and solve problems.
In the above steps 101 to 104, a test case and at least one drawing view angle are respectively input in the reference environment and the test environment to obtain at least one group of reference images and test images; then determining difference pixel points of the at least one group of reference images and the test images; classifying the difference pixel points according to a nearest neighbor algorithm to obtain at least one difference area; and visually displaying the at least one difference area. The method and the device for testing the wiring software can automatically determine whether the reference image and the test image have different pixels based on an image processing technology, and then test of the wiring software is completed.
To better illustrate the testing scheme of the wiring software of the present disclosure, another embodiment is described below.
Fig. 2A is a flowchart of determining a difference region of the testing method of the wiring software of the present disclosure, fig. 2B is a schematic diagram of determining a difference pixel point of the testing method of the wiring software of the present disclosure, fig. 2C is a schematic diagram of the testing method of the wiring software of the present disclosure before determining the difference region, fig. 2D is a schematic diagram of the testing method of the wiring software of the present disclosure after determining the difference region, fig. 2E is a schematic diagram of visually displaying a test result of the testing method of the wiring software of the present disclosure, and fig. 2F is a flowchart of classifying the difference pixels of the testing method of the wiring software of the present disclosure; the present embodiment takes how to determine the difference region as an example for illustration, as shown in fig. 2A, the method includes the following steps:
in step 201, noise point filtering is performed on all difference pixel points existing in the at least one group of reference images and the test images to obtain a difference pixel set.
In one embodiment, a set of difference pixels of the reference image and the test image are recorded in a difference pixel set.
In an embodiment, after the difference pixel points in the reference image and the test image are determined, random noise pixel points may be filtered, specifically, a corrosion algorithm may be used to perform noise filtering, and then a difference pixel set is obtained. And correspondingly obtaining a difference pixel set by the difference pixel points of the reference image and the test image of the Yi nationality.
In an embodiment, since the reference images are all correct schemes prepared in advance and verified manually, the difference pixel points are displayed in the test image, and a difference pixel set, that is, a clean difference pixel test image, can be obtained by filtering the noise points.
In step 202, the difference pixel set is divided into at least one subset, wherein the distance between any pixel points in one subset is not greater than a set distance.
In an embodiment, a nearest neighbor algorithm may be used to classify the difference pixel points to obtain at least one subset, and each subset corresponds to a difference region.
In an embodiment, with the implementation illustrated in fig. 2F, the difference pixel set may be divided into at least one subset, as shown in fig. 2F, including the following steps 221 to 224:
in step 221, a pixel point is extracted from the at least one difference pixel set.
In step 222, when there is no existing subset, the fetched pixel points are placed into a new subset.
In step 223, when there is an existing subset, the distance between the fetched pixel point and the pixel point in the existing subset is calculated.
In step 224, the extracted pixel points are placed into the corresponding existing sub-set or into a new sub-set based on the distance between the extracted pixel points and the pixel points in the existing sub-set.
After performing step 224, step 221 continues to be performed until the at least one difference set of pixels becomes an empty set.
In an embodiment, the step of placing the extracted pixel point into a corresponding existing subset or into a new subset includes: in response to the existing subset with the distance between the pixel points and the extracted pixel points not larger than the set threshold, the extracted pixel points are placed into the existing subset with the distance between the pixel points and the existing subset not larger than the set threshold; and in response to the fact that the distances between the extracted pixel points and the pixel points in the existing sub-set are larger than the set threshold value, placing the extracted pixel points into a new sub-set.
In steps 221 to 224, before the pixel point is first taken out from the difference pixel set, there is no subset, and the pixel point taken out may be first placed into a new subset (e.g., the first subset), and the initial value of the new subset is an empty set.
In an embodiment, after a pixel point is taken out from the difference pixel set, when the pixel point is taken out, the distance between the pixel point and the existing subset, such as the distance between all elements in the first subset, may be calculated first, and if the distance between an element in the first subset and the taken out pixel point is not greater than the set distance (such as 100), the pixel point is considered to be a neighbor of the element in the first subset, and the pixel point is placed in the first subset.
In an embodiment, after a pixel point is extracted from the difference pixel set, distances between the pixel point and all elements in the first subset may be calculated, if the distances between all elements in the first subset and the extracted pixel point are greater than a set distance (e.g., 100), the pixel point is considered not to be a neighbor of the elements in the first subset, distances between the pixel point and the elements in other existing subsets may be further calculated, if the distances between the elements in the existing subsets and the extracted pixel point are not greater than the set distance (e.g., 100), the pixel point is placed into the corresponding subset, otherwise, a new subset is placed. Thus, all elements in the difference pixel set can be fetched and classified.
In step 203, determining the coordinate extremum of all the difference pixel points in the at least one subset; and the coordinate extreme value is the minimum coordinate value in the left and lower directions and the maximum coordinate value in the right and upper directions of all the difference pixel points in the corresponding subset.
In one embodiment, there are a plurality of difference pixels in one subset, and in order to find a rectangular region in which the difference pixels can be framed, it is necessary to find the minimum coordinate values in the left and lower directions and the maximum coordinate values in the right and upper directions of the difference pixels.
In step 204, at least one difference region corresponding to the at least one subset is determined based on the coordinate extremum, and each of the subsets corresponds to one of the difference regions.
In one embodiment, in steps 203 to 204, after at least one subset is obtained by classification, each subset may be traversed to find the upper, lower, left, and right extreme values of each pixel in each subset, and a rectangular region is drawn by using the (upper, left) extreme value and the (lower, right) extreme value as two points, where the region is the difference region of the corresponding subset.
Through the steps 201 to 204, in the embodiment, the difference recognition is completed on the reference image and the test image through the image difference recognition and the nearest neighbor algorithm, each difference area can be clearly marked, and the problem that the test of the wiring software cannot be accurately positioned can be accurately positioned.
Fig. 3 is a flow chart of a testing method of wiring software of the present disclosure for obtaining available keel configurations; the present embodiment exemplifies how the BIM server side obtains the available keel configuration, as shown in fig. 3, the method includes the following steps:
in step 301, a test case and at least one drawing view angle are respectively input in a reference environment and a test environment, so as to obtain at least one set of reference image and test image, where the set of reference image and test image correspond to a wiring rule.
In step 302, the at least one set of reference images and test images are grayscale processed.
In step 303, a binary process is performed on the at least one set of the reference image and the test image subjected to the gradation process.
In an embodiment, after the image is binary-processed, the difference pixel points in the reference image and the test image can be calculated through an exclusive-or operation, if there is no difference pixel point in the reference image and the test image, step 304 is executed, and if there is a difference pixel point in the reference image and the test image, step 305 is executed.
In step 304, in response to that there is no difference between the at least one group of reference images and the test images, prompt information that the wiring rules corresponding to the at least one group of reference images and the test images pass the test is output.
In one embodiment, if there is no difference between a set of reference images and a set of test images, it is indicated that the wiring rule corresponding to the set of reference images and the set of test images meets the expectation, and the wiring rule passes the test.
In step 305, in response to differences in the at least one set of reference images and the test image, difference pixel points of the at least one set of reference images and the test image are determined.
In step 306, the difference pixel points are classified according to a nearest neighbor algorithm to obtain at least one difference region.
In step 307, the wiring rule to be straightened corresponding to at least one group of the reference image and the test image with the difference region is determined.
In an embodiment, the wiring rule to be corrected refers to a wiring rule corresponding to a group of reference images and test images which are determined to have different pixel points after image difference identification.
In step 308, the wiring rule to be corrected, a reference image corresponding to the wiring rule to be corrected, and a test image marked with the at least one difference region are output.
Through the steps 301 to 308, the embodiment can automatically determine whether the reference image and the test image have the difference pixel based on the image processing technology, and then complete the test of the wiring software, because the test case and the drawing view angle are preset, and the reference image and the test image acquired at each drawing view angle correspond to one wiring rule, the test of the wiring software is automated, and the problem of high test cost of performing manual test verification on each rule is solved.
Corresponding to the embodiment of the test method of the wiring software, the disclosure also provides a corresponding embodiment of the test device of the wiring software.
Fig. 4 is a schematic structural diagram of an embodiment of a testing apparatus for wiring software according to the present disclosure, which is applied to a testing platform for wiring software, and as shown in fig. 4, the apparatus includes:
the image obtaining module 41 is configured to input a test case and at least one drawing view angle in a reference environment and a test environment, respectively, to obtain at least one group of reference images and at least one test image, where the group of reference images and the test image correspond to a wiring rule;
a difference pixel determination module 42, configured to determine difference pixel points of the at least one group of reference images and the test image in response to a difference existing in the at least one group of reference images and the test image;
a difference region determining module 43, configured to classify the difference pixel points according to a nearest neighbor algorithm to obtain at least one difference region;
a display module 44, configured to perform visual display on the at least one difference area.
Fig. 5 is a schematic structural diagram of another embodiment of the testing apparatus for wiring software according to the present disclosure, as shown in fig. 5, based on the embodiment shown in fig. 4, in an embodiment, the demonstration module 44 includes:
the rule determining submodule 441 is used for determining at least one group of reference images with difference areas and wiring rules to be rectified corresponding to the test images;
the output sub-module 442 is configured to output the wiring rule to be corrected, a reference image corresponding to the wiring rule to be corrected, and a test image marked with the at least one difference area.
In one embodiment, the difference region determining module 43 includes:
a noise filtering submodule 431, configured to perform noise point filtering on all difference pixel points existing in the at least one group of reference images and the test image, so as to obtain a difference pixel set, where one difference pixel set records difference pixel points of a group of reference images and a group of test images;
a dividing submodule 432, configured to divide the difference pixel set into at least one subset, where a distance between any pixel points in one subset is not greater than a set distance;
an extreme value determining submodule 433, configured to determine coordinate extreme values of all the difference pixel points in the at least one subset; the coordinate extreme value is the minimum coordinate value in the left and lower directions and the maximum coordinate value in the right and upper directions of all the difference pixel points in the corresponding subset;
and a region determining submodule 434, configured to determine, based on the coordinate extremum, at least one difference region corresponding to the at least one subset, where each of the subsets corresponds to one of the difference regions.
In one embodiment, the partitioning sub-module 432 includes:
a pixel extraction sub-module 4321, configured to extract a pixel point from the at least one difference pixel set;
a first embedding submodule 4322, configured to embed the extracted pixel into a new subset when there is no existing subset;
a distance calculating submodule 4323, configured to calculate, when there is an existing subset, a distance between the extracted pixel point and a pixel point in the existing subset;
a second inserting submodule 4324, configured to insert the extracted pixel point into the corresponding existing subset or into a new subset based on a distance between the extracted pixel point and a pixel point in the existing subset;
the pixel extraction sub-module 4321 is configured to perform the step of extracting a pixel point from the at least one difference pixel set until the at least one difference pixel set becomes an empty set.
In an embodiment, the second inserting sub-module 4324 is specifically configured to, in response to that there is an existing subset whose distance from the extracted pixel point is not greater than a set threshold, insert the extracted pixel point into the existing subset whose distance from the extracted pixel point is not greater than the set threshold; and in response to the fact that the distances between the extracted pixel points and the pixel points in the existing sub-set are larger than the set threshold value, placing the extracted pixel points into a new sub-set.
Fig. 6 is a schematic structural diagram of a further embodiment of the testing apparatus for wiring software according to the present disclosure, as shown in fig. 6, and on the basis of the embodiments shown in fig. 4 and/or fig. 5, in an embodiment, the apparatus further includes:
and a test passing module 45, configured to output a prompt message that the wiring rule corresponding to the at least one group of reference images and the test images passes the test when there is no difference between the at least one group of reference images and the test images.
In one embodiment, the apparatus further comprises:
a gray processing module 46, configured to perform gray processing on the at least one set of reference image and test image;
a binary processing module 47, configured to perform binary processing on the at least one set of reference image and test image subjected to the grayscale processing;
the difference pixel determining module 42 is specifically configured to determine difference pixel points of at least one group of reference images and test images after binary processing.
The implementation process of the functions and actions of each unit in the above device is specifically described in the implementation process of the corresponding step in the above method, and is not described herein again.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and the parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the disclosed solution. One of ordinary skill in the art can understand and implement it without inventive effort.
An electronic device according to an embodiment of the present disclosure in which an apparatus implementing a method according to an embodiment of the present disclosure may be integrated is described below with reference to fig. 7. Fig. 7 is a block diagram of an electronic device provided in an exemplary embodiment of the disclosure, and as shown in fig. 7, the electronic device 7 includes one or more processors 71, one or more memories 72 of a computer-readable storage medium, and a computer program stored on the memories and executable on the processors. The above-described test method of the wiring software can be implemented when the program of the memory 72 is executed.
In particular, in practical applications, the electronic device may further include an input device 73, an output device 74, and the like, which are interconnected via a bus system and/or other types of connection mechanisms (not shown). Those skilled in the art will appreciate that the configuration of the electronic device shown in fig. 7 is not intended to be limiting of the electronic device and may include more or fewer components than shown, or certain components, or a different arrangement of components. Wherein:
the processor 71 may be a Central Processing Unit (CPU) or other form of processing unit having data processing capabilities and/or instruction execution capabilities, and may control other components in the electronic device to perform desired functions.
The memory 72 may store one or more computer program products and may include various forms of computer-readable storage media, such as volatile memory and/or non-volatile memory. Volatile memory can include, for example, random Access Memory (RAM), cache memory (or the like). The non-volatile memory may include, for example, read Only Memory (ROM), a hard disk, flash memory, and the like. One or more computer program products may be stored on the computer-readable storage medium and executed by the processor 71 to implement the above test software testing methods of the wiring software of the various embodiments of the present disclosure and/or other desired functions.
In one example, the electronic device may further include: an input device 73 and an output device 74, which are interconnected by a bus system and/or other form of connection mechanism (not shown),
further, the input device 73 may include, for example, a keyboard, a mouse, and the like.
The output device 74 may output various information including the determined distance information, direction information, and the like to the outside. The output devices 74 may include, for example, a display, speakers, a printer, and a communication network and remote output devices connected thereto, among others.
Of course, for simplicity, only some of the components of the electronic device 7 relevant to the present disclosure are shown in fig. 7, omitting components such as buses, input/output interfaces, and the like. In addition, the electronic device 7 may comprise any other suitable components, depending on the specific application.
In addition to the above-described methods and apparatus, embodiments of the present disclosure may also be a computer program product comprising computer program instructions that, when executed by a processor, cause the processor to perform the steps in a method for testing software for wiring software according to various embodiments of the present disclosure described in the "exemplary methods" section above of this specification.
The computer program product may write program code for performing the operations of embodiments of the present disclosure in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server.
Furthermore, embodiments of the present disclosure may also be a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, cause the processor to perform the steps in the test software testing method of wiring software according to various embodiments of the present disclosure described in the "exemplary methods" section above in this specification.
The computer-readable storage medium may take any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may include, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The basic principles of the present disclosure have been described above in connection with specific embodiments, but it should be noted that advantages, effects, and the like, mentioned in the present disclosure are only examples and not limitations, and should not be considered essential to the various embodiments of the present disclosure. Furthermore, the foregoing disclosure of specific details is for the purpose of illustration and description and is not intended to be limiting, since the disclosure is not intended to be limited to the specific details so described.
In the present specification, the embodiments are described in a progressive manner, and each embodiment focuses on differences from other embodiments, and the same or similar parts in each embodiment are referred to each other. For the system embodiment, since it basically corresponds to the method embodiment, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
Those of ordinary skill in the art will understand that: all or part of the steps of implementing the method embodiments may be implemented by hardware related to program instructions, and the program may be stored in a computer-readable storage medium, and when executed, executes the steps including the method embodiments; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
The method and apparatus of the present disclosure may be implemented in a number of ways. For example, the methods and apparatus of the present disclosure may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above-described order for the steps of the method is for illustration only, and the steps of the method of the present disclosure are not limited to the order specifically described above unless specifically stated otherwise. Further, in some embodiments, the present disclosure may also be embodied as programs recorded in a recording medium, the programs including machine-readable instructions for implementing the methods according to the present disclosure. Thus, the present disclosure also covers a recording medium storing a program for executing the method according to the present disclosure.
The description of the present disclosure has been presented for purposes of illustration and description, and is not intended to be exhaustive or limited to the disclosure in the form disclosed. Many modifications and variations will be apparent to practitioners skilled in this art. The embodiment was chosen and described in order to best explain the principles of the disclosure and the practical application, and to enable others of ordinary skill in the art to understand the disclosure for various embodiments with various modifications as are suited to the particular use contemplated.

Claims (10)

1. A method of testing wiring software, the method comprising:
respectively inputting a test case and at least one drawing visual angle in a reference environment and a test environment to obtain at least one group of reference images and test images, wherein the group of reference images and the test images correspond to a wiring rule;
responding to the difference between the at least one group of reference images and the test images, and determining difference pixel points of the at least one group of reference images and the test images;
classifying the difference pixel points according to a nearest neighbor algorithm to obtain at least one difference area;
and visually displaying the at least one difference area.
2. The method according to claim 1, wherein said visually displaying said at least one difference region comprises:
determining at least one group of reference images with difference areas and wiring rules to be corrected corresponding to the test images;
and outputting the wiring rule to be corrected, a reference image corresponding to the wiring rule to be corrected and a test image marked with the at least one difference area.
3. The method of claim 1, wherein the classifying the differential pixels according to a nearest neighbor algorithm to obtain at least one differential area comprises:
performing noise point filtering on all difference pixel points existing in the at least one group of reference images and test images to obtain at least one difference pixel set, wherein the difference pixel points of the group of reference images and test images are recorded in one difference pixel set;
dividing the difference pixel set into at least one sub-set, wherein the distance between any pixel points in one sub-set is not greater than a set distance;
determining the coordinate extreme values of all the different pixel points in the at least one subset; the coordinate extreme value is the minimum coordinate value in the left and lower directions and the maximum coordinate value in the right and upper directions of all the difference pixel points in the corresponding subset;
and determining at least one difference area corresponding to the at least one subset based on the coordinate extreme value, wherein each subset corresponds to one difference area.
4. The method of claim 3, wherein the dividing the set of difference pixels into at least one subset comprises:
taking out a pixel point from the at least one difference pixel set;
when the existing subset does not exist, the extracted pixel points are placed into a new subset;
when the existing subset exists, calculating the distance between the extracted pixel point and the pixel point in the existing subset;
based on the distance between the pixel point and the pixel point in the existing sub-set, the pixel point is put into the corresponding existing sub-set or a new sub-set;
and executing the step of taking out a pixel point from the at least one difference pixel set until the at least one difference pixel set becomes an empty set.
5. The method of claim 4, wherein the placing the extracted pixel point into a corresponding existing subset or into a new subset comprises:
in response to the existing subset with the distance between the pixel points and the extracted pixel points not larger than the set threshold, the extracted pixel points are placed into the existing subset with the distance between the pixel points and the existing subset not larger than the set threshold;
and in response to the fact that the distances between the extracted pixel points and the pixel points in the existing sub-set are larger than the set threshold value, placing the extracted pixel points into a new sub-set.
6. The method of claim 1, further comprising:
and responding to the at least one group of reference images and the test images without difference, and outputting prompt information that the wiring rules corresponding to the at least one group of reference images and the test images pass the test.
7. The method of claim 1, wherein prior to determining the difference pixel points of the at least one set of reference and test images, the method further comprises:
performing gray scale processing on the at least one group of reference images and the test images;
performing binary processing on at least one group of reference images and test images subjected to gray level processing;
the determining the difference pixel points of the at least one group of reference images and the test images comprises:
and determining difference pixel points of at least one group of reference images and test images after binary processing.
8. An electronic device, comprising:
a memory for storing a computer product;
a processor for executing a computer product stored in said memory, and when executed, implementing the method of any of the preceding claims 1-7.
9. A computer-readable storage medium having computer instructions stored thereon, wherein the computer instructions, when executed by a processor, implement the method of any of claims 1-7.
10. A computer program product comprising computer program instructions, characterized in that the computer program instructions, when executed by a processor, implement the method of any of claims 1-7.
CN202211015205.8A 2022-08-23 2022-08-23 Testing method and device for wiring software, electronic equipment and storage medium Pending CN115374517A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211015205.8A CN115374517A (en) 2022-08-23 2022-08-23 Testing method and device for wiring software, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211015205.8A CN115374517A (en) 2022-08-23 2022-08-23 Testing method and device for wiring software, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115374517A true CN115374517A (en) 2022-11-22

Family

ID=84066919

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211015205.8A Pending CN115374517A (en) 2022-08-23 2022-08-23 Testing method and device for wiring software, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115374517A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117523795A (en) * 2024-01-08 2024-02-06 电子科技大学 Weak current bridge circuit layout abnormality early warning method and system based on Internet of things

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117523795A (en) * 2024-01-08 2024-02-06 电子科技大学 Weak current bridge circuit layout abnormality early warning method and system based on Internet of things
CN117523795B (en) * 2024-01-08 2024-03-12 电子科技大学 Weak current bridge circuit layout abnormality early warning method and system based on Internet of things

Similar Documents

Publication Publication Date Title
CN107358596B (en) Vehicle loss assessment method and device based on image, electronic equipment and system
US11797886B2 (en) Image processing device, image processing method, and image processing program
US10878173B2 (en) Object recognition and tagging based on fusion deep learning models
CN111028213A (en) Image defect detection method and device, electronic equipment and storage medium
CN110781885A (en) Text detection method, device, medium and electronic equipment based on image processing
US20180253852A1 (en) Method and device for locating image edge in natural background
CN111738045B (en) Image detection method and device, electronic equipment and storage medium
CN116168351B (en) Inspection method and device for power equipment
CN110738236A (en) Image matching method and device, computer equipment and storage medium
CN116363037B (en) Multi-mode image fusion method, device and equipment
CN115861400B (en) Target object detection method, training device and electronic equipment
CN112651953A (en) Image similarity calculation method and device, computer equipment and storage medium
CN114005126A (en) Table reconstruction method and device, computer equipment and readable storage medium
CN113469944A (en) Product quality inspection method and device and electronic equipment
US9508006B2 (en) System and method for identifying trees
CN115374517A (en) Testing method and device for wiring software, electronic equipment and storage medium
CN106709490B (en) Character recognition method and device
CN110969602A (en) Image definition detection method and device
CN113743378A (en) Fire monitoring method and device based on video
CN112287905A (en) Vehicle damage identification method, device, equipment and storage medium
CN111414889A (en) Financial statement identification method and device based on character identification
CN114120305A (en) Training method of text classification model, and recognition method and device of text content
CN114418969A (en) Defect detection method, device, equipment and storage medium
CN114240924A (en) Power grid equipment quality evaluation method based on digitization technology
CN113554024A (en) Method and device for determining cleanliness of vehicle and computer equipment

Legal Events

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