1 | initial version |
(You probably know this, but just in case: The HoughLines function will not do canny edge detection on its own, you need to supply it with an edge image as input. It will take a grayscale input, but it will simply tread every nonzero pixel as an edge.)
If you want to do a fast hough transform for your detected blue dots, one way would be to call houghLines with a new matrix where every pixel is zero except for your detected dots. This should be very fast, since the speed of the hough transform almost solely depends on the number of edge pixels.
Unfortunately I do not think there is much more you can configure with the native houghLines function (but a basic hough transform for lines is not hard to implement)
If most of your detected edge pixels are on the line you seek, you could do a cv::lineFit
alternative ideas to speed up houghLines: - you could downscale your image first before canny edge detection and subsequent houghLines, - you could blur before canny (to decrease the number of edge pixels) - you could use higher thresholds (to decrease the number of edge pixels)
2 | No.2 Revision |
(You probably know this, but just in case: The HoughLines function will not do canny edge detection on its own, you need to supply it with an edge image as input. It will take a grayscale input, but it will simply tread every nonzero pixel as an edge.)
If you want to do a fast hough transform for your detected blue dots, one way would be to call houghLines with a new matrix where every pixel is zero except for your detected dots. This should be very fast, since the speed of the hough transform almost solely depends on the number of edge pixels.
Unfortunately I do not think there is much more you can configure with the native houghLines function (but a basic hough transform for lines is not hard to implement)
If most of your detected edge pixels are on the line you seek, you could do a cv::lineFit
alternative ideas to speed up houghLines:
-
3 | No.3 Revision |
(You probably know this, but just in case: The HoughLines function will not do canny edge detection on its own, you need to supply it with an edge image as input. It will take a grayscale input, but it will simply tread every nonzero pixel as an edge.)edge. (The HoughCircles function unfortunately works totally different))
If you want to do a fast hough transform for your detected blue dots, one way would be to call houghLines with a new matrix where every pixel is zero except for your detected dots. This should be very fast, since the speed of the hough transform almost solely depends on the number of edge pixels.
Unfortunately I do not think there is much more you can configure with the native houghLines function (but a basic hough transform for lines is not hard to implement)
If most of your detected edge pixels are on the line you seek, you could do a cv::lineFit
alternative ideas to speed up houghLines:
4 | No.4 Revision |
(You probably know this, but just in case: The HoughLines function will not do canny edge detection on its own, you need to supply it with an edge image as input. It will take a grayscale input, but it will simply tread every nonzero pixel as an edge. (The HoughCircles function unfortunately works totally different))
If you want to do a fast hough transform for your detected blue dots, one way would be to call houghLines with a new matrix where every pixel is zero except for your detected dots. This should be very fast, since the speed of the hough transform almost solely depends on the number of edge pixels.
Unfortunately I do not think there is much more you can configure with the native houghLines function (but a basic hough transform for lines is not hard to implement)
If most of your detected edge pixels are on the line you seek, you could do a cv::lineFit
alternative ideas to speed up houghLines:
edit: as requested here are my suggestions for dealing with 5 megapixel images:
Having a big but almost black image should be no problem for the hough transform. Checking whether a pixel is zero is a very fast operation, the only time-consuming work happens for edge pixels.
5 | No.5 Revision |
(You probably know this, but just in case: The HoughLines function will not do canny edge detection on its own, you need to supply it with an edge image as input. It will take a grayscale input, but it will simply tread every nonzero pixel as an edge. (The HoughCircles function unfortunately works totally different))
If you want to do a fast hough transform for your detected blue dots, one way would be to call houghLines with a new matrix where every pixel is zero except for your detected dots. This should be very fast, since the speed of the hough transform almost solely depends on the number of edge pixels.
Unfortunately I do not think there is much more you can configure with the native houghLines function (but a basic hough transform for lines is not hard to implement)
If most of your detected edge pixels are on the line you seek, you could do a cv::lineFit
alternative ideas to speed up houghLines:
edit: as requested here are my suggestions for dealing with 5 megapixel images:
Having a big but almost black image should be no problem for the hough transform. Checking whether a pixel is zero is a very fast operation, the only time-consuming work happens for edge pixels.