(Ebooks PDF) Download Building Computer Vision Applications Using Artificial Neural Networks: With Step-by-Step Examples in OpenCV and TensorFlow With Python 1st Edition Shamshad Ansari Full Chapters
(Ebooks PDF) Download Building Computer Vision Applications Using Artificial Neural Networks: With Step-by-Step Examples in OpenCV and TensorFlow With Python 1st Edition Shamshad Ansari Full Chapters
com
OR CLICK BUTTON
DOWLOAD NOW
More products digital (pdf, epub, mobi) instant
download maybe you interests ...
https://ebookmeta.com/product/building-computer-vision-
applications-using-artificial-neural-networks-2nd-edition-
shamshad-ansari/
https://ebookmeta.com/product/learn-opencv-with-python-by-
examples-2nd-edition-james-chen/
https://ebookmeta.com/product/artificial-neural-networks-with-
java-tools-for-building-neural-network-applications-2nd-edition-
igor-livshin/
https://ebookmeta.com/product/the-absolute-beginners-guide-to-
python-programming-a-step-by-step-guide-with-examples-and-lab-
exercises-1st-edition-kevin-wilson/
https://ebookmeta.com/product/artificial-neural-networks-with-
tensorflow-2-ann-architecture-machine-learning-projects-
poornachandra-sarang/
https://ebookmeta.com/product/learning-deep-learning-theory-and-
practice-of-neural-networks-computer-vision-nlp-and-transformers-
using-tensorflow-1st-edition-ekman-magnus/
https://ebookmeta.com/product/learn-computer-vision-using-opencv-
with-deep-learning-cnns-and-rnns-1st-edition-sunila-gollapudi/
Building Computer
Vision Applications
Using Artificial Neural
Networks
With Step-by-Step Examples in
OpenCV and TensorFlow with Python
—
Shamshad Ansari
www.allitebooks.com
Building Computer Vision
Applications Using
Artificial Neural Networks
With Step-by-Step Examples
in OpenCV and TensorFlow
with Python
Shamshad Ansari
www.allitebooks.com
Building Computer Vision Applications Using Artificial Neural Networks: With
Step-by-Step Examples in OpenCV and TensorFlow with Python
Shamshad Ansari
Centreville, VA, USA
www.allitebooks.com
In God we trust.
To my wonderful parents, Abdul Samad and
Nazhat Parween, who always corrected my mistakes and
raised me to become a good person.
To my lovely wife, Shazia, and our two beautiful daughters,
Dua and Erum. Without their love and support, this book
would not have been possible.
www.allitebooks.com
Table of Contents
About the Author�����������������������������������������������������������������������������������������������������xv
Introduction������������������������������������������������������������������������������������������������������������xxi
www.allitebooks.com
Table of Contents
vi
Table of Contents
Median Blurring��������������������������������������������������������������������������������������������������������������������� 69
Bilateral Blurring������������������������������������������������������������������������������������������������������������������� 71
Binarization with Thresholding��������������������������������������������������������������������������������������������������� 74
Simple Thresholding�������������������������������������������������������������������������������������������������������������� 74
Adaptive Thresholding����������������������������������������������������������������������������������������������������������� 77
Otsu’s Binarization����������������������������������������������������������������������������������������������������������������� 79
Gradients and Edge Detection����������������������������������������������������������������������������������������������������� 82
Sobel Derivatives (cv2.Sobel() Function)������������������������������������������������������������������������������� 82
Laplacian Derivatives (cv2.Laplacian() Function)������������������������������������������������������������������ 87
Canny Edge Detection����������������������������������������������������������������������������������������������������������� 89
Contours�������������������������������������������������������������������������������������������������������������������������������������� 90
Drawing Contours������������������������������������������������������������������������������������������������������������������ 93
Summary������������������������������������������������������������������������������������������������������������������������������������ 94
vii
Table of Contents
viii
Table of Contents
ix
Table of Contents
x
Table of Contents
xi
Table of Contents
xii
Table of Contents
Index��������������������������������������������������������������������������������������������������������������������� 443
xiii
About the Author
Shamshad (Sam) Ansari is president and CEO of Accure
Inc., an artificial intelligence automation company that he
founded. He has raised Accure from startup to a sustainable
business by building a winning team and acquiring customers
from across the globe. He has technical expertise in the areas
of computer vision, machine learning, AI, cognitive science,
NLP, and big data. He architected, designed, and developed
the Momentum platform that automates AI solution
development. He is an inventor and has four US patents in the
areas of AI and cognitive computing.
Shamshad previously worked as a senior software engineer with IBM, as VP of
engineering with Orbit Solutions, and as principal architect and director of engineering
with Apixio.
xv
About the Technical Reviewer
James Baldo is an associate professor at George Mason
University in the Volgenau School of Engineering and the
director of the Data Analytics Engineering (DAEN) Program.
His 38 years as a practicing engineer has provided him
with a broad foundation of knowledge and experience
in data analytics and engineering systems. His data
analytics interests span the areas of data engineering, data
science, and data architecture with a focus on data-centric
applications. His software engineering expertise has been
in support of deploying applications to cloud-based environments and microservice
architectures. As director of the DAEN Program, he has been responsible for developing
and coordinating its new online program offering. He holds a BS in chemistry, MS in
chemistry, MS in computer engineering, and PhD in information technology/software
engineering. He enjoys canoeing, hiking, and golf, and he lives in Manassas, Virginia,
with his wife.
xvii
Another random document with
no related content on Scribd:
Some think, and perhaps rightly, that his tilt with Mr. Conkling
popularized him greatly with the members of the House, who
thoroughly enjoyed it, and so prepared the way to the honor which
in point of fact was his by right of nature. But six years was a long
time to wait, yet he waited, and was rewarded. And still it was not
waiting, but working, with him, occupying the stronghold he had
made for himself in the manifold business of the House.
But now he is taken from this, and out of the arena of debate, and
yet lifted into greater prominence and power; appointing all the
great committees of the House, a task requiring the highest order of
ability in the knowledge of men; deciding all questions, and
exercising a controlling influence over legislation.
There is little power men employ in all the great work of life, but he
needs it in its rarest form. He must be a broad, a wide, a universal
man; in sympathy with all, so far as right and justice are concerned.
There are the choice, the crowned ones from every congressional
district in all the states and territories, and he is the choice, the
crowned one among them,—their chosen chief.
Tennyson’s words press for utterance right here, as we see him step
from the floor to the speaker’s chair:—
It was only by the proof of character, the most solid and reliable, he
could possibly have secured the friendship of Mr. Stevens. And not
his alone, but the friendship of Hon. Elihu B. Washburne, of Illinois,
who nominated Mr. Blaine as candidate for speaker, and who, as
senior member, swore him in.
It was a proud day for Mr. Washburne, the staunch friend of General
Grant, to witness his inaugural, and then, as the true friend of Mr.
Blaine, aid so largely in putting him into the speaker’s chair the same
day.
Mr. Stevens was not there to enjoy the triumph of his friend, but his
endorsement was good as a letter of credit.
When the ballot was concluded it read:—Whole number of votes
cast, one hundred and ninety-two; necessary for a choice, ninety-
seven; Mr. Blaine received one hundred and thirty-five; Mr. Kerr
received fifty-seven.
Mr. Dawes and Mr. Kerr conducted him to the chair, when he
addressed the House as follows:—
“Gentlemen of the House of Representatives:
“I thank you profoundly for the great honor which your
votes have just conferred upon me. The gratification
which this signal mark of your confidence brings to me,
finds its only drawback in the diffidence with which I
assume the weighty duties devolving upon me.
Succeeding to a chair made illustrious by such eminent
statesmen, and skilled parliamentarians as Clay, and
Stevenson, and Polk, and Winthrop, and Banks, and Grow,
and Colfax, I may well distrust my ability to meet the just
expectations of those who have shown me such marked
partiality. But relying, gentlemen, upon my honest purpose
to perform all my duties faithfully and fearlessly, and
trusting in a large measure to the indulgence which I am
sure you will always extend to me, I shall hope to retain,
as I have secured, your confidence, your kindly regard,
and your generous support.
“The forty-first congress assembles at an auspicious
period in the history of our government. The splendid and
impressive ceremonial which we have just witnessed in
another part of the capitol [Grant’s inauguration],
appropriately symbolizes the triumphs of the past, and the
hopes of the future, a great chieftain, whose sword at the
head of gallant and victorious armies, saved the Republic
from dismemberment and ruin, has been fitly called to the
highest civic honor which a grateful people can bestow.
Sustained by a congress which so ably represents the
loyalty, the patriotism, and the personal worth of the
nation, the president this day inaugurated will assure to
the country an administration of purity, fidelity, and
prosperity; an era of liberty regulated by law, and of law
thoroughly inspired with liberty.
“Congratulating you, gentlemen, on the happy auguries of
the day, and invoking the gracious blessings of Almighty
God on the arduous and responsible labors before you, I
am now ready to take the oath of office, and enter upon
the discharge of the duties to which you have called me.”
It is a curious coincidence that General Schenck, of Ohio, who
startled Mr. Blaine with the charge of irrelevancy at his first utterance
on the floor, but was so utterly discomfited afterwards, is now the
first one to address him as “Mr. Speaker,” and Mr. Kerr, his
competitor, soon follows.
It was at this session that new members from reconstructed states
appeared, and many were the objections made to this new member
and that, because of disloyalty. It was to present a charge of this
kind that Mr. Schenck arose.
The noticeable feature of Mr. Blaine’s speakership is the expeditious
manner in which business is conducted, and the consequent brevity
of sessions.
It may be observed right here that Mr. Blaine’s friend, E. B.
Washburne, chose rather to go as minister to Paris, and Hamilton
Fish became secretary of state.
For two successive congresses Mr. Blaine was re-elected speaker by
the large Republican majorities serving through the reconstruction
period of the rebel states, and through most of General Grant’s two
terms of the presidency. It was during this period his reputation
became truly national.
He might have occupied the chair all the time, and taken things
easy; but this was not his nature. It was his privilege to go upon the
floor, and take up the gauntlet of debate. It was expected that
things would become lively at once when he did so. There was a
resolution one day for a committee to investigate the outrages in the
South. Mr. Blaine had written the resolution, which was presented by
his colleague, and asked for its passage; and, lest the claquers
should say he put only “weak-kneed Republicans” on the committee,
he made Benj. F. Butler chairman, which in some almost
unaccountable way greatly enraged Mr. Butler, who might have then
contemplated accompanying Gen. John M. Palmer and others into
the Democratic party, and so he telegraphed to newspapers and
issued a circular which appeared on the desks of members,
denouncing what he was pleased to call a trick, and used other
vigorous language on the floor of the House. Of course the speaker
could not sit quietly in the chair and be thus tempestuously assailed,
so calling a future vice-president to the chair (Wheeler), he said, “I
wish to ask the gentleman from Massachusetts whether he denies
me the right to have drawn that resolution” (it was presented in the
caucus first which had just re-nominated Mr. Blaine for speaker).
Mr. Butler replied, “I have made no assertion on that subject, one
way or other.”
Mr. Blaine: “Did not the gentleman know distinctly that I drew it?”
“No, sir!” was the reply.
“Did I not take it to the gentleman and read it to him?”
“Yes, sir,” replied Mr. Butler.
“Did I not show him the manuscript?”
“Yes, sir,” was the reply.
“And at his suggestion,” continued Mr. Blaine, “I added these words,
‘and the expenses of said committee shall be paid from the
contingent fund of the House of Representatives’ (applause), and
the fact that ways and means were wanted to pay the expenses was
the only objection he made to it.”
It appears that the resolution was considered as a test of the
Republicanism of members. General Butler had been asked to take
the chairmanship, but refused, and said he would have nothing to do
with the resolution; but Mr. Blaine put him on the committee, and
when asked why, replied, “Because I knew very well that if I omitted
the appointment of the gentleman it would be heralded throughout
the length and breadth of the country by the claquers, who have so
industriously distributed this letter this morning, that the speaker
had packed the committee, as the gentleman said he would, with
‘weak-kneed Republicans,’ who would not go into an investigation
vigorously, as he would. That was the reason (applause), so that the
chair laid the responsibility upon the gentleman of declining the
appointment, and now the gentleman from Massachusetts is on his
responsibility before the country,” and there we leave him.
It can but be with peculiar interest that we read the strong words of
the oath taken so repeatedly by Mr. Blaine, and administered the
second time by Mr. Dawes, of Massachusetts, after he had received
one hundred and twenty-six votes, to ninety-two for Gen. George W.
Morgan, of Ohio.
It kept a large committee busy to pass upon the character of
members-elect and the legality of their election. Such was the
broken condition of state governments in the South, so battered by
war, and distracted by schism and contending factions. All of these
perplexities adhered to applicants for membership in congress,
presenting credentials of membership various in value as greenbacks
and gold, and these same perplexities affected the staple of
congressional measures.
Congress was increasing rapidly in the number of its members, so
that while one hundred and ninety-two votes were cast at Mr.
Blaine’s first election to the speakership in 1869, there were two
hundred and sixty-nine votes cast at his election to the same office
in 1873, of which number he received one hundred and eighty-nine,
and Mr. Ferdinand Wood received seventy-six.
Mr. Blaine refers to it in his address to the “Gentlemen of the House
of Representatives,” the last time he was elected speaker. “To be
chosen,” he says, “speaker of the House of Representatives is always
an honorable distinction; to be chosen a third time enhances the
honor more than three fold; to be chosen by the largest body that
ever assembled in the Capitol imposes a burden of responsibility
which only your indulgent kindness could embolden me to assume.
The first occupant of this chair presided over a House of sixty-five
members, representing a population far below the present aggregate
of the state of New York. At that time there were not, in the whole
United States, fifty thousand civilized inhabitants to be found one
hundred miles distant from the flow of the Atlantic tide. To-day,
gentlemen, a large majority of you come from beyond that limit, and
represent districts peopled then only by the Indian and the
adventurous frontiersman.
“The national government is not yet as old as many of its citizens,
but in this brief span of time,—less than one lengthened life,—it has,
under God’s good providence, extended its power until a continent is
the field of its empire, and attests the majesty of its law.
“With the growth of new states and the resulting changes in the
centres of population, new interests are developed, rival to the old,
but by no means hostile; diverse, but not antagonistic. Nay, rather
are all these interests in harmony, and the true science of just
government is to give to each its full and fair play, oppressing none
by undue exaction, favoring none by undue privilege.
“It is this great lesson which our daily experience is teaching,
binding us together more closely, making our mutual dependence
more manifest, and causing us to feel that, whether we live in the
North or in the South, in the East or in the West, we have indeed but
‘one country, one constitution, one destiny.’”
Few addresses so brief breathe a spirit of broader statesmanship, or
loftier ideal of civil government. Two years before this, in 1871, he
had been charged by General Butler with having presidential
aspirations, and surely he was able to manifest the true conception
of a just and righteous government, “oppressing none by undue
exaction, favoring none by undue privilege,” which is apparently the
exact outcome—a sort of paraphrase of Lincoln’s words, “With
malice toward none, with charity toward all.”
Many who had participated in the Rebellion, having had their political
disabilities removed by the vote of two-thirds of each House of
congress, came forward and took the special oath provided for them
by act of July 11, 1868.
Mr. Blaine seldom, if ever, leaves the chair to participate in debate
when questions of a political nature are pending, so that he may
hold himself aloof for fair ruling in all of his decisions.
The position of speaker is, in many respects, a thankless one. When
party spirit runs high, as it does at times, like the tide of battle, in
the great debates, men are swept on by their sympathies, as barks
are tossed in ocean-storms, and under the influence of their most
powerful prejudices they are driven to rash and unwarrantable
conclusions regarding the justice of any ruling, to conjectures the
most unfair and wanton regarding motive, and as in the case of Mr.
Blaine, to the most stupendous efforts at political assassination.
But it was not until the days of his speakership were over, and the
people at home had expressed their confidence in him and their love
and admiration for him, by electing him to congress for the seventh
time consecutively, that the storm struck him. It had been gathering
long. Its animus was enmity, its bulk was hate, its dark, frowning
exterior was streaked with the lurid lightnings of a baleful jealousy;
muttering thunders like the deep growlings of exasperation were
heard oft, but feared not.
The solid South had marched its rebel brigadiers by the score into
the arena of national questioning and discussion, where for twelve
years he had stood intrepid as the founders of the Republic. No man
was more at home upon that field than he,—none more familiar with
the men, the methods, and the measures that had triumphed there,
—and few have been more victorious in the great ends for which he
strove, few readier to challenge the coming of any man, to know his
rights, his mission, and his weight. He was, of all men, the most
unconquerable by those who plead for measures subversive of any
great or minor end for which the war was fought.
He had gained the credit of the fourteenth amendment, and had
been identified with all. He was simply bent upon resistance, the
most powerful he could command, against all encroachments of the
bad and false, and to show no favor toward any feature for which
rebellion fought. Fair, honorable, just,—none could be more so.
When speaker of the House, he was informed one day that a
prominent correspondent of a leading paper, who had maligned and
vilified him shockingly, was on the floor, and at once he said, “Invite
him up here,” and he gave him a seat by his side, within the
speaker’s desk, and placed at the disposal of the man the
information of public importance at his command. The fellow was
amazed, and went away and wrote how kindly he had been treated
by the great-hearted man of noble impulses, after he had so roundly
abused him.
There is nothing vindictive about him, nothing despicable. He is
severe, herculean, desperate for the right, and will win in every
battle that commands the forces of his being, if victory be
achievable. But he honors strong, square men, who have convictions
and dare proclaim them; but petty, mean, ignoble souls are first
despised, then pitied.
But the day of his betrayal came, the day of rebel wrath; and he met
the stroke before the nation’s gaze, and was vindicated before the
world.
A business correspondence, it had been said he had burned. He
said, “No, there it is, and I will read it to the House,” and he read it.
What business firm, it has been asked, would like to have their
correspondence regarding any great business interest, read to those
who are filled with all manner of suspicions, and so have it
misjudged, misinterpreted, and misapplied? And then, to show the
temper of those with whom he dealt, a cablegram from Europe
vindicating him, was for two days suppressed by the chairman of the
congressional committee, before whom he stood, and who failed to
convict him by any document at their command. The scene at that
time, and their discomfiture, is thus described by an eye-witness:—
“His management of his own case when the Mulligan letters came
out was worthy of any general who ever set a squadron in the field.
For nearly fifteen years I have looked down from the galleries of the
House and Senate, and I never saw, and never expect to see, and
never have read of such a scene, where the grandeur of human
effort was better illustrated, than when this great orator rushed
down the aisle, and, in the very face of Proctor Knott, charged him
with suppressing a telegram favorable to Blaine. The whole floor and
all the galleries were wild with excitement. Men yelled and cheered,
women waved their handkerchiefs and went off into hysterics, and
the floor was little less than a mob.”
About this time, Hon. Lot M. Morrill, of his state, was transferred
from the senate to the cabinet of President Grant, and as a partial
justification, General Connor, the governor of Maine at this time,
appointed him to represent Maine in the United States senate in
place of Mr. Morrill. The official note was as follows:—
“Augusta, Maine, July 9, 1876.
“To Hon. Milton Saylor, Speaker of the House of
Representatives, Washington, D. C.:
“Having tendered to the Hon. James G. Blaine the
appointment of senator in congress, he has placed in my
hands his resignation as representative from the third
district of Maine, to take effect Monday, July 10, 1876.
“SELDON CONNOR,
“Governor of Maine.”
When the legislature of his state met, he came before them and
placed himself under a thorough investigation at their hands. And as
Ex-Gov. A. P. Morrill says, “They made thorough work of it.” A man to
come forth from such an ordeal unscathed, and without the smell of
fire on his garments, must be right and not wrong,—or else he is the
veriest scoundrel, guilty, deeply so, and competent for bribes, and
they, the legislature of Maine, who virtually tried him, hopelessly
corrupt. But, no! this cannot be; and so he was vindicated, and
triumphantly elected by them to the highest trust within their gift, to
wear the honors of a Morrill and a Fessenden.
And yet again do they elect him for a full term of years. And then
the royal Garfield, the nation’s loved and honored president, knowing
all, and knowing him most intimately for seventeen years or more,
takes him into his cabinet, trustingly, and for the nation’s good.
Can victory be grander, or triumph more complete, endorsement
more honorable, or vindication more just, or a verdict be more
patient, thorough, or exhaustive of evidence! What man in all the
land, traduced and vilified just as Washington, Lincoln, and Garfield
were, wears prouder badges of endorsement from congress,
governor, legislature, senate, and conventions by the score! What
man that bears credentials of his character as trophies of higher
worth, from judges of sounder mind, and lives more unimpeachable?
Answer, ye who can!
XV.
UNITED STATES SENATOR.