Commit 5f62c34d authored by samesh97's avatar samesh97

Code error fixes and mapped with tools.

parent c45f3d70
...@@ -108,5 +108,7 @@ dependencies { ...@@ -108,5 +108,7 @@ dependencies {
implementation 'com.squareup.retrofit2:retrofit:2.1.0' implementation 'com.squareup.retrofit2:retrofit:2.1.0'
implementation 'com.squareup.retrofit2:converter-gson:2.1.0' implementation 'com.squareup.retrofit2:converter-gson:2.1.0'
implementation("com.squareup.okhttp3:okhttp:4.9.2")
implementation 'com.squareup.picasso:picasso:2.71828' implementation 'com.squareup.picasso:picasso:2.71828'
} }
\ No newline at end of file
...@@ -22,21 +22,16 @@ ...@@ -22,21 +22,16 @@
android:requestLegacyExternalStorage="true" android:requestLegacyExternalStorage="true"
android:roundIcon="@mipmap/ic_launcher_round" android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true" android:supportsRtl="true"
android:theme="@style/Theme.SmartPhotoEditor"> android:theme="@style/Theme.Design.NoActionBar">
<activity android:name=".ImageProcessing.Backgroundupload"></activity> <activity android:name=".activities.SetupActivity"/>
<activity android:name=".ImageProcessing.Splashedit" /> <activity android:name=".activities.SpeechTest"/>
<activity android:name=".ImageProcessing.Cut" />
<activity android:name=".ImageProcessing.Blur" />
<activity android:name=".ImageProcessing.Selectedit" />
<!-- <activity android:name=".ImageProcessing.BackgroundCustomization" />-->
<activity android:name=".activities.DenoisingActivity" /> <activity android:name=".activities.DenoisingActivity" />
<activity android:name=".activities.MyGallery" /> <activity android:name=".activities.CustomGallery" />
<activity android:name=".activities.CropActivity" />
<activity android:name=".activities.HeadPoseActivity" /> <activity android:name=".activities.HeadPoseActivity" />
<activity android:name=".activities.CameraView" /> <activity android:name=".activities.CameraView" />
<activity android:name=".activities.EnvironmentChecker" /> <activity android:name=".activities.EnvironmentChecker" />
<activity <activity
android:name=".ImageProcessing.BackgroundCustomization" android:name=".activities.SplashScreen"
android:screenOrientation="portrait"> android:screenOrientation="portrait">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
...@@ -66,6 +61,16 @@ ...@@ -66,6 +61,16 @@
android:label="Save" android:label="Save"
android:screenOrientation="portrait" /> android:screenOrientation="portrait" />
<activity android:name=".ImageProcessing.Backgroundupload"/>
<activity android:name=".ImageProcessing.Splashedit" />
<activity android:name=".ImageProcessing.Cut" />
<activity android:name=".ImageProcessing.Blur" />
<activity android:name=".ImageProcessing.Selectedit" />
<activity android:name=".ImageProcessing.MedBlur"/>
<activity android:name=".ImageProcessing.BackgroundCustomization"/>
<activity android:name=".ImageProcessing.Bokeh"/>
<meta-data <meta-data
android:name="com.google.mlkit.vision.DEPENDENCIES" android:name="com.google.mlkit.vision.DEPENDENCIES"
android:value="face" /> android:value="face" />
...@@ -79,4 +84,4 @@ ...@@ -79,4 +84,4 @@
</receiver> </receiver>
</application> </application>
</manifest> </manifest>
\ No newline at end of file
...@@ -14,6 +14,11 @@ import androidx.constraintlayout.widget.ConstraintLayout; ...@@ -14,6 +14,11 @@ import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import com.app.smartphotoeditor.ImageProcessing.BackgroundCustomization;
import com.app.smartphotoeditor.ImageProcessing.Blur;
import com.app.smartphotoeditor.ImageProcessing.Bokeh;
import com.app.smartphotoeditor.ImageProcessing.MedBlur;
import com.app.smartphotoeditor.ImageProcessing.Splashedit;
import com.app.smartphotoeditor.R; import com.app.smartphotoeditor.R;
import com.app.smartphotoeditor.adapters.ToolsAdapter; import com.app.smartphotoeditor.adapters.ToolsAdapter;
import com.app.smartphotoeditor.config.ImageList; import com.app.smartphotoeditor.config.ImageList;
...@@ -104,6 +109,16 @@ public class EditorActivity extends AppCompatActivity ...@@ -104,6 +109,16 @@ public class EditorActivity extends AppCompatActivity
intent = new Intent(getApplicationContext(), RestorationActivity.class); intent = new Intent(getApplicationContext(), RestorationActivity.class);
else if(clickedPos == 5) else if(clickedPos == 5)
intent = new Intent(getApplicationContext(), LowLightEnhanceActivity.class); intent = new Intent(getApplicationContext(), LowLightEnhanceActivity.class);
else if(clickedPos == 6)
intent = new Intent(getApplicationContext(), MedBlur.class);
else if(clickedPos == 7)
intent = new Intent(getApplicationContext(), BackgroundCustomization.class);
else if(clickedPos == 8)
intent = new Intent(getApplicationContext(), Blur.class);
else if(clickedPos == 9)
intent = new Intent(getApplicationContext(), Bokeh.class);
else if(clickedPos == 10)
intent = new Intent(getApplicationContext(), Splashedit.class);
if(intent != null) if(intent != null)
......
...@@ -192,103 +192,6 @@ public class EnvironmentChecker extends AppCompatActivity implements OnEyeStatus ...@@ -192,103 +192,6 @@ public class EnvironmentChecker extends AppCompatActivity implements OnEyeStatus
} }
void markIrisLocation(Mat eye_cropped)
{
Mat gray = new Mat();
//make gray frame
Imgproc.cvtColor(eye_cropped, gray, Imgproc.COLOR_BGR2GRAY);
gray.convertTo(gray,-1,brightnessLevel,0);
// gray.convertTo(gray,-1,2,0);
//add Blur
Imgproc.blur(gray,gray,new Size(11,11));
//Imgproc.GaussianBlur(gray,gray,new Size(11,11),11);
//gray.convertTo(gray,-1,1.1,0);
//Imgproc.Canny(gray,gray,0,120);
//create binary
Mat binary = new Mat();
Imgproc.threshold(gray, binary, 150, 255, Imgproc.THRESH_BINARY);
//find contours
List<MatOfPoint> contours = new ArrayList<>();
Mat hierarchy = new Mat();
Imgproc.findContours(binary, contours, hierarchy, Imgproc.RETR_TREE, Imgproc.CHAIN_APPROX_SIMPLE);
//Collections.sort(contours, Collections.reverseOrder());
if(contours.size() >= 1)
{
contours.remove(0);
}
// now iterate over all top level contours
double largestContuorArea = 0;
int position = 0;
for ( int contourIdx = 0; contourIdx < contours.size(); contourIdx++ )
{
Log.d("Contour","" +contours.size());
double contourArea = Imgproc.contourArea(contours.get(contourIdx));
if (largestContuorArea < contourArea)
{
largestContuorArea = contourArea;
position = contourIdx;
}
}
Log.d("ContourArea","" + largestContuorArea);
if(contours.size() > position)
{
//draw contour
Imgproc.drawContours ( eye_cropped, contours, position, new Scalar(0, 255, 0), 1);
//draw circle on middle point
Moments p = Imgproc.moments(contours.get(position));
int x = (int) (p.get_m10() / p.get_m00());
int y = (int) (p.get_m01() / p.get_m00());
Imgproc.circle(eye_cropped, new Point(x, y), 4, new Scalar(255,49,0,255));
//draw horizontal and vertical lines to create a cross
Imgproc.line(eye_cropped,new Point(x - 20,y),new Point(x + 20,y),new Scalar(0, 255, 0));
Imgproc.line(eye_cropped,new Point(x,y - 20),new Point(x,y + 20),new Scalar(0, 255, 0));
//draw circle in the gray frame
Imgproc.circle(binary, new Point(x, y), 5, new Scalar(0,0,0,255),10);
}
Bitmap grayFrame = matToBitmap(gray);
Bitmap binaryFrame = matToBitmap(binary);
Bitmap croppedOriginalFrame = matToBitmap(eye_cropped);
findTheViewPoint(binary);
if(isAccessingEnvironment)
{
accessEnvironment(binary,contours.size(),largestContuorArea);
}
@Override @Override
public void onRight() { public void onRight() {
...@@ -376,4 +279,4 @@ public class EnvironmentChecker extends AppCompatActivity implements OnEyeStatus ...@@ -376,4 +279,4 @@ public class EnvironmentChecker extends AppCompatActivity implements OnEyeStatus
{ {
tts.speak(text,TextToSpeech.QUEUE_FLUSH,null,null); tts.speak(text,TextToSpeech.QUEUE_FLUSH,null,null);
} }
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment