Skip to content

Commit

Permalink
Refactor image sample app to support API 16.
Browse files Browse the repository at this point in the history
Add default options to realtime app.
  • Loading branch information
Suaro committed Mar 24, 2021
1 parent 8d6b755 commit 521d279
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,11 @@ This library currently is full developed in Kotlin with C++, no additional depen
- [x] Face detection
- [x] Pupil detection
- [x] Landmarks detection
- [x] Pure Java Pidroid (to delete avoid Kotlin dependency)
- [ ] Publish Library as Github Package
- [ ] Pure Java Pidroid (to delete avoid Kotlin dependency)
- [ ] Rotated faces detection
- [ ] Neon support
- [ ] SSE support
- [ ] Tegra support


## Usage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ class CanvasView @JvmOverloads constructor(context: Context, attrs: AttributeSet
paint.setColor(color)
paint.setStrokeWidth(RECT_BORDER_WIDTH);

canvas?.drawRoundRect(rect.left.toFloat(), rect.top.toFloat(), rect.right.toFloat(), rect.bottom.toFloat(), RECT_BORDER_RADIUS, RECT_BORDER_RADIUS, paint);
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
canvas?.drawRoundRect(rect.left.toFloat(), rect.top.toFloat(), rect.right.toFloat(), rect.bottom.toFloat(), RECT_BORDER_RADIUS, RECT_BORDER_RADIUS, paint)
} else {
canvas?.drawRect(rect, paint)
}
}

fun drawCircle(circle: Circle, canvas: Canvas?, color: Int = Color.GREEN) {;
Expand Down
10 changes: 5 additions & 5 deletions pidroid/src/main/java/com/suaro/pidroid/core/PidroidConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ public final class PidroidConfig {
private float scalefactor = 1.1F;
private float stridefactorWidth = 0.2F;
private float stridefactorHeight = 0.12F;
private float qthreshold = 1.0F;
private float qthreshold = 3.0F;
private int perturbs = 10;
private boolean clustering = true;
private boolean pupilDetectionEnable = true;
Expand Down Expand Up @@ -69,31 +69,31 @@ public void setPerturbs(int perturbs) {
this.perturbs = perturbs;
}

public boolean isClustering() {
public boolean getClustering() {
return clustering;
}

public void setClustering(boolean clustering) {
this.clustering = clustering;
}

public boolean isPupilDetectionEnable() {
public boolean getPupilDetectionEnable() {
return pupilDetectionEnable;
}

public void setPupilDetectionEnable(boolean pupilDetectionEnable) {
this.pupilDetectionEnable = pupilDetectionEnable;
}

public boolean isLandmarkDetectionEnable() {
public boolean getLandmarkDetectionEnable() {
return landmarkDetectionEnable;
}

public void setLandmarkDetectionEnable(boolean landmarkDetectionEnable) {
this.landmarkDetectionEnable = landmarkDetectionEnable;
}

public boolean isProminentFaceOnly() {
public boolean getProminentFaceOnly() {
return prominentFaceOnly;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ class MainActivity : AppCompatActivity(), Camera.View, Capturer.View{

private fun setupNative() {
val pidroidConfig = PidroidConfig()
pidroidConfig.isProminentFaceOnly = true
pidroidConfig.prominentFaceOnly = true
pidroidConfig.qthreshold = 1.5f
Pidroid.setup(this, pidroidConfig)
}

Expand Down

0 comments on commit 521d279

Please sign in to comment.