Skip to content

Commit

Permalink
- Updated for 0.33.1
Browse files Browse the repository at this point in the history
- Added missing __version__ string
  • Loading branch information
lessthanoptimal committed May 13, 2019
1 parent 154cd41 commit d3f7183
Show file tree
Hide file tree
Showing 24 changed files with 58 additions and 18 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ apply plugin: 'eclipse'
apply plugin: 'maven'

group = 'org.pyboof'
version = '0.32'
version = '0.33.1'

repositories {
mavenCentral()
Expand Down
4 changes: 4 additions & 0 deletions change.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### Version 0.33.1

- Updated for latest BoofCV

### Version 0.32

- Updated for latest BoofCV
Expand Down
2 changes: 2 additions & 0 deletions examples/blur_image.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python3

import numpy as np
import pyboof as pb

Expand Down
2 changes: 2 additions & 0 deletions examples/calibrate_fisheye_camera.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python3

import pyboof as pb
import numpy as np
import os
Expand Down
2 changes: 2 additions & 0 deletions examples/calibrate_pinhole_camera.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python3

import pyboof as pb
import numpy as np
import os
Expand Down
2 changes: 2 additions & 0 deletions examples/calibration_target_detect.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python3

import pyboof as pb
import numpy as np
import os
Expand Down
2 changes: 2 additions & 0 deletions examples/estimate_camera_motion.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python3

import numpy as np

import pyboof as pb
Expand Down
2 changes: 2 additions & 0 deletions examples/fiducial_square_binary_3D.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python3

import pyboof as pb
import numpy as np
import os
Expand Down
2 changes: 2 additions & 0 deletions examples/fiducial_square_image_3D.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python3

import pyboof as pb
import numpy as np
import os
Expand Down
4 changes: 3 additions & 1 deletion examples/fisheye_to_pinhole.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python3

import pyboof as pb
import numpy as np
import os
Expand Down Expand Up @@ -35,5 +37,5 @@
image_distorter.apply(image_fisheye, image_pinhole)
cv2.imshow("Pinhole Rotated", pb.boof_to_ndarray(image_pinhole)[...,[2,1,0]])

print("Close Windows to Exit")
print("Press Any Key to Exit")
cv2.waitKey(0)
2 changes: 2 additions & 0 deletions examples/gradient.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python3

import numpy as np

import pyboof as pb
Expand Down
2 changes: 2 additions & 0 deletions examples/loading_images.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python3

import numpy as np

import cv2
Expand Down
2 changes: 2 additions & 0 deletions examples/match_features.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python3

import numpy as np

import pyboof as pb
Expand Down
2 changes: 2 additions & 0 deletions examples/object_tracking.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python3

import cv2
import pyboof as pb
import numpy as np
Expand Down
2 changes: 2 additions & 0 deletions examples/qrcode_detect.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python3

import numpy as np
import pyboof as pb

Expand Down
2 changes: 2 additions & 0 deletions examples/qrcode_encode.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python3

import pyboof as pb

pb.init_memmap()
Expand Down
2 changes: 2 additions & 0 deletions examples/remove_lens_distortion.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python3

import numpy as np
import os
import pyboof as pb
Expand Down
2 changes: 2 additions & 0 deletions examples/stereo_disparity.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python3

import numpy as np

# pip install matplotlib
Expand Down
2 changes: 2 additions & 0 deletions examples/threshold_image.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python3

import numpy as np

import pyboof as pb
Expand Down
2 changes: 2 additions & 0 deletions pyboof/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
from py4j.protocol import Py4JError
from py4j.protocol import Py4JNetworkError

__version__ = "0.33.1"

gateway = JavaGateway()

mmap_size = 0
Expand Down
6 changes: 3 additions & 3 deletions pyboof/calib.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def set_from_boof(self, boof_intrinsic):

def convert_to_boof(self, storage=None):
if storage is None:
boof_intrinsic = gateway.jvm.boofcv.struct.calib.CameraPinholeRadial()
boof_intrinsic = gateway.jvm.boofcv.struct.calib.CameraPinholeBrown()
else:
boof_intrinsic = storage
boof_intrinsic.setFx(float(self.fx))
Expand Down Expand Up @@ -267,7 +267,7 @@ def create_narrow_lens_distorter( camera_model ):
elif isinstance(camera_model, CameraPinhole):
boof_model = camera_model.convert_to_boof()
if camera_model.is_distorted():
java_obj = gateway.jvm.boofcv.alg.distort.radtan.LensDistortionRadialTangential(boof_model)
java_obj = gateway.jvm.boofcv.alg.distort.brown.LensDistortionBrown(boof_model)
else:
java_obj = gateway.jvm.boofcv.alg.distort.pinhole.LensDistortionPinhole(boof_model)
else:
Expand Down Expand Up @@ -413,7 +413,7 @@ def create_change_camera_model(intrinsic_orig,intrinsic_desired, image_type,
java_border = border_to_java(border)
java_original = intrinsic_orig.convert_to_boof()
java_desired = intrinsic_desired.convert_to_boof()
java_intrinsic_out = gateway.jvm.boofcv.struct.calib.CameraPinholeRadial()
java_intrinsic_out = gateway.jvm.boofcv.struct.calib.CameraPinholeBrown()
id = gateway.jvm.boofcv.alg.distort.LensDistortionOps.changeCameraModel(
java_adjustment,java_border,java_original,java_desired,java_intrinsic_out,java_image_type)
return (ImageDistort(id), CameraPinhole(java_intrinsic_out))
Expand Down
20 changes: 10 additions & 10 deletions pyboof/ip.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,25 +93,25 @@ def border_to_java(border):
:return: java_object
"""
if border == Border.SKIP:
return gateway.jvm.boofcv.core.image.border.BorderType.valueOf("SKIP")
return gateway.jvm.boofcv.struct.border.BorderType.valueOf("SKIP")
elif border == Border.EXTENDED:
return gateway.jvm.boofcv.core.image.border.BorderType.valueOf("EXTENDED")
return gateway.jvm.boofcv.struct.border.BorderType.valueOf("EXTENDED")
elif border == Border.NORMALIZED:
return gateway.jvm.boofcv.core.image.border.BorderType.valueOf("NORMALIZED")
return gateway.jvm.boofcv.struct.border.BorderType.valueOf("NORMALIZED")
elif border == Border.REFLECT:
return gateway.jvm.boofcv.core.image.border.BorderType.valueOf("REFLECT")
return gateway.jvm.boofcv.struct.border.BorderType.valueOf("REFLECT")
elif border == Border.WRAP:
return gateway.jvm.boofcv.core.image.border.BorderType.valueOf("WRAP")
return gateway.jvm.boofcv.struct.border.BorderType.valueOf("WRAP")
elif border == Border.ZERO:
return gateway.jvm.boofcv.core.image.border.BorderType.valueOf("ZERO")
return gateway.jvm.boofcv.struct.border.BorderType.valueOf("ZERO")


def blur_gaussian(image, output, sigma=-1.0,radius=1):
gateway.jvm.boofcv.alg.filter.blur.BlurImageOps.gaussian(image, output, sigma, radius, None)


def blur_mean(image, output, radius=1):
gateway.jvm.boofcv.alg.filter.blur.BlurImageOps.mean(image, output, radius, None)
gateway.jvm.boofcv.alg.filter.blur.BlurImageOps.mean(image, output, radius, None, None)


def blur_median(image, output, radius=1):
Expand Down Expand Up @@ -293,7 +293,7 @@ def localSauvola(self, region_width, k=0.3, down=True):
region_width = boof_fixed_length(region_width)

java_object = gateway.jvm.boofcv.factory.filter.binary.FactoryThresholdBinary.\
localSauvola(region_width,float(k),down,self.boof_image_type)
localSauvola(region_width,down,float(k),self.boof_image_type)
return InputToBinary(java_object)

def localMean(self, region_width, scale=0.95, down=True):
Expand Down Expand Up @@ -359,7 +359,7 @@ def blockMinMax(self, region_width, scale=0.95, down=True, minimumSpread=-1.0,th
region_width = boof_fixed_length(region_width)

java_object = gateway.jvm.boofcv.factory.filter.binary.FactoryThresholdBinary. \
blockMinMax(region_width, float(scale), down, float(minimumSpread), thresholdFromLocalBlocks,self.boof_image_type)
blockMinMax(region_width, float(scale), down, thresholdFromLocalBlocks, float(minimumSpread), self.boof_image_type)
return InputToBinary(java_object)

def blockMean(self, region_width, scale=0.95, down=True,thresholdFromLocalBlocks=True):
Expand Down Expand Up @@ -405,7 +405,7 @@ def blockOtsu(self, region_width, scale=0.95, down=True, otsu2 = False, tuning=0
region_width = boof_fixed_length(region_width)

java_object = gateway.jvm.boofcv.factory.filter.binary.FactoryThresholdBinary. \
blockOtsu(otsu2,region_width,float(tuning),float(scale),down,thresholdFromLocalBlocks,self.boof_image_type)
blockOtsu(region_width,float(scale),down,thresholdFromLocalBlocks,otsu2,float(tuning),self.boof_image_type)
return InputToBinary(java_object)

def globalEntropy(self, min_value=0, max_value=255, down=True):
Expand Down
2 changes: 1 addition & 1 deletion pyboof/swing.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def show_list(image_name_pairs, title="Image List"):


def colorize_gradient( derivX , derivY ):
return gateway.jvm.boofcv.gui.image.VisualizeImageData.colorizeGradient(derivX,derivY,-1)
return gateway.jvm.boofcv.gui.image.VisualizeImageData.colorizeGradient(derivX,derivY,-1,None)


def render_binary( binary , invert=False):
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import os.path
import time
Expand Down Expand Up @@ -55,7 +55,7 @@ def run(self):

setup(name='PyBoof',
cmdclass={'build_py': MyBuild},
version='0.32',
version='0.33.1', # Change in in __init__ too
description='Py4J Python wrapper for BoofCV',
long_description=open('README.md', 'r').read(),
url='https://github.com/lessthanoptimal/PyBoof',
Expand Down

0 comments on commit d3f7183

Please sign in to comment.