Giter Site home page Giter Site logo

mohammaduzair9 / basic-image-processing Goto Github PK

View Code? Open in Web Editor NEW
166.0 2.0 46.0 31.97 MB

Implementation of Basic Digital Image Processing Tasks in Python / OpenCV

Python 100.00%
digital-image-processing image-processing centroid connected-component-labelling gradient histogram-equalization negative segmentation morphology sharpening

basic-image-processing's People

Contributors

mohammaduzair9 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

basic-image-processing's Issues

Another problem

def calculateTransitions(im):
h, w = im.shape[0], im.shape[1]
prev = im[0,0]
n = 0
for x in range(1, h):
for y in range(1, w):
curr = im[x,y]
# check if the is black to white transition
n = n+1 if curr == 255 and prev == 0 else n
prev = curr
return n

There is something wrong with
n = n+1 if curr == 255 and prev == 0 else n
prev = curr
return n
this part

please solve getting the same error

I am getting an error

NameError Traceback (most recent call last)
in
54 return n
55
---> 56 boundingBox = findBB(binary)
57 cropImg = binary[boundingBox[0]:boundingBox[1], boundingBox[2]:boundingBox[3]]
58 centroid = findCentroid(cropImg)

in findBB(im)
10 right, bottom = 0, 0
11
---> 12 for x in xrange(h):
13 for y in xrange(w):
14 if (im[x,y] == 0):

NameError: name 'xrange' is not defined

I am getting another error

ValueError Traceback (most recent call last)
in
55 return n
56
---> 57 boundingBox = findBB(binary)
58 cropImg = binary[boundingBox[0]:boundingBox[1], boundingBox[2]:boundingBox[3]]
59 centroid = findCentroid(cropImg)

in findBB(im)
13 for x in range(h):
14 for y in range(w):
---> 15 if (im[x,y] == 0):
16 right = x if x > right else right
17 left = x if x < left else left

ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

I have tried a lot but still not able to solve this error. Please help

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.