mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-07 11:37:36 +08:00
Add pep8-naming to pre-commit hooks and fixes incorrect naming conventions (#7062)
* ci(pre-commit): Add pep8-naming to `pre-commit` hooks (#7038) * refactor: Fix naming conventions (#7038) * Update arithmetic_analysis/lu_decomposition.py Co-authored-by: Christian Clauss <cclauss@me.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * refactor(lu_decomposition): Replace `NDArray` with `ArrayLike` (#7038) * chore: Fix naming conventions in doctests (#7038) * fix: Temporarily disable project euler problem 104 (#7069) * chore: Fix naming conventions in doctests (#7038) Co-authored-by: Christian Clauss <cclauss@me.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
@ -11,7 +11,7 @@ import numpy as np
|
||||
from matplotlib import pyplot as plt
|
||||
|
||||
|
||||
class contrastStretch:
|
||||
class ConstantStretch:
|
||||
def __init__(self):
|
||||
self.img = ""
|
||||
self.original_image = ""
|
||||
@ -45,10 +45,10 @@ class contrastStretch:
|
||||
self.img[j][i] = self.last_list[num]
|
||||
cv2.imwrite("output_data/output.jpg", self.img)
|
||||
|
||||
def plotHistogram(self):
|
||||
def plot_histogram(self):
|
||||
plt.hist(self.img.ravel(), 256, [0, 256])
|
||||
|
||||
def showImage(self):
|
||||
def show_image(self):
|
||||
cv2.imshow("Output-Image", self.img)
|
||||
cv2.imshow("Input-Image", self.original_image)
|
||||
cv2.waitKey(5000)
|
||||
@ -57,7 +57,7 @@ class contrastStretch:
|
||||
|
||||
if __name__ == "__main__":
|
||||
file_path = os.path.join(os.path.basename(__file__), "image_data/input.jpg")
|
||||
stretcher = contrastStretch()
|
||||
stretcher = ConstantStretch()
|
||||
stretcher.stretch(file_path)
|
||||
stretcher.plotHistogram()
|
||||
stretcher.showImage()
|
||||
stretcher.plot_histogram()
|
||||
stretcher.show_image()
|
||||
|
Reference in New Issue
Block a user