Changes to be committed: new file: .gitignore new file: ENTRY.py new file: LICENSE modified: README.md new file: main_windows/main_window.py new file: main_windows/ui_main_window.py new file: static/cascade.xml new file: static/icon.ico new file: sub_windows/sub_window_1.py new file: sub_windows/sub_window_10.py new file: sub_windows/sub_window_2.py new file: sub_windows/sub_window_3.py new file: sub_windows/sub_window_4.py new file: sub_windows/sub_window_5.py new file: sub_windows/sub_window_6.py new file: sub_windows/sub_window_7.py new file: sub_windows/sub_window_8.py new file: sub_windows/ui_sub_window_1.py new file: sub_windows/ui_sub_window_10.py new file: sub_windows/ui_sub_window_2.py new file: sub_windows/ui_sub_window_3.py new file: sub_windows/ui_sub_window_4.py new file: sub_windows/ui_sub_window_5.py new file: sub_windows/ui_sub_window_6.py new file: sub_windows/ui_sub_window_7.py new file: sub_windows/ui_sub_window_8.py new file: test_image/cameraman.png new file: test_image/coins.jpg new file: test_image/contours.png new file: test_image/hezhao.jpg new file: test_image/lena-low-light.png new file: test_image/lena-low_duibi.png new file: test_image/lena.png new file: test_image/lenanoise.png new file: test_image/my_mask.png new file: test_image/rice.png new file: test_image/touxiang1.jpg new file: test_image/web_img1.jpg new file: ui_xml/ui_main_window.ui new file: ui_xml/ui_sub_window_1.ui new file: ui_xml/ui_sub_window_10.ui new file: ui_xml/ui_sub_window_2.ui new file: ui_xml/ui_sub_window_3.ui new file: ui_xml/ui_sub_window_4.ui new file: ui_xml/ui_sub_window_5.ui new file: ui_xml/ui_sub_window_6.ui new file: ui_xml/ui_sub_window_7.ui new file: ui_xml/ui_sub_window_8.uimaster
@ -0,0 +1 @@
|
||||
__pycache__
|
@ -0,0 +1,17 @@
|
||||
import sys
|
||||
|
||||
from PyQt5.QtWidgets import QApplication
|
||||
|
||||
# 窗口实例
|
||||
from main_windows import main_window
|
||||
|
||||
|
||||
def main():
|
||||
app = QApplication(sys.argv)
|
||||
main_window_ = main_window.MainWindow()
|
||||
main_window_.show()
|
||||
sys.exit(app.exec_())
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
@ -0,0 +1,674 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<https://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
@ -0,0 +1,88 @@
|
||||
from PyQt5.QtWidgets import *
|
||||
from PyQt5.QtGui import QIcon
|
||||
|
||||
# 主布局
|
||||
from main_windows import ui_main_window
|
||||
|
||||
# 子窗口实例
|
||||
from sub_windows import sub_window_1
|
||||
from sub_windows import sub_window_2
|
||||
from sub_windows import sub_window_3
|
||||
from sub_windows import sub_window_4
|
||||
from sub_windows import sub_window_5
|
||||
from sub_windows import sub_window_6
|
||||
from sub_windows import sub_window_7
|
||||
from sub_windows import sub_window_8
|
||||
from sub_windows import sub_window_10
|
||||
|
||||
|
||||
class MainWindow(QMainWindow):
|
||||
|
||||
def __init__(self):
|
||||
super().__init__(parent=None)
|
||||
# 布局初始化
|
||||
self.ui = ui_main_window.Ui_Form()
|
||||
self.ui.setupUi(Form=self)
|
||||
# 子窗口实例化命名空间
|
||||
self.sub_window_1_ = None # 色彩空间转换
|
||||
self.sub_window_2_ = None # 图像缩放剪裁
|
||||
self.sub_window_3_ = None # 图像加噪平滑
|
||||
self.sub_window_4_ = None # 图像锐化
|
||||
self.sub_window_5_ = None # 直方图变换
|
||||
self.sub_window_6_ = None # DCT图像压缩
|
||||
self.sub_window_7_ = None # Canny边缘检测
|
||||
self.sub_window_8_ = None # 人脸检测实例
|
||||
self.sub_window_10_ = None # 关于页面
|
||||
# 多线程
|
||||
pass
|
||||
# 信号与槽定义
|
||||
self.signal_and_slot()
|
||||
# 图标
|
||||
self.setWindowIcon(QIcon('./static/icon.ico'))
|
||||
|
||||
def signal_and_slot(self):
|
||||
self.ui.pushButton_1.clicked.connect(self.pushButton_1)
|
||||
self.ui.pushButton_2.clicked.connect(self.pushButton_2)
|
||||
self.ui.pushButton_3.clicked.connect(self.pushButton_3)
|
||||
self.ui.pushButton_4.clicked.connect(self.pushButton_4)
|
||||
self.ui.pushButton_5.clicked.connect(self.pushButton_5)
|
||||
self.ui.pushButton_6.clicked.connect(self.pushButton_6)
|
||||
self.ui.pushButton_7.clicked.connect(self.pushButton_7)
|
||||
self.ui.pushButton_8.clicked.connect(self.pushButton_8)
|
||||
self.ui.pushButton_10.clicked.connect(self.pushButton_10)
|
||||
|
||||
def pushButton_1(self):
|
||||
self.sub_window_1_ = sub_window_1.SubWindow()
|
||||
self.sub_window_1_.show()
|
||||
|
||||
def pushButton_2(self):
|
||||
self.sub_window_2_ = sub_window_2.SubWindow()
|
||||
self.sub_window_2_.show()
|
||||
|
||||
def pushButton_3(self):
|
||||
self.sub_window_3_ = sub_window_3.SubWindow()
|
||||
self.sub_window_3_.show()
|
||||
|
||||
def pushButton_4(self):
|
||||
self.sub_window_4_ = sub_window_4.SubWindow()
|
||||
self.sub_window_4_.show()
|
||||
|
||||
def pushButton_5(self):
|
||||
self.sub_window_5_ = sub_window_5.SubWindow()
|
||||
self.sub_window_5_.show()
|
||||
|
||||
def pushButton_6(self):
|
||||
self.sub_window_6_ = sub_window_6.SubWindow()
|
||||
self.sub_window_6_.show()
|
||||
|
||||
def pushButton_7(self):
|
||||
self.sub_window_7_ = sub_window_7.SubWindow()
|
||||
self.sub_window_7_.show()
|
||||
|
||||
def pushButton_8(self):
|
||||
self.sub_window_8_ = sub_window_8.SubWindow()
|
||||
self.sub_window_8_.show()
|
||||
|
||||
def pushButton_10(self):
|
||||
self.sub_window_10_ = sub_window_10.SubWindow()
|
||||
self.sub_window_10_.show()
|
@ -0,0 +1,77 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file './ui_main_window.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.11.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
class Ui_Form(object):
|
||||
def setupUi(self, Form):
|
||||
Form.setObjectName("Form")
|
||||
Form.resize(733, 546)
|
||||
self.label = QtWidgets.QLabel(Form)
|
||||
self.label.setGeometry(QtCore.QRect(220, 10, 291, 61))
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("黑体")
|
||||
font.setPointSize(20)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.label.setFont(font)
|
||||
self.label.setAlignment(QtCore.Qt.AlignCenter)
|
||||
self.label.setObjectName("label")
|
||||
self.groupBox = QtWidgets.QGroupBox(Form)
|
||||
self.groupBox.setGeometry(QtCore.QRect(30, 130, 331, 261))
|
||||
self.groupBox.setObjectName("groupBox")
|
||||
self.pushButton_1 = QtWidgets.QPushButton(self.groupBox)
|
||||
self.pushButton_1.setGeometry(QtCore.QRect(40, 50, 111, 71))
|
||||
self.pushButton_1.setObjectName("pushButton_1")
|
||||
self.pushButton_2 = QtWidgets.QPushButton(self.groupBox)
|
||||
self.pushButton_2.setGeometry(QtCore.QRect(170, 50, 111, 71))
|
||||
self.pushButton_2.setObjectName("pushButton_2")
|
||||
self.pushButton_3 = QtWidgets.QPushButton(self.groupBox)
|
||||
self.pushButton_3.setGeometry(QtCore.QRect(40, 140, 111, 71))
|
||||
self.pushButton_3.setObjectName("pushButton_3")
|
||||
self.pushButton_4 = QtWidgets.QPushButton(self.groupBox)
|
||||
self.pushButton_4.setGeometry(QtCore.QRect(170, 140, 111, 71))
|
||||
self.pushButton_4.setObjectName("pushButton_4")
|
||||
self.groupBox_2 = QtWidgets.QGroupBox(Form)
|
||||
self.groupBox_2.setGeometry(QtCore.QRect(380, 130, 331, 261))
|
||||
self.groupBox_2.setObjectName("groupBox_2")
|
||||
self.pushButton_8 = QtWidgets.QPushButton(self.groupBox_2)
|
||||
self.pushButton_8.setGeometry(QtCore.QRect(180, 140, 111, 71))
|
||||
self.pushButton_8.setObjectName("pushButton_8")
|
||||
self.pushButton_6 = QtWidgets.QPushButton(self.groupBox_2)
|
||||
self.pushButton_6.setGeometry(QtCore.QRect(180, 50, 111, 71))
|
||||
self.pushButton_6.setObjectName("pushButton_6")
|
||||
self.pushButton_5 = QtWidgets.QPushButton(self.groupBox_2)
|
||||
self.pushButton_5.setGeometry(QtCore.QRect(50, 50, 111, 71))
|
||||
self.pushButton_5.setObjectName("pushButton_5")
|
||||
self.pushButton_7 = QtWidgets.QPushButton(self.groupBox_2)
|
||||
self.pushButton_7.setGeometry(QtCore.QRect(50, 140, 111, 71))
|
||||
self.pushButton_7.setObjectName("pushButton_7")
|
||||
self.pushButton_10 = QtWidgets.QPushButton(Form)
|
||||
self.pushButton_10.setGeometry(QtCore.QRect(560, 430, 111, 71))
|
||||
self.pushButton_10.setObjectName("pushButton_10")
|
||||
|
||||
self.retranslateUi(Form)
|
||||
QtCore.QMetaObject.connectSlotsByName(Form)
|
||||
|
||||
def retranslateUi(self, Form):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
Form.setWindowTitle(_translate("Form", "图像处理仿真系统"))
|
||||
self.label.setText(_translate("Form", "图像处理仿真系统"))
|
||||
self.groupBox.setTitle(_translate("Form", "图像变换"))
|
||||
self.pushButton_1.setText(_translate("Form", "色彩空间转换"))
|
||||
self.pushButton_2.setText(_translate("Form", "图像缩放剪裁"))
|
||||
self.pushButton_3.setText(_translate("Form", "图像加噪平滑"))
|
||||
self.pushButton_4.setText(_translate("Form", "图像锐化"))
|
||||
self.groupBox_2.setTitle(_translate("Form", "应用实例"))
|
||||
self.pushButton_8.setText(_translate("Form", "人脸检测"))
|
||||
self.pushButton_6.setText(_translate("Form", "图像压缩"))
|
||||
self.pushButton_5.setText(_translate("Form", "直方图变换"))
|
||||
self.pushButton_7.setText(_translate("Form", "边缘检测"))
|
||||
self.pushButton_10.setText(_translate("Form", "关于"))
|
||||
|
After Width: | Height: | Size: 17 KiB |
@ -0,0 +1,85 @@
|
||||
import cv2
|
||||
from PyQt5.QtGui import *
|
||||
from PyQt5.QtWidgets import *
|
||||
|
||||
# 子窗口布局
|
||||
from sub_windows import ui_sub_window_1
|
||||
|
||||
|
||||
class SubWindow(QMainWindow):
|
||||
def __init__(self):
|
||||
super().__init__(parent=None)
|
||||
self.ui = ui_sub_window_1.Ui_Form()
|
||||
self.ui.setupUi(self)
|
||||
self.ui_init()
|
||||
self.cv_srcImage = None
|
||||
self.q_image = None
|
||||
|
||||
def ui_init(self):
|
||||
self.ui.pushButton_open_file.clicked.connect(self.open_file)
|
||||
self.ui.pushButton_gray_convert.clicked.connect(self.gray_convert)
|
||||
self.ui.pushButton_bin_convert.clicked.connect(self.bin_convert)
|
||||
self.ui.pushButton_reset.clicked.connect(self.reset)
|
||||
|
||||
def open_file(self):
|
||||
file_path, file_type = QFileDialog.getOpenFileName(QFileDialog(), '选择图片', '', '图像文件(*.jpg *.bmp *.png)')
|
||||
self.cv_srcImage = cv2.imread(file_path)
|
||||
height, width, channels = self.cv_srcImage.shape
|
||||
ui_image = QImage(cv2.cvtColor(self.cv_srcImage, cv2.COLOR_BGR2RGB), width, height, QImage.Format_RGB888)
|
||||
if width > height:
|
||||
ui_image = ui_image.scaledToWidth(self.ui.label_image.width())
|
||||
else:
|
||||
ui_image = ui_image.scaledToHeight(self.ui.label_image.height())
|
||||
self._update_qimage_to_label(ui_image)
|
||||
self._show_image_information(1)
|
||||
self._set_pushbutton_enabled()
|
||||
|
||||
def gray_convert(self):
|
||||
gray_image = cv2.cvtColor(self.cv_srcImage, cv2.COLOR_BGR2GRAY)
|
||||
height, width = gray_image.shape
|
||||
ui_image = QImage(cv2.cvtColor(gray_image, cv2.COLOR_BGR2RGB), width, height, QImage.Format_RGB888)
|
||||
if width > height:
|
||||
ui_image = ui_image.scaledToWidth(self.ui.label_image.width())
|
||||
else:
|
||||
ui_image = ui_image.scaledToHeight(self.ui.label_image.height())
|
||||
self._update_qimage_to_label(ui_image)
|
||||
self._show_image_information(2)
|
||||
|
||||
def bin_convert(self):
|
||||
threshold_value = int(self.ui.spinBox_bin_threshold.value())
|
||||
gray_image = cv2.cvtColor(self.cv_srcImage, cv2.COLOR_BGR2GRAY)
|
||||
ret, bin_image = cv2.threshold(gray_image, threshold_value, 255, cv2.THRESH_BINARY)
|
||||
height, width = bin_image.shape
|
||||
ui_image = QImage(cv2.cvtColor(bin_image, cv2.COLOR_BGR2RGB), width, height, QImage.Format_RGB888)
|
||||
if width > height:
|
||||
ui_image = ui_image.scaledToWidth(self.ui.label_image.width())
|
||||
else:
|
||||
ui_image = ui_image.scaledToHeight(self.ui.label_image.height())
|
||||
self._update_qimage_to_label(ui_image)
|
||||
self._show_image_information(3)
|
||||
|
||||
def reset(self):
|
||||
height, width, channels = self.cv_srcImage.shape
|
||||
ui_image = QImage(cv2.cvtColor(self.cv_srcImage, cv2.COLOR_BGR2RGB), width, height, QImage.Format_RGB888)
|
||||
if width > height:
|
||||
ui_image = ui_image.scaledToWidth(self.ui.label_image.width())
|
||||
else:
|
||||
ui_image = ui_image.scaledToHeight(self.ui.label_image.height())
|
||||
self._update_qimage_to_label(ui_image)
|
||||
self._show_image_information(1)
|
||||
|
||||
def _update_qimage_to_label(self, qimage):
|
||||
self.ui.label_image.setPixmap(QPixmap.fromImage(qimage))
|
||||
|
||||
def _show_image_information(self, current_image_type):
|
||||
if current_image_type == 1:
|
||||
self.ui.label_color_space_2.setText('彩色图')
|
||||
if current_image_type == 2:
|
||||
self.ui.label_color_space_2.setText('灰度图')
|
||||
if current_image_type == 3:
|
||||
self.ui.label_color_space_2.setText('二值图')
|
||||
|
||||
def _set_pushbutton_enabled(self):
|
||||
self.ui.pushButton_gray_convert.setEnabled(True)
|
||||
self.ui.pushButton_bin_convert.setEnabled(True)
|
||||
self.ui.pushButton_reset.setEnabled(True)
|
@ -0,0 +1,18 @@
|
||||
from PyQt5.QtWidgets import *
|
||||
|
||||
# 子窗口布局
|
||||
from sub_windows import ui_sub_window_10
|
||||
|
||||
|
||||
class SubWindow(QMainWindow):
|
||||
def __init__(self):
|
||||
super().__init__(parent=None)
|
||||
self.ui = ui_sub_window_10.Ui_Form()
|
||||
self.ui.setupUi(self)
|
||||
self.cv_srcImage = None
|
||||
self.saveImage = None
|
||||
self.ui_init()
|
||||
|
||||
def ui_init(self):
|
||||
pass
|
||||
|
@ -0,0 +1,273 @@
|
||||
import cv2
|
||||
import numpy as np
|
||||
from PyQt5.QtGui import *
|
||||
from PyQt5.QtWidgets import *
|
||||
|
||||
# 子窗口布局
|
||||
from sub_windows import ui_sub_window_3
|
||||
|
||||
|
||||
class SubWindow(QMainWindow):
|
||||
def __init__(self):
|
||||
super().__init__(parent=None)
|
||||
self.ui = ui_sub_window_3.Ui_Form()
|
||||
self.ui.setupUi(self)
|
||||
self.ui_init()
|
||||
self.cv_srcImage = None
|
||||
self.cv_noiseImage = None
|
||||
self.cv_blurImage = None
|
||||
|
||||
def ui_init(self):
|
||||
self._group_enable_ctrl()
|
||||
# 下拉选择
|
||||
noise_type_list = ['椒盐噪声', '高斯噪声', '乘积性噪声']
|
||||
self.ui.comboBox_noise_type.addItems(noise_type_list)
|
||||
self.ui.comboBox_noise_type.activated.connect(self.comboBox_noise_type_selected)
|
||||
filter_type_list = ['均值滤波', '高斯滤波', '中值滤波', '双边滤波']
|
||||
self.ui.comboBox_filter_type.addItems(filter_type_list)
|
||||
self.ui.comboBox_filter_type.activated.connect(self.comboBox_filter_type_selected)
|
||||
# 按钮
|
||||
self.ui.pushButton_open_file.clicked.connect(self.open_file)
|
||||
self.ui.pushButton_salt_pepper_noise.clicked.connect(self.salt_pepper_noise)
|
||||
self.ui.pushButton_gasuss_noise.clicked.connect(self.gasuss_noise)
|
||||
self.ui.pushButton_speckle_noise.clicked.connect(self.speckle_noise)
|
||||
self.ui.pushButton_mean_blur_filter.clicked.connect(self.mean_blur_filter)
|
||||
self.ui.pushButton_gauss_blur_filter.clicked.connect(self.gauss_blur_filter)
|
||||
self.ui.pushButton_median_blur_filter.clicked.connect(self.median_blur_filter)
|
||||
self.ui.pushButton_double_blur_filter.clicked.connect(self.double_blur_filter)
|
||||
|
||||
def _group_enable_ctrl(self, flag=None):
|
||||
if flag is None:
|
||||
self.ui.groupBox_salt_noise.setEnabled(False)
|
||||
self.ui.groupBox_gauss_noise.setEnabled(False)
|
||||
self.ui.groupBox_speckle_noise.setEnabled(False)
|
||||
self.ui.groupBox_mean_blur_filter.setEnabled(False)
|
||||
self.ui.groupBox_gauss_blur_filter.setEnabled(False)
|
||||
self.ui.groupBox_median_blur_filter.setEnabled(False)
|
||||
self.ui.groupBox_double_blur_filter.setEnabled(False)
|
||||
elif flag == '椒盐噪声' and self.cv_srcImage is not None:
|
||||
self.ui.groupBox_salt_noise.setEnabled(True)
|
||||
self.ui.groupBox_gauss_noise.setEnabled(False)
|
||||
self.ui.groupBox_speckle_noise.setEnabled(False)
|
||||
elif flag == '高斯噪声' and self.cv_srcImage is not None:
|
||||
self.ui.groupBox_salt_noise.setEnabled(False)
|
||||
self.ui.groupBox_gauss_noise.setEnabled(True)
|
||||
self.ui.groupBox_speckle_noise.setEnabled(False)
|
||||
elif flag == '乘积性噪声' and self.cv_srcImage is not None:
|
||||
self.ui.groupBox_salt_noise.setEnabled(False)
|
||||
self.ui.groupBox_gauss_noise.setEnabled(False)
|
||||
self.ui.groupBox_speckle_noise.setEnabled(True)
|
||||
elif flag == '均值滤波' and self.cv_srcImage is not None:
|
||||
self.ui.groupBox_mean_blur_filter.setEnabled(True)
|
||||
self.ui.groupBox_gauss_blur_filter.setEnabled(False)
|
||||
self.ui.groupBox_median_blur_filter.setEnabled(False)
|
||||
self.ui.groupBox_double_blur_filter.setEnabled(False)
|
||||
elif flag == '高斯滤波' and self.cv_srcImage is not None:
|
||||
self.ui.groupBox_mean_blur_filter.setEnabled(False)
|
||||
self.ui.groupBox_gauss_blur_filter.setEnabled(True)
|
||||
self.ui.groupBox_median_blur_filter.setEnabled(False)
|
||||
self.ui.groupBox_double_blur_filter.setEnabled(False)
|
||||
elif flag == '中值滤波' and self.cv_srcImage is not None:
|
||||
self.ui.groupBox_mean_blur_filter.setEnabled(False)
|
||||
self.ui.groupBox_gauss_blur_filter.setEnabled(False)
|
||||
self.ui.groupBox_median_blur_filter.setEnabled(True)
|
||||
self.ui.groupBox_double_blur_filter.setEnabled(False)
|
||||
elif flag == '双边滤波' and self.cv_srcImage is not None:
|
||||
self.ui.groupBox_mean_blur_filter.setEnabled(False)
|
||||
self.ui.groupBox_gauss_blur_filter.setEnabled(False)
|
||||
self.ui.groupBox_median_blur_filter.setEnabled(False)
|
||||
self.ui.groupBox_double_blur_filter.setEnabled(True)
|
||||
|
||||
def open_file(self):
|
||||
file_path, file_type = QFileDialog.getOpenFileName(QFileDialog(), '选择图片', '', '*.jpg *.bmp *.png *tif')
|
||||
self.cv_srcImage = cv2.imread(file_path)
|
||||
height, width, channels = self.cv_srcImage.shape
|
||||
ui_image = QImage(cv2.cvtColor(self.cv_srcImage, cv2.COLOR_BGR2RGB), width, height, QImage.Format_RGB888)
|
||||
if width > height:
|
||||
ui_image = ui_image.scaledToWidth(self.ui.label_image_1.width())
|
||||
else:
|
||||
ui_image = ui_image.scaledToHeight(self.ui.label_image_1.height())
|
||||
self.ui.label_image_1.setPixmap(QPixmap.fromImage(ui_image))
|
||||
|
||||
def comboBox_noise_type_selected(self):
|
||||
selected = self.ui.comboBox_noise_type.currentText()
|
||||
self._group_enable_ctrl(flag=selected)
|
||||
|
||||
def comboBox_filter_type_selected(self):
|
||||
selected = self.ui.comboBox_filter_type.currentText()
|
||||
self._group_enable_ctrl(flag=selected)
|
||||
|
||||
def salt_pepper_noise(self):
|
||||
def _salt_pepper_noise(image, proportion, mode=1):
|
||||
copyImage = image.copy()
|
||||
height, width, channels = copyImage.shape
|
||||
noise_pixel_num = int(height * width * proportion)
|
||||
if mode == 1 and channels == 3:
|
||||
for k in range(noise_pixel_num):
|
||||
x_axis = int(np.random.random() * width)
|
||||
y_axis = int(np.random.random() * height)
|
||||
salt_pepper_flag = np.random.choice((True, False))
|
||||
copyImage[y_axis, x_axis, 0] = 255 if salt_pepper_flag else 0
|
||||
copyImage[y_axis, x_axis, 1] = 255 if salt_pepper_flag else 0
|
||||
copyImage[y_axis, x_axis, 2] = 255 if salt_pepper_flag else 0
|
||||
return copyImage
|
||||
elif mode == 1 and channels == 2:
|
||||
for k in range(noise_pixel_num):
|
||||
x_axis = int(np.random.random() * width)
|
||||
y_axis = int(np.random.random() * height)
|
||||
salt_pepper_flag = np.random.choice((True, False))
|
||||
copyImage[y_axis, x_axis] = 255 if salt_pepper_flag else 0
|
||||
return copyImage
|
||||
elif mode == 2 and channels == 3:
|
||||
for k in range(noise_pixel_num):
|
||||
x_axis = int(np.random.random() * width)
|
||||
y_axis = int(np.random.random() * height)
|
||||
copyImage[y_axis, x_axis, 0] = 255
|
||||
copyImage[y_axis, x_axis, 1] = 255
|
||||
copyImage[y_axis, x_axis, 2] = 255
|
||||
return copyImage
|
||||
elif mode == 2 and channels == 2:
|
||||
for k in range(noise_pixel_num):
|
||||
x_axis = int(np.random.random() * width)
|
||||
y_axis = int(np.random.random() * height)
|
||||
copyImage[y_axis, x_axis] = 255
|
||||
return copyImage
|
||||
elif mode == 3 and channels == 3:
|
||||
for k in range(noise_pixel_num):
|
||||
x_axis = int(np.random.random() * width)
|
||||
y_axis = int(np.random.random() * height)
|
||||
copyImage[y_axis, x_axis, 0] = 0
|
||||
copyImage[y_axis, x_axis, 1] = 0
|
||||
copyImage[y_axis, x_axis, 2] = 0
|
||||
return copyImage
|
||||
elif mode == 3 and channels == 3:
|
||||
for k in range(noise_pixel_num):
|
||||
x_axis = int(np.random.random() * width)
|
||||
y_axis = int(np.random.random() * height)
|
||||
copyImage[y_axis, x_axis] = 0
|
||||
return copyImage
|
||||
proportion = self.ui.doubleSpinBox_salt_proportion.value()
|
||||
mode = 1
|
||||
if self.ui.radioButton_1.isChecked():
|
||||
mode = 1
|
||||
elif self.ui.radioButton_2.isChecked():
|
||||
mode = 2
|
||||
elif self.ui.radioButton_3.isChecked():
|
||||
mode = 3
|
||||
self.cv_noiseImage = _salt_pepper_noise(image=self.cv_srcImage, proportion=proportion, mode=mode)
|
||||
height, width, channels = self.cv_noiseImage.shape
|
||||
ui_image = QImage(cv2.cvtColor(self.cv_noiseImage, cv2.COLOR_BGR2RGB), width, height, QImage.Format_RGB888)
|
||||
if width > height:
|
||||
ui_image = ui_image.scaledToWidth(self.ui.label_image_2.width())
|
||||
else:
|
||||
ui_image = ui_image.scaledToHeight(self.ui.label_image_2.height())
|
||||
self.ui.label_image_2.setPixmap(QPixmap.fromImage(ui_image))
|
||||
|
||||
def gasuss_noise(self):
|
||||
def _gasuss_noise(image, mean=0.0, var=0.1):
|
||||
copyImage = image.copy()
|
||||
noise = np.random.normal(loc=mean, scale=var, size=copyImage.shape)
|
||||
copyImage = np.array(copyImage / 255, dtype=float)
|
||||
out = copyImage + noise
|
||||
out = np.clip(out, 0.0, 1.0)
|
||||
out = np.uint8(out * 255)
|
||||
return out
|
||||
mean = self.ui.doubleSpinBox_gauss_mean.value()
|
||||
var = self.ui.doubleSpinBox_gauss_var.value()
|
||||
self.cv_noiseImage = _gasuss_noise(image=self.cv_srcImage, mean=mean, var=var)
|
||||
height, width, channels = self.cv_noiseImage.shape
|
||||
ui_image = QImage(cv2.cvtColor(self.cv_noiseImage, cv2.COLOR_BGR2RGB), width, height, QImage.Format_RGB888)
|
||||
if width > height:
|
||||
ui_image = ui_image.scaledToWidth(self.ui.label_image_2.width())
|
||||
else:
|
||||
ui_image = ui_image.scaledToHeight(self.ui.label_image_2.height())
|
||||
self.ui.label_image_2.setPixmap(QPixmap.fromImage(ui_image))
|
||||
|
||||
def speckle_noise(self):
|
||||
def _speckle_noise(image, mean=0.0, var=0.2):
|
||||
copyImage = image.copy()
|
||||
noise = np.random.normal(loc=mean, scale=var, size=copyImage.shape)
|
||||
copyImage = np.array(copyImage / 255, dtype=float)
|
||||
out = (1 + noise) * copyImage
|
||||
out = np.clip(out, 0.0, 1.0)
|
||||
out = np.uint8(out * 255)
|
||||
return out
|
||||
|
||||
mean = self.ui.doubleSpinBox_speckle_mean.value()
|
||||
var = self.ui.doubleSpinBox_speckle_var.value()
|
||||
self.cv_noiseImage = _speckle_noise(image=self.cv_srcImage, mean=mean, var=var)
|
||||
height, width, channels = self.cv_noiseImage.shape
|
||||
ui_image = QImage(cv2.cvtColor(self.cv_noiseImage, cv2.COLOR_BGR2RGB), width, height, QImage.Format_RGB888)
|
||||
if width > height:
|
||||
ui_image = ui_image.scaledToWidth(self.ui.label_image_2.width())
|
||||
else:
|
||||
ui_image = ui_image.scaledToHeight(self.ui.label_image_2.height())
|
||||
self.ui.label_image_2.setPixmap(QPixmap.fromImage(ui_image))
|
||||
|
||||
def mean_blur_filter(self):
|
||||
def _mean_blur_filter(image, size=5):
|
||||
copyImage = image.copy()
|
||||
if int(size) % 2 == 0:
|
||||
return None
|
||||
copyImage = cv2.blur(copyImage, ksize=(int(size), int(size)))
|
||||
return copyImage
|
||||
size = self.ui.spinBox_mean_ksize.value()
|
||||
self.cv_blurImage = _mean_blur_filter(image=self.cv_noiseImage, size=size)
|
||||
height, width, channels = self.cv_blurImage.shape
|
||||
ui_image = QImage(cv2.cvtColor(self.cv_blurImage, cv2.COLOR_BGR2RGB), width, height, QImage.Format_RGB888)
|
||||
if width > height:
|
||||
ui_image = ui_image.scaledToWidth(self.ui.label_image_3.width())
|
||||
else:
|
||||
ui_image = ui_image.scaledToHeight(self.ui.label_image_3.height())
|
||||
self.ui.label_image_3.setPixmap(QPixmap.fromImage(ui_image))
|
||||
|
||||
def gauss_blur_filter(self):
|
||||
def _gauss_blur_filter(image, size=5):
|
||||
copyImage = image.copy()
|
||||
if int(size) % 2 == 0:
|
||||
return None
|
||||
copyImage = cv2.GaussianBlur(copyImage, ksize=(int(size), int(size)), sigmaX=0, sigmaY=0)
|
||||
return copyImage
|
||||
size = self.ui.spinBox_gauss_blur_ksize.value()
|
||||
self.cv_blurImage = _gauss_blur_filter(image=self.cv_noiseImage, size=size)
|
||||
height, width, channels = self.cv_blurImage.shape
|
||||
ui_image = QImage(cv2.cvtColor(self.cv_blurImage, cv2.COLOR_BGR2RGB), width, height, QImage.Format_RGB888)
|
||||
if width > height:
|
||||
ui_image = ui_image.scaledToWidth(self.ui.label_image_3.width())
|
||||
else:
|
||||
ui_image = ui_image.scaledToHeight(self.ui.label_image_3.height())
|
||||
self.ui.label_image_3.setPixmap(QPixmap.fromImage(ui_image))
|
||||
|
||||
def median_blur_filter(self):
|
||||
def _median_blur_filter(image, size=5):
|
||||
copyImage = image.copy()
|
||||
if int(size) % 2 == 0:
|
||||
return None
|
||||
copyImage = cv2.medianBlur(copyImage, ksize=int(size))
|
||||
return copyImage
|
||||
size = self.ui.spinBox_median_ksize.value()
|
||||
self.cv_blurImage = _median_blur_filter(image=self.cv_noiseImage, size=size)
|
||||
height, width, channels = self.cv_blurImage.shape
|
||||
ui_image = QImage(cv2.cvtColor(self.cv_blurImage, cv2.COLOR_BGR2RGB), width, height, QImage.Format_RGB888)
|
||||
if width > height:
|
||||
ui_image = ui_image.scaledToWidth(self.ui.label_image_3.width())
|
||||
else:
|
||||
ui_image = ui_image.scaledToHeight(self.ui.label_image_3.height())
|
||||
self.ui.label_image_3.setPixmap(QPixmap.fromImage(ui_image))
|
||||
|
||||
def double_blur_filter(self):
|
||||
def _double_blur_filter(image):
|
||||
copyImage = image.copy()
|
||||
copyImage = cv2.bilateralFilter(copyImage, d=25, sigmaColor=25 * 2, sigmaSpace=25 / 2)
|
||||
return copyImage
|
||||
self.cv_blurImage = _double_blur_filter(image=self.cv_srcImage)
|
||||
height, width, channels = self.cv_blurImage.shape
|
||||
ui_image = QImage(cv2.cvtColor(self.cv_blurImage, cv2.COLOR_BGR2RGB), width, height, QImage.Format_RGB888)
|
||||
if width > height:
|
||||
ui_image = ui_image.scaledToWidth(self.ui.label_image_3.width())
|
||||
else:
|
||||
ui_image = ui_image.scaledToHeight(self.ui.label_image_3.height())
|
||||
self.ui.label_image_3.setPixmap(QPixmap.fromImage(ui_image))
|
||||
cv2.namedWindow('haha', cv2.WINDOW_NORMAL)
|
||||
cv2.imshow('haha', self.cv_blurImage)
|
||||
cv2.waitKey(0)
|
@ -0,0 +1,139 @@
|
||||
import cv2
|
||||
import numpy as np
|
||||
from PyQt5.QtGui import *
|
||||
from PyQt5.QtWidgets import *
|
||||
|
||||
# 子窗口布局
|
||||
from sub_windows import ui_sub_window_4
|
||||
|
||||
|
||||
class SubWindow(QMainWindow):
|
||||
def __init__(self):
|
||||
super().__init__(parent=None)
|
||||
self.ui = ui_sub_window_4.Ui_Form()
|
||||
self.ui.setupUi(self)
|
||||
self.ui_init()
|
||||
|
||||
def ui_init(self):
|
||||
sharpen_type_list = ['Sobel算子', 'Laplace算子', '自定义卷积核']
|
||||
self.ui.comboBox_selector.addItems(sharpen_type_list)
|
||||
self.ui.comboBox_selector.activated.connect(self.comboBox_selected)
|
||||
self.ui.pushButton_open_file.clicked.connect(self.open_file)
|
||||
self.ui.pushButton_sobel_filter.clicked.connect(self.sobel_sharpen_filter)
|
||||
self.ui.pushButton_laplace_filter.clicked.connect(self.laplacian_sharpen_filter)
|
||||
self.ui.pushButton_custom_filter.clicked.connect(self.custom_filter)
|
||||
self.cv_srcImage = None
|
||||
self.cv_sharpenImage = None
|
||||
self._group_enable_ctrl()
|
||||
pass
|
||||
|
||||
def comboBox_selected(self):
|
||||
selected = self.ui.comboBox_selector.currentText()
|
||||
self._group_enable_ctrl(selected=selected)
|
||||
|
||||
def _group_enable_ctrl(self, selected=None):
|
||||
if selected is None:
|
||||
self.ui.groupBox_sobel_filter.setEnabled(False)
|
||||
self.ui.groupBox_laplace_filter.setEnabled(False)
|
||||
self.ui.groupBox_custom_filter.setEnabled(False)
|
||||
elif selected == 'Sobel算子':
|
||||
self.ui.groupBox_sobel_filter.setEnabled(True)
|
||||
self.ui.groupBox_laplace_filter.setEnabled(False)
|
||||
self.ui.groupBox_custom_filter.setEnabled(False)
|
||||
elif selected == 'Laplace算子':
|
||||
self.ui.groupBox_sobel_filter.setEnabled(False)
|
||||
self.ui.groupBox_laplace_filter.setEnabled(True)
|
||||
self.ui.groupBox_custom_filter.setEnabled(False)
|
||||
elif selected == '自定义卷积核':
|
||||
self.ui.groupBox_sobel_filter.setEnabled(False)
|
||||
self.ui.groupBox_laplace_filter.setEnabled(False)
|
||||
self.ui.groupBox_custom_filter.setEnabled(True)
|
||||
|
||||
def open_file(self):
|
||||
file_path, file_type = QFileDialog.getOpenFileName(QFileDialog(), '选择图片', '', '图像文件(*.jpg *.bmp *.png)')
|
||||
self.cv_srcImage = cv2.imread(file_path)
|
||||
height, width, channels = self.cv_srcImage.shape
|
||||
ui_image = QImage(cv2.cvtColor(self.cv_srcImage, cv2.COLOR_BGR2RGB), width, height, QImage.Format_RGB888)
|
||||
if width > height:
|
||||
ui_image = ui_image.scaledToWidth(self.ui.label_image_1.width())
|
||||
else:
|
||||
ui_image = ui_image.scaledToHeight(self.ui.label_image_1.height())
|
||||
self.ui.label_image_1.setPixmap(QPixmap.fromImage(ui_image))
|
||||
|
||||
def sobel_sharpen_filter(self):
|
||||
def _sobel_sharpen_filter(image, mode=0):
|
||||
copyImage = image.copy()
|
||||
if copyImage.ndim == 3:
|
||||
copyImage = cv2.cvtColor(copyImage, cv2.COLOR_BGR2GRAY)
|
||||
if mode == 1:
|
||||
x = cv2.Sobel(copyImage, ddepth=cv2.CV_16S, dx=1, dy=0)
|
||||
x = cv2.convertScaleAbs(x)
|
||||
return x
|
||||
elif mode == 2:
|
||||
y = cv2.Sobel(copyImage, ddepth=cv2.CV_16S, dx=0, dy=1)
|
||||
y = cv2.convertScaleAbs(y)
|
||||
return y
|
||||
elif mode == 0:
|
||||
x = cv2.Sobel(copyImage, ddepth=cv2.CV_16S, dx=1, dy=0)
|
||||
x = cv2.convertScaleAbs(x)
|
||||
y = cv2.Sobel(copyImage, ddepth=cv2.CV_16S, dx=0, dy=1)
|
||||
y = cv2.convertScaleAbs(y)
|
||||
x_y = cv2.addWeighted(x, 0.5, y, 0.5, 0)
|
||||
return x_y
|
||||
mode = 0
|
||||
if self.ui.radioButton_sobel_dx.isChecked():
|
||||
mode = 1
|
||||
elif self.ui.radioButton_sobel_dy.isChecked():
|
||||
mode = 2
|
||||
elif self.ui.radioButton_sobel_dx_dy.isChecked():
|
||||
mode = 0
|
||||
self.cv_sharpenImage = _sobel_sharpen_filter(image=self.cv_srcImage, mode=mode)
|
||||
height, width = self.cv_sharpenImage.shape
|
||||
ui_image = QImage(cv2.cvtColor(self.cv_sharpenImage, cv2.COLOR_BGR2RGB), width, height, QImage.Format_RGB888)
|
||||
if width > height:
|
||||
ui_image = ui_image.scaledToWidth(self.ui.label_image_2.width())
|
||||
else:
|
||||
ui_image = ui_image.scaledToHeight(self.ui.label_image_2.height())
|
||||
self.ui.label_image_2.setPixmap(QPixmap.fromImage(ui_image))
|
||||
|
||||
def laplacian_sharpen_filter(self):
|
||||
def _laplacian_sharpen_filter(image, size=1):
|
||||
copyImage = image.copy()
|
||||
if copyImage.ndim == 3:
|
||||
copyImage = cv2.cvtColor(copyImage, cv2.COLOR_BGR2GRAY)
|
||||
copyImage = cv2.Laplacian(copyImage, ddepth=cv2.CV_16S, ksize=int(size))
|
||||
copyImage = cv2.convertScaleAbs(copyImage)
|
||||
return copyImage
|
||||
size = self.ui.spinBox_laplace_ksize.value()
|
||||
self.cv_sharpenImage = _laplacian_sharpen_filter(image=self.cv_srcImage, size=size)
|
||||
height, width = self.cv_sharpenImage.shape
|
||||
ui_image = QImage(cv2.cvtColor(self.cv_sharpenImage, cv2.COLOR_BGR2RGB), width, height, QImage.Format_RGB888)
|
||||
if width > height:
|
||||
ui_image = ui_image.scaledToWidth(self.ui.label_image_2.width())
|
||||
else:
|
||||
ui_image = ui_image.scaledToHeight(self.ui.label_image_2.height())
|
||||
self.ui.label_image_2.setPixmap(QPixmap.fromImage(ui_image))
|
||||
|
||||
def custom_filter(self):
|
||||
def _custom_filter(image, custom_kernel=None):
|
||||
if custom_kernel is None:
|
||||
kernel = np.array([[0, -1.5, 0], [-1.5, 7, -1.5], [0, -1.5, 0]], np.float)
|
||||
else:
|
||||
kernel = np.array([[custom_kernel[0], custom_kernel[1], custom_kernel[2]],
|
||||
[custom_kernel[3], custom_kernel[4], custom_kernel[5]],
|
||||
[custom_kernel[6], custom_kernel[7], custom_kernel[8]]],
|
||||
np.float)
|
||||
dst = cv2.filter2D(src=image, ddepth=cv2.CV_16S, kernel=kernel)
|
||||
dst = cv2.convertScaleAbs(dst)
|
||||
return dst
|
||||
custom_kernel = [self.ui.doubleSpinBox_custom_filter_1.value(), self.ui.doubleSpinBox_custom_filter_2.value(), self.ui.doubleSpinBox_custom_filter_3.value(),
|
||||
self.ui.doubleSpinBox_custom_filter_4.value(), self.ui.doubleSpinBox_custom_filter_5.value(), self.ui.doubleSpinBox_custom_filter_6.value(),
|
||||
self.ui.doubleSpinBox_custom_filter_7.value(), self.ui.doubleSpinBox_custom_filter_8.value(), self.ui.doubleSpinBox_custom_filter_9.value()]
|
||||
self.cv_sharpenImage = _custom_filter(image=self.cv_srcImage, custom_kernel=custom_kernel)
|
||||
height, width = self.cv_sharpenImage.shape[0], self.cv_sharpenImage.shape[1]
|
||||
ui_image = QImage(cv2.cvtColor(self.cv_sharpenImage, cv2.COLOR_BGR2RGB), width, height, QImage.Format_RGB888)
|
||||
if width > height:
|
||||
ui_image = ui_image.scaledToWidth(self.ui.label_image_2.width())
|
||||
else:
|
||||
ui_image = ui_image.scaledToHeight(self.ui.label_image_2.height())
|
||||
self.ui.label_image_2.setPixmap(QPixmap.fromImage(ui_image))
|
@ -0,0 +1,102 @@
|
||||
import cv2
|
||||
import numpy as np
|
||||
from PyQt5.QtGui import *
|
||||
from PyQt5.QtWidgets import *
|
||||
|
||||
# 子窗口布局
|
||||
from sub_windows import ui_sub_window_5
|
||||
|
||||
|
||||
class SubWindow(QMainWindow):
|
||||
def __init__(self):
|
||||
super().__init__(parent=None)
|
||||
self.ui = ui_sub_window_5.Ui_Form()
|
||||
self.ui.setupUi(self)
|
||||
self.ui_init()
|
||||
self.cv_srcImage = None
|
||||
self.cv_equImage = None
|
||||
|
||||
def ui_init(self):
|
||||
self.ui.pushButton_open_file.clicked.connect(self.open_file)
|
||||
self.ui.pushButton_brightness_change.clicked.connect(self.brightness_change)
|
||||
self.ui.pushButton_hist_equ.clicked.connect(self.hist_equ)
|
||||
pass
|
||||
|
||||
def open_file(self):
|
||||
file_path, file_type = QFileDialog.getOpenFileName(QFileDialog(), '选择图片', '', '图像文件(*.jpg *.bmp *.png)')
|
||||
self.cv_srcImage = cv2.imread(file_path)
|
||||
print(self.cv_srcImage.shape)
|
||||
height, width = self.cv_srcImage.shape[0], self.cv_srcImage.shape[1]
|
||||
ui_image = QImage(cv2.cvtColor(self.cv_srcImage, cv2.COLOR_BGR2RGB), width, height, QImage.Format_RGB888)
|
||||
if width > height:
|
||||
ui_image = ui_image.scaledToWidth(self.ui.label_image_1.width())
|
||||
else:
|
||||
ui_image = ui_image.scaledToHeight(self.ui.label_image_1.height())
|
||||
self.ui.label_image_1.setPixmap(QPixmap.fromImage(ui_image))
|
||||
self._show_hist_image(flag=1)
|
||||
|
||||
def brightness_change(self):
|
||||
def _brightness_change(image, p=0):
|
||||
copyImage = image.copy()
|
||||
copyImage = np.array(copyImage, dtype=np.uint16)
|
||||
copyImage = copyImage + p
|
||||
copyImage = np.clip(copyImage, 0, 255)
|
||||
copyImage = np.array(copyImage, dtype=np.uint8)
|
||||
return copyImage
|
||||
self.cv_equImage = _brightness_change(image=self.cv_srcImage, p=self.ui.spinBox_brightness_change.value())
|
||||
height, width = self.cv_equImage.shape[0], self.cv_equImage.shape[1]
|
||||
ui_image = QImage(cv2.cvtColor(self.cv_equImage, cv2.COLOR_BGR2RGB), width, height, QImage.Format_RGB888)
|
||||
if width > height:
|
||||
ui_image = ui_image.scaledToWidth(self.ui.label_image_2.width())
|
||||
else:
|
||||
ui_image = ui_image.scaledToHeight(self.ui.label_image_2.height())
|
||||
self.ui.label_image_2.setPixmap(QPixmap.fromImage(ui_image))
|
||||
self._show_hist_image(flag=2)
|
||||
|
||||
def hist_equ(self):
|
||||
def _his_equ(image):
|
||||
copyImage = image.copy()
|
||||
if copyImage.ndim == 3:
|
||||
ycrcbImage = cv2.cvtColor(copyImage, cv2.COLOR_BGR2YCR_CB)
|
||||
channels = cv2.split(ycrcbImage)
|
||||
channels[0] = cv2.equalizeHist(src=channels[0])
|
||||
ycrcbImage = cv2.merge([channels[0], channels[1], channels[2]])
|
||||
copyImage = cv2.cvtColor(ycrcbImage, cv2.COLOR_YCR_CB2BGR)
|
||||
return copyImage
|
||||
elif copyImage.ndim == 2:
|
||||
copyImage = cv2.equalizeHist(src=copyImage)
|
||||
return copyImage
|
||||
self.cv_equImage = _his_equ(image=self.cv_srcImage)
|
||||
height, width = self.cv_equImage.shape[0], self.cv_equImage.shape[1]
|
||||
ui_image = QImage(cv2.cvtColor(self.cv_equImage, cv2.COLOR_BGR2RGB), width, height, QImage.Format_RGB888)
|
||||
if width > height:
|
||||
ui_image = ui_image.scaledToWidth(self.ui.label_image_2.width())
|
||||
else:
|
||||
ui_image = ui_image.scaledToHeight(self.ui.label_image_2.height())
|
||||
self.ui.label_image_2.setPixmap(QPixmap.fromImage(ui_image))
|
||||
self._show_hist_image(flag=2)
|
||||
|
||||
def _show_hist_image(self, flag=1):
|
||||
if flag == 1:
|
||||
histImg = self._calc_gray_hist(image=self.cv_srcImage)
|
||||
width, height = histImg.shape[0], histImg.shape[1]
|
||||
ui_image = QImage(cv2.cvtColor(histImg, cv2.COLOR_BGR2RGB), width, height, QImage.Format_RGB888)
|
||||
self.ui.label_image_3.setPixmap(QPixmap.fromImage(ui_image))
|
||||
elif flag == 2:
|
||||
histImg = self._calc_gray_hist(image=self.cv_equImage)
|
||||
width, height = histImg.shape[0], histImg.shape[1]
|
||||
ui_image = QImage(cv2.cvtColor(histImg, cv2.COLOR_BGR2RGB), width, height, QImage.Format_RGB888)
|
||||
self.ui.label_image_4.setPixmap(QPixmap.fromImage(ui_image))
|
||||
|
||||
def _calc_gray_hist(self, image):
|
||||
copyImage = image.copy()
|
||||
if copyImage.ndim == 3:
|
||||
copyImage = cv2.cvtColor(copyImage, cv2.COLOR_BGR2GRAY)
|
||||
histArray = cv2.calcHist([copyImage], [0], None, [256], [0, 255]) # 统计数组
|
||||
mnVal, maxVal, minLoc, macLoc = cv2.minMaxLoc(histArray) # 找最大值
|
||||
histImg = np.zeros([256, 256, 3], np.uint8)
|
||||
hpt = int(0.9 * 256) # 预留顶部空间
|
||||
for i in range(256):
|
||||
intensity = int(histArray[i] * hpt / maxVal) # 柱状图高度
|
||||
cv2.line(histImg, (i, 256), (i, 256 - intensity), [255, 255, 255]) # 画线
|
||||
return histImg
|
@ -0,0 +1,179 @@
|
||||
import cv2
|
||||
import numpy as np
|
||||
from PyQt5.QtGui import *
|
||||
from PyQt5.QtWidgets import *
|
||||
|
||||
# 子窗口布局
|
||||
from sub_windows import ui_sub_window_6
|
||||
|
||||
|
||||
class SubWindow(QMainWindow):
|
||||
def __init__(self):
|
||||
super().__init__(parent=None)
|
||||
self.ui = ui_sub_window_6.Ui_Form()
|
||||
self.ui.setupUi(self)
|
||||
self.cv_srcImage = None
|
||||
self.saveImage = None
|
||||
self.ui_init()
|
||||
|
||||
def ui_init(self):
|
||||
self.ui.pushButton_open_file.clicked.connect(self.open_file)
|
||||
self.ui.pushButton_dct_process.clicked.connect(self.dct_process)
|
||||
self.ui.pushButton_save.clicked.connect(self.save)
|
||||
|
||||
def open_file(self):
|
||||
file_path, file_type = QFileDialog.getOpenFileName(QFileDialog(), '选择图片', '', '图像文件(*.jpg *.bmp *.png)')
|
||||
self.cv_srcImage = cv2.imread(file_path)
|
||||
height, width = self.cv_srcImage.shape[0], self.cv_srcImage.shape[1]
|
||||
ui_image = QImage(cv2.cvtColor(self.cv_srcImage, cv2.COLOR_BGR2RGB), width, height, QImage.Format_RGB888)
|
||||
if width > height:
|
||||
ui_image = ui_image.scaledToWidth(self.ui.label_image_1.width())
|
||||
else:
|
||||
ui_image = ui_image.scaledToHeight(self.ui.label_image_1.height())
|
||||
self.ui.label_image_1.setPixmap(QPixmap.fromImage(ui_image))
|
||||
|
||||
def dct_process(self):
|
||||
if self.cv_srcImage is None:
|
||||
return
|
||||
# 判断radio
|
||||
mask_flag = 6
|
||||
if self.ui.radioButton_s1.isChecked():
|
||||
print('s1')
|
||||
mask_flag = 1
|
||||
elif self.ui.radioButton_s3.isChecked():
|
||||
print('s3')
|
||||
mask_flag = 3
|
||||
elif self.ui.radioButton_s6.isChecked():
|
||||
print('s6')
|
||||
mask_flag = 6
|
||||
elif self.ui.radioButton_s10.isChecked():
|
||||
print('s10')
|
||||
mask_flag = 10
|
||||
elif self.ui.radioButton_s15.isChecked():
|
||||
print('s15')
|
||||
mask_flag = 15
|
||||
elif self.ui.radioButton_s21.isChecked():
|
||||
print('s21')
|
||||
mask_flag = 21
|
||||
# DCT处理
|
||||
compressImage = self._dct_test(image=self.cv_srcImage, block=8, mask_flag=mask_flag)
|
||||
self.saveImage = compressImage.copy()
|
||||
height, width = compressImage.shape[0], compressImage.shape[1]
|
||||
ui_image = QImage(cv2.cvtColor(compressImage, cv2.COLOR_BGR2RGB), width, height, QImage.Format_RGB888)
|
||||
if width > height:
|
||||
ui_image = ui_image.scaledToWidth(self.ui.label_image_1.width())
|
||||
else:
|
||||
ui_image = ui_image.scaledToHeight(self.ui.label_image_1.height())
|
||||
self.ui.label_image_2.setPixmap(QPixmap.fromImage(ui_image))
|
||||
|
||||
def _dct_test(self, image, block=8, mask_flag=10):
|
||||
mask_21 = np.uint8([[1, 1, 1, 1, 1, 1, 0, 0],
|
||||
[1, 1, 1, 1, 1, 0, 0, 0],
|
||||
[1, 1, 1, 1, 0, 0, 0, 0],
|
||||
[1, 1, 1, 0, 0, 0, 0, 0],
|
||||
[1, 1, 0, 0, 0, 0, 0, 0],
|
||||
[1, 0, 0, 0, 0, 0, 0, 0],
|
||||
[0, 0, 0, 0, 0, 0, 0, 0],
|
||||
[0, 0, 0, 0, 0, 0, 0, 0]])
|
||||
mask_15 = np.uint8([[1, 1, 1, 1, 1, 0, 0, 0],
|
||||
[1, 1, 1, 1, 0, 0, 0, 0],
|
||||
[1, 1, 1, 0, 0, 0, 0, 0],
|
||||
[1, 1, 0, 0, 0, 0, 0, 0],
|
||||
[1, 0, 0, 0, 0, 0, 0, 0],
|
||||
[0, 0, 0, 0, 0, 0, 0, 0],
|
||||
[0, 0, 0, 0, 0, 0, 0, 0],
|
||||
[0, 0, 0, 0, 0, 0, 0, 0]])
|
||||
mask_10 = np.uint8([[1, 1, 1, 1, 0, 0, 0, 0],
|
||||
[1, 1, 1, 0, 0, 0, 0, 0],
|
||||
[1, 1, 0, 0, 0, 0, 0, 0],
|
||||
[1, 0, 0, 0, 0, 0, 0, 0],
|
||||
[0, 0, 0, 0, 0, 0, 0, 0],
|
||||
[0, 0, 0, 0, 0, 0, 0, 0],
|
||||
[0, 0, 0, 0, 0, 0, 0, 0],
|
||||
[0, 0, 0, 0, 0, 0, 0, 0]])
|
||||
mask_6 = np.uint8([[1, 1, 1, 0, 0, 0, 0, 0],
|
||||
[1, 1, 0, 0, 0, 0, 0, 0],
|
||||
[1, 0, 0, 0, 0, 0, 0, 0],
|
||||
[0, 0, 0, 0, 0, 0, 0, 0],
|
||||
[0, 0, 0, 0, 0, 0, 0, 0],
|
||||
[0, 0, 0, 0, 0, 0, 0, 0],
|
||||
[0, 0, 0, 0, 0, 0, 0, 0],
|
||||
[0, 0, 0, 0, 0, 0, 0, 0]])
|
||||
mask_3 = np.uint8([[1, 1, 0, 0, 0, 0, 0, 0],
|
||||
[1, 0, 0, 0, 0, 0, 0, 0],
|
||||
[0, 0, 0, 0, 0, 0, 0, 0],
|
||||
[0, 0, 0, 0, 0, 0, 0, 0],
|
||||
[0, 0, 0, 0, 0, 0, 0, 0],
|
||||
[0, 0, 0, 0, 0, 0, 0, 0],
|
||||
[0, 0, 0, 0, 0, 0, 0, 0],
|
||||
[0, 0, 0, 0, 0, 0, 0, 0]])
|
||||
mask_1 = np.uint8([[1, 0, 0, 0, 0, 0, 0, 0],
|
||||
[0, 0, 0, 0, 0, 0, 0, 0],
|
||||
[0, 0, 0, 0, 0, 0, 0, 0],
|
||||
[0, 0, 0, 0, 0, 0, 0, 0],
|
||||
[0, 0, 0, 0, 0, 0, 0, 0],
|
||||
[0, 0, 0, 0, 0, 0, 0, 0],
|
||||
[0, 0, 0, 0, 0, 0, 0, 0],
|
||||
[0, 0, 0, 0, 0, 0, 0, 0]])
|
||||
mask = mask_10
|
||||
if mask_flag == 1:
|
||||
mask = mask_1
|
||||
elif mask_flag == 3:
|
||||
mask = mask_3
|
||||
elif mask_flag == 6:
|
||||
mask = mask_6
|
||||
elif mask_flag == 10:
|
||||
mask = mask_10
|
||||
elif mask_flag == 15:
|
||||
mask = mask_15
|
||||
elif mask_flag == 21:
|
||||
mask = mask_21
|
||||
|
||||
srcImage = cv2.cvtColor(image.copy(), cv2.COLOR_BGR2YUV)
|
||||
retImage = np.zeros(
|
||||
((srcImage.shape[0] // block + 1) * block, (srcImage.shape[1] // block + 1) * block, srcImage.ndim),
|
||||
np.float32)
|
||||
channels = cv2.split(srcImage)
|
||||
Y_channel_float = np.array(channels[0], dtype=np.float32)
|
||||
U_channel_float = np.array(channels[1], dtype=np.float32)
|
||||
V_channel_float = np.array(channels[2], dtype=np.float32)
|
||||
retImage[0: Y_channel_float.shape[0], 0: Y_channel_float.shape[1], 0] = Y_channel_float
|
||||
retImage[0: U_channel_float.shape[0], 0: U_channel_float.shape[1], 1] = U_channel_float
|
||||
retImage[0: V_channel_float.shape[0], 0: V_channel_float.shape[1], 2] = V_channel_float
|
||||
|
||||
T = np.zeros((block, block), np.float64)
|
||||
T[0, :] = 1 * np.sqrt(1 / block)
|
||||
for i in range(1, block):
|
||||
for j in range(0, block):
|
||||
T[i, j] = np.cos(np.pi * i * (2 * j + 1) / (2 * block)) * np.sqrt(2 / block)
|
||||
|
||||
for y_offset in range(int(retImage.shape[0] / block)):
|
||||
for x_offset in range(int(retImage.shape[1] / block)):
|
||||
for c in range(int(retImage.ndim)):
|
||||
# opencv的方法
|
||||
# subImg = retImage[y_offset * block: y_offset * block + block, x_offset * block: x_offset * block + block, c]
|
||||
# subImg = cv2.dct(subImg) * mask
|
||||
# subImg = cv2.idct(subImg)
|
||||
# retImage[y_offset * block: y_offset * block + block, x_offset * block: x_offset * block + block, c] = subImg
|
||||
# 自建的方法
|
||||
subImg = retImage[y_offset * block: y_offset * block + block,
|
||||
x_offset * block: x_offset * block + block, c]
|
||||
dctImg = np.dot(np.dot(T, subImg), np.transpose(T)) * mask
|
||||
subImg = np.dot(np.dot(np.transpose(T), dctImg), T)
|
||||
retImage[y_offset * block: y_offset * block + block, x_offset * block: x_offset * block + block,
|
||||
c] = subImg
|
||||
retImage = cv2.cvtColor(np.uint8(retImage), cv2.COLOR_YUV2BGR)
|
||||
retImage = retImage[0: srcImage.shape[0], 0: srcImage.shape[1]]
|
||||
return retImage
|
||||
|
||||
def save(self):
|
||||
if self.saveImage is None:
|
||||
return
|
||||
jpg_image = cv2.imencode('.jpg', self.saveImage)[1]
|
||||
fp = open('.././dctCompressImage.jpg', 'wb')
|
||||
fp.write(jpg_image)
|
||||
fp.close()
|
||||
print('ok')
|
||||
|
||||
|
||||
|
@ -0,0 +1,44 @@
|
||||
import cv2
|
||||
from PyQt5.QtGui import *
|
||||
from PyQt5.QtWidgets import *
|
||||
|
||||
# 子窗口布局
|
||||
from sub_windows import ui_sub_window_7
|
||||
|
||||
|
||||
class SubWindow(QMainWindow):
|
||||
def __init__(self):
|
||||
super().__init__(parent=None)
|
||||
self.ui = ui_sub_window_7.Ui_Form()
|
||||
self.ui.setupUi(self)
|
||||
self.cv_srcImage = None
|
||||
self.ui_init()
|
||||
|
||||
def ui_init(self):
|
||||
self.ui.pushButton_open_file.clicked.connect(self.open_file)
|
||||
self.ui.pushButton_canny.clicked.connect(self.canny_process)
|
||||
|
||||
def open_file(self):
|
||||
file_path, file_type = QFileDialog.getOpenFileName(QFileDialog(), '选择图片', '', '图像文件(*.jpg *.bmp *.png)')
|
||||
self.cv_srcImage = cv2.imread(file_path)
|
||||
height, width = self.cv_srcImage.shape[0], self.cv_srcImage.shape[1]
|
||||
ui_image = QImage(cv2.cvtColor(self.cv_srcImage, cv2.COLOR_BGR2RGB), width, height, QImage.Format_RGB888)
|
||||
if width > height:
|
||||
ui_image = ui_image.scaledToWidth(self.ui.label_image_1.width())
|
||||
else:
|
||||
ui_image = ui_image.scaledToHeight(self.ui.label_image_1.height())
|
||||
self.ui.label_image_1.setPixmap(QPixmap.fromImage(ui_image))
|
||||
|
||||
def canny_process(self):
|
||||
if self.cv_srcImage is None:
|
||||
return
|
||||
low_th = int(self.ui.spinBox_low_th.value())
|
||||
high_th = int(self.ui.spinBox_high_th.value())
|
||||
edgeImg = cv2.Canny(self.cv_srcImage.copy(), low_th, high_th)
|
||||
height, width = edgeImg.shape[0], edgeImg.shape[1]
|
||||
ui_image = QImage(cv2.cvtColor(edgeImg, cv2.COLOR_BGR2RGB), width, height, QImage.Format_RGB888)
|
||||
if width > height:
|
||||
ui_image = ui_image.scaledToWidth(self.ui.label_image_1.width())
|
||||
else:
|
||||
ui_image = ui_image.scaledToHeight(self.ui.label_image_1.height())
|
||||
self.ui.label_image_2.setPixmap(QPixmap.fromImage(ui_image))
|
@ -0,0 +1,74 @@
|
||||
import cv2
|
||||
from PyQt5.QtCore import pyqtSignal, QThread
|
||||
from PyQt5.QtGui import *
|
||||
from PyQt5.QtWidgets import *
|
||||
|
||||
# 子窗口布局
|
||||
from sub_windows import ui_sub_window_8
|
||||
|
||||
|
||||
class SubWindow(QMainWindow):
|
||||
def __init__(self):
|
||||
super().__init__(parent=None)
|
||||
self.ui = ui_sub_window_8.Ui_Form()
|
||||
self.ui.setupUi(self)
|
||||
self.FaceDetect_ = None
|
||||
self.ui_init()
|
||||
self.face_cascade = cv2.CascadeClassifier('./static/cascade.xml')
|
||||
|
||||
def ui_init(self):
|
||||
self.ui.pushButton_video_captrue.clicked.connect(self.video_captrue)
|
||||
self.ui.pushButton_open_file.clicked.connect(self.open_file)
|
||||
self.FaceDetect_ = FaceDetect()
|
||||
self.FaceDetect_.DetectOneFrame.connect(self.update_frame_to_label)
|
||||
|
||||
def open_file(self):
|
||||
file_path, file_type = QFileDialog.getOpenFileName(QFileDialog(), '选择图片', '', '图像文件(*.jpg *.bmp *.png)')
|
||||
self.cv_srcImage = cv2.imread(file_path)
|
||||
gray = cv2.cvtColor(self.cv_srcImage, cv2.COLOR_BGR2GRAY)
|
||||
faces = self.face_cascade.detectMultiScale(gray, scaleFactor=1.15, minNeighbors=5, minSize=(5, 5))
|
||||
for (x, y, w, h) in faces:
|
||||
cv2.rectangle(self.cv_srcImage, (x, y), (x + w, y + w), (0, 255, 0), 5)
|
||||
height, width = self.cv_srcImage.shape[0], self.cv_srcImage.shape[1]
|
||||
ui_image = QImage(cv2.cvtColor(self.cv_srcImage, cv2.COLOR_BGR2RGB), width, height, QImage.Format_RGB888)
|
||||
if width > height:
|
||||
ui_image = ui_image.scaledToWidth(self.ui.label_image_1.width())
|
||||
else:
|
||||
ui_image = ui_image.scaledToHeight(self.ui.label_image_1.height())
|
||||
self.ui.label_image_1.setPixmap(QPixmap.fromImage(ui_image))
|
||||
|
||||
|
||||
def video_captrue(self):
|
||||
if not self.FaceDetect_.working:
|
||||
self.FaceDetect_.working = True
|
||||
self.FaceDetect_.start()
|
||||
else:
|
||||
self.FaceDetect_.working = None
|
||||
self.ui.label_image_1.setText('停止捕捉')
|
||||
|
||||
def update_frame_to_label(self, frame):
|
||||
self.ui.label_image_1.setPixmap(QPixmap.fromImage(frame))
|
||||
|
||||
|
||||
class FaceDetect(QThread):
|
||||
DetectOneFrame = pyqtSignal(QImage)
|
||||
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.working = None
|
||||
|
||||
def run(self):
|
||||
face_cascade = cv2.CascadeClassifier('./static/cascade.xml')
|
||||
capture = cv2.VideoCapture(0)
|
||||
while self.working:
|
||||
ret, frame_color = capture.read()
|
||||
(height, width, channels) = frame_color.shape
|
||||
frame_color = cv2.flip(frame_color, flipCode=1) # 镜像
|
||||
gray = cv2.cvtColor(frame_color, cv2.COLOR_BGR2GRAY)
|
||||
faces = face_cascade.detectMultiScale(gray, scaleFactor=1.15, minNeighbors=5, minSize=(5, 5))
|
||||
for (x, y, w, h) in faces:
|
||||
cv2.rectangle(frame_color, (x, y), (x + w, y + w), (255, 255, 0), 4)
|
||||
ui_image = QImage(cv2.cvtColor(frame_color, cv2.COLOR_BGR2RGB), width, height, QImage.Format_RGB888)
|
||||
self.DetectOneFrame.emit(ui_image)
|
||||
capture.release()
|
||||
print('结束人脸检测')
|
@ -0,0 +1,109 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file './ui_sub_window_1.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.11.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
class Ui_Form(object):
|
||||
def setupUi(self, Form):
|
||||
Form.setObjectName("Form")
|
||||
Form.resize(1158, 789)
|
||||
self.label_title = QtWidgets.QLabel(Form)
|
||||
self.label_title.setGeometry(QtCore.QRect(810, 10, 321, 41))
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("Agency FB")
|
||||
font.setPointSize(22)
|
||||
font.setBold(True)
|
||||
font.setWeight(75)
|
||||
self.label_title.setFont(font)
|
||||
self.label_title.setAlignment(QtCore.Qt.AlignCenter)
|
||||
self.label_title.setObjectName("label_title")
|
||||
self.label_image = QtWidgets.QLabel(Form)
|
||||
self.label_image.setGeometry(QtCore.QRect(240, 60, 900, 700))
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("Agency FB")
|
||||
font.setPointSize(14)
|
||||
font.setBold(True)
|
||||
font.setWeight(75)
|
||||
self.label_image.setFont(font)
|
||||
self.label_image.setFrameShape(QtWidgets.QFrame.Box)
|
||||
self.label_image.setFrameShadow(QtWidgets.QFrame.Raised)
|
||||
self.label_image.setAlignment(QtCore.Qt.AlignCenter)
|
||||
self.label_image.setObjectName("label_image")
|
||||
self.pushButton_open_file = QtWidgets.QPushButton(Form)
|
||||
self.pushButton_open_file.setGeometry(QtCore.QRect(20, 20, 191, 28))
|
||||
self.pushButton_open_file.setCheckable(False)
|
||||
self.pushButton_open_file.setDefault(True)
|
||||
self.pushButton_open_file.setObjectName("pushButton_open_file")
|
||||
self.groupBox = QtWidgets.QGroupBox(Form)
|
||||
self.groupBox.setGeometry(QtCore.QRect(10, 170, 221, 81))
|
||||
self.groupBox.setObjectName("groupBox")
|
||||
self.pushButton_gray_convert = QtWidgets.QPushButton(self.groupBox)
|
||||
self.pushButton_gray_convert.setEnabled(False)
|
||||
self.pushButton_gray_convert.setGeometry(QtCore.QRect(50, 30, 121, 28))
|
||||
self.pushButton_gray_convert.setObjectName("pushButton_gray_convert")
|
||||
self.groupBox_2 = QtWidgets.QGroupBox(Form)
|
||||
self.groupBox_2.setGeometry(QtCore.QRect(10, 290, 221, 101))
|
||||
self.groupBox_2.setObjectName("groupBox_2")
|
||||
self.label_bin_convert_1 = QtWidgets.QLabel(self.groupBox_2)
|
||||
self.label_bin_convert_1.setGeometry(QtCore.QRect(20, 20, 91, 21))
|
||||
self.label_bin_convert_1.setObjectName("label_bin_convert_1")
|
||||
self.pushButton_bin_convert = QtWidgets.QPushButton(self.groupBox_2)
|
||||
self.pushButton_bin_convert.setEnabled(False)
|
||||
self.pushButton_bin_convert.setGeometry(QtCore.QRect(50, 60, 121, 28))
|
||||
self.pushButton_bin_convert.setObjectName("pushButton_bin_convert")
|
||||
self.spinBox_bin_threshold = QtWidgets.QSpinBox(self.groupBox_2)
|
||||
self.spinBox_bin_threshold.setGeometry(QtCore.QRect(135, 20, 61, 22))
|
||||
self.spinBox_bin_threshold.setMaximum(255)
|
||||
self.spinBox_bin_threshold.setProperty("value", 127)
|
||||
self.spinBox_bin_threshold.setObjectName("spinBox_bin_threshold")
|
||||
self.layoutWidget = QtWidgets.QWidget(Form)
|
||||
self.layoutWidget.setGeometry(QtCore.QRect(40, 80, 149, 51))
|
||||
self.layoutWidget.setObjectName("layoutWidget")
|
||||
self.horizontalLayout = QtWidgets.QHBoxLayout(self.layoutWidget)
|
||||
self.horizontalLayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||
self.label_color_space_1 = QtWidgets.QLabel(self.layoutWidget)
|
||||
self.label_color_space_1.setEnabled(False)
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("Agency FB")
|
||||
font.setPointSize(9)
|
||||
self.label_color_space_1.setFont(font)
|
||||
self.label_color_space_1.setAlignment(QtCore.Qt.AlignCenter)
|
||||
self.label_color_space_1.setObjectName("label_color_space_1")
|
||||
self.horizontalLayout.addWidget(self.label_color_space_1)
|
||||
self.label_color_space_2 = QtWidgets.QLabel(self.layoutWidget)
|
||||
self.label_color_space_2.setEnabled(False)
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("Agency FB")
|
||||
self.label_color_space_2.setFont(font)
|
||||
self.label_color_space_2.setText("")
|
||||
self.label_color_space_2.setAlignment(QtCore.Qt.AlignCenter)
|
||||
self.label_color_space_2.setObjectName("label_color_space_2")
|
||||
self.horizontalLayout.addWidget(self.label_color_space_2)
|
||||
self.pushButton_reset = QtWidgets.QPushButton(Form)
|
||||
self.pushButton_reset.setEnabled(False)
|
||||
self.pushButton_reset.setGeometry(QtCore.QRect(60, 430, 121, 28))
|
||||
self.pushButton_reset.setObjectName("pushButton_reset")
|
||||
|
||||
self.retranslateUi(Form)
|
||||
QtCore.QMetaObject.connectSlotsByName(Form)
|
||||
|
||||
def retranslateUi(self, Form):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
Form.setWindowTitle(_translate("Form", "图像色彩空间转换"))
|
||||
self.label_title.setText(_translate("Form", "图像色彩空间转换"))
|
||||
self.label_image.setText(_translate("Form", "图片将显示在这里"))
|
||||
self.pushButton_open_file.setText(_translate("Form", "打开图片"))
|
||||
self.groupBox.setTitle(_translate("Form", "灰度转换"))
|
||||
self.pushButton_gray_convert.setText(_translate("Form", "灰度转换"))
|
||||
self.groupBox_2.setTitle(_translate("Form", "二值化"))
|
||||
self.label_bin_convert_1.setText(_translate("Form", "设置阈值:"))
|
||||
self.pushButton_bin_convert.setText(_translate("Form", "二值化转换"))
|
||||
self.label_color_space_1.setText(_translate("Form", "当前色彩空间:"))
|
||||
self.pushButton_reset.setText(_translate("Form", "恢复默认"))
|
||||
|
@ -0,0 +1,54 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file './ui_sub_window_10.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.11.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
class Ui_Form(object):
|
||||
def setupUi(self, Form):
|
||||
Form.setObjectName("Form")
|
||||
Form.resize(686, 524)
|
||||
self.label = QtWidgets.QLabel(Form)
|
||||
self.label.setGeometry(QtCore.QRect(210, 30, 271, 61))
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("黑体")
|
||||
font.setPointSize(12)
|
||||
self.label.setFont(font)
|
||||
self.label.setAlignment(QtCore.Qt.AlignCenter)
|
||||
self.label.setObjectName("label")
|
||||
self.textBrowser = QtWidgets.QTextBrowser(Form)
|
||||
self.textBrowser.setGeometry(QtCore.QRect(100, 110, 491, 261))
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("黑体")
|
||||
font.setPointSize(10)
|
||||
self.textBrowser.setFont(font)
|
||||
self.textBrowser.setFocusPolicy(QtCore.Qt.StrongFocus)
|
||||
self.textBrowser.setObjectName("textBrowser")
|
||||
self.label_2 = QtWidgets.QLabel(Form)
|
||||
self.label_2.setGeometry(QtCore.QRect(490, 430, 101, 41))
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("黑体")
|
||||
font.setPointSize(10)
|
||||
self.label_2.setFont(font)
|
||||
self.label_2.setObjectName("label_2")
|
||||
|
||||
self.retranslateUi(Form)
|
||||
QtCore.QMetaObject.connectSlotsByName(Form)
|
||||
|
||||
def retranslateUi(self, Form):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
Form.setWindowTitle(_translate("Form", "关于本软件"))
|
||||
self.label.setText(_translate("Form", "1561130423-阳旭 的毕业设计"))
|
||||
self.textBrowser.setHtml(_translate("Form", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
|
||||
"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
|
||||
"p, li { white-space: pre-wrap; }\n"
|
||||
"</style></head><body style=\" font-family:\'黑体\'; font-size:10pt; font-weight:400; font-style:normal;\">\n"
|
||||
"<p align=\"justify\" style=\" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-family:\'宋体\';\">本课题针对图像处理的难点,设计了一款界面友好的图像处理仿真系统,意在帮助初学者形象的理解图像处理所涉及的部分知识点。</span></p>\n"
|
||||
"<p align=\"justify\" style=\" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-family:\'宋体\';\">该软件包含常见的图像处理实例,例如图像缩放、加噪、平滑锐化、直方图均衡、压缩编码,边缘检测、人脸检测等。这些模块涉及到较多图像处理知识,通过每个模块设计的实例,循序渐进的让初学者加深理解图像处理方法间的联系,激发初学者对图像处理的兴趣。</span></p>\n"
|
||||
"<p align=\"justify\" style=\" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-family:\'宋体\';\">本设计利用</span><span style=\" font-family:\'Times New Roman,serif\';\">PyCharm</span><span style=\" font-family:\'宋体\';\">和</span><span style=\" font-family:\'Times New Roman,serif\';\">QT Designer</span><span style=\" font-family:\'宋体\';\">开发平台,基于</span><span style=\" font-family:\'Times New Roman,serif\';\">Python</span><span style=\" font-family:\'宋体\';\">编程语言以及</span><span style=\" font-family:\'Times New Roman,serif\';\">OpenCV</span><span style=\" font-family:\'宋体\';\">计算机视觉库,利用</span><span style=\" font-family:\'Times New Roman,serif\';\">Qt5</span><span style=\" font-family:\'宋体\';\">作为</span><span style=\" font-family:\'Times New Roman,serif\';\">GUI</span><span style=\" font-family:\'宋体\';\">框架,构建了一个兼容</span><span style=\" font-family:\'Times New Roman,serif\';\">Windows-x86</span><span style=\" font-family:\'宋体\';\">平台的软件。</span></p></body></html>"))
|
||||
self.label_2.setText(_translate("Form", "2019-06-03"))
|
||||
|
@ -0,0 +1,297 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file './ui_sub_window_3.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.11.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
class Ui_Form(object):
|
||||
def setupUi(self, Form):
|
||||
Form.setObjectName("Form")
|
||||
Form.resize(1334, 770)
|
||||
self.groupBox = QtWidgets.QGroupBox(Form)
|
||||
self.groupBox.setGeometry(QtCore.QRect(650, 20, 361, 201))
|
||||
self.groupBox.setTitle("")
|
||||
self.groupBox.setObjectName("groupBox")
|
||||
self.groupBox_median_blur_filter = QtWidgets.QGroupBox(self.groupBox)
|
||||
self.groupBox_median_blur_filter.setGeometry(QtCore.QRect(10, 100, 161, 91))
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("Agency FB")
|
||||
font.setPointSize(8)
|
||||
self.groupBox_median_blur_filter.setFont(font)
|
||||
self.groupBox_median_blur_filter.setObjectName("groupBox_median_blur_filter")
|
||||
self.label_title_3 = QtWidgets.QLabel(self.groupBox_median_blur_filter)
|
||||
self.label_title_3.setGeometry(QtCore.QRect(10, 20, 51, 21))
|
||||
self.label_title_3.setObjectName("label_title_3")
|
||||
self.spinBox_median_ksize = QtWidgets.QSpinBox(self.groupBox_median_blur_filter)
|
||||
self.spinBox_median_ksize.setGeometry(QtCore.QRect(100, 20, 46, 22))
|
||||
self.spinBox_median_ksize.setMinimum(3)
|
||||
self.spinBox_median_ksize.setSingleStep(2)
|
||||
self.spinBox_median_ksize.setProperty("value", 3)
|
||||
self.spinBox_median_ksize.setObjectName("spinBox_median_ksize")
|
||||
self.pushButton_median_blur_filter = QtWidgets.QPushButton(self.groupBox_median_blur_filter)
|
||||
self.pushButton_median_blur_filter.setGeometry(QtCore.QRect(30, 50, 111, 28))
|
||||
self.pushButton_median_blur_filter.setObjectName("pushButton_median_blur_filter")
|
||||
self.groupBox_gauss_blur_filter = QtWidgets.QGroupBox(self.groupBox)
|
||||
self.groupBox_gauss_blur_filter.setGeometry(QtCore.QRect(190, 10, 161, 91))
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("Agency FB")
|
||||
font.setPointSize(8)
|
||||
self.groupBox_gauss_blur_filter.setFont(font)
|
||||
self.groupBox_gauss_blur_filter.setObjectName("groupBox_gauss_blur_filter")
|
||||
self.label_title_7 = QtWidgets.QLabel(self.groupBox_gauss_blur_filter)
|
||||
self.label_title_7.setGeometry(QtCore.QRect(10, 20, 51, 21))
|
||||
self.label_title_7.setObjectName("label_title_7")
|
||||
self.spinBox_gauss_blur_ksize = QtWidgets.QSpinBox(self.groupBox_gauss_blur_filter)
|
||||
self.spinBox_gauss_blur_ksize.setGeometry(QtCore.QRect(100, 20, 46, 22))
|
||||
self.spinBox_gauss_blur_ksize.setMinimum(3)
|
||||
self.spinBox_gauss_blur_ksize.setSingleStep(2)
|
||||
self.spinBox_gauss_blur_ksize.setProperty("value", 3)
|
||||
self.spinBox_gauss_blur_ksize.setObjectName("spinBox_gauss_blur_ksize")
|
||||
self.pushButton_gauss_blur_filter = QtWidgets.QPushButton(self.groupBox_gauss_blur_filter)
|
||||
self.pushButton_gauss_blur_filter.setGeometry(QtCore.QRect(30, 50, 111, 28))
|
||||
self.pushButton_gauss_blur_filter.setObjectName("pushButton_gauss_blur_filter")
|
||||
self.groupBox_mean_blur_filter = QtWidgets.QGroupBox(self.groupBox)
|
||||
self.groupBox_mean_blur_filter.setGeometry(QtCore.QRect(10, 10, 161, 91))
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("Agency FB")
|
||||
font.setPointSize(8)
|
||||
self.groupBox_mean_blur_filter.setFont(font)
|
||||
self.groupBox_mean_blur_filter.setObjectName("groupBox_mean_blur_filter")
|
||||
self.label_title_9 = QtWidgets.QLabel(self.groupBox_mean_blur_filter)
|
||||
self.label_title_9.setGeometry(QtCore.QRect(10, 20, 51, 21))
|
||||
self.label_title_9.setObjectName("label_title_9")
|
||||
self.spinBox_mean_ksize = QtWidgets.QSpinBox(self.groupBox_mean_blur_filter)
|
||||
self.spinBox_mean_ksize.setGeometry(QtCore.QRect(100, 20, 46, 22))
|
||||
self.spinBox_mean_ksize.setMinimum(3)
|
||||
self.spinBox_mean_ksize.setSingleStep(2)
|
||||
self.spinBox_mean_ksize.setProperty("value", 3)
|
||||
self.spinBox_mean_ksize.setObjectName("spinBox_mean_ksize")
|
||||
self.pushButton_mean_blur_filter = QtWidgets.QPushButton(self.groupBox_mean_blur_filter)
|
||||
self.pushButton_mean_blur_filter.setGeometry(QtCore.QRect(30, 50, 111, 28))
|
||||
self.pushButton_mean_blur_filter.setObjectName("pushButton_mean_blur_filter")
|
||||
self.groupBox_double_blur_filter = QtWidgets.QGroupBox(self.groupBox)
|
||||
self.groupBox_double_blur_filter.setGeometry(QtCore.QRect(190, 100, 161, 91))
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("Agency FB")
|
||||
font.setPointSize(8)
|
||||
self.groupBox_double_blur_filter.setFont(font)
|
||||
self.groupBox_double_blur_filter.setObjectName("groupBox_double_blur_filter")
|
||||
self.pushButton_double_blur_filter = QtWidgets.QPushButton(self.groupBox_double_blur_filter)
|
||||
self.pushButton_double_blur_filter.setGeometry(QtCore.QRect(30, 30, 111, 28))
|
||||
self.pushButton_double_blur_filter.setObjectName("pushButton_double_blur_filter")
|
||||
self.pushButton_open_file = QtWidgets.QPushButton(Form)
|
||||
self.pushButton_open_file.setGeometry(QtCore.QRect(30, 30, 101, 31))
|
||||
self.pushButton_open_file.setCheckable(False)
|
||||
self.pushButton_open_file.setDefault(True)
|
||||
self.pushButton_open_file.setObjectName("pushButton_open_file")
|
||||
self.groupBox_2 = QtWidgets.QGroupBox(Form)
|
||||
self.groupBox_2.setGeometry(QtCore.QRect(150, 20, 461, 201))
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("Agency FB")
|
||||
font.setPointSize(9)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.groupBox_2.setFont(font)
|
||||
self.groupBox_2.setTitle("")
|
||||
self.groupBox_2.setFlat(False)
|
||||
self.groupBox_2.setCheckable(False)
|
||||
self.groupBox_2.setObjectName("groupBox_2")
|
||||
self.groupBox_salt_noise = QtWidgets.QGroupBox(self.groupBox_2)
|
||||
self.groupBox_salt_noise.setGeometry(QtCore.QRect(10, 10, 141, 181))
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("Agency FB")
|
||||
font.setPointSize(7)
|
||||
self.groupBox_salt_noise.setFont(font)
|
||||
self.groupBox_salt_noise.setObjectName("groupBox_salt_noise")
|
||||
self.label = QtWidgets.QLabel(self.groupBox_salt_noise)
|
||||
self.label.setGeometry(QtCore.QRect(10, 30, 41, 21))
|
||||
self.label.setObjectName("label")
|
||||
self.doubleSpinBox_salt_proportion = QtWidgets.QDoubleSpinBox(self.groupBox_salt_noise)
|
||||
self.doubleSpinBox_salt_proportion.setGeometry(QtCore.QRect(50, 30, 61, 22))
|
||||
self.doubleSpinBox_salt_proportion.setMaximum(0.9)
|
||||
self.doubleSpinBox_salt_proportion.setSingleStep(0.01)
|
||||
self.doubleSpinBox_salt_proportion.setProperty("value", 0.05)
|
||||
self.doubleSpinBox_salt_proportion.setObjectName("doubleSpinBox_salt_proportion")
|
||||
self.pushButton_salt_pepper_noise = QtWidgets.QPushButton(self.groupBox_salt_noise)
|
||||
self.pushButton_salt_pepper_noise.setGeometry(QtCore.QRect(20, 130, 101, 28))
|
||||
self.pushButton_salt_pepper_noise.setObjectName("pushButton_salt_pepper_noise")
|
||||
self.radioButton_1 = QtWidgets.QRadioButton(self.groupBox_salt_noise)
|
||||
self.radioButton_1.setGeometry(QtCore.QRect(20, 60, 101, 19))
|
||||
self.radioButton_1.setChecked(True)
|
||||
self.radioButton_1.setObjectName("radioButton_1")
|
||||
self.radioButton_2 = QtWidgets.QRadioButton(self.groupBox_salt_noise)
|
||||
self.radioButton_2.setGeometry(QtCore.QRect(20, 80, 101, 19))
|
||||
self.radioButton_2.setObjectName("radioButton_2")
|
||||
self.radioButton_3 = QtWidgets.QRadioButton(self.groupBox_salt_noise)
|
||||
self.radioButton_3.setGeometry(QtCore.QRect(20, 100, 101, 19))
|
||||
self.radioButton_3.setObjectName("radioButton_3")
|
||||
self.groupBox_speckle_noise = QtWidgets.QGroupBox(self.groupBox_2)
|
||||
self.groupBox_speckle_noise.setGeometry(QtCore.QRect(310, 10, 141, 181))
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("Agency FB")
|
||||
font.setPointSize(7)
|
||||
self.groupBox_speckle_noise.setFont(font)
|
||||
self.groupBox_speckle_noise.setObjectName("groupBox_speckle_noise")
|
||||
self.pushButton_speckle_noise = QtWidgets.QPushButton(self.groupBox_speckle_noise)
|
||||
self.pushButton_speckle_noise.setGeometry(QtCore.QRect(20, 130, 101, 28))
|
||||
self.pushButton_speckle_noise.setObjectName("pushButton_speckle_noise")
|
||||
self.label_title_11 = QtWidgets.QLabel(self.groupBox_speckle_noise)
|
||||
self.label_title_11.setGeometry(QtCore.QRect(20, 30, 41, 21))
|
||||
self.label_title_11.setObjectName("label_title_11")
|
||||
self.label_title_12 = QtWidgets.QLabel(self.groupBox_speckle_noise)
|
||||
self.label_title_12.setGeometry(QtCore.QRect(20, 60, 41, 21))
|
||||
self.label_title_12.setObjectName("label_title_12")
|
||||
self.doubleSpinBox_speckle_var = QtWidgets.QDoubleSpinBox(self.groupBox_speckle_noise)
|
||||
self.doubleSpinBox_speckle_var.setGeometry(QtCore.QRect(60, 60, 61, 22))
|
||||
self.doubleSpinBox_speckle_var.setMaximum(1.0)
|
||||
self.doubleSpinBox_speckle_var.setSingleStep(0.01)
|
||||
self.doubleSpinBox_speckle_var.setProperty("value", 0.05)
|
||||
self.doubleSpinBox_speckle_var.setObjectName("doubleSpinBox_speckle_var")
|
||||
self.doubleSpinBox_speckle_mean = QtWidgets.QDoubleSpinBox(self.groupBox_speckle_noise)
|
||||
self.doubleSpinBox_speckle_mean.setGeometry(QtCore.QRect(60, 30, 61, 22))
|
||||
self.doubleSpinBox_speckle_mean.setMinimum(-1.0)
|
||||
self.doubleSpinBox_speckle_mean.setMaximum(1.0)
|
||||
self.doubleSpinBox_speckle_mean.setSingleStep(0.01)
|
||||
self.doubleSpinBox_speckle_mean.setProperty("value", 0.0)
|
||||
self.doubleSpinBox_speckle_mean.setObjectName("doubleSpinBox_speckle_mean")
|
||||
self.groupBox_gauss_noise = QtWidgets.QGroupBox(self.groupBox_2)
|
||||
self.groupBox_gauss_noise.setGeometry(QtCore.QRect(160, 10, 141, 181))
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("Agency FB")
|
||||
font.setPointSize(7)
|
||||
self.groupBox_gauss_noise.setFont(font)
|
||||
self.groupBox_gauss_noise.setObjectName("groupBox_gauss_noise")
|
||||
self.pushButton_gasuss_noise = QtWidgets.QPushButton(self.groupBox_gauss_noise)
|
||||
self.pushButton_gasuss_noise.setGeometry(QtCore.QRect(20, 130, 101, 28))
|
||||
self.pushButton_gasuss_noise.setObjectName("pushButton_gasuss_noise")
|
||||
self.doubleSpinBox_gauss_mean = QtWidgets.QDoubleSpinBox(self.groupBox_gauss_noise)
|
||||
self.doubleSpinBox_gauss_mean.setGeometry(QtCore.QRect(60, 30, 61, 22))
|
||||
self.doubleSpinBox_gauss_mean.setMinimum(-1.0)
|
||||
self.doubleSpinBox_gauss_mean.setMaximum(1.0)
|
||||
self.doubleSpinBox_gauss_mean.setSingleStep(0.01)
|
||||
self.doubleSpinBox_gauss_mean.setProperty("value", 0.0)
|
||||
self.doubleSpinBox_gauss_mean.setObjectName("doubleSpinBox_gauss_mean")
|
||||
self.label_title_8 = QtWidgets.QLabel(self.groupBox_gauss_noise)
|
||||
self.label_title_8.setGeometry(QtCore.QRect(20, 30, 41, 21))
|
||||
self.label_title_8.setObjectName("label_title_8")
|
||||
self.doubleSpinBox_gauss_var = QtWidgets.QDoubleSpinBox(self.groupBox_gauss_noise)
|
||||
self.doubleSpinBox_gauss_var.setGeometry(QtCore.QRect(60, 60, 61, 22))
|
||||
self.doubleSpinBox_gauss_var.setMaximum(1.0)
|
||||
self.doubleSpinBox_gauss_var.setSingleStep(0.01)
|
||||
self.doubleSpinBox_gauss_var.setProperty("value", 0.05)
|
||||
self.doubleSpinBox_gauss_var.setObjectName("doubleSpinBox_gauss_var")
|
||||
self.label_title_10 = QtWidgets.QLabel(self.groupBox_gauss_noise)
|
||||
self.label_title_10.setGeometry(QtCore.QRect(20, 60, 41, 21))
|
||||
self.label_title_10.setObjectName("label_title_10")
|
||||
self.comboBox_noise_type = QtWidgets.QComboBox(Form)
|
||||
self.comboBox_noise_type.setGeometry(QtCore.QRect(30, 110, 100, 20))
|
||||
self.comboBox_noise_type.setMaxVisibleItems(10)
|
||||
self.comboBox_noise_type.setInsertPolicy(QtWidgets.QComboBox.InsertAtBottom)
|
||||
self.comboBox_noise_type.setSizeAdjustPolicy(QtWidgets.QComboBox.AdjustToContentsOnFirstShow)
|
||||
self.comboBox_noise_type.setFrame(True)
|
||||
self.comboBox_noise_type.setModelColumn(0)
|
||||
self.comboBox_noise_type.setObjectName("comboBox_noise_type")
|
||||
self.label_2 = QtWidgets.QLabel(Form)
|
||||
self.label_2.setGeometry(QtCore.QRect(30, 80, 100, 31))
|
||||
self.label_2.setObjectName("label_2")
|
||||
self.label_3 = QtWidgets.QLabel(Form)
|
||||
self.label_3.setGeometry(QtCore.QRect(30, 150, 100, 31))
|
||||
self.label_3.setObjectName("label_3")
|
||||
self.comboBox_filter_type = QtWidgets.QComboBox(Form)
|
||||
self.comboBox_filter_type.setGeometry(QtCore.QRect(30, 180, 100, 20))
|
||||
self.comboBox_filter_type.setMaxVisibleItems(10)
|
||||
self.comboBox_filter_type.setFrame(True)
|
||||
self.comboBox_filter_type.setModelColumn(0)
|
||||
self.comboBox_filter_type.setObjectName("comboBox_filter_type")
|
||||
self.label_title = QtWidgets.QLabel(Form)
|
||||
self.label_title.setGeometry(QtCore.QRect(1030, 30, 281, 41))
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("Agency FB")
|
||||
font.setPointSize(22)
|
||||
font.setBold(True)
|
||||
font.setWeight(75)
|
||||
self.label_title.setFont(font)
|
||||
self.label_title.setAlignment(QtCore.Qt.AlignCenter)
|
||||
self.label_title.setObjectName("label_title")
|
||||
self.label_image_3 = QtWidgets.QLabel(Form)
|
||||
self.label_image_3.setGeometry(QtCore.QRect(880, 280, 420, 400))
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("Agency FB")
|
||||
font.setPointSize(12)
|
||||
font.setBold(True)
|
||||
font.setWeight(75)
|
||||
self.label_image_3.setFont(font)
|
||||
self.label_image_3.setFrameShape(QtWidgets.QFrame.Box)
|
||||
self.label_image_3.setFrameShadow(QtWidgets.QFrame.Raised)
|
||||
self.label_image_3.setAlignment(QtCore.Qt.AlignCenter)
|
||||
self.label_image_3.setObjectName("label_image_3")
|
||||
self.label_image_2 = QtWidgets.QLabel(Form)
|
||||
self.label_image_2.setGeometry(QtCore.QRect(450, 280, 420, 400))
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("Agency FB")
|
||||
font.setPointSize(12)
|
||||
font.setBold(True)
|
||||
font.setWeight(75)
|
||||
self.label_image_2.setFont(font)
|
||||
self.label_image_2.setFrameShape(QtWidgets.QFrame.Box)
|
||||
self.label_image_2.setFrameShadow(QtWidgets.QFrame.Raised)
|
||||
self.label_image_2.setAlignment(QtCore.Qt.AlignCenter)
|
||||
self.label_image_2.setObjectName("label_image_2")
|
||||
self.label_image_1 = QtWidgets.QLabel(Form)
|
||||
self.label_image_1.setGeometry(QtCore.QRect(20, 280, 420, 400))
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("Agency FB")
|
||||
font.setPointSize(12)
|
||||
font.setBold(True)
|
||||
font.setWeight(75)
|
||||
self.label_image_1.setFont(font)
|
||||
self.label_image_1.setFrameShape(QtWidgets.QFrame.Box)
|
||||
self.label_image_1.setFrameShadow(QtWidgets.QFrame.Raised)
|
||||
self.label_image_1.setAlignment(QtCore.Qt.AlignCenter)
|
||||
self.label_image_1.setObjectName("label_image_1")
|
||||
|
||||
self.retranslateUi(Form)
|
||||
self.comboBox_noise_type.setCurrentIndex(-1)
|
||||
self.comboBox_filter_type.setCurrentIndex(-1)
|
||||
QtCore.QMetaObject.connectSlotsByName(Form)
|
||||
|
||||
def retranslateUi(self, Form):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
Form.setWindowTitle(_translate("Form", "图像的加噪和平滑"))
|
||||
self.groupBox_median_blur_filter.setTitle(_translate("Form", "中值滤波"))
|
||||
self.label_title_3.setText(_translate("Form", "核大小:"))
|
||||
self.pushButton_median_blur_filter.setText(_translate("Form", "开始处理"))
|
||||
self.groupBox_gauss_blur_filter.setTitle(_translate("Form", "高斯滤波"))
|
||||
self.label_title_7.setText(_translate("Form", "核大小:"))
|
||||
self.pushButton_gauss_blur_filter.setText(_translate("Form", "开始处理"))
|
||||
self.groupBox_mean_blur_filter.setTitle(_translate("Form", "均值滤波"))
|
||||
self.label_title_9.setText(_translate("Form", "核大小:"))
|
||||
self.pushButton_mean_blur_filter.setText(_translate("Form", "开始处理"))
|
||||
self.groupBox_double_blur_filter.setTitle(_translate("Form", "双边滤波"))
|
||||
self.pushButton_double_blur_filter.setText(_translate("Form", "开始处理"))
|
||||
self.pushButton_open_file.setText(_translate("Form", "打开图片"))
|
||||
self.groupBox_salt_noise.setTitle(_translate("Form", "椒盐噪声"))
|
||||
self.label.setText(_translate("Form", "比例:"))
|
||||
self.pushButton_salt_pepper_noise.setText(_translate("Form", "确定"))
|
||||
self.radioButton_1.setText(_translate("Form", "椒盐(随机)"))
|
||||
self.radioButton_2.setText(_translate("Form", "盐(白点)"))
|
||||
self.radioButton_3.setText(_translate("Form", "椒(黑点)"))
|
||||
self.groupBox_speckle_noise.setTitle(_translate("Form", "乘积性噪声"))
|
||||
self.pushButton_speckle_noise.setText(_translate("Form", "确定"))
|
||||
self.label_title_11.setText(_translate("Form", "均值:"))
|
||||
self.label_title_12.setText(_translate("Form", "方差:"))
|
||||
self.groupBox_gauss_noise.setTitle(_translate("Form", "高斯噪声"))
|
||||
self.pushButton_gasuss_noise.setText(_translate("Form", "确定"))
|
||||
self.label_title_8.setText(_translate("Form", "均值:"))
|
||||
self.label_title_10.setText(_translate("Form", "方差:"))
|
||||
self.label_2.setText(_translate("Form", "添加噪声类型:"))
|
||||
self.label_3.setText(_translate("Form", "平滑滤波类型:"))
|
||||
self.label_title.setText(_translate("Form", "图像加噪和平滑"))
|
||||
self.label_image_3.setText(_translate("Form", "平滑滤波"))
|
||||
self.label_image_2.setText(_translate("Form", "加噪"))
|
||||
self.label_image_1.setText(_translate("Form", "原图"))
|
||||
|
@ -0,0 +1,178 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file './ui_sub_window_4.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.11.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
class Ui_Form(object):
|
||||
def setupUi(self, Form):
|
||||
Form.setObjectName("Form")
|
||||
Form.resize(1269, 752)
|
||||
self.label_title = QtWidgets.QLabel(Form)
|
||||
self.label_title.setGeometry(QtCore.QRect(30, 10, 161, 41))
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("Agency FB")
|
||||
font.setPointSize(22)
|
||||
font.setBold(True)
|
||||
font.setWeight(75)
|
||||
self.label_title.setFont(font)
|
||||
self.label_title.setAlignment(QtCore.Qt.AlignCenter)
|
||||
self.label_title.setObjectName("label_title")
|
||||
self.label_image_2 = QtWidgets.QLabel(Form)
|
||||
self.label_image_2.setGeometry(QtCore.QRect(740, 10, 480, 480))
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("Agency FB")
|
||||
font.setPointSize(14)
|
||||
font.setBold(True)
|
||||
font.setWeight(75)
|
||||
self.label_image_2.setFont(font)
|
||||
self.label_image_2.setFrameShape(QtWidgets.QFrame.Box)
|
||||
self.label_image_2.setFrameShadow(QtWidgets.QFrame.Raised)
|
||||
self.label_image_2.setAlignment(QtCore.Qt.AlignCenter)
|
||||
self.label_image_2.setObjectName("label_image_2")
|
||||
self.pushButton_open_file = QtWidgets.QPushButton(Form)
|
||||
self.pushButton_open_file.setGeometry(QtCore.QRect(40, 90, 111, 28))
|
||||
self.pushButton_open_file.setCheckable(False)
|
||||
self.pushButton_open_file.setDefault(True)
|
||||
self.pushButton_open_file.setObjectName("pushButton_open_file")
|
||||
self.groupBox_sobel_filter = QtWidgets.QGroupBox(Form)
|
||||
self.groupBox_sobel_filter.setGeometry(QtCore.QRect(10, 230, 171, 151))
|
||||
self.groupBox_sobel_filter.setObjectName("groupBox_sobel_filter")
|
||||
self.pushButton_sobel_filter = QtWidgets.QPushButton(self.groupBox_sobel_filter)
|
||||
self.pushButton_sobel_filter.setGeometry(QtCore.QRect(40, 110, 93, 28))
|
||||
self.pushButton_sobel_filter.setObjectName("pushButton_sobel_filter")
|
||||
self.radioButton_sobel_dx = QtWidgets.QRadioButton(self.groupBox_sobel_filter)
|
||||
self.radioButton_sobel_dx.setGeometry(QtCore.QRect(30, 20, 121, 19))
|
||||
self.radioButton_sobel_dx.setObjectName("radioButton_sobel_dx")
|
||||
self.radioButton_sobel_dy = QtWidgets.QRadioButton(self.groupBox_sobel_filter)
|
||||
self.radioButton_sobel_dy.setGeometry(QtCore.QRect(30, 50, 121, 19))
|
||||
self.radioButton_sobel_dy.setObjectName("radioButton_sobel_dy")
|
||||
self.radioButton_sobel_dx_dy = QtWidgets.QRadioButton(self.groupBox_sobel_filter)
|
||||
self.radioButton_sobel_dx_dy.setGeometry(QtCore.QRect(30, 80, 121, 19))
|
||||
self.radioButton_sobel_dx_dy.setObjectName("radioButton_sobel_dx_dy")
|
||||
self.groupBox_laplace_filter = QtWidgets.QGroupBox(Form)
|
||||
self.groupBox_laplace_filter.setGeometry(QtCore.QRect(10, 400, 171, 111))
|
||||
self.groupBox_laplace_filter.setObjectName("groupBox_laplace_filter")
|
||||
self.pushButton_laplace_filter = QtWidgets.QPushButton(self.groupBox_laplace_filter)
|
||||
self.pushButton_laplace_filter.setGeometry(QtCore.QRect(40, 60, 93, 28))
|
||||
self.pushButton_laplace_filter.setObjectName("pushButton_laplace_filter")
|
||||
self.spinBox_laplace_ksize = QtWidgets.QSpinBox(self.groupBox_laplace_filter)
|
||||
self.spinBox_laplace_ksize.setGeometry(QtCore.QRect(100, 30, 46, 22))
|
||||
self.spinBox_laplace_ksize.setMinimum(1)
|
||||
self.spinBox_laplace_ksize.setSingleStep(2)
|
||||
self.spinBox_laplace_ksize.setProperty("value", 1)
|
||||
self.spinBox_laplace_ksize.setObjectName("spinBox_laplace_ksize")
|
||||
self.label_title_9 = QtWidgets.QLabel(self.groupBox_laplace_filter)
|
||||
self.label_title_9.setGeometry(QtCore.QRect(30, 30, 51, 21))
|
||||
self.label_title_9.setObjectName("label_title_9")
|
||||
self.label_image_1 = QtWidgets.QLabel(Form)
|
||||
self.label_image_1.setGeometry(QtCore.QRect(220, 10, 480, 480))
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("Agency FB")
|
||||
font.setPointSize(14)
|
||||
font.setBold(True)
|
||||
font.setWeight(75)
|
||||
self.label_image_1.setFont(font)
|
||||
self.label_image_1.setFrameShape(QtWidgets.QFrame.Box)
|
||||
self.label_image_1.setFrameShadow(QtWidgets.QFrame.Raised)
|
||||
self.label_image_1.setScaledContents(False)
|
||||
self.label_image_1.setAlignment(QtCore.Qt.AlignCenter)
|
||||
self.label_image_1.setObjectName("label_image_1")
|
||||
self.groupBox_custom_filter = QtWidgets.QGroupBox(Form)
|
||||
self.groupBox_custom_filter.setGeometry(QtCore.QRect(10, 530, 271, 211))
|
||||
self.groupBox_custom_filter.setObjectName("groupBox_custom_filter")
|
||||
self.doubleSpinBox_custom_filter_1 = QtWidgets.QDoubleSpinBox(self.groupBox_custom_filter)
|
||||
self.doubleSpinBox_custom_filter_1.setGeometry(QtCore.QRect(40, 40, 51, 22))
|
||||
self.doubleSpinBox_custom_filter_1.setDecimals(1)
|
||||
self.doubleSpinBox_custom_filter_1.setMinimum(-100.0)
|
||||
self.doubleSpinBox_custom_filter_1.setSingleStep(0.5)
|
||||
self.doubleSpinBox_custom_filter_1.setObjectName("doubleSpinBox_custom_filter_1")
|
||||
self.doubleSpinBox_custom_filter_2 = QtWidgets.QDoubleSpinBox(self.groupBox_custom_filter)
|
||||
self.doubleSpinBox_custom_filter_2.setGeometry(QtCore.QRect(110, 40, 51, 22))
|
||||
self.doubleSpinBox_custom_filter_2.setDecimals(1)
|
||||
self.doubleSpinBox_custom_filter_2.setMinimum(-100.0)
|
||||
self.doubleSpinBox_custom_filter_2.setSingleStep(0.5)
|
||||
self.doubleSpinBox_custom_filter_2.setProperty("value", -1.0)
|
||||
self.doubleSpinBox_custom_filter_2.setObjectName("doubleSpinBox_custom_filter_2")
|
||||
self.doubleSpinBox_custom_filter_3 = QtWidgets.QDoubleSpinBox(self.groupBox_custom_filter)
|
||||
self.doubleSpinBox_custom_filter_3.setGeometry(QtCore.QRect(180, 40, 51, 22))
|
||||
self.doubleSpinBox_custom_filter_3.setDecimals(1)
|
||||
self.doubleSpinBox_custom_filter_3.setMinimum(-100.0)
|
||||
self.doubleSpinBox_custom_filter_3.setSingleStep(0.5)
|
||||
self.doubleSpinBox_custom_filter_3.setObjectName("doubleSpinBox_custom_filter_3")
|
||||
self.doubleSpinBox_custom_filter_4 = QtWidgets.QDoubleSpinBox(self.groupBox_custom_filter)
|
||||
self.doubleSpinBox_custom_filter_4.setGeometry(QtCore.QRect(40, 80, 51, 22))
|
||||
self.doubleSpinBox_custom_filter_4.setDecimals(1)
|
||||
self.doubleSpinBox_custom_filter_4.setMinimum(-100.0)
|
||||
self.doubleSpinBox_custom_filter_4.setSingleStep(0.5)
|
||||
self.doubleSpinBox_custom_filter_4.setProperty("value", -1.0)
|
||||
self.doubleSpinBox_custom_filter_4.setObjectName("doubleSpinBox_custom_filter_4")
|
||||
self.doubleSpinBox_custom_filter_5 = QtWidgets.QDoubleSpinBox(self.groupBox_custom_filter)
|
||||
self.doubleSpinBox_custom_filter_5.setGeometry(QtCore.QRect(110, 80, 51, 22))
|
||||
self.doubleSpinBox_custom_filter_5.setDecimals(1)
|
||||
self.doubleSpinBox_custom_filter_5.setMinimum(-100.0)
|
||||
self.doubleSpinBox_custom_filter_5.setSingleStep(0.5)
|
||||
self.doubleSpinBox_custom_filter_5.setProperty("value", 5.0)
|
||||
self.doubleSpinBox_custom_filter_5.setObjectName("doubleSpinBox_custom_filter_5")
|
||||
self.doubleSpinBox_custom_filter_6 = QtWidgets.QDoubleSpinBox(self.groupBox_custom_filter)
|
||||
self.doubleSpinBox_custom_filter_6.setGeometry(QtCore.QRect(180, 80, 51, 22))
|
||||
self.doubleSpinBox_custom_filter_6.setDecimals(1)
|
||||
self.doubleSpinBox_custom_filter_6.setMinimum(-100.0)
|
||||
self.doubleSpinBox_custom_filter_6.setSingleStep(0.5)
|
||||
self.doubleSpinBox_custom_filter_6.setProperty("value", -1.0)
|
||||
self.doubleSpinBox_custom_filter_6.setObjectName("doubleSpinBox_custom_filter_6")
|
||||
self.doubleSpinBox_custom_filter_7 = QtWidgets.QDoubleSpinBox(self.groupBox_custom_filter)
|
||||
self.doubleSpinBox_custom_filter_7.setGeometry(QtCore.QRect(40, 120, 51, 22))
|
||||
self.doubleSpinBox_custom_filter_7.setDecimals(1)
|
||||
self.doubleSpinBox_custom_filter_7.setMinimum(-100.0)
|
||||
self.doubleSpinBox_custom_filter_7.setSingleStep(0.5)
|
||||
self.doubleSpinBox_custom_filter_7.setObjectName("doubleSpinBox_custom_filter_7")
|
||||
self.doubleSpinBox_custom_filter_8 = QtWidgets.QDoubleSpinBox(self.groupBox_custom_filter)
|
||||
self.doubleSpinBox_custom_filter_8.setGeometry(QtCore.QRect(110, 120, 51, 22))
|
||||
self.doubleSpinBox_custom_filter_8.setDecimals(1)
|
||||
self.doubleSpinBox_custom_filter_8.setMinimum(-100.0)
|
||||
self.doubleSpinBox_custom_filter_8.setSingleStep(0.5)
|
||||
self.doubleSpinBox_custom_filter_8.setProperty("value", -1.0)
|
||||
self.doubleSpinBox_custom_filter_8.setObjectName("doubleSpinBox_custom_filter_8")
|
||||
self.doubleSpinBox_custom_filter_9 = QtWidgets.QDoubleSpinBox(self.groupBox_custom_filter)
|
||||
self.doubleSpinBox_custom_filter_9.setGeometry(QtCore.QRect(180, 120, 51, 22))
|
||||
self.doubleSpinBox_custom_filter_9.setDecimals(1)
|
||||
self.doubleSpinBox_custom_filter_9.setMinimum(-100.0)
|
||||
self.doubleSpinBox_custom_filter_9.setSingleStep(0.5)
|
||||
self.doubleSpinBox_custom_filter_9.setObjectName("doubleSpinBox_custom_filter_9")
|
||||
self.pushButton_custom_filter = QtWidgets.QPushButton(self.groupBox_custom_filter)
|
||||
self.pushButton_custom_filter.setGeometry(QtCore.QRect(90, 160, 93, 28))
|
||||
self.pushButton_custom_filter.setObjectName("pushButton_custom_filter")
|
||||
self.comboBox_selector = QtWidgets.QComboBox(Form)
|
||||
self.comboBox_selector.setGeometry(QtCore.QRect(40, 180, 111, 31))
|
||||
self.comboBox_selector.setObjectName("comboBox_selector")
|
||||
self.label = QtWidgets.QLabel(Form)
|
||||
self.label.setGeometry(QtCore.QRect(40, 140, 111, 31))
|
||||
self.label.setObjectName("label")
|
||||
|
||||
self.retranslateUi(Form)
|
||||
QtCore.QMetaObject.connectSlotsByName(Form)
|
||||
|
||||
def retranslateUi(self, Form):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
Form.setWindowTitle(_translate("Form", "图像锐化"))
|
||||
self.label_title.setText(_translate("Form", "图像锐化"))
|
||||
self.label_image_2.setText(_translate("Form", "处理后的图像"))
|
||||
self.pushButton_open_file.setText(_translate("Form", "打开图片"))
|
||||
self.groupBox_sobel_filter.setTitle(_translate("Form", "Sobel算子"))
|
||||
self.pushButton_sobel_filter.setText(_translate("Form", "确定"))
|
||||
self.radioButton_sobel_dx.setText(_translate("Form", "X方向梯度"))
|
||||
self.radioButton_sobel_dy.setText(_translate("Form", "Y方向梯度"))
|
||||
self.radioButton_sobel_dx_dy.setText(_translate("Form", "X和Y方向梯度"))
|
||||
self.groupBox_laplace_filter.setTitle(_translate("Form", "Laplace算子"))
|
||||
self.pushButton_laplace_filter.setText(_translate("Form", "确定"))
|
||||
self.label_title_9.setText(_translate("Form", "核大小:"))
|
||||
self.label_image_1.setText(_translate("Form", "原图"))
|
||||
self.groupBox_custom_filter.setTitle(_translate("Form", "自定义3*3卷积核"))
|
||||
self.pushButton_custom_filter.setText(_translate("Form", "确定"))
|
||||
self.label.setText(_translate("Form", "选择锐化类型:"))
|
||||
|
@ -0,0 +1,108 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file './ui_sub_window_5.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.11.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
class Ui_Form(object):
|
||||
def setupUi(self, Form):
|
||||
Form.setObjectName("Form")
|
||||
Form.resize(1269, 797)
|
||||
self.label_image_2 = QtWidgets.QLabel(Form)
|
||||
self.label_image_2.setGeometry(QtCore.QRect(710, 10, 450, 450))
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("Agency FB")
|
||||
font.setPointSize(14)
|
||||
font.setBold(True)
|
||||
font.setWeight(75)
|
||||
self.label_image_2.setFont(font)
|
||||
self.label_image_2.setFrameShape(QtWidgets.QFrame.Box)
|
||||
self.label_image_2.setFrameShadow(QtWidgets.QFrame.Raised)
|
||||
self.label_image_2.setAlignment(QtCore.Qt.AlignCenter)
|
||||
self.label_image_2.setObjectName("label_image_2")
|
||||
self.pushButton_open_file = QtWidgets.QPushButton(Form)
|
||||
self.pushButton_open_file.setGeometry(QtCore.QRect(60, 60, 111, 28))
|
||||
self.pushButton_open_file.setCheckable(False)
|
||||
self.pushButton_open_file.setDefault(True)
|
||||
self.pushButton_open_file.setObjectName("pushButton_open_file")
|
||||
self.label_image_1 = QtWidgets.QLabel(Form)
|
||||
self.label_image_1.setGeometry(QtCore.QRect(250, 10, 450, 450))
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("Agency FB")
|
||||
font.setPointSize(14)
|
||||
font.setBold(True)
|
||||
font.setWeight(75)
|
||||
self.label_image_1.setFont(font)
|
||||
self.label_image_1.setFrameShape(QtWidgets.QFrame.Box)
|
||||
self.label_image_1.setFrameShadow(QtWidgets.QFrame.Raised)
|
||||
self.label_image_1.setScaledContents(False)
|
||||
self.label_image_1.setAlignment(QtCore.Qt.AlignCenter)
|
||||
self.label_image_1.setObjectName("label_image_1")
|
||||
self.label_image_3 = QtWidgets.QLabel(Form)
|
||||
self.label_image_3.setGeometry(QtCore.QRect(370, 470, 256, 256))
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("Agency FB")
|
||||
font.setPointSize(14)
|
||||
font.setBold(True)
|
||||
font.setWeight(75)
|
||||
self.label_image_3.setFont(font)
|
||||
self.label_image_3.setFrameShape(QtWidgets.QFrame.Box)
|
||||
self.label_image_3.setFrameShadow(QtWidgets.QFrame.Raised)
|
||||
self.label_image_3.setScaledContents(False)
|
||||
self.label_image_3.setAlignment(QtCore.Qt.AlignCenter)
|
||||
self.label_image_3.setObjectName("label_image_3")
|
||||
self.label_image_4 = QtWidgets.QLabel(Form)
|
||||
self.label_image_4.setGeometry(QtCore.QRect(820, 470, 256, 256))
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("Agency FB")
|
||||
font.setPointSize(14)
|
||||
font.setBold(True)
|
||||
font.setWeight(75)
|
||||
self.label_image_4.setFont(font)
|
||||
self.label_image_4.setFrameShape(QtWidgets.QFrame.Box)
|
||||
self.label_image_4.setFrameShadow(QtWidgets.QFrame.Raised)
|
||||
self.label_image_4.setAlignment(QtCore.Qt.AlignCenter)
|
||||
self.label_image_4.setObjectName("label_image_4")
|
||||
self.groupBox_1 = QtWidgets.QGroupBox(Form)
|
||||
self.groupBox_1.setGeometry(QtCore.QRect(30, 140, 181, 131))
|
||||
self.groupBox_1.setObjectName("groupBox_1")
|
||||
self.pushButton_brightness_change = QtWidgets.QPushButton(self.groupBox_1)
|
||||
self.pushButton_brightness_change.setGeometry(QtCore.QRect(40, 80, 93, 28))
|
||||
self.pushButton_brightness_change.setObjectName("pushButton_brightness_change")
|
||||
self.spinBox_brightness_change = QtWidgets.QSpinBox(self.groupBox_1)
|
||||
self.spinBox_brightness_change.setGeometry(QtCore.QRect(100, 40, 46, 22))
|
||||
self.spinBox_brightness_change.setMinimum(-255)
|
||||
self.spinBox_brightness_change.setMaximum(255)
|
||||
self.spinBox_brightness_change.setProperty("value", 20)
|
||||
self.spinBox_brightness_change.setObjectName("spinBox_brightness_change")
|
||||
self.label = QtWidgets.QLabel(self.groupBox_1)
|
||||
self.label.setGeometry(QtCore.QRect(20, 40, 61, 21))
|
||||
self.label.setObjectName("label")
|
||||
self.groupBox_2 = QtWidgets.QGroupBox(Form)
|
||||
self.groupBox_2.setGeometry(QtCore.QRect(30, 310, 181, 131))
|
||||
self.groupBox_2.setObjectName("groupBox_2")
|
||||
self.pushButton_hist_equ = QtWidgets.QPushButton(self.groupBox_2)
|
||||
self.pushButton_hist_equ.setGeometry(QtCore.QRect(40, 60, 93, 28))
|
||||
self.pushButton_hist_equ.setObjectName("pushButton_hist_equ")
|
||||
|
||||
self.retranslateUi(Form)
|
||||
QtCore.QMetaObject.connectSlotsByName(Form)
|
||||
|
||||
def retranslateUi(self, Form):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
Form.setWindowTitle(_translate("Form", "直方图均衡"))
|
||||
self.label_image_2.setText(_translate("Form", "处理后的图像"))
|
||||
self.pushButton_open_file.setText(_translate("Form", "打开图片"))
|
||||
self.label_image_1.setText(_translate("Form", "原图"))
|
||||
self.label_image_3.setText(_translate("Form", "原图直方图"))
|
||||
self.label_image_4.setText(_translate("Form", "处理后的图像直方图"))
|
||||
self.groupBox_1.setTitle(_translate("Form", "亮度均衡"))
|
||||
self.pushButton_brightness_change.setText(_translate("Form", "确定"))
|
||||
self.label.setText(_translate("Form", "均衡值"))
|
||||
self.groupBox_2.setTitle(_translate("Form", "直方图均衡"))
|
||||
self.pushButton_hist_equ.setText(_translate("Form", "确定"))
|
||||
|
@ -0,0 +1,106 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file './ui_sub_window_6.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.11.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
class Ui_Form(object):
|
||||
def setupUi(self, Form):
|
||||
Form.setObjectName("Form")
|
||||
Form.resize(1269, 613)
|
||||
self.label_image_2 = QtWidgets.QLabel(Form)
|
||||
self.label_image_2.setGeometry(QtCore.QRect(720, 10, 450, 450))
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("Agency FB")
|
||||
font.setPointSize(14)
|
||||
font.setBold(True)
|
||||
font.setWeight(75)
|
||||
self.label_image_2.setFont(font)
|
||||
self.label_image_2.setFrameShape(QtWidgets.QFrame.Box)
|
||||
self.label_image_2.setFrameShadow(QtWidgets.QFrame.Raised)
|
||||
self.label_image_2.setAlignment(QtCore.Qt.AlignCenter)
|
||||
self.label_image_2.setObjectName("label_image_2")
|
||||
self.pushButton_open_file = QtWidgets.QPushButton(Form)
|
||||
self.pushButton_open_file.setGeometry(QtCore.QRect(60, 110, 111, 28))
|
||||
self.pushButton_open_file.setCheckable(False)
|
||||
self.pushButton_open_file.setDefault(True)
|
||||
self.pushButton_open_file.setObjectName("pushButton_open_file")
|
||||
self.label_image_1 = QtWidgets.QLabel(Form)
|
||||
self.label_image_1.setGeometry(QtCore.QRect(250, 10, 450, 450))
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("Agency FB")
|
||||
font.setPointSize(14)
|
||||
font.setBold(True)
|
||||
font.setWeight(75)
|
||||
self.label_image_1.setFont(font)
|
||||
self.label_image_1.setFrameShape(QtWidgets.QFrame.Box)
|
||||
self.label_image_1.setFrameShadow(QtWidgets.QFrame.Raised)
|
||||
self.label_image_1.setScaledContents(False)
|
||||
self.label_image_1.setAlignment(QtCore.Qt.AlignCenter)
|
||||
self.label_image_1.setObjectName("label_image_1")
|
||||
self.groupBox_1 = QtWidgets.QGroupBox(Form)
|
||||
self.groupBox_1.setGeometry(QtCore.QRect(30, 180, 191, 271))
|
||||
self.groupBox_1.setObjectName("groupBox_1")
|
||||
self.pushButton_dct_process = QtWidgets.QPushButton(self.groupBox_1)
|
||||
self.pushButton_dct_process.setGeometry(QtCore.QRect(50, 220, 93, 28))
|
||||
self.pushButton_dct_process.setObjectName("pushButton_dct_process")
|
||||
self.verticalLayoutWidget = QtWidgets.QWidget(self.groupBox_1)
|
||||
self.verticalLayoutWidget.setGeometry(QtCore.QRect(40, 40, 111, 151))
|
||||
self.verticalLayoutWidget.setObjectName("verticalLayoutWidget")
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(self.verticalLayoutWidget)
|
||||
self.verticalLayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.radioButton_s1 = QtWidgets.QRadioButton(self.verticalLayoutWidget)
|
||||
self.radioButton_s1.setObjectName("radioButton_s1")
|
||||
self.verticalLayout.addWidget(self.radioButton_s1)
|
||||
self.radioButton_s3 = QtWidgets.QRadioButton(self.verticalLayoutWidget)
|
||||
self.radioButton_s3.setObjectName("radioButton_s3")
|
||||
self.verticalLayout.addWidget(self.radioButton_s3)
|
||||
self.radioButton_s6 = QtWidgets.QRadioButton(self.verticalLayoutWidget)
|
||||
self.radioButton_s6.setChecked(True)
|
||||
self.radioButton_s6.setObjectName("radioButton_s6")
|
||||
self.verticalLayout.addWidget(self.radioButton_s6)
|
||||
self.radioButton_s10 = QtWidgets.QRadioButton(self.verticalLayoutWidget)
|
||||
self.radioButton_s10.setObjectName("radioButton_s10")
|
||||
self.verticalLayout.addWidget(self.radioButton_s10)
|
||||
self.radioButton_s15 = QtWidgets.QRadioButton(self.verticalLayoutWidget)
|
||||
self.radioButton_s15.setObjectName("radioButton_s15")
|
||||
self.verticalLayout.addWidget(self.radioButton_s15)
|
||||
self.radioButton_s21 = QtWidgets.QRadioButton(self.verticalLayoutWidget)
|
||||
self.radioButton_s21.setObjectName("radioButton_s21")
|
||||
self.verticalLayout.addWidget(self.radioButton_s21)
|
||||
self.label = QtWidgets.QLabel(Form)
|
||||
self.label.setGeometry(QtCore.QRect(30, 10, 181, 51))
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("黑体")
|
||||
font.setPointSize(12)
|
||||
self.label.setFont(font)
|
||||
self.label.setObjectName("label")
|
||||
self.pushButton_save = QtWidgets.QPushButton(Form)
|
||||
self.pushButton_save.setGeometry(QtCore.QRect(920, 480, 93, 28))
|
||||
self.pushButton_save.setObjectName("pushButton_save")
|
||||
|
||||
self.retranslateUi(Form)
|
||||
QtCore.QMetaObject.connectSlotsByName(Form)
|
||||
|
||||
def retranslateUi(self, Form):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
Form.setWindowTitle(_translate("Form", "基于DCT的图像压缩"))
|
||||
self.label_image_2.setText(_translate("Form", "处理后的图像"))
|
||||
self.pushButton_open_file.setText(_translate("Form", "打开图片"))
|
||||
self.label_image_1.setText(_translate("Form", "原图"))
|
||||
self.groupBox_1.setTitle(_translate("Form", "DCT保留的频域系数"))
|
||||
self.pushButton_dct_process.setText(_translate("Form", "确定"))
|
||||
self.radioButton_s1.setText(_translate("Form", "1个系数"))
|
||||
self.radioButton_s3.setText(_translate("Form", "3个系数"))
|
||||
self.radioButton_s6.setText(_translate("Form", "6个系数"))
|
||||
self.radioButton_s10.setText(_translate("Form", "10个系数"))
|
||||
self.radioButton_s15.setText(_translate("Form", "15个系数"))
|
||||
self.radioButton_s21.setText(_translate("Form", "21个系数"))
|
||||
self.label.setText(_translate("Form", "基于DCT的图像压缩"))
|
||||
self.pushButton_save.setText(_translate("Form", "保存该图像"))
|
||||
|
@ -0,0 +1,81 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file './ui_sub_window_7.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.11.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
class Ui_Form(object):
|
||||
def setupUi(self, Form):
|
||||
Form.setObjectName("Form")
|
||||
Form.resize(1269, 613)
|
||||
self.label_image_2 = QtWidgets.QLabel(Form)
|
||||
self.label_image_2.setGeometry(QtCore.QRect(720, 10, 450, 450))
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("Agency FB")
|
||||
font.setPointSize(14)
|
||||
font.setBold(True)
|
||||
font.setWeight(75)
|
||||
self.label_image_2.setFont(font)
|
||||
self.label_image_2.setFrameShape(QtWidgets.QFrame.Box)
|
||||
self.label_image_2.setFrameShadow(QtWidgets.QFrame.Raised)
|
||||
self.label_image_2.setAlignment(QtCore.Qt.AlignCenter)
|
||||
self.label_image_2.setObjectName("label_image_2")
|
||||
self.pushButton_open_file = QtWidgets.QPushButton(Form)
|
||||
self.pushButton_open_file.setGeometry(QtCore.QRect(80, 80, 111, 28))
|
||||
self.pushButton_open_file.setCheckable(False)
|
||||
self.pushButton_open_file.setDefault(True)
|
||||
self.pushButton_open_file.setObjectName("pushButton_open_file")
|
||||
self.label_image_1 = QtWidgets.QLabel(Form)
|
||||
self.label_image_1.setGeometry(QtCore.QRect(250, 10, 450, 450))
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("Agency FB")
|
||||
font.setPointSize(14)
|
||||
font.setBold(True)
|
||||
font.setWeight(75)
|
||||
self.label_image_1.setFont(font)
|
||||
self.label_image_1.setFrameShape(QtWidgets.QFrame.Box)
|
||||
self.label_image_1.setFrameShadow(QtWidgets.QFrame.Raised)
|
||||
self.label_image_1.setScaledContents(False)
|
||||
self.label_image_1.setAlignment(QtCore.Qt.AlignCenter)
|
||||
self.label_image_1.setObjectName("label_image_1")
|
||||
self.groupBox_1 = QtWidgets.QGroupBox(Form)
|
||||
self.groupBox_1.setGeometry(QtCore.QRect(30, 190, 191, 251))
|
||||
self.groupBox_1.setObjectName("groupBox_1")
|
||||
self.pushButton_canny = QtWidgets.QPushButton(self.groupBox_1)
|
||||
self.pushButton_canny.setGeometry(QtCore.QRect(50, 190, 93, 28))
|
||||
self.pushButton_canny.setObjectName("pushButton_canny")
|
||||
self.spinBox_low_th = QtWidgets.QSpinBox(self.groupBox_1)
|
||||
self.spinBox_low_th.setGeometry(QtCore.QRect(120, 50, 61, 41))
|
||||
self.spinBox_low_th.setMaximum(255)
|
||||
self.spinBox_low_th.setProperty("value", 150)
|
||||
self.spinBox_low_th.setObjectName("spinBox_low_th")
|
||||
self.label = QtWidgets.QLabel(self.groupBox_1)
|
||||
self.label.setGeometry(QtCore.QRect(10, 50, 81, 41))
|
||||
self.label.setObjectName("label")
|
||||
self.spinBox_high_th = QtWidgets.QSpinBox(self.groupBox_1)
|
||||
self.spinBox_high_th.setGeometry(QtCore.QRect(120, 110, 61, 41))
|
||||
self.spinBox_high_th.setMaximum(255)
|
||||
self.spinBox_high_th.setProperty("value", 200)
|
||||
self.spinBox_high_th.setObjectName("spinBox_high_th")
|
||||
self.label_2 = QtWidgets.QLabel(self.groupBox_1)
|
||||
self.label_2.setGeometry(QtCore.QRect(10, 110, 81, 41))
|
||||
self.label_2.setObjectName("label_2")
|
||||
|
||||
self.retranslateUi(Form)
|
||||
QtCore.QMetaObject.connectSlotsByName(Form)
|
||||
|
||||
def retranslateUi(self, Form):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
Form.setWindowTitle(_translate("Form", "边缘检测"))
|
||||
self.label_image_2.setText(_translate("Form", "处理后的图像"))
|
||||
self.pushButton_open_file.setText(_translate("Form", "打开图片"))
|
||||
self.label_image_1.setText(_translate("Form", "原图"))
|
||||
self.groupBox_1.setTitle(_translate("Form", "Canny边缘检测"))
|
||||
self.pushButton_canny.setText(_translate("Form", "确定"))
|
||||
self.label.setText(_translate("Form", "低阈值抑制"))
|
||||
self.label_2.setText(_translate("Form", "高阈值抑制"))
|
||||
|
@ -0,0 +1,66 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file './ui_sub_window_8.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.11.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
class Ui_Form(object):
|
||||
def setupUi(self, Form):
|
||||
Form.setObjectName("Form")
|
||||
Form.resize(921, 726)
|
||||
self.label_title = QtWidgets.QLabel(Form)
|
||||
self.label_title.setGeometry(QtCore.QRect(20, 20, 161, 41))
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("Agency FB")
|
||||
font.setPointSize(22)
|
||||
font.setBold(True)
|
||||
font.setWeight(75)
|
||||
self.label_title.setFont(font)
|
||||
self.label_title.setAlignment(QtCore.Qt.AlignCenter)
|
||||
self.label_title.setObjectName("label_title")
|
||||
self.pushButton_open_file = QtWidgets.QPushButton(Form)
|
||||
self.pushButton_open_file.setGeometry(QtCore.QRect(40, 90, 111, 28))
|
||||
self.pushButton_open_file.setCheckable(False)
|
||||
self.pushButton_open_file.setDefault(True)
|
||||
self.pushButton_open_file.setObjectName("pushButton_open_file")
|
||||
self.label_image_1 = QtWidgets.QLabel(Form)
|
||||
self.label_image_1.setGeometry(QtCore.QRect(210, 10, 700, 700))
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("Agency FB")
|
||||
font.setPointSize(14)
|
||||
font.setBold(True)
|
||||
font.setWeight(75)
|
||||
self.label_image_1.setFont(font)
|
||||
self.label_image_1.setFrameShape(QtWidgets.QFrame.Box)
|
||||
self.label_image_1.setFrameShadow(QtWidgets.QFrame.Raised)
|
||||
self.label_image_1.setScaledContents(False)
|
||||
self.label_image_1.setAlignment(QtCore.Qt.AlignCenter)
|
||||
self.label_image_1.setObjectName("label_image_1")
|
||||
self.pushButton_video_captrue = QtWidgets.QPushButton(Form)
|
||||
self.pushButton_video_captrue.setGeometry(QtCore.QRect(40, 140, 111, 81))
|
||||
self.pushButton_video_captrue.setObjectName("pushButton_video_captrue")
|
||||
self.groupBox = QtWidgets.QGroupBox(Form)
|
||||
self.groupBox.setGeometry(QtCore.QRect(30, 260, 151, 81))
|
||||
self.groupBox.setObjectName("groupBox")
|
||||
self.label = QtWidgets.QLabel(self.groupBox)
|
||||
self.label.setGeometry(QtCore.QRect(40, 40, 72, 15))
|
||||
self.label.setAlignment(QtCore.Qt.AlignCenter)
|
||||
self.label.setObjectName("label")
|
||||
|
||||
self.retranslateUi(Form)
|
||||
QtCore.QMetaObject.connectSlotsByName(Form)
|
||||
|
||||
def retranslateUi(self, Form):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
Form.setWindowTitle(_translate("Form", "人脸检测"))
|
||||
self.label_title.setText(_translate("Form", "人脸检测"))
|
||||
self.pushButton_open_file.setText(_translate("Form", "打开图片"))
|
||||
self.label_image_1.setText(_translate("Form", "帧预览"))
|
||||
self.pushButton_video_captrue.setText(_translate("Form", "开始捕捉摄像头"))
|
||||
self.groupBox.setTitle(_translate("Form", "当前帧人脸数量:"))
|
||||
self.label.setText(_translate("Form", "0"))
|
||||
|
After Width: | Height: | Size: 40 KiB |
After Width: | Height: | Size: 6.0 KiB |
After Width: | Height: | Size: 32 KiB |
After Width: | Height: | Size: 504 KiB |
After Width: | Height: | Size: 471 KiB |
After Width: | Height: | Size: 512 KiB |
After Width: | Height: | Size: 646 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 86 KiB |
After Width: | Height: | Size: 128 KiB |
After Width: | Height: | Size: 88 KiB |
@ -0,0 +1,186 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Form</class>
|
||||
<widget class="QWidget" name="Form">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>733</width>
|
||||
<height>546</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>图像处理仿真系统</string>
|
||||
</property>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>220</x>
|
||||
<y>10</y>
|
||||
<width>291</width>
|
||||
<height>61</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>黑体</family>
|
||||
<pointsize>20</pointsize>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>图像处理仿真系统</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>30</x>
|
||||
<y>130</y>
|
||||
<width>331</width>
|
||||
<height>261</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>图像变换</string>
|
||||
</property>
|
||||
<widget class="QPushButton" name="pushButton_1">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>40</x>
|
||||
<y>50</y>
|
||||
<width>111</width>
|
||||
<height>71</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>色彩空间转换</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>170</x>
|
||||
<y>50</y>
|
||||
<width>111</width>
|
||||
<height>71</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>图像缩放剪裁</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_3">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>40</x>
|
||||
<y>140</y>
|
||||
<width>111</width>
|
||||
<height>71</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>图像加噪平滑</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_4">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>170</x>
|
||||
<y>140</y>
|
||||
<width>111</width>
|
||||
<height>71</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>图像锐化</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QGroupBox" name="groupBox_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>380</x>
|
||||
<y>130</y>
|
||||
<width>331</width>
|
||||
<height>261</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>应用实例</string>
|
||||
</property>
|
||||
<widget class="QPushButton" name="pushButton_8">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>180</x>
|
||||
<y>140</y>
|
||||
<width>111</width>
|
||||
<height>71</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>人脸检测</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_6">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>180</x>
|
||||
<y>50</y>
|
||||
<width>111</width>
|
||||
<height>71</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>图像压缩</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_5">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>50</x>
|
||||
<y>50</y>
|
||||
<width>111</width>
|
||||
<height>71</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>直方图变换</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_7">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>50</x>
|
||||
<y>140</y>
|
||||
<width>111</width>
|
||||
<height>71</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>边缘检测</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_10">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>560</x>
|
||||
<y>430</y>
|
||||
<width>111</width>
|
||||
<height>71</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>关于</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@ -0,0 +1,244 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Form</class>
|
||||
<widget class="QWidget" name="Form">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1158</width>
|
||||
<height>789</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>图像色彩空间转换</string>
|
||||
</property>
|
||||
<widget class="QLabel" name="label_title">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>810</x>
|
||||
<y>10</y>
|
||||
<width>321</width>
|
||||
<height>41</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Agency FB</family>
|
||||
<pointsize>22</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>图像色彩空间转换</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_image">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>240</x>
|
||||
<y>60</y>
|
||||
<width>900</width>
|
||||
<height>700</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Agency FB</family>
|
||||
<pointsize>14</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Box</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>图片将显示在这里</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_open_file">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<y>20</y>
|
||||
<width>191</width>
|
||||
<height>28</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>打开图片</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="default">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>170</y>
|
||||
<width>221</width>
|
||||
<height>81</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>灰度转换</string>
|
||||
</property>
|
||||
<widget class="QPushButton" name="pushButton_gray_convert">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>50</x>
|
||||
<y>30</y>
|
||||
<width>121</width>
|
||||
<height>28</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>灰度转换</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QGroupBox" name="groupBox_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>290</y>
|
||||
<width>221</width>
|
||||
<height>101</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>二值化</string>
|
||||
</property>
|
||||
<widget class="QLabel" name="label_bin_convert_1">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<y>20</y>
|
||||
<width>91</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>设置阈值:</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_bin_convert">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>50</x>
|
||||
<y>60</y>
|
||||
<width>121</width>
|
||||
<height>28</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>二值化转换</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QSpinBox" name="spinBox_bin_threshold">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>135</x>
|
||||
<y>20</y>
|
||||
<width>61</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>255</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>127</number>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QWidget" name="layoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>40</x>
|
||||
<y>80</y>
|
||||
<width>149</width>
|
||||
<height>51</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_color_space_1">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Agency FB</family>
|
||||
<pointsize>9</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>当前色彩空间:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_color_space_2">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Agency FB</family>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_reset">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>60</x>
|
||||
<y>430</y>
|
||||
<width>121</width>
|
||||
<height>28</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>恢复默认</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@ -0,0 +1,88 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Form</class>
|
||||
<widget class="QWidget" name="Form">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>686</width>
|
||||
<height>524</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>关于本软件</string>
|
||||
</property>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>210</x>
|
||||
<y>30</y>
|
||||
<width>271</width>
|
||||
<height>61</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>黑体</family>
|
||||
<pointsize>12</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>1561130423-阳旭 的毕业设计</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QTextBrowser" name="textBrowser">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>100</x>
|
||||
<y>110</y>
|
||||
<width>491</width>
|
||||
<height>261</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>黑体</family>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::StrongFocus</enum>
|
||||
</property>
|
||||
<property name="html">
|
||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'黑体'; font-size:10pt; font-weight:400; font-style:normal;">
|
||||
<p align="justify" style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'宋体';">本课题针对图像处理的难点,设计了一款界面友好的图像处理仿真系统,意在帮助初学者形象的理解图像处理所涉及的部分知识点。</span></p>
|
||||
<p align="justify" style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'宋体';">该软件包含常见的图像处理实例,例如图像缩放、加噪、平滑锐化、直方图均衡、压缩编码,边缘检测、人脸检测等。这些模块涉及到较多图像处理知识,通过每个模块设计的实例,循序渐进的让初学者加深理解图像处理方法间的联系,激发初学者对图像处理的兴趣。</span></p>
|
||||
<p align="justify" style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'宋体';">本设计利用</span><span style=" font-family:'Times New Roman,serif';">PyCharm</span><span style=" font-family:'宋体';">和</span><span style=" font-family:'Times New Roman,serif';">QT Designer</span><span style=" font-family:'宋体';">开发平台,基于</span><span style=" font-family:'Times New Roman,serif';">Python</span><span style=" font-family:'宋体';">编程语言以及</span><span style=" font-family:'Times New Roman,serif';">OpenCV</span><span style=" font-family:'宋体';">计算机视觉库,利用</span><span style=" font-family:'Times New Roman,serif';">Qt5</span><span style=" font-family:'宋体';">作为</span><span style=" font-family:'Times New Roman,serif';">GUI</span><span style=" font-family:'宋体';">框架,构建了一个兼容</span><span style=" font-family:'Times New Roman,serif';">Windows-x86</span><span style=" font-family:'宋体';">平台的软件。</span></p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>490</x>
|
||||
<y>430</y>
|
||||
<width>101</width>
|
||||
<height>41</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>黑体</family>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>2019-06-03</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@ -0,0 +1,796 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Form</class>
|
||||
<widget class="QWidget" name="Form">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1334</width>
|
||||
<height>770</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>图像的加噪和平滑</string>
|
||||
</property>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>650</x>
|
||||
<y>20</y>
|
||||
<width>361</width>
|
||||
<height>201</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string/>
|
||||
</property>
|
||||
<widget class="QGroupBox" name="groupBox_median_blur_filter">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>100</y>
|
||||
<width>161</width>
|
||||
<height>91</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Agency FB</family>
|
||||
<pointsize>8</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>中值滤波</string>
|
||||
</property>
|
||||
<widget class="QLabel" name="label_title_3">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>20</y>
|
||||
<width>51</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>核大小:</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QSpinBox" name="spinBox_median_ksize">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>100</x>
|
||||
<y>20</y>
|
||||
<width>46</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>3</number>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_median_blur_filter">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>30</x>
|
||||
<y>50</y>
|
||||
<width>111</width>
|
||||
<height>28</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>开始处理</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QGroupBox" name="groupBox_gauss_blur_filter">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>190</x>
|
||||
<y>10</y>
|
||||
<width>161</width>
|
||||
<height>91</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Agency FB</family>
|
||||
<pointsize>8</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>高斯滤波</string>
|
||||
</property>
|
||||
<widget class="QLabel" name="label_title_7">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>20</y>
|
||||
<width>51</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>核大小:</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QSpinBox" name="spinBox_gauss_blur_ksize">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>100</x>
|
||||
<y>20</y>
|
||||
<width>46</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>3</number>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_gauss_blur_filter">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>30</x>
|
||||
<y>50</y>
|
||||
<width>111</width>
|
||||
<height>28</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>开始处理</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QGroupBox" name="groupBox_mean_blur_filter">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>10</y>
|
||||
<width>161</width>
|
||||
<height>91</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Agency FB</family>
|
||||
<pointsize>8</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>均值滤波</string>
|
||||
</property>
|
||||
<widget class="QLabel" name="label_title_9">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>20</y>
|
||||
<width>51</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>核大小:</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QSpinBox" name="spinBox_mean_ksize">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>100</x>
|
||||
<y>20</y>
|
||||
<width>46</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>3</number>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_mean_blur_filter">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>30</x>
|
||||
<y>50</y>
|
||||
<width>111</width>
|
||||
<height>28</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>开始处理</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QGroupBox" name="groupBox_double_blur_filter">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>190</x>
|
||||
<y>100</y>
|
||||
<width>161</width>
|
||||
<height>91</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Agency FB</family>
|
||||
<pointsize>8</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>双边滤波</string>
|
||||
</property>
|
||||
<widget class="QPushButton" name="pushButton_double_blur_filter">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>30</x>
|
||||
<y>30</y>
|
||||
<width>111</width>
|
||||
<height>28</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>开始处理</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_open_file">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>30</x>
|
||||
<y>30</y>
|
||||
<width>101</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>打开图片</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="default">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QGroupBox" name="groupBox_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>150</x>
|
||||
<y>20</y>
|
||||
<width>461</width>
|
||||
<height>201</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Agency FB</family>
|
||||
<pointsize>9</pointsize>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="flat">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<widget class="QGroupBox" name="groupBox_salt_noise">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>10</y>
|
||||
<width>141</width>
|
||||
<height>181</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Agency FB</family>
|
||||
<pointsize>7</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>椒盐噪声</string>
|
||||
</property>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>30</y>
|
||||
<width>41</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>比例:</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QDoubleSpinBox" name="doubleSpinBox_salt_proportion">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>50</x>
|
||||
<y>30</y>
|
||||
<width>61</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>0.900000000000000</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.010000000000000</double>
|
||||
</property>
|
||||
<property name="value">
|
||||
<double>0.050000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_salt_pepper_noise">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<y>130</y>
|
||||
<width>101</width>
|
||||
<height>28</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>确定</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QRadioButton" name="radioButton_1">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<y>60</y>
|
||||
<width>101</width>
|
||||
<height>19</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>椒盐(随机)</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QRadioButton" name="radioButton_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<y>80</y>
|
||||
<width>101</width>
|
||||
<height>19</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>盐(白点)</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QRadioButton" name="radioButton_3">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<y>100</y>
|
||||
<width>101</width>
|
||||
<height>19</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>椒(黑点)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QGroupBox" name="groupBox_speckle_noise">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>310</x>
|
||||
<y>10</y>
|
||||
<width>141</width>
|
||||
<height>181</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Agency FB</family>
|
||||
<pointsize>7</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>乘积性噪声</string>
|
||||
</property>
|
||||
<widget class="QPushButton" name="pushButton_speckle_noise">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<y>130</y>
|
||||
<width>101</width>
|
||||
<height>28</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>确定</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_title_11">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<y>30</y>
|
||||
<width>41</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>均值:</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_title_12">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<y>60</y>
|
||||
<width>41</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>方差:</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QDoubleSpinBox" name="doubleSpinBox_speckle_var">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>60</x>
|
||||
<y>60</y>
|
||||
<width>61</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>1.000000000000000</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.010000000000000</double>
|
||||
</property>
|
||||
<property name="value">
|
||||
<double>0.050000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QDoubleSpinBox" name="doubleSpinBox_speckle_mean">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>60</x>
|
||||
<y>30</y>
|
||||
<width>61</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>-1.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>1.000000000000000</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.010000000000000</double>
|
||||
</property>
|
||||
<property name="value">
|
||||
<double>0.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QGroupBox" name="groupBox_gauss_noise">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>160</x>
|
||||
<y>10</y>
|
||||
<width>141</width>
|
||||
<height>181</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Agency FB</family>
|
||||
<pointsize>7</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>高斯噪声</string>
|
||||
</property>
|
||||
<widget class="QPushButton" name="pushButton_gasuss_noise">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<y>130</y>
|
||||
<width>101</width>
|
||||
<height>28</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>确定</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QDoubleSpinBox" name="doubleSpinBox_gauss_mean">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>60</x>
|
||||
<y>30</y>
|
||||
<width>61</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>-1.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>1.000000000000000</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.010000000000000</double>
|
||||
</property>
|
||||
<property name="value">
|
||||
<double>0.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_title_8">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<y>30</y>
|
||||
<width>41</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>均值:</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QDoubleSpinBox" name="doubleSpinBox_gauss_var">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>60</x>
|
||||
<y>60</y>
|
||||
<width>61</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>1.000000000000000</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.010000000000000</double>
|
||||
</property>
|
||||
<property name="value">
|
||||
<double>0.050000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_title_10">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<y>60</y>
|
||||
<width>41</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>方差:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QComboBox" name="comboBox_noise_type">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>30</x>
|
||||
<y>110</y>
|
||||
<width>100</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>-1</number>
|
||||
</property>
|
||||
<property name="maxVisibleItems">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="insertPolicy">
|
||||
<enum>QComboBox::InsertAtBottom</enum>
|
||||
</property>
|
||||
<property name="sizeAdjustPolicy">
|
||||
<enum>QComboBox::AdjustToContentsOnFirstShow</enum>
|
||||
</property>
|
||||
<property name="frame">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="modelColumn">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>30</x>
|
||||
<y>80</y>
|
||||
<width>100</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>添加噪声类型:</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>30</x>
|
||||
<y>150</y>
|
||||
<width>100</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>平滑滤波类型:</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QComboBox" name="comboBox_filter_type">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>30</x>
|
||||
<y>180</y>
|
||||
<width>100</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>-1</number>
|
||||
</property>
|
||||
<property name="maxVisibleItems">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="frame">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="modelColumn">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_title">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>1030</x>
|
||||
<y>30</y>
|
||||
<width>281</width>
|
||||
<height>41</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Agency FB</family>
|
||||
<pointsize>22</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>图像加噪和平滑</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_image_3">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>880</x>
|
||||
<y>280</y>
|
||||
<width>420</width>
|
||||
<height>400</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Agency FB</family>
|
||||
<pointsize>12</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Box</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>平滑滤波</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_image_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>450</x>
|
||||
<y>280</y>
|
||||
<width>420</width>
|
||||
<height>400</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Agency FB</family>
|
||||
<pointsize>12</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Box</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>加噪</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_image_1">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<y>280</y>
|
||||
<width>420</width>
|
||||
<height>400</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Agency FB</family>
|
||||
<pointsize>12</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Box</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>原图</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@ -0,0 +1,483 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Form</class>
|
||||
<widget class="QWidget" name="Form">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1269</width>
|
||||
<height>752</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>图像锐化</string>
|
||||
</property>
|
||||
<widget class="QLabel" name="label_title">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>30</x>
|
||||
<y>10</y>
|
||||
<width>161</width>
|
||||
<height>41</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Agency FB</family>
|
||||
<pointsize>22</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>图像锐化</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_image_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>740</x>
|
||||
<y>10</y>
|
||||
<width>480</width>
|
||||
<height>480</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Agency FB</family>
|
||||
<pointsize>14</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Box</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>处理后的图像</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_open_file">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>40</x>
|
||||
<y>90</y>
|
||||
<width>111</width>
|
||||
<height>28</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>打开图片</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="default">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QGroupBox" name="groupBox_sobel_filter">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>230</y>
|
||||
<width>171</width>
|
||||
<height>151</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Sobel算子</string>
|
||||
</property>
|
||||
<widget class="QPushButton" name="pushButton_sobel_filter">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>40</x>
|
||||
<y>110</y>
|
||||
<width>93</width>
|
||||
<height>28</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>确定</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QRadioButton" name="radioButton_sobel_dx">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>30</x>
|
||||
<y>20</y>
|
||||
<width>121</width>
|
||||
<height>19</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>X方向梯度</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QRadioButton" name="radioButton_sobel_dy">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>30</x>
|
||||
<y>50</y>
|
||||
<width>121</width>
|
||||
<height>19</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Y方向梯度</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QRadioButton" name="radioButton_sobel_dx_dy">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>30</x>
|
||||
<y>80</y>
|
||||
<width>121</width>
|
||||
<height>19</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>X和Y方向梯度</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QGroupBox" name="groupBox_laplace_filter">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>400</y>
|
||||
<width>171</width>
|
||||
<height>111</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Laplace算子</string>
|
||||
</property>
|
||||
<widget class="QPushButton" name="pushButton_laplace_filter">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>40</x>
|
||||
<y>60</y>
|
||||
<width>93</width>
|
||||
<height>28</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>确定</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QSpinBox" name="spinBox_laplace_ksize">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>100</x>
|
||||
<y>30</y>
|
||||
<width>46</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>1</number>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_title_9">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>30</x>
|
||||
<y>30</y>
|
||||
<width>51</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>核大小:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_image_1">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>220</x>
|
||||
<y>10</y>
|
||||
<width>480</width>
|
||||
<height>480</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Agency FB</family>
|
||||
<pointsize>14</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Box</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>原图</string>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QGroupBox" name="groupBox_custom_filter">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>530</y>
|
||||
<width>271</width>
|
||||
<height>211</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>自定义3*3卷积核</string>
|
||||
</property>
|
||||
<widget class="QDoubleSpinBox" name="doubleSpinBox_custom_filter_1">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>40</x>
|
||||
<y>40</y>
|
||||
<width>51</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>-100.000000000000000</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.500000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QDoubleSpinBox" name="doubleSpinBox_custom_filter_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>110</x>
|
||||
<y>40</y>
|
||||
<width>51</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>-100.000000000000000</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.500000000000000</double>
|
||||
</property>
|
||||
<property name="value">
|
||||
<double>-1.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QDoubleSpinBox" name="doubleSpinBox_custom_filter_3">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>180</x>
|
||||
<y>40</y>
|
||||
<width>51</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>-100.000000000000000</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.500000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QDoubleSpinBox" name="doubleSpinBox_custom_filter_4">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>40</x>
|
||||
<y>80</y>
|
||||
<width>51</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>-100.000000000000000</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.500000000000000</double>
|
||||
</property>
|
||||
<property name="value">
|
||||
<double>-1.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QDoubleSpinBox" name="doubleSpinBox_custom_filter_5">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>110</x>
|
||||
<y>80</y>
|
||||
<width>51</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>-100.000000000000000</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.500000000000000</double>
|
||||
</property>
|
||||
<property name="value">
|
||||
<double>5.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QDoubleSpinBox" name="doubleSpinBox_custom_filter_6">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>180</x>
|
||||
<y>80</y>
|
||||
<width>51</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>-100.000000000000000</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.500000000000000</double>
|
||||
</property>
|
||||
<property name="value">
|
||||
<double>-1.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QDoubleSpinBox" name="doubleSpinBox_custom_filter_7">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>40</x>
|
||||
<y>120</y>
|
||||
<width>51</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>-100.000000000000000</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.500000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QDoubleSpinBox" name="doubleSpinBox_custom_filter_8">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>110</x>
|
||||
<y>120</y>
|
||||
<width>51</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>-100.000000000000000</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.500000000000000</double>
|
||||
</property>
|
||||
<property name="value">
|
||||
<double>-1.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QDoubleSpinBox" name="doubleSpinBox_custom_filter_9">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>180</x>
|
||||
<y>120</y>
|
||||
<width>51</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>-100.000000000000000</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.500000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_custom_filter">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>90</x>
|
||||
<y>160</y>
|
||||
<width>93</width>
|
||||
<height>28</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>确定</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QComboBox" name="comboBox_selector">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>40</x>
|
||||
<y>180</y>
|
||||
<width>111</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>40</x>
|
||||
<y>140</y>
|
||||
<width>111</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>选择锐化类型:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@ -0,0 +1,248 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Form</class>
|
||||
<widget class="QWidget" name="Form">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1269</width>
|
||||
<height>797</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>直方图均衡</string>
|
||||
</property>
|
||||
<widget class="QLabel" name="label_image_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>710</x>
|
||||
<y>10</y>
|
||||
<width>450</width>
|
||||
<height>450</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Agency FB</family>
|
||||
<pointsize>14</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Box</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>处理后的图像</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_open_file">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>60</x>
|
||||
<y>60</y>
|
||||
<width>111</width>
|
||||
<height>28</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>打开图片</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="default">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_image_1">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>250</x>
|
||||
<y>10</y>
|
||||
<width>450</width>
|
||||
<height>450</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Agency FB</family>
|
||||
<pointsize>14</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Box</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>原图</string>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_image_3">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>370</x>
|
||||
<y>470</y>
|
||||
<width>256</width>
|
||||
<height>256</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Agency FB</family>
|
||||
<pointsize>14</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Box</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>原图直方图</string>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_image_4">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>820</x>
|
||||
<y>470</y>
|
||||
<width>256</width>
|
||||
<height>256</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Agency FB</family>
|
||||
<pointsize>14</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Box</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>处理后的图像直方图</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QGroupBox" name="groupBox_1">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>30</x>
|
||||
<y>140</y>
|
||||
<width>181</width>
|
||||
<height>131</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>亮度均衡</string>
|
||||
</property>
|
||||
<widget class="QPushButton" name="pushButton_brightness_change">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>40</x>
|
||||
<y>80</y>
|
||||
<width>93</width>
|
||||
<height>28</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>确定</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QSpinBox" name="spinBox_brightness_change">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>100</x>
|
||||
<y>40</y>
|
||||
<width>46</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>-255</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>255</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>20</number>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<y>40</y>
|
||||
<width>61</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>均衡值</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QGroupBox" name="groupBox_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>30</x>
|
||||
<y>310</y>
|
||||
<width>181</width>
|
||||
<height>131</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>直方图均衡</string>
|
||||
</property>
|
||||
<widget class="QPushButton" name="pushButton_hist_equ">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>40</x>
|
||||
<y>60</y>
|
||||
<width>93</width>
|
||||
<height>28</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>确定</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@ -0,0 +1,216 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Form</class>
|
||||
<widget class="QWidget" name="Form">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1269</width>
|
||||
<height>613</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>基于DCT的图像压缩</string>
|
||||
</property>
|
||||
<widget class="QLabel" name="label_image_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>720</x>
|
||||
<y>10</y>
|
||||
<width>450</width>
|
||||
<height>450</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Agency FB</family>
|
||||
<pointsize>14</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Box</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>处理后的图像</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_open_file">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>60</x>
|
||||
<y>110</y>
|
||||
<width>111</width>
|
||||
<height>28</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>打开图片</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="default">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_image_1">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>250</x>
|
||||
<y>10</y>
|
||||
<width>450</width>
|
||||
<height>450</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Agency FB</family>
|
||||
<pointsize>14</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Box</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>原图</string>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QGroupBox" name="groupBox_1">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>30</x>
|
||||
<y>180</y>
|
||||
<width>191</width>
|
||||
<height>271</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>DCT保留的频域系数</string>
|
||||
</property>
|
||||
<widget class="QPushButton" name="pushButton_dct_process">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>50</x>
|
||||
<y>220</y>
|
||||
<width>93</width>
|
||||
<height>28</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>确定</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QWidget" name="verticalLayoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>40</x>
|
||||
<y>40</y>
|
||||
<width>111</width>
|
||||
<height>151</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QRadioButton" name="radioButton_s1">
|
||||
<property name="text">
|
||||
<string>1个系数</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="radioButton_s3">
|
||||
<property name="text">
|
||||
<string>3个系数</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="radioButton_s6">
|
||||
<property name="text">
|
||||
<string>6个系数</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="radioButton_s10">
|
||||
<property name="text">
|
||||
<string>10个系数</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="radioButton_s15">
|
||||
<property name="text">
|
||||
<string>15个系数</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="radioButton_s21">
|
||||
<property name="text">
|
||||
<string>21个系数</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>30</x>
|
||||
<y>10</y>
|
||||
<width>181</width>
|
||||
<height>51</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>黑体</family>
|
||||
<pointsize>12</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>基于DCT的图像压缩</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_save">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>920</x>
|
||||
<y>480</y>
|
||||
<width>93</width>
|
||||
<height>28</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>保存该图像</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@ -0,0 +1,185 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Form</class>
|
||||
<widget class="QWidget" name="Form">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1269</width>
|
||||
<height>613</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>边缘检测</string>
|
||||
</property>
|
||||
<widget class="QLabel" name="label_image_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>720</x>
|
||||
<y>10</y>
|
||||
<width>450</width>
|
||||
<height>450</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Agency FB</family>
|
||||
<pointsize>14</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Box</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>处理后的图像</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_open_file">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>80</x>
|
||||
<y>80</y>
|
||||
<width>111</width>
|
||||
<height>28</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>打开图片</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="default">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_image_1">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>250</x>
|
||||
<y>10</y>
|
||||
<width>450</width>
|
||||
<height>450</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Agency FB</family>
|
||||
<pointsize>14</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Box</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>原图</string>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QGroupBox" name="groupBox_1">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>30</x>
|
||||
<y>190</y>
|
||||
<width>191</width>
|
||||
<height>251</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Canny边缘检测</string>
|
||||
</property>
|
||||
<widget class="QPushButton" name="pushButton_canny">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>50</x>
|
||||
<y>190</y>
|
||||
<width>93</width>
|
||||
<height>28</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>确定</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QSpinBox" name="spinBox_low_th">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>120</x>
|
||||
<y>50</y>
|
||||
<width>61</width>
|
||||
<height>41</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>255</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>150</number>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>50</y>
|
||||
<width>81</width>
|
||||
<height>41</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>低阈值抑制</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QSpinBox" name="spinBox_high_th">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>120</x>
|
||||
<y>110</y>
|
||||
<width>61</width>
|
||||
<height>41</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>255</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>200</number>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>110</y>
|
||||
<width>81</width>
|
||||
<height>41</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>高阈值抑制</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@ -0,0 +1,137 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Form</class>
|
||||
<widget class="QWidget" name="Form">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>921</width>
|
||||
<height>726</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>人脸检测</string>
|
||||
</property>
|
||||
<widget class="QLabel" name="label_title">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<y>20</y>
|
||||
<width>161</width>
|
||||
<height>41</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Agency FB</family>
|
||||
<pointsize>22</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>人脸检测</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_open_file">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>40</x>
|
||||
<y>90</y>
|
||||
<width>111</width>
|
||||
<height>28</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>打开图片</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="default">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_image_1">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>210</x>
|
||||
<y>10</y>
|
||||
<width>700</width>
|
||||
<height>700</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Agency FB</family>
|
||||
<pointsize>14</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Box</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>帧预览</string>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_video_captrue">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>40</x>
|
||||
<y>140</y>
|
||||
<width>111</width>
|
||||
<height>81</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>开始捕捉摄像头</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>30</x>
|
||||
<y>260</y>
|
||||
<width>151</width>
|
||||
<height>81</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>当前帧人脸数量:</string>
|
||||
</property>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>40</x>
|
||||
<y>40</y>
|
||||
<width>72</width>
|
||||
<height>15</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>0</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|