├── app ├── .gitignore ├── src │ ├── main │ │ ├── ic_opencv-playstore.png │ │ ├── res │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_opencv.png │ │ │ │ └── ic_opencv_round.png │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_opencv.png │ │ │ │ └── ic_opencv_round.png │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_opencv.png │ │ │ │ └── ic_opencv_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_opencv.png │ │ │ │ └── ic_opencv_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_opencv.png │ │ │ │ └── ic_opencv_round.png │ │ │ ├── menu │ │ │ │ ├── options_menu.xml │ │ │ │ └── navdrawer_menu.xml │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ ├── ic_opencv.xml │ │ │ │ └── ic_opencv_round.xml │ │ │ ├── values │ │ │ │ ├── colors.xml │ │ │ │ ├── themes.xml │ │ │ │ └── strings.xml │ │ │ ├── drawable │ │ │ │ ├── ic_baseline_vibration.xml │ │ │ │ ├── ic_license.xml │ │ │ │ └── ic_opencv_foreground.xml │ │ │ ├── values-night │ │ │ │ └── themes.xml │ │ │ ├── layout │ │ │ │ ├── fragment_grayscale.xml │ │ │ │ ├── activity_main.xml │ │ │ │ ├── fragment_licence.xml │ │ │ │ ├── fragment_erode.xml │ │ │ │ ├── fragment_dilate.xml │ │ │ │ ├── fragment_threshold.xml │ │ │ │ ├── fragment_canny.xml │ │ │ │ ├── fragment_gaussianblur.xml │ │ │ │ ├── fragment_title.xml │ │ │ │ ├── fragment_hsvextraction.xml │ │ │ │ └── fragment_rgbextraction.xml │ │ │ ├── navigation │ │ │ │ └── navigation.xml │ │ │ └── drawable-night │ │ │ │ └── ic_opencv_foreground.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── momomomo111 │ │ │ │ └── camerax_opencv │ │ │ │ ├── data │ │ │ │ ├── GrayscaleViewModel.kt │ │ │ │ ├── ErodeViewModel.kt │ │ │ │ ├── DilateViewModel.kt │ │ │ │ ├── CannyViewModel.kt │ │ │ │ ├── ThresholdViewModel.kt │ │ │ │ ├── SettingsViewModel.kt │ │ │ │ ├── GaussianblurViewModel.kt │ │ │ │ ├── Params.kt │ │ │ │ ├── HsvextractionViewModel.kt │ │ │ │ └── RgbextractionViewModel.kt │ │ │ │ ├── ui │ │ │ │ ├── LicenceFragment.kt │ │ │ │ ├── GrayScaleFragment.kt │ │ │ │ ├── ErodeFragment.kt │ │ │ │ ├── CannyFragment.kt │ │ │ │ ├── DilateFragment.kt │ │ │ │ ├── ThresholdFragment.kt │ │ │ │ ├── GaussianBlurFragment.kt │ │ │ │ ├── HsvExtractionFragment.kt │ │ │ │ ├── RgbExtractionFragment.kt │ │ │ │ └── TitleFragment.kt │ │ │ │ ├── util │ │ │ │ ├── VibrationUtil.kt │ │ │ │ ├── ProcessImageAnalyzer.kt │ │ │ │ └── CameraUtil.kt │ │ │ │ └── MainActivity.kt │ │ └── AndroidManifest.xml │ └── androidTest │ │ └── java │ │ └── com │ │ └── momomomo111 │ │ └── camerax_opencv │ │ └── CameraPreviewTest.kt ├── proguard-rules.pro └── build.gradle.kts ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .idea ├── codeStyles │ ├── codeStyleConfig.xml │ └── Project.xml ├── .gitignore ├── compiler.xml ├── jarRepositories.xml └── $CACHE_FILE$ ├── settings.gradle ├── LICENSE ├── README.md ├── docs └── PrivacyPolicy │ ├── Japanese.md │ └── English.md ├── gradle.properties ├── .github └── workflows │ └── android.yml ├── .gitignore ├── gradlew.bat └── gradlew /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/momomomo111/camerax_opencv/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/src/main/ic_opencv-playstore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/momomomo111/camerax_opencv/HEAD/app/src/main/ic_opencv-playstore.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_opencv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/momomomo111/camerax_opencv/HEAD/app/src/main/res/mipmap-hdpi/ic_opencv.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_opencv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/momomomo111/camerax_opencv/HEAD/app/src/main/res/mipmap-mdpi/ic_opencv.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_opencv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/momomomo111/camerax_opencv/HEAD/app/src/main/res/mipmap-xhdpi/ic_opencv.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_opencv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/momomomo111/camerax_opencv/HEAD/app/src/main/res/mipmap-xxhdpi/ic_opencv.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_opencv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/momomomo111/camerax_opencv/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_opencv.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_opencv_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/momomomo111/camerax_opencv/HEAD/app/src/main/res/mipmap-hdpi/ic_opencv_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_opencv_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/momomomo111/camerax_opencv/HEAD/app/src/main/res/mipmap-mdpi/ic_opencv_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_opencv_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/momomomo111/camerax_opencv/HEAD/app/src/main/res/mipmap-xhdpi/ic_opencv_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_opencv_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/momomomo111/camerax_opencv/HEAD/app/src/main/res/mipmap-xxhdpi/ic_opencv_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_opencv_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/momomomo111/camerax_opencv/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_opencv_round.png -------------------------------------------------------------------------------- /.idea/codeStyles/codeStyleConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | /deploymentTargetSelector.xml 5 | /kotlinc.xml 6 | /other.xml 7 | /androidTestResultsUserPreferences.xml 8 | /migrations.xml 9 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | rootProject.name = "camerax_opencv" 3 | 4 | def opencvsdk='./OpenCV-android-sdk' 5 | //def opencvsdk='/' 6 | include ':opencv' 7 | project(':opencv').projectDir = new File(opencvsdk + '/sdk') 8 | -------------------------------------------------------------------------------- /app/src/main/res/menu/options_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sun Apr 04 18:58:53 JST 2021 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip 7 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_opencv.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_opencv_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #FFBB86FC 4 | #FF6200EE 5 | #FF3700B3 6 | #FF03DAC5 7 | #FF018786 8 | #FF000000 9 | #FFFFFFFF 10 | -------------------------------------------------------------------------------- /app/src/main/java/com/momomomo111/camerax_opencv/data/GrayscaleViewModel.kt: -------------------------------------------------------------------------------- 1 | package com.momomomo111.camerax_opencv.data 2 | 3 | import androidx.lifecycle.ViewModel 4 | import kotlinx.coroutines.flow.MutableStateFlow 5 | import kotlinx.coroutines.flow.StateFlow 6 | 7 | class GrayscaleViewModel : ViewModel() { 8 | private val _params = MutableStateFlow(Params.GrayScaleParams(null)) 9 | val params: StateFlow = _params 10 | } 11 | -------------------------------------------------------------------------------- /app/src/main/res/menu/navdrawer_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 12 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright [2022] [Motoharu Asanuma] 2 | 3 | Licensed under the Apache License, Version 2.0 (the “License”); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 8 | Unless required by applicable law or agreed to in writing, software 9 | distributed under the License is distributed on an “AS IS” BASIS, 10 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_baseline_vibration.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # About 2 | Check the results of real-time processing of images from a camera using the OpenCV library. 3 | 4 | - OpenCV official website: https://opencv.org/ 5 | - OpenCV official GitHub page: https://github.com/opencv/opencv 6 | 7 | # Requirement 8 | 9 | opencv-4.10.0-android-sdk 10 | 11 | # GooglePlayStore 12 | 13 | https://play.google.com/store/apps/details?id=com.momomomo111.camerax_opencv 14 | 15 | # PrivacyPolicy(English) 16 | 17 | https://momomomo111.github.io/camerax_opencv/PrivacyPolicy/English 18 | 19 | # プライバシーポリシー(日本語) 20 | 21 | https://momomomo111.github.io/camerax_opencv/PrivacyPolicy/Japanese 22 | -------------------------------------------------------------------------------- /app/src/main/java/com/momomomo111/camerax_opencv/ui/LicenceFragment.kt: -------------------------------------------------------------------------------- 1 | package com.momomomo111.camerax_opencv.ui 2 | 3 | import android.os.Bundle 4 | import android.view.LayoutInflater 5 | import android.view.View 6 | import android.view.ViewGroup 7 | import androidx.fragment.app.Fragment 8 | import com.momomomo111.camerax_opencv.R 9 | 10 | class LicenceFragment : Fragment() { 11 | override fun onCreateView( 12 | inflater: LayoutInflater, 13 | container: ViewGroup?, 14 | savedInstanceState: Bundle? 15 | ): View? { 16 | return inflater.inflate(R.layout.fragment_licence, container, false) 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /app/src/main/java/com/momomomo111/camerax_opencv/data/ErodeViewModel.kt: -------------------------------------------------------------------------------- 1 | package com.momomomo111.camerax_opencv.data 2 | 3 | import androidx.lifecycle.ViewModel 4 | import kotlinx.coroutines.flow.MutableStateFlow 5 | import kotlinx.coroutines.flow.StateFlow 6 | 7 | class ErodeViewModel : ViewModel() { 8 | private val _params = MutableStateFlow(Params.ErodeParams(1, 1)) 9 | val params: StateFlow = _params 10 | 11 | fun onKSizeChange(data: Int) { 12 | _params.value = _params.value.copy(kSize = data) 13 | } 14 | 15 | fun onIterationsChange(data: Int) { 16 | _params.value = _params.value.copy(iterations = data) 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /app/src/main/java/com/momomomo111/camerax_opencv/data/DilateViewModel.kt: -------------------------------------------------------------------------------- 1 | package com.momomomo111.camerax_opencv.data 2 | 3 | import androidx.lifecycle.ViewModel 4 | import kotlinx.coroutines.flow.MutableStateFlow 5 | import kotlinx.coroutines.flow.StateFlow 6 | 7 | class DilateViewModel : ViewModel() { 8 | private val _params = MutableStateFlow(Params.DilateParams(1, 1)) 9 | val params: StateFlow = _params 10 | 11 | fun onKSizeChange(data: Int) { 12 | _params.value = _params.value.copy(kSize = data) 13 | } 14 | 15 | fun onIterationsChange(data: Int) { 16 | _params.value = _params.value.copy(iterations = data) 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /app/src/main/java/com/momomomo111/camerax_opencv/data/CannyViewModel.kt: -------------------------------------------------------------------------------- 1 | package com.momomomo111.camerax_opencv.data 2 | 3 | import androidx.lifecycle.ViewModel 4 | import kotlinx.coroutines.flow.MutableStateFlow 5 | import kotlinx.coroutines.flow.StateFlow 6 | 7 | class CannyViewModel : ViewModel() { 8 | private val _params = MutableStateFlow(Params.CannyParams(255.0, 255.0)) 9 | val params: StateFlow = _params 10 | 11 | fun onThreshold1Change(data: Double) { 12 | _params.value = _params.value.copy(threshold1 = data) 13 | } 14 | 15 | fun onThreshold2Change(data: Double) { 16 | _params.value = _params.value.copy(threshold2 = data) 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /app/src/main/java/com/momomomo111/camerax_opencv/data/ThresholdViewModel.kt: -------------------------------------------------------------------------------- 1 | package com.momomomo111.camerax_opencv.data 2 | 3 | import androidx.lifecycle.ViewModel 4 | import kotlinx.coroutines.flow.MutableStateFlow 5 | import kotlinx.coroutines.flow.StateFlow 6 | 7 | class ThresholdViewModel : ViewModel() { 8 | private val _params = MutableStateFlow(Params.ThresholdParams(128.0, 255.0)) 9 | val params: StateFlow = _params 10 | 11 | fun onThreshChange(data: Double) { 12 | _params.value = _params.value.copy(thresh = data) 13 | } 14 | 15 | fun onMaxValChange(data: Double) { 16 | _params.value = _params.value.copy(maxVal = data) 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /app/src/main/java/com/momomomo111/camerax_opencv/data/SettingsViewModel.kt: -------------------------------------------------------------------------------- 1 | package com.momomomo111.camerax_opencv.data 2 | 3 | import androidx.lifecycle.ViewModel 4 | import kotlinx.coroutines.flow.MutableStateFlow 5 | import kotlinx.coroutines.flow.StateFlow 6 | 7 | class SettingsViewModel : ViewModel() { 8 | private val _settingsUiState = MutableStateFlow(SettingsUiState.None) 9 | val settingsUiState: StateFlow = _settingsUiState 10 | 11 | fun onVibrationChange(value: Boolean) { 12 | _settingsUiState.value = SettingsUiState.Success(vibration = value) 13 | } 14 | } 15 | 16 | sealed class SettingsUiState { 17 | data class Success(val vibration: Boolean) : SettingsUiState() 18 | object None : SettingsUiState() 19 | } 20 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle.kts. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile -------------------------------------------------------------------------------- /app/src/main/java/com/momomomo111/camerax_opencv/data/GaussianblurViewModel.kt: -------------------------------------------------------------------------------- 1 | package com.momomomo111.camerax_opencv.data 2 | 3 | import androidx.lifecycle.ViewModel 4 | import kotlinx.coroutines.flow.MutableStateFlow 5 | import kotlinx.coroutines.flow.StateFlow 6 | 7 | class GaussianblurViewModel : ViewModel() { 8 | private val _params = MutableStateFlow(Params.GaussianBlurParams(1.0, 0.0, 0.0)) 9 | val params: StateFlow = _params 10 | 11 | fun onKSizeChange(data: Double) { 12 | _params.value = _params.value.copy(kSize = data) 13 | } 14 | 15 | fun onSigmaXChange(data: Double) { 16 | _params.value = _params.value.copy(sigmaX = data) 17 | } 18 | 19 | fun onSigmaYChange(data: Double) { 20 | _params.value = _params.value.copy(sigmaY = data) 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /app/src/main/res/values/themes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/values-night/themes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_grayscale.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 18 | 19 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 15 | 16 | 22 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 16 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /docs/PrivacyPolicy/Japanese.md: -------------------------------------------------------------------------------- 1 | # プライバシーポリシー 2 | 3 | 本プライバシーポリシーは、OpenCV Image Process(以下、「当アプリ」とします。)の各種サービス(当アプリによる情報提供、各種お問合せの受付等)において、当アプリの利用者(以下、「利用者」とします。)の個人情報もしくはそれに準ずる情報を取り扱う際に、当アプリが遵守する方針を示したものです。 4 | 5 | ## 基本方針 6 | 7 | 当アプリは、個人情報の重要性を認識し、個人情報を保護することが社会的責務であると考え、個人情報に関する法令を遵守し、当アプリで取扱う個人情報の取得、利用、管理を適正に行います。当アプリで収集した情報は、利用目的の範囲内で適切に取り扱います。 8 | 9 | ## 適用範囲 10 | 11 | 本プライバシーポリシーは、当アプリにおいてのみ適用されます。 12 | 13 | ## このサイトが収集する個人データと収集の理由 14 | 15 | 当アプリではアクセス情報を除いた個人データについては収集をしておりません。 16 | 17 | ## アクセス解析ツールについて 18 | 19 | 当サイトでは、Google によるアクセス解析ツール「Google アナリティクス」を利用しています。 20 | 21 | この Google アナリティクスはアクセス情報の収集のために使用しています。このアクセス情報は匿名で収集されており、個人を特定するものではありません。 22 | 23 | Google アナリティクスの利用規約に関して確認したい場合は、Google アナリティクス利用規約をご確認ください。 24 | 25 | また、「ユーザーが Google パートナーのサイトやアプリを使用する際の Google によるデータ使用」に関して確認したい場合は、Google ポリシーと規約:広告をご確認ください。 26 | 27 | ## 個人情報の第三者への提供について 28 | 29 | 当サイトは、利用者からご提供いただいた個人情報を、利用者本人の同意を得ることなく第三者に提供することはありません。 30 | 31 | また、今後第三者提供を行うことになった場合には、提供する情報と提供目的などを提示し、利用者から同意を得た場合のみ第三者提供を行います。 32 | 33 | ## プライバシーポリシーの変更について 34 | 35 | 当アプリは、個人情報に関して適用される日本の法令を遵守するとともに、本プライバシーポリシーの内容を適宜見直しその改善に努めます。修正された最新のプライバシーポリシーは常に本ページにて開示されます。 36 | 37 | 2021 年 8 月 9 日 策定 38 | -------------------------------------------------------------------------------- /app/src/main/java/com/momomomo111/camerax_opencv/util/VibrationUtil.kt: -------------------------------------------------------------------------------- 1 | package com.momomomo111.camerax_opencv.util 2 | 3 | import android.annotation.SuppressLint 4 | import android.content.Context 5 | import android.os.Build 6 | import android.os.VibrationEffect 7 | import android.os.Vibrator 8 | import android.os.VibratorManager 9 | 10 | object VibrationUtil { 11 | @SuppressLint("WrongConstant") 12 | fun setVibrator(context: Context?): Vibrator { 13 | val vibrator = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { 14 | val vibratorManager = 15 | context?.getSystemService(Context.VIBRATOR_MANAGER_SERVICE) as VibratorManager 16 | vibratorManager.defaultVibrator 17 | } else { 18 | context?.getSystemService(Context.VIBRATOR_SERVICE) as Vibrator 19 | } 20 | return vibrator 21 | } 22 | 23 | fun Vibrator.effectSlider() { 24 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { 25 | val effect = VibrationEffect.createOneShot(10, VibrationEffect.DEFAULT_AMPLITUDE) 26 | this.vibrate(effect) 27 | } else { 28 | this.vibrate(10) 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /app/src/main/java/com/momomomo111/camerax_opencv/data/Params.kt: -------------------------------------------------------------------------------- 1 | package com.momomomo111.camerax_opencv.data 2 | 3 | import androidx.annotation.Nullable 4 | 5 | sealed class Params { 6 | data class GaussianBlurParams(val kSize: Double, val sigmaX: Double, val sigmaY: Double) : 7 | Params() 8 | 9 | data class ThresholdParams(val thresh: Double, val maxVal: Double) : Params() 10 | data class CannyParams(val threshold1: Double, val threshold2: Double) : Params() 11 | data class GrayScaleParams(val param: Nullable?) : Params() 12 | data class RgbExtractionParams( 13 | val upperR: Double, 14 | val upperG: Double, 15 | val upperB: Double, 16 | val lowerR: Double, 17 | val lowerG: Double, 18 | val lowerB: Double 19 | ) : Params() 20 | data class HsvExtractionParams( 21 | val upperH: Double, 22 | val upperS: Double, 23 | val upperV: Double, 24 | val lowerH: Double, 25 | val lowerS: Double, 26 | val lowerV: Double 27 | ) : Params() 28 | data class ErodeParams(val kSize: Int, val iterations: Int) : 29 | Params() 30 | data class DilateParams(val kSize: Int, val iterations: Int) : 31 | Params() 32 | } 33 | -------------------------------------------------------------------------------- /app/src/main/java/com/momomomo111/camerax_opencv/data/HsvextractionViewModel.kt: -------------------------------------------------------------------------------- 1 | package com.momomomo111.camerax_opencv.data 2 | 3 | import androidx.lifecycle.ViewModel 4 | import kotlinx.coroutines.flow.MutableStateFlow 5 | import kotlinx.coroutines.flow.StateFlow 6 | 7 | class HsvextractionViewModel : ViewModel() { 8 | private val _params = 9 | MutableStateFlow(Params.HsvExtractionParams(255.0, 255.0, 255.0, 0.0, 0.0, 0.0)) 10 | val params: StateFlow = _params 11 | 12 | fun onUpperHChange(data: Double) { 13 | _params.value = _params.value.copy(upperH = data) 14 | } 15 | 16 | fun onUpperSChange(data: Double) { 17 | _params.value = _params.value.copy(upperS = data) 18 | } 19 | 20 | fun onUpperVChange(data: Double) { 21 | _params.value = _params.value.copy(upperV = data) 22 | } 23 | 24 | fun onLowerHChange(data: Double) { 25 | _params.value = _params.value.copy(lowerH = data) 26 | } 27 | 28 | fun onLowerSChange(data: Double) { 29 | _params.value = _params.value.copy(lowerS = data) 30 | } 31 | 32 | fun onLowerVChange(data: Double) { 33 | _params.value = _params.value.copy(lowerV = data) 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /app/src/main/java/com/momomomo111/camerax_opencv/data/RgbextractionViewModel.kt: -------------------------------------------------------------------------------- 1 | package com.momomomo111.camerax_opencv.data 2 | 3 | import androidx.lifecycle.ViewModel 4 | import kotlinx.coroutines.flow.MutableStateFlow 5 | import kotlinx.coroutines.flow.StateFlow 6 | 7 | class RgbextractionViewModel : ViewModel() { 8 | private val _params = 9 | MutableStateFlow(Params.RgbExtractionParams(255.0, 255.0, 255.0, 0.0, 0.0, 0.0)) 10 | val params: StateFlow = _params 11 | 12 | fun onUpperRChange(data: Double) { 13 | _params.value = _params.value.copy(upperR = data) 14 | } 15 | 16 | fun onUpperGChange(data: Double) { 17 | _params.value = _params.value.copy(upperG = data) 18 | } 19 | 20 | fun onUpperBChange(data: Double) { 21 | _params.value = _params.value.copy(upperB = data) 22 | } 23 | 24 | fun onLowerRChange(data: Double) { 25 | _params.value = _params.value.copy(lowerR = data) 26 | } 27 | 28 | fun onLowerGChange(data: Double) { 29 | _params.value = _params.value.copy(lowerG = data) 30 | } 31 | 32 | fun onLowerBChange(data: Double) { 33 | _params.value = _params.value.copy(lowerB = data) 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /.idea/jarRepositories.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 10 | 14 | 15 | 19 | 20 | 24 | 25 | 29 | 30 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. More details, visit 12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 13 | # org.gradle.parallel=true 14 | # AndroidX package structure to make it clearer which packages are bundled with the 15 | # Android operating system, and which are packaged with your app"s APK 16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn 17 | android.useAndroidX=true 18 | # Automatically convert third-party libraries to use AndroidX 19 | android.enableJetifier=true 20 | # Kotlin code style for this project: "official" or "obsolete": 21 | kotlin.code.style=official 22 | 23 | android.buildTypes.release.ndk.debugSymbolLevel = { SYMBOL_TABLE | FULL } 24 | android.defaults.buildfeatures.buildconfig=true 25 | android.nonTransitiveRClass=false 26 | android.nonFinalResIds=false -------------------------------------------------------------------------------- /.github/workflows/android.yml: -------------------------------------------------------------------------------- 1 | name: Android CI 2 | 3 | on: 4 | push: 5 | branches: [ "main" ] 6 | pull_request: 7 | branches: [ "main" ] 8 | 9 | jobs: 10 | android-test: 11 | runs-on: ubuntu-latest 12 | strategy: 13 | matrix: 14 | api-level: [ 22, 23, 24, 25, 26, 27, 28, 29, 30 ] # Enumerate terminals where emulators are supported. 15 | fail-fast: false 16 | timeout-minutes: 30 # Specify a timeout as testing on emulators is unstable. 17 | steps: 18 | - name: Check out 19 | uses: actions/checkout@v3 20 | - name: Set up JDK 21 | uses: actions/setup-java@v3 22 | with: 23 | distribution: 'zulu' 24 | java-version: 17 25 | - uses: actions/cache@v3.0.8 26 | with: 27 | path: | 28 | ~/.gradle/caches 29 | ~/.gradle/wrapper 30 | key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} 31 | restore-keys: | 32 | ${{ runner.os }}-gradle- 33 | - name: Enable KVM group perms 34 | run: | 35 | echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules 36 | sudo udevadm control --reload-rules 37 | sudo udevadm trigger --name-match=kvm 38 | - name: Run Android test 39 | uses: reactivecircus/android-emulator-runner@v2 40 | with: 41 | api-level: ${{ matrix.api-level }} 42 | target: 'google_apis' 43 | arch: 'x86' 44 | profile: 'pixel' 45 | disable-animations: true 46 | script: ./gradlew connectedAndroidTest 47 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Built application files 2 | *.apk 3 | *.aar 4 | *.ap_ 5 | *.aab 6 | 7 | # Files for the ART/Dalvik VM 8 | *.dex 9 | 10 | # Java class files 11 | *.class 12 | 13 | # Generated files 14 | bin/ 15 | gen/ 16 | out/ 17 | # Uncomment the following line in case you need and you don't have the release build type files in your app 18 | # release/ 19 | 20 | # Gradle files 21 | .gradle/ 22 | build/ 23 | 24 | # Local configuration file (sdk path, etc) 25 | local.properties 26 | 27 | # Proguard folder generated by Eclipse 28 | proguard/ 29 | 30 | # Log Files 31 | *.log 32 | 33 | # Android Studio Navigation editor temp files 34 | .navigation/ 35 | 36 | # Android Studio captures folder 37 | captures/ 38 | 39 | # IntelliJ 40 | *.iml 41 | .idea/workspace.xml 42 | .idea/tasks.xml 43 | .idea/gradle.xml 44 | .idea/assetWizardSettings.xml 45 | .idea/dictionaries 46 | .idea/libraries 47 | .idea/misc.xml 48 | # Android Studio 3 in .gitignore file. 49 | .idea/caches 50 | .idea/modules.xml 51 | # Comment next line if keeping position of elements in Navigation Editor is relevant for you 52 | .idea/navEditor.xml 53 | .idea/misc.xml 54 | 55 | # Keystore files 56 | # Uncomment the following lines if you do not want to check your keystore files in. 57 | #*.jks 58 | #*.keystore 59 | 60 | # External native build folder generated in Android Studio 2.2 and later 61 | .externalNativeBuild 62 | .cxx/ 63 | 64 | # Google Services (e.g. APIs or Firebase) 65 | # google-services.json 66 | 67 | # Freeline 68 | freeline.py 69 | freeline/ 70 | freeline_project_description.json 71 | 72 | # fastlane 73 | fastlane/report.xml 74 | fastlane/Preview.html 75 | fastlane/screenshots 76 | fastlane/test_output 77 | fastlane/readme.md 78 | 79 | # Version control 80 | vcs.xml 81 | 82 | # lint 83 | lint/intermediates/ 84 | lint/generated/ 85 | lint/outputs/ 86 | lint/tmp/ 87 | # lint/reports/ 88 | 89 | # OpenCV-SDK 90 | OpenCV-android-sdk/ 91 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_licence.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 18 | 19 | 30 | 31 | 42 | 43 | -------------------------------------------------------------------------------- /app/src/main/java/com/momomomo111/camerax_opencv/ui/GrayScaleFragment.kt: -------------------------------------------------------------------------------- 1 | package com.momomomo111.camerax_opencv.ui 2 | 3 | import android.os.Bundle 4 | import android.view.LayoutInflater 5 | import android.view.View 6 | import android.view.ViewGroup 7 | import androidx.fragment.app.Fragment 8 | import androidx.fragment.app.viewModels 9 | import com.momomomo111.camerax_opencv.data.GrayscaleViewModel 10 | import com.momomomo111.camerax_opencv.databinding.FragmentGrayscaleBinding 11 | import com.momomomo111.camerax_opencv.util.CameraUtil 12 | import com.momomomo111.camerax_opencv.util.ProcessImageAnalyzer 13 | 14 | class GrayScaleFragment : Fragment() { 15 | private val viewModel: GrayscaleViewModel by viewModels() 16 | 17 | private var _binding: FragmentGrayscaleBinding? = null 18 | private val binding get() = _binding!! 19 | 20 | override fun onCreateView( 21 | inflater: LayoutInflater, 22 | container: ViewGroup?, 23 | savedInstanceState: Bundle? 24 | ): View { 25 | _binding = FragmentGrayscaleBinding.inflate(inflater, container, false) 26 | return binding.root 27 | } 28 | 29 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) { 30 | super.onViewCreated(view, savedInstanceState) 31 | 32 | CameraUtil.startCamera( 33 | requireContext(), 34 | ProcessImageAnalyzer( 35 | { 36 | runOnUiThread { 37 | _binding?.imageView?.setImageBitmap( 38 | it 39 | ) 40 | } 41 | }, 42 | viewModel.params 43 | ) 44 | ) 45 | } 46 | 47 | override fun onDestroyView() { 48 | super.onDestroyView() 49 | _binding = null 50 | } 51 | 52 | private fun Fragment.runOnUiThread(action: () -> Unit) { 53 | if (!isAdded) return 54 | activity?.runOnUiThread(action) 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_license.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /app/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("com.android.application") 3 | kotlin("android") 4 | kotlin("kapt") 5 | id("androidx.navigation.safeargs.kotlin") 6 | } 7 | 8 | android { 9 | compileSdk = 34 10 | 11 | defaultConfig { 12 | applicationId = "com.momomomo111.camerax_opencv" 13 | minSdk = 22 14 | targetSdk = 34 15 | versionCode = 10 16 | versionName = "1.3.0" 17 | 18 | testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" 19 | } 20 | buildFeatures { 21 | viewBinding = true 22 | } 23 | buildTypes { 24 | getByName("release") { 25 | isMinifyEnabled = false 26 | proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), file("proguard-rules.pro")) 27 | } 28 | } 29 | compileOptions { 30 | sourceCompatibility = JavaVersion.VERSION_17 31 | targetCompatibility = JavaVersion.VERSION_17 32 | } 33 | namespace = "com.momomomo111.camerax_opencv" 34 | tasks.withType { 35 | kotlinOptions { 36 | jvmTarget = "17" 37 | } 38 | } 39 | } 40 | 41 | dependencies { 42 | implementation("androidx.core:core-ktx:1.13.1") 43 | implementation("androidx.appcompat:appcompat:1.7.0") 44 | implementation("com.google.android.material:material:1.12.0") 45 | implementation("androidx.constraintlayout:constraintlayout:2.1.4") 46 | implementation("androidx.activity:activity-ktx:1.9.0") 47 | implementation("androidx.fragment:fragment-ktx:1.8.1") 48 | implementation("androidx.navigation:navigation-fragment-ktx:2.7.7") 49 | implementation("androidx.navigation:navigation-ui-ktx:2.7.7") 50 | implementation("androidx.lifecycle:lifecycle-livedata-ktx:2.8.3") 51 | implementation("org.opencv:opencv:4.10.0") 52 | // CameraX 53 | val cameraxVersion = "1.3.4" 54 | implementation("androidx.camera:camera-camera2:$cameraxVersion") 55 | implementation("androidx.camera:camera-lifecycle:$cameraxVersion") 56 | implementation("androidx.camera:camera-view:$cameraxVersion") 57 | // Unit testing 58 | androidTestImplementation("androidx.test.ext:junit:1.2.1") 59 | androidTestImplementation("androidx.test:core:1.6.1") 60 | androidTestImplementation("androidx.test:rules:1.6.1") 61 | androidTestImplementation("androidx.test:runner:1.6.1") 62 | androidTestImplementation("androidx.test.espresso:espresso-core:3.6.1") 63 | } 64 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | 53 | :win9xME_args 54 | @rem Slurp the command line arguments. 55 | set CMD_LINE_ARGS= 56 | set _SKIP=2 57 | 58 | :win9xME_args_slurp 59 | if "x%~1" == "x" goto execute 60 | 61 | set CMD_LINE_ARGS=%* 62 | 63 | :execute 64 | @rem Setup the command line 65 | 66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 67 | 68 | @rem Execute Gradle 69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 70 | 71 | :end 72 | @rem End local scope for the variables with windows NT shell 73 | if "%ERRORLEVEL%"=="0" goto mainEnd 74 | 75 | :fail 76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 77 | rem the _cmd.exe /c_ return code! 78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 79 | exit /b 1 80 | 81 | :mainEnd 82 | if "%OS%"=="Windows_NT" endlocal 83 | 84 | :omega 85 | -------------------------------------------------------------------------------- /app/src/main/java/com/momomomo111/camerax_opencv/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.momomomo111.camerax_opencv 2 | 3 | import android.content.Context 4 | import android.os.Bundle 5 | import androidx.activity.viewModels 6 | import androidx.appcompat.app.AppCompatActivity 7 | import androidx.drawerlayout.widget.DrawerLayout 8 | import androidx.navigation.findNavController 9 | import androidx.navigation.fragment.NavHostFragment 10 | import androidx.navigation.ui.NavigationUI 11 | import com.google.android.material.switchmaterial.SwitchMaterial 12 | import com.momomomo111.camerax_opencv.data.SettingsViewModel 13 | import com.momomomo111.camerax_opencv.databinding.ActivityMainBinding 14 | 15 | class MainActivity : AppCompatActivity() { 16 | private lateinit var drawerLayout: DrawerLayout 17 | private lateinit var binding: ActivityMainBinding 18 | override fun onCreate(savedInstanceState: Bundle?) { 19 | super.onCreate(savedInstanceState) 20 | binding = ActivityMainBinding.inflate(layoutInflater) 21 | setContentView(binding.root) 22 | drawerLayout = binding.drawerLayout 23 | val settingsViewModel: SettingsViewModel by viewModels() 24 | val navController = ( 25 | supportFragmentManager.findFragmentById(R.id.myNavHostFragment) 26 | as NavHostFragment 27 | ).navController 28 | NavigationUI.setupActionBarWithNavController(this, navController, drawerLayout) 29 | NavigationUI.setupWithNavController(binding.navView, navController) 30 | 31 | val sharedPref = getPreferences(Context.MODE_PRIVATE) ?: return 32 | 33 | val vibSwitch = SwitchMaterial(this) 34 | val vibrationEnable = sharedPref.getBoolean(getString(R.string.vibration_enable), true) 35 | vibSwitch.isChecked = vibrationEnable 36 | settingsViewModel.onVibrationChange(vibrationEnable) 37 | vibSwitch.setOnCheckedChangeListener { _, isChecked -> 38 | with(sharedPref.edit()) { 39 | putBoolean(getString(R.string.vibration_enable), isChecked) 40 | settingsViewModel.onVibrationChange(isChecked) 41 | apply() 42 | } 43 | } 44 | binding.navView.menu.findItem(R.id.vibrationSwitch).actionView = vibSwitch 45 | } 46 | 47 | override fun onSupportNavigateUp(): Boolean { 48 | val navController = this.findNavController(R.id.myNavHostFragment) 49 | return NavigationUI.navigateUp(navController, drawerLayout) 50 | } 51 | 52 | companion object { 53 | init { 54 | System.loadLibrary("opencv_java4") 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /docs/PrivacyPolicy/English.md: -------------------------------------------------------------------------------- 1 | # Privacy Policy 2 | 3 | This Privacy Policy applies to all services of OpenCV Image Process (hereinafter referred to as "this application"). (hereinafter referred to as "the Application") in various services (such as the provision of information by the Application and the acceptance of various inquiries) of the users of the Application (hereinafter referred to as "the Users"). (hereinafter referred to as "the App") in various services (such as providing information through the App and accepting various inquiries). 4 | 5 | ## Basic Policy 6 | 7 | This application recognizes the importance of personal information and considers the protection of personal information to be a social responsibility, and complies with laws and regulations regarding personal information, and appropriately acquires, uses, and manages personal information handled by this application. The information collected by this application will be handled appropriately within the scope of the purpose of use. 8 | 9 | ## Scope of application 10 | 11 | This privacy policy applies only to this application. 12 | 13 | ## Personal data collected by this site and reasons for collection 14 | 15 | This app does not collect any personal data except access information. 16 | 17 | ## About access analysis tools 18 | 19 | This site uses Google Analytics, an access analysis tool by Google. 20 | 21 | This Google Analytics is used to collect access information. This access information is collected anonymously and does not identify any individual. 22 | 23 | If you would like to learn more about the Google Analytics Terms of Service, please see the Google Analytics Terms of Service. 24 | 25 | If you would like to learn more about Google's use of your data when you use Google partners' sites and apps, please see Google Policies and Terms: Advertising. 26 | 27 | ## Sharing of personal information with third parties 28 | 29 | This site will not provide personal information provided by users to third parties without their consent. 30 | 31 | If we decide to provide the information to a third party in the future, we will present the information to be provided and the purpose for which it will be provided, and we will provide the information to the third party only after obtaining the consent of the user. 32 | 33 | ## Changes to the Privacy Policy 34 | 35 | In addition to complying with the Japanese laws and regulations applicable to personal information, this application will review and improve the contents of this privacy policy from time to time. The revised and updated Privacy Policy will always be disclosed on this page. 36 | 37 | Formulated on August 9, 2021 38 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_erode.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 18 | 19 | 29 | 30 | 40 | 41 | 51 | 52 | 62 | 63 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_dilate.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 18 | 19 | 29 | 30 | 40 | 41 | 51 | 52 | 62 | 63 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_threshold.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 18 | 19 | 29 | 30 | 40 | 41 | 53 | 54 | 65 | 66 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_canny.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 18 | 19 | 29 | 30 | 40 | 41 | 52 | 53 | 64 | 65 | -------------------------------------------------------------------------------- /app/src/main/java/com/momomomo111/camerax_opencv/ui/ErodeFragment.kt: -------------------------------------------------------------------------------- 1 | package com.momomomo111.camerax_opencv.ui 2 | 3 | import android.os.Bundle 4 | import android.view.LayoutInflater 5 | import android.view.View 6 | import android.view.ViewGroup 7 | import androidx.fragment.app.Fragment 8 | import androidx.fragment.app.viewModels 9 | import androidx.navigation.fragment.navArgs 10 | import com.momomomo111.camerax_opencv.R 11 | import com.momomomo111.camerax_opencv.data.ErodeViewModel 12 | import com.momomomo111.camerax_opencv.databinding.FragmentErodeBinding 13 | import com.momomomo111.camerax_opencv.util.CameraUtil 14 | import com.momomomo111.camerax_opencv.util.ProcessImageAnalyzer 15 | import com.momomomo111.camerax_opencv.util.VibrationUtil 16 | import com.momomomo111.camerax_opencv.util.VibrationUtil.effectSlider 17 | 18 | class ErodeFragment : Fragment() { 19 | private val erodeViewModel: ErodeViewModel by viewModels() 20 | private val args: ErodeFragmentArgs by navArgs() 21 | 22 | private var _binding: FragmentErodeBinding? = null 23 | private val binding get() = _binding!! 24 | 25 | override fun onCreateView( 26 | inflater: LayoutInflater, 27 | container: ViewGroup?, 28 | savedInstanceState: Bundle? 29 | ): View { 30 | _binding = FragmentErodeBinding.inflate(inflater, container, false) 31 | return binding.root 32 | } 33 | 34 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) { 35 | super.onViewCreated(view, savedInstanceState) 36 | 37 | val enableVibration = args.vibrationEnable 38 | 39 | CameraUtil.startCamera( 40 | requireContext(), 41 | ProcessImageAnalyzer( 42 | { 43 | runOnUiThread { 44 | _binding?.imageView?.setImageBitmap( 45 | it 46 | ) 47 | } 48 | }, 49 | erodeViewModel.params 50 | ) 51 | ) 52 | 53 | val vibrator = VibrationUtil.setVibrator(this.context) 54 | 55 | _binding?.sliderKSize?.addOnChangeListener { _, value, _ -> 56 | val kSize = value.toInt() 57 | erodeViewModel.onKSizeChange(kSize) 58 | binding.kSizeText.text = getString(R.string.k_size, kSize.toString()) 59 | if (enableVibration) { 60 | vibrator.effectSlider() 61 | } 62 | } 63 | _binding?.sliderIterations?.addOnChangeListener { _, value, _ -> 64 | val iterations = value.toInt() 65 | erodeViewModel.onIterationsChange(iterations) 66 | binding.iterationsText.text = getString(R.string.iterations, iterations.toString()) 67 | if (enableVibration) { 68 | vibrator.effectSlider() 69 | } 70 | } 71 | } 72 | 73 | override fun onDestroyView() { 74 | super.onDestroyView() 75 | _binding = null 76 | } 77 | 78 | private fun Fragment.runOnUiThread(action: () -> Unit) { 79 | if (!isAdded) return 80 | activity?.runOnUiThread(action) 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /app/src/main/java/com/momomomo111/camerax_opencv/ui/CannyFragment.kt: -------------------------------------------------------------------------------- 1 | package com.momomomo111.camerax_opencv.ui 2 | 3 | import android.os.Bundle 4 | import android.view.LayoutInflater 5 | import android.view.View 6 | import android.view.ViewGroup 7 | import androidx.fragment.app.Fragment 8 | import androidx.fragment.app.viewModels 9 | import androidx.navigation.fragment.navArgs 10 | import com.momomomo111.camerax_opencv.R 11 | import com.momomomo111.camerax_opencv.data.CannyViewModel 12 | import com.momomomo111.camerax_opencv.databinding.FragmentCannyBinding 13 | import com.momomomo111.camerax_opencv.util.CameraUtil 14 | import com.momomomo111.camerax_opencv.util.ProcessImageAnalyzer 15 | import com.momomomo111.camerax_opencv.util.VibrationUtil.effectSlider 16 | import com.momomomo111.camerax_opencv.util.VibrationUtil.setVibrator 17 | 18 | class CannyFragment : Fragment() { 19 | private val cannyViewModel: CannyViewModel by viewModels() 20 | private val args: CannyFragmentArgs by navArgs() 21 | 22 | private var _binding: FragmentCannyBinding? = null 23 | private val binding get() = _binding!! 24 | 25 | override fun onCreateView( 26 | inflater: LayoutInflater, 27 | container: ViewGroup?, 28 | savedInstanceState: Bundle? 29 | ): View { 30 | _binding = FragmentCannyBinding.inflate(inflater, container, false) 31 | return binding.root 32 | } 33 | 34 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) { 35 | super.onViewCreated(view, savedInstanceState) 36 | 37 | val enableVibration = args.vibrationEnable 38 | 39 | CameraUtil.startCamera( 40 | requireContext(), 41 | ProcessImageAnalyzer( 42 | { 43 | runOnUiThread { 44 | _binding?.imageView?.setImageBitmap( 45 | it 46 | ) 47 | } 48 | }, 49 | cannyViewModel.params 50 | ), 51 | ) 52 | 53 | val vibrator = setVibrator(this.context) 54 | 55 | _binding?.sliderThreshold1?.addOnChangeListener { _, value, _ -> 56 | val thresh = value.toDouble() 57 | cannyViewModel.onThreshold1Change(thresh) 58 | binding.threshold1.text = getString(R.string.threshold1, thresh.toString()) 59 | if (enableVibration) { 60 | vibrator.effectSlider() 61 | } 62 | } 63 | _binding?.sliderThreshold2?.addOnChangeListener { _, value, _ -> 64 | val maxVal = value.toDouble() 65 | cannyViewModel.onThreshold2Change(maxVal) 66 | binding.threshold2.text = getString(R.string.threshold2, maxVal.toString()) 67 | if (enableVibration) { 68 | vibrator.effectSlider() 69 | } 70 | } 71 | } 72 | 73 | override fun onDestroyView() { 74 | super.onDestroyView() 75 | _binding = null 76 | } 77 | 78 | private fun Fragment.runOnUiThread(action: () -> Unit) { 79 | if (!isAdded) return 80 | activity?.runOnUiThread(action) 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /app/src/main/java/com/momomomo111/camerax_opencv/ui/DilateFragment.kt: -------------------------------------------------------------------------------- 1 | package com.momomomo111.camerax_opencv.ui 2 | 3 | import android.os.Bundle 4 | import android.view.LayoutInflater 5 | import android.view.View 6 | import android.view.ViewGroup 7 | import androidx.fragment.app.Fragment 8 | import androidx.fragment.app.viewModels 9 | import androidx.navigation.fragment.navArgs 10 | import com.momomomo111.camerax_opencv.R 11 | import com.momomomo111.camerax_opencv.data.DilateViewModel 12 | import com.momomomo111.camerax_opencv.databinding.FragmentDilateBinding 13 | import com.momomomo111.camerax_opencv.util.CameraUtil 14 | import com.momomomo111.camerax_opencv.util.ProcessImageAnalyzer 15 | import com.momomomo111.camerax_opencv.util.VibrationUtil 16 | import com.momomomo111.camerax_opencv.util.VibrationUtil.effectSlider 17 | 18 | class DilateFragment : Fragment() { 19 | private val dilateViewModel: DilateViewModel by viewModels() 20 | private val args: DilateFragmentArgs by navArgs() 21 | 22 | private var _binding: FragmentDilateBinding? = null 23 | private val binding get() = _binding!! 24 | 25 | override fun onCreateView( 26 | inflater: LayoutInflater, 27 | container: ViewGroup?, 28 | savedInstanceState: Bundle? 29 | ): View { 30 | _binding = FragmentDilateBinding.inflate(inflater, container, false) 31 | return binding.root 32 | } 33 | 34 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) { 35 | super.onViewCreated(view, savedInstanceState) 36 | 37 | val enableVibration = args.vibrationEnable 38 | 39 | CameraUtil.startCamera( 40 | requireContext(), 41 | ProcessImageAnalyzer( 42 | { 43 | runOnUiThread { 44 | _binding?.imageView?.setImageBitmap( 45 | it 46 | ) 47 | } 48 | }, 49 | dilateViewModel.params 50 | ), 51 | ) 52 | 53 | val vibrator = VibrationUtil.setVibrator(this.context) 54 | 55 | _binding?.sliderKSize?.addOnChangeListener { _, value, _ -> 56 | val kSize = value.toInt() 57 | dilateViewModel.onKSizeChange(kSize) 58 | binding.kSizeText.text = getString(R.string.k_size, kSize.toString()) 59 | if (enableVibration) { 60 | vibrator.effectSlider() 61 | } 62 | } 63 | _binding?.sliderIterations?.addOnChangeListener { _, value, _ -> 64 | val iterations = value.toInt() 65 | dilateViewModel.onIterationsChange(iterations) 66 | binding.iterationsText.text = getString(R.string.iterations, iterations.toString()) 67 | if (enableVibration) { 68 | vibrator.effectSlider() 69 | } 70 | } 71 | } 72 | 73 | override fun onDestroyView() { 74 | super.onDestroyView() 75 | _binding = null 76 | } 77 | 78 | private fun Fragment.runOnUiThread(action: () -> Unit) { 79 | if (!isAdded) return 80 | activity?.runOnUiThread(action) 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /app/src/main/java/com/momomomo111/camerax_opencv/ui/ThresholdFragment.kt: -------------------------------------------------------------------------------- 1 | package com.momomomo111.camerax_opencv.ui 2 | 3 | import android.os.Bundle 4 | import android.view.LayoutInflater 5 | import android.view.View 6 | import android.view.ViewGroup 7 | import androidx.fragment.app.Fragment 8 | import androidx.fragment.app.viewModels 9 | import androidx.navigation.fragment.navArgs 10 | import com.momomomo111.camerax_opencv.R 11 | import com.momomomo111.camerax_opencv.data.ThresholdViewModel 12 | import com.momomomo111.camerax_opencv.databinding.FragmentThresholdBinding 13 | import com.momomomo111.camerax_opencv.util.CameraUtil 14 | import com.momomomo111.camerax_opencv.util.ProcessImageAnalyzer 15 | import com.momomomo111.camerax_opencv.util.VibrationUtil 16 | import com.momomomo111.camerax_opencv.util.VibrationUtil.effectSlider 17 | 18 | class ThresholdFragment : Fragment() { 19 | private val thresholdViewModel: ThresholdViewModel by viewModels() 20 | private val args: ThresholdFragmentArgs by navArgs() 21 | 22 | private var _binding: FragmentThresholdBinding? = null 23 | private val binding get() = _binding!! 24 | 25 | override fun onCreateView( 26 | inflater: LayoutInflater, 27 | container: ViewGroup?, 28 | savedInstanceState: Bundle? 29 | ): View { 30 | _binding = FragmentThresholdBinding.inflate(inflater, container, false) 31 | return binding.root 32 | } 33 | 34 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) { 35 | super.onViewCreated(view, savedInstanceState) 36 | 37 | val enableVibration = args.vibrationEnable 38 | 39 | CameraUtil.startCamera( 40 | requireContext(), 41 | ProcessImageAnalyzer( 42 | { 43 | runOnUiThread { 44 | _binding?.imageView?.setImageBitmap( 45 | it 46 | ) 47 | } 48 | }, 49 | thresholdViewModel.params 50 | ) 51 | ) 52 | 53 | val vibrator = VibrationUtil.setVibrator(this.context) 54 | 55 | _binding?.sliderThresh?.addOnChangeListener { _, value, _ -> 56 | val thresh = value.toDouble() 57 | thresholdViewModel.onThreshChange(thresh) 58 | binding.thresh.text = getString(R.string.thresh, thresh.toString()) 59 | if (enableVibration) { 60 | vibrator.effectSlider() 61 | } 62 | } 63 | _binding?.sliderMaxVal?.addOnChangeListener { _, value, _ -> 64 | val maxVal = value.toDouble() 65 | thresholdViewModel.onMaxValChange(maxVal) 66 | binding.MaxVal.text = getString(R.string.max_val, maxVal.toString()) 67 | if (enableVibration) { 68 | vibrator.effectSlider() 69 | } 70 | } 71 | } 72 | 73 | override fun onDestroyView() { 74 | super.onDestroyView() 75 | _binding = null 76 | } 77 | 78 | private fun Fragment.runOnUiThread(action: () -> Unit) { 79 | if (!isAdded) return 80 | activity?.runOnUiThread(action) 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /app/src/main/java/com/momomomo111/camerax_opencv/ui/GaussianBlurFragment.kt: -------------------------------------------------------------------------------- 1 | package com.momomomo111.camerax_opencv.ui 2 | 3 | import android.os.Bundle 4 | import android.view.LayoutInflater 5 | import android.view.View 6 | import android.view.ViewGroup 7 | import androidx.fragment.app.Fragment 8 | import androidx.fragment.app.viewModels 9 | import androidx.navigation.fragment.navArgs 10 | import com.momomomo111.camerax_opencv.R 11 | import com.momomomo111.camerax_opencv.data.GaussianblurViewModel 12 | import com.momomomo111.camerax_opencv.databinding.FragmentGaussianblurBinding 13 | import com.momomomo111.camerax_opencv.util.CameraUtil 14 | import com.momomomo111.camerax_opencv.util.ProcessImageAnalyzer 15 | import com.momomomo111.camerax_opencv.util.VibrationUtil 16 | import com.momomomo111.camerax_opencv.util.VibrationUtil.effectSlider 17 | 18 | class GaussianBlurFragment : Fragment() { 19 | private val gaussianblurViewModel: GaussianblurViewModel by viewModels() 20 | private val args: GaussianBlurFragmentArgs by navArgs() 21 | 22 | private var _binding: FragmentGaussianblurBinding? = null 23 | private val binding get() = _binding!! 24 | 25 | override fun onCreateView( 26 | inflater: LayoutInflater, 27 | container: ViewGroup?, 28 | savedInstanceState: Bundle? 29 | ): View { 30 | _binding = FragmentGaussianblurBinding.inflate(inflater, container, false) 31 | return binding.root 32 | } 33 | 34 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) { 35 | super.onViewCreated(view, savedInstanceState) 36 | 37 | val enableVibration = args.vibrationEnable 38 | 39 | CameraUtil.startCamera( 40 | requireContext(), 41 | ProcessImageAnalyzer( 42 | { 43 | runOnUiThread { 44 | _binding?.imageView?.setImageBitmap( 45 | it 46 | ) 47 | } 48 | }, 49 | gaussianblurViewModel.params 50 | ) 51 | ) 52 | 53 | val vibrator = VibrationUtil.setVibrator(this.context) 54 | 55 | _binding?.sliderKSize?.addOnChangeListener { _, value, _ -> 56 | val kSize = value.toDouble() 57 | gaussianblurViewModel.onKSizeChange(kSize) 58 | binding.kSizeText.text = getString(R.string.k_size, kSize.toString()) 59 | if (enableVibration) { 60 | vibrator.effectSlider() 61 | } 62 | } 63 | _binding?.sliderSigmaX?.addOnChangeListener { _, value, _ -> 64 | val sigmaX = value.toDouble() 65 | gaussianblurViewModel.onSigmaXChange(sigmaX) 66 | binding.sigmaXText.text = getString(R.string.sigma_x, sigmaX.toString()) 67 | if (enableVibration) { 68 | vibrator.effectSlider() 69 | } 70 | } 71 | _binding?.sliderSigmaY?.addOnChangeListener { _, value, _ -> 72 | val sigmaY = value.toDouble() 73 | gaussianblurViewModel.onSigmaYChange(sigmaY) 74 | binding.sigmaYText.text = getString(R.string.sigma_y, sigmaY.toString()) 75 | if (enableVibration) { 76 | vibrator.effectSlider() 77 | } 78 | } 79 | } 80 | 81 | override fun onDestroyView() { 82 | super.onDestroyView() 83 | _binding = null 84 | } 85 | 86 | private fun Fragment.runOnUiThread(action: () -> Unit) { 87 | if (!isAdded) return 88 | activity?.runOnUiThread(action) 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_gaussianblur.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 18 | 19 | 29 | 30 | 39 | 40 | 50 | 51 | 61 | 62 | 72 | 73 | 83 | 84 | -------------------------------------------------------------------------------- /.idea/$CACHE_FILE$: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Android 10 | 11 | 12 | ClassesObjective-C 13 | 14 | 15 | CorrectnessLintAndroid 16 | 17 | 18 | EditorConfig 19 | 20 | 21 | JNIAndroid 22 | 23 | 24 | JUnitJava 25 | 26 | 27 | Java 28 | 29 | 30 | Java 14Java language level migration aidsJava 31 | 32 | 33 | Java 5Java language level migration aidsJava 34 | 35 | 36 | Java 7Java language level migration aidsJava 37 | 38 | 39 | Java 8Java language level migration aidsJava 40 | 41 | 42 | Java language level migration aidsJava 43 | 44 | 45 | Java 言語レベルの移行支援Java 46 | 47 | 48 | JavadocJava 49 | 50 | 51 | Kotlin 52 | 53 | 54 | Kotlin Android 55 | 56 | 57 | LintAndroid 58 | 59 | 60 | Message resolutionObjective-C 61 | 62 | 63 | Objective-C 64 | 65 | 66 | PerformanceLintAndroid 67 | 68 | 69 | ProductivityLintAndroid 70 | 71 | 72 | SecurityLintAndroid 73 | 74 | 75 | Style issuesKotlin 76 | 77 | 78 | UsabilityLintAndroid 79 | 80 | 81 | クラス構造Java 82 | 83 | 84 | コード・スタイル問題Java 85 | 86 | 87 | ポータビリティーJava 88 | 89 | 90 | 一般 91 | 92 | 93 | 依存関係問題Java 94 | 95 | 96 | 国際化対応 97 | 98 | 99 | 国際化対応Java 100 | 101 | 102 | 宣言の冗長性Java 103 | 104 | 105 | 推定されるバグJava 106 | 107 | 108 | 数値問題Java 109 | 110 | 111 | 継承問題Java 112 | 113 | 114 | 詳細または冗長なコード構成Java 115 | 116 | 117 | 118 | 119 | Android 120 | 121 | 122 | 123 | 124 | 125 | -------------------------------------------------------------------------------- /app/src/main/java/com/momomomo111/camerax_opencv/util/ProcessImageAnalyzer.kt: -------------------------------------------------------------------------------- 1 | package com.momomomo111.camerax_opencv.util 2 | 3 | import android.graphics.Bitmap 4 | import androidx.camera.core.ImageAnalysis 5 | import androidx.camera.core.ImageProxy 6 | import com.momomomo111.camerax_opencv.data.Params 7 | import kotlinx.coroutines.flow.StateFlow 8 | import org.opencv.android.Utils 9 | import org.opencv.core.Core 10 | import org.opencv.core.Mat 11 | import org.opencv.core.Point 12 | import org.opencv.core.Scalar 13 | import org.opencv.core.Size 14 | import org.opencv.imgproc.Imgproc 15 | 16 | class ProcessImageAnalyzer( 17 | val runOnUiThread: (Bitmap) -> Unit, 18 | val params: StateFlow 19 | ) : ImageAnalysis.Analyzer { 20 | override fun analyze(image: ImageProxy) { 21 | val mat: Mat = CameraUtil.getMatFromImage(image) 22 | val matMask = Mat(mat.rows(), mat.cols(), 0) 23 | val matTemp = Mat(mat.rows(), mat.cols(), mat.type()) 24 | val matOutput = Mat(mat.rows(), mat.cols(), mat.type()) 25 | 26 | when (val params = params.value) { 27 | is Params.GaussianBlurParams -> { 28 | Imgproc.GaussianBlur( 29 | mat, 30 | matOutput, 31 | Size(params.kSize, params.kSize), 32 | params.sigmaX, 33 | params.sigmaY 34 | ) 35 | } 36 | is Params.ThresholdParams -> { 37 | Imgproc.cvtColor(mat, mat, Imgproc.COLOR_RGB2GRAY) 38 | Imgproc.threshold( 39 | mat, 40 | matOutput, 41 | params.thresh, 42 | params.maxVal, 43 | 0 44 | ) 45 | } 46 | is Params.CannyParams -> { 47 | Imgproc.cvtColor(mat, mat, Imgproc.COLOR_RGB2GRAY) 48 | Imgproc.Canny( 49 | mat, 50 | matOutput, 51 | params.threshold1, 52 | params.threshold2 53 | ) 54 | } 55 | is Params.GrayScaleParams -> { 56 | Imgproc.cvtColor(mat, matOutput, Imgproc.COLOR_RGB2GRAY) 57 | } 58 | is Params.RgbExtractionParams -> { 59 | val sMin = Scalar(params.lowerR, params.lowerG, params.lowerB) 60 | val sMax = Scalar(params.upperR, params.upperG, params.upperB) 61 | Core.inRange(mat, sMin, sMax, matMask) 62 | Core.bitwise_and(mat, mat, matOutput, matMask) 63 | } 64 | is Params.HsvExtractionParams -> { 65 | val sMin = Scalar(params.lowerH, params.lowerS, params.lowerV) 66 | val sMax = Scalar(params.upperH, params.upperS, params.upperV) 67 | Imgproc.cvtColor(mat, mat, Imgproc.COLOR_RGB2HSV) 68 | Core.inRange(mat, sMin, sMax, matMask) 69 | Core.bitwise_and(mat, mat, matTemp, matMask) 70 | Imgproc.cvtColor(matTemp, matOutput, Imgproc.COLOR_HSV2RGB) 71 | } 72 | is Params.ErodeParams -> { 73 | Imgproc.erode( 74 | mat, 75 | matOutput, 76 | Mat(params.kSize, params.kSize, 0), 77 | Point(-1.0, -1.0), 78 | params.iterations 79 | ) 80 | } 81 | is Params.DilateParams -> { 82 | Imgproc.dilate( 83 | mat, 84 | matOutput, 85 | Mat(params.kSize, params.kSize, 0), 86 | Point(-1.0, -1.0), 87 | params.iterations 88 | ) 89 | } 90 | } 91 | val bitmap: Bitmap = 92 | Bitmap.createBitmap(matOutput.cols(), matOutput.rows(), Bitmap.Config.ARGB_8888) 93 | Utils.matToBitmap(matOutput, bitmap) 94 | runOnUiThread(bitmap) 95 | image.close() 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | camerax_opencv 3 | 4 | Copyright [2022] [Motoharu Asanuma]\n 5 | 6 | Licensed under the Apache License, Version 2.0 (the “License”);\n 7 | you may not use this file except in compliance with the License.\n 8 | You may obtain a copy of the License at\n 9 | http://www.apache.org/licenses/LICENSE-2.0\n 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an “AS IS” BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n 14 | 15 | See the License for the specific language governing permissions and 16 | limitations under the License. 17 | 18 | ksize: %s 19 | ksize: 1.0 20 | kernel: %s 21 | sigmaX: %s 22 | sigmaX: 0.0 23 | sigmaY: %s 24 | sigmaY: 0.0 25 | thresh: %s 26 | thresh: 128.0 27 | maxval: %s 28 | maxval: 255.0 29 | iterations: %s 30 | iterations: 1 31 | threshold1: %s 32 | threshold1: 255.0 33 | threshold2: %s 34 | threshold2: 255.0 35 | upper_R: \n %s 36 | upper_R: \n 255.0 37 | upper_G: \n %s 38 | upper_G: \n 255.0 39 | upper_B: \n %s 40 | upper_B: \n 255.0 41 | lower_R: \n %s 42 | lower_R: \n 0.0 43 | lower_G: \n %s 44 | lower_G: \n 0.0 45 | lower_B: \n %s 46 | lower_B: \n 0.0 47 | upper_H: \n %s 48 | upper_H: \n 255.0 49 | upper_S: \n %s 50 | upper_S: \n 255.0 51 | upper_V: \n %s 52 | upper_V: \n 255.0 53 | lower_H: \n %s 54 | lower_H: \n 0.0 55 | lower_S: \n %s 56 | lower_S: \n 0.0 57 | lower_V: \n %s 58 | lower_V: \n 0.0 59 | GaussianBlur 60 | Threshold 61 | Canny 62 | opencvのロゴマークです 63 | 画像処理された画像を表示します 64 | Licence 65 | Vibration 66 | OpenCV LICENCE 67 | GrayScale 68 | RGBExtraction 69 | HSVExtraction 70 | Erode 71 | Dilate 72 | https://github.com/momomomo111/camerax_opencv 73 | vibrationEnable 74 | -------------------------------------------------------------------------------- /.idea/codeStyles/Project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 11 | 12 | 124 | 125 | 127 | 128 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_title.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 19 | 20 |