From 849fc80a30e9e8585d0e8040dd5e77547c9901cf Mon Sep 17 00:00:00 2001 From: isatyamks Date: Mon, 7 Oct 2024 21:50:34 +0530 Subject: [PATCH 1/3] Update computer_vision/README.md with OpenCV documentation link --- computer_vision/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/computer_vision/README.md b/computer_vision/README.md index 1657128fd25e..9f935b142c08 100644 --- a/computer_vision/README.md +++ b/computer_vision/README.md @@ -8,4 +8,4 @@ Image processing and computer vision are a little different from each other. Ima While computer vision comes from modelling image processing using the techniques of machine learning, computer vision applies machine learning to recognize patterns for interpretation of images (much like the process of visual reasoning of human vision). * -* +* From 8422b3be63f6bfa24c3970e44651aef3cc64200e Mon Sep 17 00:00:00 2001 From: Satyam Kumar Date: Tue, 8 Oct 2024 23:05:42 +0530 Subject: [PATCH 2/3] Update fuzzy_operations.py --- fuzzy_logic/fuzzy_operations.py | 38 ++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/fuzzy_logic/fuzzy_operations.py b/fuzzy_logic/fuzzy_operations.py index c5e4cbde019d..094337c27157 100644 --- a/fuzzy_logic/fuzzy_operations.py +++ b/fuzzy_logic/fuzzy_operations.py @@ -138,23 +138,27 @@ def membership(self, x: float) -> float: msg = f"Invalid value {x} for fuzzy set {self}" raise ValueError(msg) - def union(self, other) -> FuzzySet: - """ - Calculate the union of this fuzzy set with another fuzzy set. - Args: - other (FuzzySet): Another fuzzy set to union with. - Returns: - FuzzySet: A new fuzzy set representing the union. - - >>> FuzzySet("a", 0.1, 0.2, 0.3).union(FuzzySet("b", 0.4, 0.5, 0.6)) - FuzzySet(name='a U b', left_boundary=0.1, peak=0.6, right_boundary=0.35) - """ - return FuzzySet( - f"{self.name} U {other.name}", - min(self.left_boundary, other.left_boundary), - max(self.right_boundary, other.right_boundary), - (self.peak + other.peak) / 2, - ) + def union(self, other: FuzzySet) -> FuzzySet: + """ + Calculate the union of this fuzzy set with another fuzzy set. + The union of two fuzzy sets is determined by taking the maximum + membership value at each point. + + Args: + other (FuzzySet): Another fuzzy set to union with. + + Returns: + FuzzySet: A new fuzzy set representing the union. + + >>> FuzzySet("a", 0.1, 0.2, 0.3).union(FuzzySet("b", 0.4, 0.5, 0.6)) + FuzzySet(name='a U b', left_boundary=0.1, peak=0.5, right_boundary=0.6) + """ + return FuzzySet( + f"{self.name} U {other.name}", + min(self.left_boundary, other.left_boundary), + max(self.peak, other.peak), + max(self.right_boundary, other.right_boundary) + ) def plot(self): """ From 94608c5f21e57c36b9c66ff13ac655f86dc95bd1 Mon Sep 17 00:00:00 2001 From: Satyam Kumar Date: Tue, 8 Oct 2024 23:07:37 +0530 Subject: [PATCH 3/3] Update README.md --- computer_vision/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/computer_vision/README.md b/computer_vision/README.md index 9f935b142c08..1657128fd25e 100644 --- a/computer_vision/README.md +++ b/computer_vision/README.md @@ -8,4 +8,4 @@ Image processing and computer vision are a little different from each other. Ima While computer vision comes from modelling image processing using the techniques of machine learning, computer vision applies machine learning to recognize patterns for interpretation of images (much like the process of visual reasoning of human vision). * -* +*