반응형

💻 개발(Dev) 43

[OpenCV] Mediapipe를 사용하여 구글 T-rex게임 제어하기

대학생때 Toy Project로 진행하였던, 손가락 위치에 따른 Trex게임 제어를 포스팅 하겠습니다. 해당 프로젝트는 Mediapipe 라이브러리를 사용하여 손을 인식 시키고, 손가락 위치에 따른 키보드 제어를 통해 Google Trex게임을 다루어보았습니다. https://google.github.io/mediapipe/solutions/hands.html Hands Cross-platform, customizable ML solutions for live and streaming media. google.github.io Mediapipe의 hands는 손의 각 부분에 LandMark가 지정되어 있으며, LandMark의 위치에 따른 제어를 진행 할 수 있습니다. Mediapipe 설치 cmd창에서..

[Android]ENOENT (No such file or directory) 이미지 경로변경

image파일의 경로 이상. image파일의 경로의 log를 찍어보면 /content/— 형식으로 나오는데, /storage/emulated/0/Pictures/KakaoTalk/1664328418019.png 이러한 형식으로 변형해주어야 합니다. publicString getPathFromUri(Uri uri){ Cursorcursor = getContentResolver().query(uri,null,null,null,null); cursor.moveToNext(); String path = cursor.getString( cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA)); cursor.close(); return path; } 위 메소드를 통..

[Android] 새로고침 구현 - swipe refresh

swipe refresh 데이터를 받아오는 작업을 하거나, 새로고침이 필요한 경우 해당 라이브러리를 사용하여 간단한게 구현할 수 있습니다. build.gradle // swipe refresh implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0" xml // 내용 새로고침을 구현할 부분을 SwipeRefreshLayout으로 감싸 줍니다. Activity SwipeRefreshLayout swipeRefreshLayout; ... // 새로고침 swipeRefreshLayout = findViewById(R.id.swiperefreshlayout); swipeRefreshLayout.setOnRefreshListener(new Swi..

[Android] lottie 라이브러리를 사용하여 애니메이션 구현

lottie lottie 애니메이션은 카테고리 옆 이미지, 로딩 다이얼로그 등 화면을 보다 동적으로 보여주기에 목적에 따라 다양하게 활용 될 수 있습니다. build.gradle // lottie implementation 'com.airbnb.android:lottie:5.0.2' raw 파일 생성 res 우클릭 - New - Android Resource Directory lottie 홈페이지 https://lottiefiles.com/ LottieFiles: Download Free lightweight animations for website & apps. Effortlessly bring the smallest, free, ready-to-use motion graphics for the web..

[Android] Retrofit2 라이브러리를 사용하여 서버와 통신하기

Retrofit2 라이브러리를 사용하여 서버와 데이터를 주고 받는 작업을 진행하겠습니다. Retrofit2 Retrofit2 은 서버와의 RestAPI 통신을 가능하게 도와주는 라이브러리 입니다. retrofit 외에 통신을 가능하게 하는 라이브러리가 있지만, 속도 뿐만 아니라 많은 장점을 보유하고 있기에 Retrofit을 많이 선호 한다고 합니다. build.gradle // retrofit2 implementation 'com.squareup.retrofit2:retrofit:2.9.0' // Gson 변환기 implementation 'com.squareup.retrofit2:converter-gson:2.9.0' retrofit, gson 라이브러리를 추가해 줍니다. ApiClient.java 클..

[Android] JSoup 네이버 날씨 크롤링

크롤링(crawling) - 크롤링은 웹페이지의 내용을 그대로 가져와 데이터를 추출하는 행위 입니다. 위 사진은 현재 서울기준 네이버 날씨이며, 포커싱 된 부분의 글자를 추출하여 기기 화면으로 가져오는 코드를 Jsoup 라이브러리를 통하여 작성해보겠습니다. build.gradle // jsoup implementation 'org.jsoup:jsoup:1.13.1' xml MainActivity // 날씨 크롤링 TextView tv_temper; String tem; private String URL = "https://m.search.naver.com/search.naver?sm=mtp_sly.hst&where=m&query=%EC%84%9C%EC%9A%B8+%EB%82%A0%EC%94%A8&acr=..