Giter Site home page Giter Site logo

Image processing about matft HOT 5 OPEN

jjjkkkjjj avatar jjjkkkjjj commented on May 24, 2024
Image processing

from matft.

Comments (5)

jjjkkkjjj avatar jjjkkkjjj commented on May 24, 2024

https://docs.opencv.org/3.1.0/d3/d63/classcv_1_1Mat.html#a5fafc033e089143062fd31015b5d0f40

Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. This operation is very efficient and can be used to process external data using OpenCV functions. The external data is not automatically deallocated, so you should take care of it.

from matft.

jjjkkkjjj avatar jjjkkkjjj commented on May 24, 2024

let contextRef = CGContext(data: $0.baseAddress!, width: width, height: height, bitsPerComponent: 8, bytesPerRow: width*channel, space: colorSpace, bitmapInfo: bitmapInfo.rawValue)

bitspercomponent = 32 means float?
If so, this is more efficient

According to core graphics supposed pixel formats, it only supports RGB with float format on iOS not Gray on iOS

ref: CGContext

from matft.

jjjkkkjjj avatar jjjkkkjjj commented on May 24, 2024

I think CGContext documents implies passing data pointer will not be freed (= not copied )

data: A pointer to the destination in memory where the drawing is to be rendered. The size of this memory block should be at least (bytesPerRow*height) bytes.
Pass NULL if you want this function to allocate memory for the bitmap. This frees you from managing your own memory, which reduces memory leak issues.

from matft.

jjjkkkjjj avatar jjjkkkjjj commented on May 24, 2024

Ref: Float CGContext

https://stackoverflow.com/questions/55433107/how-to-normalize-pixel-values-of-an-uiimage-in-swift

from matft.

jjjkkkjjj avatar jjjkkkjjj commented on May 24, 2024

The difference between Planar and interleaved image link
Planar: Column contiguous
Interleaved: Row contiguous

https://developer.apple.com/documentation/accelerate/optimizing_image-processing_performance

from matft.

Related Issues (20)

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.