Skip to content

Merge work done by aavogt over the last two years#10

Open
sinelaw wants to merge 140 commits into
sinelaw:masterfrom
acowley:master
Open

Merge work done by aavogt over the last two years#10
sinelaw wants to merge 140 commits into
sinelaw:masterfrom
acowley:master

Conversation

@sinelaw

@sinelaw sinelaw commented May 16, 2014

Copy link
Copy Markdown
Owner

No description provided.

Anthony Cowley and others added 30 commits July 30, 2010 12:43
- Fixed types in foreign imports.
- Added a wrapper for cvErode.
- Moved more memory management into Haskell.
- Added reference to github fork to the .cabal file (this may be removed).
The HIplImage data type includes the features from the IplImage struct
that OpenCV makes use of. This simplifies the job of inspecting an
IplImage obtained from OpenCV for further processing in Haskell.

Added the PixelUtils module for working with OpenCV's image packing
style. The primary issue is that the image data buffer in an IplImage
will sometimes contain room for four color channels even if only three
are used. This is good for considering an image on a row-by-row basis,
but complicates the view of image data as a single vector.
- Added an HIplImage smart constructor from image dimensions and a
  vector of pixel data.

- Added a functional inteface for OpenCV dilation and erosion on
  HIplImage values.
…nels.

These changes are to improve usability of HIplImage in a pure Haskell
context. The nSize field, in parcticular, is a constant that is of no
interest from within Haskell.
Added a helper for mutating a new HIplImage value in-place.
To support this, there is now functionality for duplicating images.
Implemented in-place fusion compiler rules.
Made the houghStandard output type match houghProbabilistic's.

The in-place optimizations are all using unsafePerformIO at the
moment, and this will have to change as it is, of course, totally
unsafe. While the RULES pragma is firing correctly, other
optimizations are killing the operations. They will have to be moved
into ST or explicitly marked as IO.
The OpenCV documentation for cvSaveImage is incorrect: it takes a
third parameter that should be set to zero.

Still working out how to do the allocation fusing rules. The difficulty is
in keeping the interface looking like functions but being able to recognize
when fusable operations are composed.
Added a note about the current state of the unsafe operation fusion
rules.
The intent is that we will sometimes perform in-place updates when
composing an operation with a function whose return type explicitly
indicates that it is returning a fresh image. This gets around the
issue of fully parametric types like the identity function getting
picked up for allocation fusion.
Added a bit of HIplImage to the export list of HighCV in the hope
that HighCV can be the sole entrypoint to the library for a typical
client.
The distinction between MonoChromatic and TriChromatic,
as well as 8bpp or 16bpp, can now be determined through types.
This makes various image processing procedures that, for example,
require a monochromatic 8bpp image safe to call.
The parametricity over pixel depth can lead to generic paths
through Data.Vector code. That is horribly slow, so such
functions must be compiled with the concrete type they are
used at. Marking them as INLINE addresses this, but it is something
that needs minding.
Split parts of HIplImage into HIplUtils.
Split parts of HighCV into HighColorConv.

The main entrypoint is still HighCV, but the implementation
is a bit more broken up now as some of the modules have gotten
quite unwieldy.
This replaces the old dropAlpha as it is faster and more general.
The idea is to trim OpenCV images that have a stride that is
larger than strictly necessary. Such images have their valid
pixel data copied and placed into a Vector that can be sent
on the network faster than the padded version.
Returns a list of pixel values (of the appropriate depth and number of
channels) sampled from a line in an image.
- Improved video capture from file interface.
- Fixed bug in mkHIplImage related to the new image's size.
- Fixed support for HIplImage's with floating point data.
Anthony Cowley and others added 30 commits August 20, 2011 11:53
…ndings, if present, prevent GHCi from linking with HOpenCV so the flag defaults to False (no bindings).
Several unsafe approaches to passing structs by value have been fixed using more extensive hsc2hs wrapping.
This new type uses data kinds to more succinctly enforce type-level
properties of images.
Some code is simplified with the new Image type, and we admit fewer
absurd types with tighter kinds.
This version of the library now needs GHC 7.6.1 or newer, so the base
dependency is a signal that older GHC/base combinations won't work.
Added unsafePixelVector to return a Vector that shares storage with an
Image.

Added a type synonym for monochromatic floating point images.
Changed argument order on withPixelVector to take the Vector last.
Certain parameters, like origin, were not being properly loaded from the
C structure into Haskell.
supposedly the old way (two CInt arguments) used to work in some cases,
but this did not work (cvVideoWriter returned a null pointer) for
my system. Note that there are similar wrappers pre-existing
in HOpenCV_wrap.c
add a cvCreateVideo wrapper
Grab video from a webcam, show it on screen and write it to a compressed
video file.
working functions for contours & restrict createVideoWriter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants