diff --git a/Barcode_Reader_Python/.idea/Barcode_Reader_Python.iml b/Barcode_Reader_Python/.idea/Barcode_Reader_Python.iml
new file mode 100644
index 0000000..e98082a
--- /dev/null
+++ b/Barcode_Reader_Python/.idea/Barcode_Reader_Python.iml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Barcode_Reader_Python/.idea/misc.xml b/Barcode_Reader_Python/.idea/misc.xml
new file mode 100644
index 0000000..f99b311
--- /dev/null
+++ b/Barcode_Reader_Python/.idea/misc.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Barcode_Reader_Python/.idea/modules.xml b/Barcode_Reader_Python/.idea/modules.xml
new file mode 100644
index 0000000..142ffae
--- /dev/null
+++ b/Barcode_Reader_Python/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Barcode_Reader_Python/.idea/vcs.xml b/Barcode_Reader_Python/.idea/vcs.xml
new file mode 100644
index 0000000..6c0b863
--- /dev/null
+++ b/Barcode_Reader_Python/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Barcode_Reader_Python/.idea/workspace.xml b/Barcode_Reader_Python/.idea/workspace.xml
new file mode 100644
index 0000000..404e9de
--- /dev/null
+++ b/Barcode_Reader_Python/.idea/workspace.xml
@@ -0,0 +1,292 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ cam.read
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+ DEFINITION_ORDER
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1529543214918
+
+
+ 1529543214918
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Barcode_Reader_Python/barcodes.csv b/Barcode_Reader_Python/barcodes.csv
index 2d1c7a1..e69de29 100644
--- a/Barcode_Reader_Python/barcodes.csv
+++ b/Barcode_Reader_Python/barcodes.csv
@@ -1 +0,0 @@
-2018-06-15 23:18:13.020993,2
diff --git a/Barcode_Reader_Python/raspberry_zbar.py b/Barcode_Reader_Python/raspberry_zbar.py
index 4b69b41..62b3950 100644
--- a/Barcode_Reader_Python/raspberry_zbar.py
+++ b/Barcode_Reader_Python/raspberry_zbar.py
@@ -1,71 +1,62 @@
# import the necessary packages
from imutils.video import VideoStream
from pyzbar import pyzbar
-import argparse
-import datetime
import imutils
import time
import cv2
-
-# construct the argument parser and parse the arguments
-ap = argparse.ArgumentParser()
-ap.add_argument("-o", "--output", type=str, default="barcodes.csv",
- help="path to output CSV file containing barcodes")
-args = vars(ap.parse_args())
+import database_actions
+
# initialize the video stream and allow the camera sensor to warm up
print("[INFO] starting video stream...")
# vs = VideoStream(src=0).start()
vs = VideoStream().start()
time.sleep(2.0)
-
-# open the output CSV file for writing and initialize the set of
-# barcodes found thus far
-csv = open(args["output"], "w")
-found = set()
+dates = []
+reps = 0
+barcodes = None
+prevcode = None
+exp_date = []
+
+
# loop over the frames from the video stream
-while True:
- # grab the frame from the threaded video stream and resize it to
- # have a maximum width of 400 pixels
- frame = vs.read()
- frame = imutils.resize(frame, width=400)
-
- # find the barcodes in the frame and decode each of the barcodes
- barcodes = pyzbar.decode(frame)
- # loop over the detected barcodes
- for barcode in barcodes:
- # extract the bounding box location of the barcode and draw
- # the bounding box surrounding the barcode on the image
- (x, y, w, h) = barcode.rect
- cv2.rectangle(frame, (x, y), (x + w, y + h), (0, 0, 255), 2)
-
- # the barcode data is a bytes object so if we want to draw it
- # on our output image we need to convert it to a string first
- barcodeData = barcode.data.decode("utf-8")
- barcodeType = barcode.type
-
- # draw the barcode data and barcode type on the image
- text = "{} ({})".format(barcodeData, barcodeType)
- cv2.putText(frame, text, (x, y - 10),
- cv2.FONT_HERSHEY_SIMPLEX, 0.5, (0, 0, 255), 2)
-
- # if the barcode text is currently not in our CSV file, write
- # the timestamp + barcode to disk and update the set
- if barcodeData not in found:
- csv.write("{},{}\n".format(datetime.datetime.now(),
- barcodeData))
- csv.flush()
- found.add(barcodeData)
- # show the output frame
- cv2.imshow("Barcode Scanner", frame)
- key = cv2.waitKey(1) & 0xFF
-
- # if the `q` key was pressed, break from the loop
- if key == ord("q"):
- break
-
+while reps<1:
+ # grab the frame from the threaded video stream and resize it to
+ try:
+ while (barcodes == None or barcodes == []):
+ frame = vs.read()
+ frame = imutils.resize(frame, width=400)
+ barcodes = pyzbar.decode(frame)
+ cv2.imshow("Image", frame)
+ if cv2.waitKey(1) & 0xFF == ord('q'):
+ break
+ barcodes = pyzbar.decode(frame)
+ # loop over the detected barcodes
+ for barcode in barcodes:
+ (x, y, w, h) = barcode.rect
+ cv2.rectangle(frame, (x, y), (x + w, y + h), (0, 0, 255), 2)
+
+ barcodeData = barcode.data.decode("utf-8")
+ barcodeType = barcode.type
+
+ if (barcodeData != prevcode):
+ text = "{} ({})".format(barcodeData, barcodeType)
+ cv2.putText(frame, text, (x, y - 10), cv2.FONT_HERSHEY_SIMPLEX,
+ 0.5, (0, 0, 255), 2)
+
+ print("[INFO] Found {} barcode: {}".format(barcodeType, barcodeData))
+ dates.append(database_actions.getDate(barcodeData))
+ reps += 1
+
+ prevcode = barcodeData
+ barcodes = None
+ cv2.imshow("Image", frame)
+ if cv2.waitKey(1) & 0xFF == ord('q'):
+ break
+ except KeyboardInterrupt:
+ break
# close the output CSV file do a bit of cleanup
print("[INFO] cleaning up...")
-csv.close()
+print dates
cv2.destroyAllWindows()
-vs.stop()
\ No newline at end of file
+vs.stop()
diff --git a/Barcode_Reader_Python/run.py b/Barcode_Reader_Python/run.py
new file mode 100644
index 0000000..73a987b
--- /dev/null
+++ b/Barcode_Reader_Python/run.py
@@ -0,0 +1,4 @@
+import os
+
+script = raw_input("Please enter what you would like to run: ")
+os.system("python " + script + ".py")
\ No newline at end of file
diff --git a/Barcode_Reader_Python/zbar_live.py b/Barcode_Reader_Python/zbar_live.py
index 29dccd4..0500456 100755
--- a/Barcode_Reader_Python/zbar_live.py
+++ b/Barcode_Reader_Python/zbar_live.py
@@ -1,7 +1,5 @@
from pyzbar import pyzbar
-import argparse
import cv2
-import time
import database_actions
dates = []
@@ -10,9 +8,9 @@ barcodes = None
prevcode = None
exp_date = []
cam = cv2.VideoCapture(0)
-while(reps<2):
- while(barcodes == None or barcodes == []):
- ret , image = cam.read()
+while (reps < 2):
+ while (barcodes == None or barcodes == []):
+ ret, image = cam.read()
barcodes = pyzbar.decode(image)
cv2.imshow("Image", image)
if cv2.waitKey(1) & 0xFF == ord('q'):
@@ -20,26 +18,24 @@ while(reps<2):
for barcode in barcodes:
- (x, y, w, h) = barcode.rect
- cv2.rectangle(image, (x, y), (x + w, y + h), (0, 0, 255), 2)
- barcodeData = barcode.data.decode("utf-8")
- barcodeType = barcode.type
- if(barcodeData != prevcode):
-
- text = "{} ({})".format(barcodeData, barcodeType)
- cv2.putText(image, text, (x, y - 10), cv2.FONT_HERSHEY_SIMPLEX,
- 0.5, (0, 0, 255), 2)
-
- print("[INFO] Found {} barcode: {}".format(barcodeType, barcodeData))
- dates.append(database_actions.getDate(barcodeData))
- exp_date.append(int(barcodeData))
- reps += 1
-
- prevcode = barcodeData
- barcodes = None
- cv2.imshow("Image", image)
- if cv2.waitKey(1) & 0xFF == ord('q'):
- break
+ (x, y, w, h) = barcode.rect
+ cv2.rectangle(image, (x, y), (x + w, y + h), (0, 0, 255), 2)
+ barcodeData = barcode.data.decode("utf-8")
+ barcodeType = barcode.type
+ if (barcodeData != prevcode):
+ text = "{} ({})".format(barcodeData, barcodeType)
+ cv2.putText(image, text, (x, y - 10), cv2.FONT_HERSHEY_SIMPLEX,
+ 0.5, (0, 0, 255), 2)
-print dates
+ print("[INFO] Found {} barcode: {}".format(barcodeType, barcodeData))
+ dates.append(database_actions.getDate(barcodeData))
+ exp_date.append(int(barcodeData))
+ reps += 1
+
+ prevcode = barcodeData
+ barcodes = None
+ cv2.imshow("Image", image)
+ if cv2.waitKey(1) & 0xFF == ord('q'):
+ break
+print dates
diff --git a/FoodCloud/.idea/misc.xml b/FoodCloud/.idea/misc.xml
index 99202cc..c0f68ed 100644
--- a/FoodCloud/.idea/misc.xml
+++ b/FoodCloud/.idea/misc.xml
@@ -25,7 +25,7 @@
-
+
diff --git a/FoodCloud/app/src/main/java/gq/yigit/foodcloud/ProductInfo.java b/FoodCloud/app/src/main/java/gq/yigit/foodcloud/ProductInfo.java
index e174707..235faf0 100644
--- a/FoodCloud/app/src/main/java/gq/yigit/foodcloud/ProductInfo.java
+++ b/FoodCloud/app/src/main/java/gq/yigit/foodcloud/ProductInfo.java
@@ -133,8 +133,6 @@ public class ProductInfo extends AppCompatActivity implements OnClickListener {
BBD.setText("BBD : " +bbd);
Processed = (TextView) findViewById(R.id.Process);
Processed.setText("Process : " + processed);
- Problematic = (TextView) findViewById(R.id.Problems);
- Problematic.setText("Problemed : " + problematic);
}