Browse Source

old final

old^2
Yiğit Çolakoğlu 6 years ago
parent
commit
19d966670a
16 changed files with 177277 additions and 98352 deletions
  1. +1
    -1
      MyCity/app/src/main/java/gq/yigit/mycity/ParkFragment.java
  2. +84
    -84
      MyCity/gradlew.bat
  3. +1
    -1
      bus_stop/bus_stop.iml
  4. +3
    -3
      server_side/api/modules/SpotSelector.py
  5. BIN
      server_side/api/modules/__pycache__/navigation.cpython-37.pyc
  6. BIN
      server_side/api/modules/__pycache__/smart_park.cpython-37.pyc
  7. +120
    -0
      server_side/api/modules/databases/denunciations.json
  8. +4
    -24
      server_side/api/modules/databases/locations.json
  9. +177044
    -98228
      server_side/api/modules/databases/park_data.json
  10. +2
    -2
      server_side/api/modules/databases/ratings.json
  11. +1
    -1
      server_side/api/modules/databases/users.json
  12. BIN
      server_side/api/modules/image5.jpg
  13. +2
    -2
      server_side/api/modules/navigation.py
  14. +4
    -4
      server_side/api/modules/smart_park.py
  15. +9
    -0
      traffic_analyzer/traffic_analyzer.iml
  16. +2
    -2
      traffic_analyzer/white_mask.py

+ 1
- 1
MyCity/app/src/main/java/gq/yigit/mycity/ParkFragment.java View File

@ -183,7 +183,7 @@ public class ParkFragment extends Fragment implements WebRequest.responseListene
latitude = spot.getString("lat");
longitude = spot.getString("lng");
LatLng spot_loc = new LatLng(Integer.parseInt(latitude), Integer.parseInt(longitude));
LatLng spot_loc = new LatLng(Double.parseDouble(latitude), Double.parseDouble(longitude));
map.addMarker(new MarkerOptions().position(spot_loc).title("Parking Spot"));
LatLng loc = new LatLng(lat_orig, lng_orig);


+ 84
- 84
MyCity/gradlew.bat View File

@ -1,84 +1,84 @@
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

+ 1
- 1
bus_stop/bus_stop.iml View File

@ -3,7 +3,7 @@
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="jdk" jdkName="10.0.2+13" jdkType="JavaSDK" />
<orderEntry type="jdk" jdkName="Python 3.7" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

+ 3
- 3
server_side/api/modules/SpotSelector.py View File

@ -4,9 +4,9 @@ import json
rects = []
cam = cv2.VideoCapture("http://10.10.26.128:4747/mjpegfeed")
ret,im = cam.read()
#cam = cv2.VideoCapture("http://192.168.43.246:4747/mjpegfeed")
#ret,im = cam.read()
im = cv2.imread("image5.jpg")
if __name__ == '__main__' :
while(True):


BIN
server_side/api/modules/__pycache__/navigation.cpython-37.pyc View File


BIN
server_side/api/modules/__pycache__/smart_park.cpython-37.pyc View File


+ 120
- 0
server_side/api/modules/databases/denunciations.json
File diff suppressed because it is too large
View File


+ 4
- 24
server_side/api/modules/databases/locations.json View File

@ -1,29 +1,9 @@
{
"0": {
"x1": 212,
"y1": 342,
"x2": 378,
"y2": 426,
"lng": 33,
"lat": 34,
"y1": 62,
"x2": 318,
"x1": 108,
"y2": 350,
"priority": 0
},
"1": {
"x1": 388,
"y1": 344,
"x2": 516,
"y2": 416,
"lng": 33,
"lat": 34,
"priority": 1
},
"2": {
"x1": 90,
"y1": 338,
"x2": 208,
"y2": 420,
"lng": 33,
"lat": 34,
"priority": 2
}
}

+ 177044
- 98228
server_side/api/modules/databases/park_data.json
File diff suppressed because it is too large
View File


+ 2
- 2
server_side/api/modules/databases/ratings.json View File

@ -13,8 +13,8 @@
"9vard12ty0ad2yvwp3q53rsf3h43r2vq": {
"id": 2,
"rater": "9vard12ty0ad2yvwp3q53rsf3h43r2vq",
"score": 6,
"note": "jrjfd"
"score": 8,
"note": "cffchc"
}
}
}

+ 1
- 1
server_side/api/modules/databases/users.json View File

@ -120,7 +120,7 @@
14,
12
],
"points": 40,
"points": 35,
"electricity_bill": 100,
"water_bill": 120
}

BIN
server_side/api/modules/image5.jpg View File

Before After
Width: 360  |  Height: 380  |  Size: 56 KiB

+ 2
- 2
server_side/api/modules/navigation.py View File

@ -159,7 +159,7 @@ class Transit(Resource):
& set([x for n in stops_arr["dest"] for x in stops_arr["dest"][n]])))}
travel = {"routes":[], "total":[]}
time_cur = datetime.datetime.today().time()
time_cur = datetime.datetime.strptime("13:00","%H:%M")
if len(one_bus) > 0:
for i in one_bus:
@ -227,7 +227,7 @@ class Transit(Resource):
url = "http://88.255.141.66/mbl/android/action.asp?SID=0.4474110208361718&VER=3.1.0&LAN=tr&UID"\
"=%7BACB78701-2727-4E9A-AE62-28491D671A7D%7D-130570234&FNC=DuraktanGecisSaatleri "
weekno = datetime.datetime.today().weekday()
weekno = 4
times_anal = [[], []]
for j in range(2):
try:


+ 4
- 4
server_side/api/modules/smart_park.py View File

@ -103,7 +103,7 @@ def im2str(im):
imdata = pickle.dumps(im)
return base64.b64encode(imdata).decode('ascii')
cam = cv2.VideoCapture("http://10.10.26.128:4747/mjpegfeed")
cam = cv2.VideoCapture("http://192.168.43.246:4747/mjpegfeed")
plt.axis("off")
with open("modules/databases/locations.json","r") as f:
@ -123,10 +123,10 @@ while 0:
class Empty(Resource):
def get(self):
#ret,image = cam.read()
image = cv2.imread("modules/lot.jpg")
ret,image = cam.read()
#image = cv2.imread("modules/lot.jpg")
backup = image.copy()
spot_data = generateData(locs,image,data,["0"])
spot_data = generateData(locs,image,data,["0","1","2"])
print(spot_data)
best_spot = -1
for loc in spot_data:


+ 9
- 0
traffic_analyzer/traffic_analyzer.iml View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="jdk" jdkName="Python 3.7" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

+ 2
- 2
traffic_analyzer/white_mask.py View File

@ -17,9 +17,9 @@ def threshold_slow(image):
while True:
ret, frame = cap.read()
frame_org = frame
frame = frame[100:300, 100:300]
frame = frame[185:230, 180:225]
hsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV)
sensitivity = 40
sensitivity = 50
lower_white = np.array([0,0,255-sensitivity])
upper_white = np.array([255,sensitivity,255])
mask = cv2.inRange(hsv, lower_white, upper_white)


Loading…
Cancel
Save