OpenCV

How to remove all portrait pictures from a document

风格不统一 提交于 2021-02-10 06:47:14
问题 I am working on OCRing a document image. I want to detect all pictures and remove from the document image. I want to retain tables in the document image. Once I detect pictures I will remove and then want to OCR. I tried to find contour tried to detect all the bigger areas. unfortunately it detects tables also. Also how to remove the objects keeping other data in the doc image. I am using opencv and python Here's my code import os from PIL import Image import pytesseract img = cv2.imread(

Image translation using numpy

对着背影说爱祢 提交于 2021-02-10 06:34:05
问题 I want to perform image translation by a certain amount (shift the image vertically and horizontally). The problem is that when I paste the cropped image back on the canvas, I just get back a white blank box. Can anyone spot the issue here? Many thanks img_shape = image.shape # translate image # percentage of the dimension of the image to translate translate_factor_x = random.uniform(*translate) translate_factor_y = random.uniform(*translate) # initialize a black image the same size as the

Convert gray image to colored image using feature extraction method in ML

江枫思渺然 提交于 2021-02-10 05:33:07
问题 I have a feature array which is created from ORB with this code part: orb = cv2.ORB_create() #keypoints and descriptors kpO, desO = orb.detectAndCompute(gray_image, None) I create this gray image from colored one. And des0.shape is (500,32). Also shape of my original image(colored one) is (422, 750, 3). And I want to decisionTreeRegression from these arrays for predict the colored version of grayscale image which is I created from colored version. But the problem is starting here , feature

OpenCV cv2.VideoCapture() stopping to read RTSP IP camera

青春壹個敷衍的年華 提交于 2021-02-10 04:45:09
问题 Hello im learning opencv and im reading a ip camera through rtsp:// videoStream = "rtsp://admin:123456@10.0.0.1:554/Streaming/Channels/1" capture = cv2.VideoCapture(videoStream) im reading this stream and im making a facial detection in opencv but after 1 or 2 minutes my script crashes whit a h264 message and my opencv code gives me a error: [h264 @ 0x27e49570] error while decoding MB 55 12, bytestream -12 no video and if i use a webcan it not happening some one can help me whit how is the

Pose of camera from the pose of marker

泪湿孤枕 提交于 2021-02-10 03:11:01
问题 I am currently working on a task to localize a vehicle using computer vision. I am using OpenCV with C++ . I implemented ArUco marker to get the pose of the camera placed on the vehicle. I used of the following function to estimate pose of the marker : cv::aruco::estimatePoseSingleMarkers(markerCorners, markerLength, camMatrix, distCoeffs, rvecs,tvecs) Later I found out that rvecs and tvecs are 1x1 arrays with 3 channels (openCVDataType=CV_8UC3) . Now, I get R(3x3) matrix from cv::Rodrigues

Serialization of cv::Mat giving strange result

核能气质少年 提交于 2021-02-10 03:06:12
问题 I'm currently trying to serialize and deserialize an openCV Mat so that i can send the frame from a client to server using Boost. The problem i am having is that when i deserialise the image it gives duplicate overlapping images in different colours. I am not sure why this is happening. Any help would be much appreciated. I'm sorry I cannot post an image as i do not have enough badges. header file for custom serialisation of cv::Mat #ifndef cv__Mat_Serialization_serialization_h #define cv_

Serialization of cv::Mat giving strange result

喜夏-厌秋 提交于 2021-02-10 03:01:48
问题 I'm currently trying to serialize and deserialize an openCV Mat so that i can send the frame from a client to server using Boost. The problem i am having is that when i deserialise the image it gives duplicate overlapping images in different colours. I am not sure why this is happening. Any help would be much appreciated. I'm sorry I cannot post an image as i do not have enough badges. header file for custom serialisation of cv::Mat #ifndef cv__Mat_Serialization_serialization_h #define cv_

Increase space between text lines in image

≡放荡痞女 提交于 2021-02-09 11:12:18
问题 I have an input image of a paragraph of text in single line spacing. I'm trying to implement something like the line spacing option to increase/decrease space between text lines in Microsoft Word. The current image is in single space, how can I convert the text into double space? Or say .5 space? Essentially I'm trying to dynamically restructure the spacing between text lines, preferably with an adjustable parameter. Something like this: Input image Desired result My current attempt looks

Increase space between text lines in image

*爱你&永不变心* 提交于 2021-02-09 11:11:59
问题 I have an input image of a paragraph of text in single line spacing. I'm trying to implement something like the line spacing option to increase/decrease space between text lines in Microsoft Word. The current image is in single space, how can I convert the text into double space? Or say .5 space? Essentially I'm trying to dynamically restructure the spacing between text lines, preferably with an adjustable parameter. Something like this: Input image Desired result My current attempt looks

No rule to make target 'C:/opencv/build/lib/libopencv_world300d.dll.a', needed by 'opencv.exe'. Stop

南楼画角 提交于 2021-02-09 11:00:15
问题 So I'm trying to build a simple opencv code but I keep getting this error and I don't seem to find any solution in the internet: os: Windows 8.1 compiler GNU GCC 601 IDE: CLion CMake 3.0 and mingw64 This is the code which I got from the opencv tutorial page #include <stdio.h> #include <opencv2/opencv.hpp> using namespace cv; int main(int argc, char** argv ) { if ( argc != 2 ) { printf("usage: DisplayImage.out <Image_Path>\n"); return -1; } Mat image; image = imread( argv[1], 1 ); if ( !image