mirror of
https://github.com/euphy/polargraphcontroller
synced 2025-01-09 19:55:16 +01:00
Some more line filtering bid'nizz.
This commit is contained in:
parent
fe828d01d8
commit
d838d22ea5
@ -425,6 +425,17 @@ class DisplayMachine extends Machine
|
|||||||
float scaler = h / vec.getHeight();
|
float scaler = h / vec.getHeight();
|
||||||
PVector position = new PVector(getPanel(PANEL_NAME_WEBCAM).getOutline().getRight()+7, height -10);
|
PVector position = new PVector(getPanel(PANEL_NAME_WEBCAM).getOutline().getRight()+7, height -10);
|
||||||
|
|
||||||
|
// int noOfChildren = vec.countChildren();
|
||||||
|
// List<RShape> children = new ArrayList<RShape>(noOfChildren);
|
||||||
|
// for (int i=0; i < noOfChildren; i++)
|
||||||
|
// {
|
||||||
|
// if (vec.children[i].getArea() > pathLengthHighPassCutoff)
|
||||||
|
// children.add(vec.children[i]);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// RShape[] newArray = children.toArray(new RShape[children.size()]);
|
||||||
|
// vec.children = newArray;
|
||||||
|
|
||||||
RPoint[][] pointPaths = vec.getPointsInPaths();
|
RPoint[][] pointPaths = vec.getPointsInPaths();
|
||||||
if (pointPaths != null)
|
if (pointPaths != null)
|
||||||
{
|
{
|
||||||
|
@ -497,8 +497,8 @@ Map<String, Controller> initialiseNumberboxValues(Map<String, Controller> map)
|
|||||||
{
|
{
|
||||||
n.setDecimalPrecision(1);
|
n.setDecimalPrecision(1);
|
||||||
n.setValue(pathLengthHighPassCutoff);
|
n.setValue(pathLengthHighPassCutoff);
|
||||||
n.setMin(0);
|
n.setMin(PATH_LENGTH_HIGHPASS_CUTOFF_MIN);
|
||||||
n.setMax(10000);
|
n.setMax(PATH_LENGTH_HIGHPASS_CUTOFF_MAX);
|
||||||
n.setMultiplier(0.5);
|
n.setMultiplier(0.5);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -746,7 +746,7 @@ List<RPoint[]> removeShortPaths(List<RPoint[]> list, int cutoff)
|
|||||||
{
|
{
|
||||||
if (cutoff > 0)
|
if (cutoff > 0)
|
||||||
{
|
{
|
||||||
int numberOfPaths = list.size();
|
int numberOfPaths = list.size()-1;
|
||||||
for (int i=0; i<numberOfPaths; i++)
|
for (int i=0; i<numberOfPaths; i++)
|
||||||
{
|
{
|
||||||
if (cutoff >= list.get(i).length)
|
if (cutoff >= list.get(i).length)
|
||||||
|
16
gamepad.pde
16
gamepad.pde
@ -86,11 +86,27 @@ void dpadPress(float x, float y)
|
|||||||
if (liveSimplification > LIVE_SIMPLIFICATION_MAX)
|
if (liveSimplification > LIVE_SIMPLIFICATION_MAX)
|
||||||
liveSimplification = LIVE_SIMPLIFICATION_MAX;
|
liveSimplification = LIVE_SIMPLIFICATION_MAX;
|
||||||
}
|
}
|
||||||
|
if (val == 8.0) // left
|
||||||
|
{
|
||||||
|
pathLengthHighPassCutoff--;
|
||||||
|
if (pathLengthHighPassCutoff < PATH_LENGTH_HIGHPASS_CUTOFF_MIN)
|
||||||
|
pathLengthHighPassCutoff = PATH_LENGTH_HIGHPASS_CUTOFF_MIN;
|
||||||
|
}
|
||||||
|
else if (val == 4.0) // right
|
||||||
|
{
|
||||||
|
pathLengthHighPassCutoff++;
|
||||||
|
if (pathLengthHighPassCutoff > PATH_LENGTH_HIGHPASS_CUTOFF_MAX)
|
||||||
|
pathLengthHighPassCutoff = PATH_LENGTH_HIGHPASS_CUTOFF_MAX;
|
||||||
|
}
|
||||||
|
|
||||||
Numberbox n = (Numberbox) getAllControls().get(MODE_LIVE_SIMPLIFICATION_VALUE);
|
Numberbox n = (Numberbox) getAllControls().get(MODE_LIVE_SIMPLIFICATION_VALUE);
|
||||||
n.setValue(liveSimplification);
|
n.setValue(liveSimplification);
|
||||||
n.update();
|
n.update();
|
||||||
|
|
||||||
|
n = (Numberbox) getAllControls().get(MODE_VECTOR_PATH_LENGTH_HIGHPASS_CUTOFF);
|
||||||
|
n.setValue(pathLengthHighPassCutoff);
|
||||||
|
n.update();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void processGamepadInput()
|
void processGamepadInput()
|
||||||
|
@ -470,7 +470,9 @@ static PImage processedCapturedImage = null;
|
|||||||
static final Integer LIVE_SIMPLIFICATION_MIN = 1;
|
static final Integer LIVE_SIMPLIFICATION_MIN = 1;
|
||||||
static final Integer LIVE_SIMPLIFICATION_MAX = 32;
|
static final Integer LIVE_SIMPLIFICATION_MAX = 32;
|
||||||
|
|
||||||
static int pathLengthHighPassCutoff = 100;
|
static int pathLengthHighPassCutoff = 0;
|
||||||
|
static final Integer PATH_LENGTH_HIGHPASS_CUTOFF_MAX = 10000;
|
||||||
|
static final Integer PATH_LENGTH_HIGHPASS_CUTOFF_MIN = 0;
|
||||||
|
|
||||||
JMyron liveCamera;
|
JMyron liveCamera;
|
||||||
BlobDetector blob_detector;
|
BlobDetector blob_detector;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user