1 | initial version |
out of scope for this forum.
you can use cv.imencode()
to turn a numpy array (or cv::Mat) into an array of bytes that contains the picture file, but in memory. this resulting numpy array can be turned into a python bytes
object.
you can write an SQL query that inserts this bytestring into your database.
I would strongly recommend using "prepared statements" for safety and security reasons. you should pass slicedImage
as an argument, not splice it into the query string.
2 | No.2 Revision |
out of scope for this forum.
you can use cv.imencode()
to turn a numpy array (or cv::Mat) into an array of bytes that contains the picture file, but in memory. this resulting numpy array can be turned into a python bytes
object.
you can write an SQL query that inserts this bytestring into your database.
I would strongly recommend using "prepared statements" for safety and security reasons. you should pass slicedImage
as an argument, not splice it into the query string.